How to insert multiple checkbox values into firebase using vue js - firebase

I've a form that contains a textarea and a table with a list of many members (from a collection named Members). Each table's contain two checboxes: one to mark the presence of the member and the second one to mark his payment. After clicking on the submit button I'd like to have in my firebase database something like this:
Meeting collection:
associationId,
textareaValue,
createdAd
Presence collection:
memberId,
meetingId,
present: true or false,
createAt
Payment collection:
memberId,
meetingId,
payment: true or false,
createAt
<form #submit.prevent="handleSubmitNewMeeting">
<!-- step one -->
<div class="card" v-if="showFormPart1">
<div class="card-header">
<h4>Entrer le sujet principal de la réunion</h4>
</div>
<div class="card-body">
<div class="form-group">
<textarea class="form-control" v-model="subjects" required rows="3"></textarea>
</div>
<p></p>
<div class="row">
<div class="col-sm-6">
<button #click="showForm=false" class="btn btn-danger" style="width: 100%">
Annuler
</button>
</div>
<div class="col-sm-6">
<button
type="button" class="btn btn-outline-secondary" #click="showFormPart2=true;
showFormPart1=false;">
Suivant
</button>
</div>
</div>
</div>
</div>
<p></p>
<!-- step two -->
<div class="card" v-if="showFormPart2">
<div v-if="members">
<div class="card-header">
<h4>Cocher les présences et payements</h4>
</div>
<div class="card-block p-0">
<table class="table table-bordered">
<thead class="">
<tr align="center">
<th scope="col">Nom</th>
<th scope="col">Prénom</th>
<th scope="col">Téléphone</th>
<th scope="col">Présence</th>
<th scope="col">Payment</th>
</tr>
</thead>
<tbody>
<tr v-for="member in members" :key="member.id" align="center">
<td>{{ member.memberFirstname }}</td>
<td>{{ member.memberLastname }}</td>
<td>{{ member.memberPhoneNumber }}</td>
<td>
<label class="switch">
<input type="checkbox" class="default" v-model="present">
<span class="slider round"></span>
</label>
</td>
<td>
<label class="switch">
<input type="checkbox" class="default" v-model="payment">
<span class="slider round"></span>
</label>
</td>
</tr>
</tbody>
</table>
<p></p>
<div class="row">
<div class="col-sm-6">
<button
type="button" class="btn btn-outline-secondary" #click="showFormPart2=false;
showFormPart1=true;">
Précédent
</button>
</div>
<div class="col-sm-6">
<button class="btn btn-secondary"> Valider </button>
</div>
</div>
</div>
</div>
</div>
<p></p>
</form>
How to do these with firebase using Vue Js please ? thanks !

Related

DataTables - Disable Smart Search

