Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var fecha_inicio = $("#modalEvento #fecha_inicio").val();
- var hora_inicio = $("#modalEvento #hora_inicio").val();
- var fecha_fin = $("#modalEvento #fecha_fin").val();
- var hora_fin = $("#modalEvento #hora_fin").val();
- start = fecha_inicio + " "+ hora_inicio;
- end = fecha_fin + " " + hora_fin;
- $.ajax({
- url:"incld/insert.php",
- type:"POST",
- data:{
- title:nombre,
- start:start,
- end:end
- },
- success:function(){
- $("#modalEvento").modal('hide');
- var calendar = $('#calendar').fullCalendar();
- calendar.fullCalendar('refetchEvents');
- swal("Evento Agregado !!", "", "success");
- }
- })
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label>Fecha de Inicio</label>
- <input type="date" name="fecha_inicio" id="fecha_inicio" class="form-control" >
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label>Hora de Inicio</label>
- <input type="time" name="hora_inicio" id="hora_inicio" class="form-control">
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label>Fecha Finalización</label>
- <input type="date" name="fecha_fin" id="fecha_fin" class="form-control">
- </div>
- </div>
- <div class="col-md-6">
- <div class="form-group">
- <label>Hora de Finalización</label>
- <input type="time" name="hora_fin" id="hora_fin" class="form-control" required="">
- </div>
- </div>
- </div>
- $connect = new PDO('mysql:host=localhost;dbname=agenda', 'dbmasteruser', 'enjoyprocess23');
- $query = "
- INSERT INTO event
- (title, start_event, end_event)
- VALUES (:title, :start_event, :end_event)
- ";
- $statement = $connect->prepare($query);
- $statement->execute(
- array(
- ':title' => $_POST['title'],
- ':start_event' => $_POST['start'],
- ':end_event' => $_POST['end']
- )
- );
- start: 2019-04-30+10:30
- end: 2019-04-30+11:30
- start: 2019-04-30 05:30:00
- end: 2019-04-30 06:30:00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement