Category : php

So I have a table from where I acquire data I want to work with: $sql = mysqli_query($con,"SELECT Loc,Stat,Date_Time FROM location_history WHERE Location LIKE ‘%LOCA_NAME% ORDER BY Date_Time;") while($row = mysqli_fetch_assoc($sql)){ echo json_encode($row); } {"Loc":"ROOM01","Stat":"BUSY","Date_Time":"2021-03-02 08:02:00"} {"Loc":"ROOM02","Stat":"BUSY","Date_Time":"2021-03-02 08:15:42"} {"Loc":"ROOM02","Stat":"EMPTY","Date_Time":"2021-03-02 09:15:22"} {"Loc":"ROOM01","Stat":"EMPTY","Date_Time":"2021-03-02 10:12:00"} {"Loc":"ROOM02","Stat":"BUSY","Date_Time":"2021-03-02 12:05:48"} {"Loc":"ROOM01","Stat":"BUSY","Date_Time":"2021-03-02 12:25:54"} {"Loc":"ROOM02","Stat":"EMPTY","Date_Time":"2021-03-02 15:05:54"} {"Loc":"ROOM01","Stat":"EMPTY","Date_Time":"2021-03-02 15:06:00"} I need to calculate data ..

Read more

In short i have a text having numeric price, i want to add class after (.) for example i have price $49.00 i want .00 in a separate class so that my output should something like this: <p class="pricedigit">$49<span class="adot">.00</span></p> Basically I have no idea how to do this, I just need little help so ..

Read more

I’m starting to develop a website using HTML in frontend and PHP at backend. But, I have a question. Should I use (with index.html): <select id="select"></select> <script src="js/jquery.js"></script> <script> $(document).ready(() => { $.ajax(‘api/getUsers.php’, { method: ‘GET’ }, success: (retrievedData) => { functionToFillSelect(retrievedData) }) } </script> Or… I should use (with index.php): <?php $users = getUsersFromDatabase(); ..

Read more

<div class=’modal fade collabform’id=’collabrequest".$useremail."".$postid."’ tabindex=’-1′ role=’dialog’ aria-labelledby=’Title’ aria-hidden=’true’> <div class=’modal-dialog modal-dialog-centered’ role=’document’> <div class=’modal-content’> <div class=’modal-header’> <h5 class=’modal-title’ id=’Title’>Collab</h5> <button type=’button’ class=’close’ data-dismiss=’modal’ aria-label=’Close’> <span aria-hidden=’true’>&times;</span> </button> </div> <div class=’modal-body’> <form method=’POST’ action=” id=’collabForm’ > <textarea rows=’3′ class=’form-control’ name=’collab_message’ id= ‘collab_message’ placeholder=’Proceed by sending a message.’></textarea> <input value=’".$useremail."’ name=’useremail’ id=’useremail’ style=’display:none;’> <input value=’".$postid."’ name=’postid’ id=’postid’ ..

Read more

I am running a routine for generating a PDF in a PHP file using TCPDF. The problem is that it is not executing the jQuery part of it and hence no PDF is generated. My form is submitted through jQuery. <script> function setVal() { $(‘#hidden_div_html’).val($(‘#Chart_details’).html()); $(‘#hidden_div_html1’).val($(‘#Chart_details1’).html()); } $(document).ready(function() { // $(‘#create_pdf’).onchange(function(){ $(‘#hidden_div_html’).val($(‘#Chart_details’).html()); $(‘#hidden_div_html1’).val($(‘#Chart_details1’).html()); // }); ..

Read more

I have a problem with an ajax. function sendData(){ if (navigator.onLine) { console.log(‘Verbunden mit send.php’); var timeID = localStorage.getItem("timeID"); var staffname = localStorage.getItem("staffname"); var komminame1 = localStorage.getItem("kommi"); var lsloginDrivetime = localStorage.getItem("loginDrivetime"); var lsloginDrivetimeLat = localStorage.getItem("loginKooLatDrive"); var lsloginDrivetimeLon = localStorage.getItem("loginKooLonDrive"); console.log(komminame1); $.ajax( { url: ‘_action/send.php’, type:’POST’, data:{ timeID: "" +timeID+ "", komminame: "" +komminame1+ "", staffname: ..

Read more

i have posts sections that get populated with data from a database. Here is the markup for the post section. The posts are mostly sample data <div class="q_posts"> <div class="q_post_title"> <span>Post 1</span> </div> <div class="post_description"> Lorem ipsum dolor sit, amet consectetur adipisicing elit. Eligendi, nihil! Eligendi sed voluptate suscipit animi debitis voluptates ducimus, dolorum accusamus? ..

Read more