I searched the documentation, but when applying it to my api it didn't work... I need to disable DataTables smart search. Insert "smart": false at startup as below:
var table = $('table#tbitens').DataTable({
"ajax" : "/api/v1/get/itens/dtItem?baixado=" + baixado,
"deferRender": true,
"processing": true,
"serverSide" : true,
"destroy": false,
"scrollX": "100%",
"scrollY": "50vh",
"scrollCollapse": true,
"stateSave": true,
select: {
style: 'single'
},
"search": {
"smart": false
},
Imagem do sistema de busca
In the search button I tried these two ways, the one commented on and the one on the top line, but without success. If anyone can help, I appreciate it, I'm new in the area and I'm still in the learning process. Trying to solve this task since Monday.
//Botão pesquisar
$('#btnPesquisarItem').on('click', function(){
var otable = $('#tbitens').DataTable();
var collection = $("input.column_filter");
collection.each(function() {
if ($(this).val().trim() != ''){
otable.columns($(this).parents('tr').attr('data-column')).search("^" + $(this).val() + "$", true, false, true).draw();
// original: otable.columns($(this).parents('tr').attr('data-column')).search($(this).val().trim());
}
});
HTML
<div class="tab-content" id="tabConteudo">
<!-- FILTROS -->
<div class="tab-pane fade" id="pesquisar" role="tabpanel" aria-labelledby="pesquisar-tab">
<div class="table-responsive p-2">
<div class="row">
<form id="formitens" class="form-horizontal" method="POST" style="margin: 10px">
<div class="col-sm-4">
<table style="width: 67%; margin: 0 auto 2em auto;">
<tbody>
<tr id="filter_col0" data-column="1">
<td>Empresa</td>
<td align="center"><input type="text" class="column_filter" id="col1_filter"></td>
</tr>
<tr id="filter_col1" data-column="2">
<td>Filial</td>
<td align="center"><input type="text" class="column_filter" id="col2_filter"></td>
</tr>
<tr id="filter_col2" data-column="3">
<td>Item</td>
<td align="center"><input type="text" class="column_filter" id="col3_filter"></td>
</tr>
<tr id="filter_col3" data-column="4">
<td>Agregado</td>
<td align="center"><input type="text" class="column_filter" id="col4_filter"></td>
</tr>
<tr id="filter_col4" data-column="5">
<td>Chapa</td>
<td align="center"><input type="text" class="column_filter" id="col5_filter"></td>
</tr>
<tr id="filter_col5" data-column="6">
<td>Descrição</td>
<td align="center"><input type="text" class="column_filter" id="col6_filter"></td>
</tr>
<tr id="filter_col6" data-column="7">
<td>Conta</td>
<td align="center"><input type="text" class="column_filter" id="col7_filter"></td>
</tr>
<tr id="filter_col7" data-column="8">
<td>Classe</td>
<td align="center"><input type="text" class="column_filter" id="col8_filter"></td>
</tr>
<tr id="filter_col8" data-column="9">
<td>Centro</td>
<td align="center"><input type="text" class="column_filter" id="col9_filter"></td>
</tr>
</tbody>
</table>
</div>
</form>
<div class="col-sm-4">
<button type="submit" id="btnPesquisarItem" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span> Pesquisar
</button>
<button type="button" id="btnLimparPesquisa" class="btn btn-default">
<span class="glyphicon glyphicon-remove"></span> Limpar pesquisa
</button>
</div>
</div>
</div>
</div>
<!-- ITENS -->
<div class="tab-pane fade show active" id="itens" role="tabpanel" aria-labelledby="itens-tab">
<div class="table-responsive p-2">
<div class="panel-header p-1">
<div class="row">
<div class="col-sm-1">
<a class="tip btn btn-sm btn-success" data-container="body" data-toggle="popover" data-content="Insere um novo item" th:href="#{/itens/add/}"
sec:authorize="hasAnyAuthority('Administrador', 'Aquisições')">
<span class="glyphicon glyphicon-plus"></span>
</a>
</div>
<div class="col-sm-4" sec:authorize="hasAnyAuthority('Administrador', 'Movimentações')">
<select id="movimentacoes" autofocus="autofocus">
<option value="" disabled selected>Selecione um item para movimentar</option>
</select>
</div>
<div class="col-sm-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="verBaixados">
<label class="form-check-label" for="exampleCheck1">Exibir Itens Baixados</label>
</div>
</div>
</div>
</div>
<table id="tbitens" class="table table-sm table-hover table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>ID</th>
<th>Empresa</th>
<th>Filial</th>
<th>Item</th>
<th>Agregado</th>
<th>Chapa</th>
<th>Descrição</th>
<th>Conta</th>
<th>Classe</th>
<th>Centro</th>
<th:block th:each="area : ${areasConts}">
<th th:text="#{general.cost} + ' ' + ${area.descricao}">Custo</th>
<th th:text="#{general.depreciation} + ' ' + ${area.descricao}">Depreciação</th>
</th:block>
<th></th>
</tr>
</thead>
</table>
</div>
</div>
</div>

Bootstrap grid system doesn't work on tables

I'm trying to build a settings for my WordPress plugin, I want my image to be displayed aside the table on the right, but it always goes to bottom can you guys help me to fix that ?
<form action="options.php" method="post">');
<div class="row">
<div class="col-md-8">
<table class="form-table">
<tbody>
<tr>
<th scope="row"><label for="">test</label></th>
<td>
<input name="x'.$key.'" value="'.$option['x'.$key].'" width="50px">
<button type="button" onclick="position('.$key.')" class="button button-primary">Create/Edit</button>
<p class="description" id="">some discription</p>
</td>
</tr>
<tr>
<th scope="row"><label for="">test</label></th>
<td>
<input name="myinput" value="'.$option['x'.$key].'" width="50px">
<button type="button" onclick="position('.$key.')" class="button button-primary">Create/Edit</button>
<p class="description" id="">some discription</p>
</td>
</tr>
....
</tbody>
</table>
</div>
<div class="col-md-4">
<div id="special">
<canvas id="the-canvas" style="border:1px solid black"></canvas>
</div>
</div>
</div>
// outputs the WP submit button html
//#submit_button();
Add a div element with "container" or "container-fluid" class after form element( <form action="options.php" method="post"> )
like :<form action="options.php" method="post"><div class="container">
...............
</div></form>
OR
like :<form action="options.php" method="post"><div class="container-fluid">
...............
</div></form>

Add margin Bootstrap 3 table inside a modal

I want to add some space between the edges of a table and modal. The table is inside a modal popup but I don't know how to build the space. The table looks very bad, which clearly shows poor web design skills.
Adding the class
.table-responsive
..doesn't help.
This is how it looks like and here is the code of the modal and table.
<div id="modalUserViewEdits" class="modal-block modal-block-lg mfp-hide">
<section class="panel">
<header class="panel-heading">
<h2 class="panel-title">User</h2>
</header>
<div class="alert alert-message hide">
<!--User message alert popup-->
</div>
<div class="form-data">
<form id="form_UserEdits" class="form-horizontal form-userEditsDetails">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-3">
Username
<span class="required">*</span>
</label>
<div class="col-sm-9">
<input class="form-control" id="userId_modalUserViewEdits" type="hidden" name="id" value="0" />
<input class="form-control" id="userAction_modalUserViewEdits" type="hidden" name="action" value="active"/>
<input class="form-control" id="userOperation_modalUserViewEdits" type="hidden" name="operation" />
<input class="form-control" id="userName_modalUserViewEdits" type="text" placeholder="Username" name="userName" disabled />
</div>
</div>
</div>
</form>
<div id="divDynamicTable" class="form-data table-responsive">
<table class="table table-bordered table-striped mb-none" id="table_viewUserChanges" data-swf-path="lookandfeel/assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
<thead>
<tr>
<th>Field</th>
<th>Old Value</th>
<th>New Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<footer class="panel-footer">
<div class="row">
<div class="col-md-12 text-right">
<button type="button" id="btnApproveUserEdit" class="btn btn-success" data-name='approve'>Approve</button>
<button type="button" id="btnDeclineUserEdit" class="btn btn-danger" data-name='decline'>Decline</button>
<button type="button" class="btn btn-default modal-dismiss">Cancel</button>
</div>
</div>
</footer>
</div>
</section>
Please help
Wrap the table in div with class container-fluid
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"/>
<div id="modalUserViewEdits" class="modal-block modal-block-lg mfp-hide">
<section class="panel">
<header class="panel-heading">
<h2 class="panel-title">User</h2>
</header>
<div class="alert alert-message hide">
<!--User message alert popup-->
</div>
<div class="form-data">
<form id="form_UserEdits" class="form-horizontal form-userEditsDetails">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-3">
Username
<span class="required">*</span>
</label>
<div class="col-sm-9">
<input class="form-control" id="userId_modalUserViewEdits" type="hidden" name="id" value="0" />
<input class="form-control" id="userAction_modalUserViewEdits" type="hidden" name="action" value="active"/>
<input class="form-control" id="userOperation_modalUserViewEdits" type="hidden" name="operation" />
<input class="form-control" id="userName_modalUserViewEdits" type="text" placeholder="Username" name="userName" disabled />
</div>
</div>
</div>
</form>
<div id="divDynamicTable" class="form-data table-responsive">
<div class=container-fluid>
<table class="table table-bordered table-striped mb-none" id="table_viewUserChanges" data-swf-path="lookandfeel/assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
<thead>
<tr>
<th>Field</th>
<th>Old Value</th>
<th>New Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<footer class="panel-footer">
<div class="row">
<div class="col-md-12 text-right">
<button type="button" id="btnApproveUserEdit" class="btn btn-success" data-name='approve'>Approve</button>
<button type="button" id="btnDeclineUserEdit" class="btn btn-danger" data-name='decline'>Decline</button>
<button type="button" class="btn btn-default modal-dismiss">Cancel</button>
</div>
</div>
</footer>
</div>
</section>
wrap it in container-fluid before the table-responsive so it works perfectly in responsive way also. may it works for you
<div class="container-fluid">
<div id="divDynamicTable" class="form-data table-responsive">
<table class="table table-bordered table-striped mb-none" id="table_viewUserChanges" data-swf-path="lookandfeel/assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
<thead>
<tr>
<th>Field</th>
<th>Old Value</th>
<th>New Value</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>

Multiple Modal same page

i've this page http://steam-to-rent.ch/mietdampfanlagen2.html with Bootstrap collapse and modal. The problem is that when you click on "Anfrage" (The yellow button) the modal appears and works correctly, but when you try to close it i can't interact with the page anymore. How can i solve it? this is the code:
<div class="col-lg-12 table1">
<div id="printableArea">
<img class="logo_print logo1" src="img/logo.png" alt="" height="90" width="130" />
<p class="stampa stampa_ipad">Gewerbe Bölli<br>Böllistrasse 18<br>CH - 5072 Oeschgen<br>Tel 062 866 16 88<br>Fax 062 866 16 99<br>info#z-ag.ch</p>
<button class="btn" data-parent="tableParent" data-toggle="collapse" data-target="#table1" class="table1" style="margin-bottom: 20px; width: 100% !important; background: #fadf3e; color:#000;">Mietdampfanlage 21 kg/h 10 bar</button>
<div id="table1" class="collapse">
<table class="table table-striped table-bordered table-hover" width="744">
<thead>
<tr>
<th style="text-align: center;">Kriterium</th>
<th style="text-align: center;">Einheit</th>
<th style="text-align: center;">Grösse</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dampfleistung</td>
<td>kg/h</td>
<td>21</td>
</tr>
<tr>
<td>Abmessungen (L x B x H)</td>
<td>mm</td>
<td>1020 x 600 x 1370</td>
</tr>
<tr>
<td>Gewicht</td>
<td>kg</td>
<td>140</td>
</tr>
<tr class="">
<td>Medium</td>
<td>–</td>
<td>Sattdampf</td>
</tr>
<tr class="">
<td>Ansprechdruck SV</td>
<td>bar</td>
<td>6,0</td>
</tr>
<tr class="">
<td>Einstellbereich Kessel</td>
<td>bar</td>
<td>1,0 – 5,0</td>
</tr>
<tr class="">
<td>max. Betriebsdruck</td>
<td>bar</td>
<td>5,0</td>
</tr>
<td>Fabr. Nr. </td>
<td>–</td>
<td>21.301.112 / 05-09</td>
</tr>
<td>Gesamtanschluss</td>
<td>kW</td>
<td>elektrisch, 15 kW</td>
</tr>
<td>Stromanschluss</td>
<td>A / V</td>
<td>CEE 32A, 5-polig / 400 V</td>
</tr>
<td>Wasserenthärtung</td>
<td>–</td>
<td>separat mietbar</td>
</tr>
<td>Frostschutzsicherung</td>
<td>–</td>
<td>keine</td>
</tr>
<td>Mobilität</td>
<td>–</td>
<td>fahrbar</td>
</tr>
<td>Flexible Anschlussleitungen</td>
<td>–</td>
<td>nach Bedarf</td>
</tr>
<td>Wasseranschluss</td>
<td>Zoll</td>
<td>R 1/2" / AG</td>
</tr>
<td>Abwasseranschluss</td>
<td>Zoll</td>
<td>R 1/2" / IG</td>
</tr>
<td>Dampfanschluss</td>
<td>Zoll</td>
<td>3/4" / IG</td>
</tr>
</tbody>
<input class="printer" type="button" onclick="printDiv('printableArea')" value="Drucken" />
</table>
<button id="modal_1" type="button" class="btn btn-primary special" style="background: #fadf3e; border: 2px solid #000; color: #000; margin-bottom: 20px; margin-top: -10px; width: 100%;" data-toggle="modal" data-target=".bs-example-modal-sm" data-keyboard="true" data-backdrop="static" >Anfrage</button>
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="row">
<div class="col-sm-12 form">
<div class="modal-header">
<h4 style="color: #000;">Mietdampfanlage 21 kg/h 10 bar</h4>
</div>
<form class="form-modal" role="form" method="post" action="index.php">
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" id="name" name="name" placeholder="Vorname, Name" value="">
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<input type="text" class="form-control" id="name" name="firma" placeholder="Firma" value="">
</div>
</div>
<div class="col-sm-12 ">
<div class="form-group">
<input type="email" class="form-control" id="email" name="email" placeholder="E-Mail" value="">
</div>
</div>
<div class="col-sm-12 ">
<div class="form-group">
<input type="text" class="form-control" id="name" name="telefon" placeholder="Telefon" value="">
</div>
</div>
<div class="col-sm-12 ">
<div class="form-group">
<input type="text" class="form-control" id="name" name="zeit" placeholder="Zeitraum" value="">
</div>
</div>
<div class="col-sm-12 ">
<div class="form-group">
<textarea class="form-control" rows="4" name="message" placeholder="Nachricht"></textarea>
</div>
</div>
<div class="col-sm-12 ">
<div class="form-group">
<input id="submit" name="submit" type="submit" value="Send" class="btn btn-primary">
</div>
</div>
<div class="form-group">
<div class="col-sm-10 col-sm-offset-2">
<! Will be used to display an alert to the user>
</div>
</div>
</form></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
You made small mistakes.
You gave both modal same class (bs-example-modal-sm) name and calling them by the button by same name. That is why you facing the problem
You rather use ID instead of class to call it. For example - id="modal-1" and "modal-2".
And change replace the name on button
<button id="modal_2" type="button" class="btn btn-primary special" style="background: #fadf3e; border: 2px solid #000; color: #000; margin-bottom: 20px; margin-top: -10px; width: 100%;" data-toggle="modal" data-target="#modal-1">Anfrage</button>
See the change is 'data-target'. I replaced the ID on class name you used.
Above is right and in addition to this also you can able to provide close sign in the header on click of that modal get closed.
<div class="modal-header">
<button class="close" data-dismiss="modal" aria-hidden="true"
id="close" align="right">x</button>
<h4 class="modal-title" id="myModalLabel">Mietdampfanlage 21 kg/h 10 bar</h4>
</div>

How to control size of input in .input-group with .input-group-addon (Bootstrap3)?

A have a form in a table, and all my field sizes are fitting well. But I have one datefield that has an .input-group-addon, an that is making the size control not work very well. Is there a way to fix it?
I tried some ways to make a smaller input, but the addon stopped being attached:
http://jsfiddle.net/93MpC/1/
The code from Fiddle:
<div class="table-responsive">
<table class="table table-bordered">
<tr class="form-group">
<td><label class="field-label required-field">Name:</label></td>
<td><div class="input-group">
<input type="text" name="name" required id="id_name" class="form-control">
</div></td>
</tr>
<tr class="form-group">
<td><label class="field-label">Birthdate:</label></td>
<td><div class="input-group">
<input class="form-control datefield" id="id_dataNasc" name="dataNasc" type="text"><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
</div></td>
</tr>
<tr class="form-group">
<td><label class="field-label">Birthdate:</label></td>
<td><div class="input-group"><div class="row">
<div class="col-lg-2"><input class="form-control datefield" id="id_dataNasc" name="dataNasc" type="text"></div>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div>
</div></td>
</tr>
<tr class="form-group">
<td><label class="field-label">Birthdate:</label></td>
<td><div class="input-group">
<div class="row">
<div class="col-lg-3">
<div class="col-lg-2"><input class="form-control datefield" id="id_dataNasc" name="dataNasc" type="text"></div>
<div class="col-lg-1"><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span></div>
</div>
</div>
</div></td>
</tr>
</table>
</div>
Thanks in advance!
The proper HTML for this requires another level of nesting. More information can be found in the input groups documentation.
The <td> with your sized input and addon should look like this:
<td class="row">
<div class="col-md-6">
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</td>
The .col-* classes add padding left and right, so if that's a problem you can remove it with a little bit of CSS.
Taken from your code, I added a class half to the parent div. Here's the css:
.half {
width: 50%;
}
And the HTML (almost the same):
<div class="input-group half"><!-- here is .half -->
<input class="form-control datefield" id="id_dataNasc" name="dataNasc" type="text"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
Edit Or if you want to use col here's a different option:
<div class="row">
<div class="col-md-3">
<div class="row">
<div class="col-md-3">Birthdate:</div>
<div class="col-md-9">
<div class="input-group">
<input class="form-control datefield" id="id_dataNasc" name="dataNasc" type="text"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
</div>
</div>
Example

Resources