Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by dishadcruze

  1. I am trying to give role based access here. I want to display the pages which user has access in checkbox format. Here is my code $sql = "SELECT p.page_id AS pid, p.page, p.href, ra.pages AS rpage FROM pages p INNER JOIN role_access ra WHERE p.page_id IN (ra.page) AND ra.role=1"; $query = mysqli_query($con, $sql) or die(mysqli_error($con)); $checked_arr = array(); while($row = mysqli_fetch_array($query)) { $checked_arr = explode(",",$row['rpage'
  2. Yes, That i had corrected. Sorry for the silly mistake. I missed out echo while displaying <?php $tdata; ?> I corrected it <?php echo $tdata; ?> Thanks @Barand and @Fabel
  3. Thanks. But i tried doing exactly the same i mean without using $nid but using ?. When i used ?, i did not use bindParam. I will try it out once again
  4. if i use WHERE wa.nurse=".$nid." Error wont be there in that like, but error in
  5. Thanks @Fabel But still getting 'Fatal error: Uncaught Error: Call to a member function bindParam() on boolean' for this $stmt = $con->prepare("SELECT sdate , DATE_FORMAT(sdate, 'Week %v %W %d/%m/%Y') AS fdate , wa.shift , w.ward_name , a.bed , a.patient_id , p.patient_name FROM ward_allotment wa INNER JOIN wards w ON wa.ward=w.wid INNER JOIN admission a ON wa.ward=a.ward AND wa.sdate BETWEEN a.from_date AND a.discharge_date INNER JOIN patient p ON a.patient_id=p.patient_id WHERE wa.nurse=:nid AND sdate BETWEEN CURDATE() AND CURDATE() + INTERVAL 6 DAY ORDER BY sdate, shif
  6. Thanks @Barand But i couldn't solve 'Fatal error: Uncaught Error: Call to a member function execute() on boolean' in the query as am very well-versed with PDO. Here is the screenshot of the query where it says its a error.
  7. I am developing a script for hospital. I have wards like General, Delux, ICU etc. Each ward can have number of patients. Each nurse will be allocated to some wards in weekly basis. Now I want to display for the nurse that how many patients are there in the ward which is allocated to her/him on that week. Here is my wards table Here is my ward allotment for each nurse And patient admitted details i get from admission table, which is like this Now i want to show result like this From 16/09/2019 to 22/09/2019 General Ward Patient
  8. Hi, I am trying to build an webapp (PHP script) to display a waveform of my audio (mp3/wav) file same as VocalPitchMonitor app spmething like this This script gets input file from user and then it shows the waveform with notations(music), which has defined and stored in database. I tried https://github.com/boyhagemann/Wave and https://github.com/afreiday/php-waveform-png. with some customized settings. But it generates a wave like this Is there any script similar to this? or how can i do this? Please suggest
  9. Trying to write a webapp in PHP which works similar to VocalPitchMonitor app (Android) with some added features. But capturing voice and display it as wave format is possible in PHP? Is there any example script for this?
  10. @ kicken Can i PM my code to you? i have replaced header( "refresh:25...." ); instead of javascript. Still the problem is same. even in mobile also it happens the same.
  11. Yeah, i am using javascript to submit form to set flag in leader's end like this <script type="text/javascript"> $(function(){ // document.ready function... setTimeout(function(){ $('#FrmID').submit(); },3000); }); </script> And in result page header( "refresh:25;url=play_game.php?id=".$grp_id."" );
  12. i am using php and mysql. 1. Leader starts the game, a flag is set to 1 in database and players will see the questions (Only this needs Leader's click) 2. After 40 seconds, result will open in leader's side and the result flag will set to 1 and players will see the result. 3. After 40 seconds, it will go back to questions and same thing happens Leader will just starts the game and his work is done. Till he exists the game, it should be running. Here if the leader is inactive , the flag won't set and player have to wait till leader is active. I don't know how to overcome this
  13. I have a small online question and answer game. In which once a leader starts games, on particular time duration it goes on till he exits from the game. But when the leader's screen is inactive (both in mobile and laptop as well) / locked, the game stops, it doesn't work. How can i overcome this problem? i have not used cookies so far. is the cookies solve my problem? or any other way please suggest
  14. Yup!. Even i tried the same and this the only possible way to get the nearby result as i wanted. Thanks Barand
  15. Now i can't change the method of storing data. how should i solve it then?
  16. @Barand: i tried like this select jm.po_no, jm.vendor, jm.post_date, ji.ref_id, sum(case when ji.type = 'poo' then qty else 0 end) as ordered, sum(case when ji.type = 'por' then qty else 0 end) as received, sum(case when ji.type = 'poo' then qty else - qty end) as total FROM journal_main jm INNER JOIN journal_item ji ON jm.id=ji.ref_id WHERE ji.type IN('poo', 'por') group by jm.id but it returns ordered and received in separate row
  17. I have 2 tbles journal_main and journal_item. in journal main i have fields like id | po_no | period | post_date | vendor 1 | PO123 | 12 | 2018-02-12 | XYZ 2 | PO234 | 12 | 2018-02-13 | ABC in journal_item id | ref_id | type | sku | qty 1 | 1 | poo | A123 | 12 2 | 1 | poo | B234 | 20 3 | 2 | por | A123 | 2 4 | 2 | por | A123 | 3 5 | 2 | por | B234 | 6 i want to get the output as po_no | date | vendor | sku | ordered_qty | received_qty | balance po123 | 2018-02-12 | XYZ | A123 | 12
  18. I got the solutions for that. But in my server.php i am displaying a form which will be having few input fields. This should display in #response area. Now i am able to display the same on instant basis. As it loads on seconds basis, i am not able to enter anything on any input boxes. Here is my display page. <?php ob_start(); include('includes/sessions.php'); include('includes/config.php'); include('includes/functions.php'); $grp_id = $_GET['id']; ?> <!DOCTYPE html> <head> <!-- head section --> <script type="text/javascript" src="http://code.jq
  19. @ mac_gyver My exact scenario is: There is a group A formed by a user User1 and in that group there will be minimum 4 members. When minimum 4 members are online, group owner (User1) will updates some queries on db and he will hit a button 'OK'. When he hits the button , a filed in database sets 1. When this sets to 1, all the online users of this group gets the notification about this. And for them approve button will be activated. Once they approve its immediately visible to admin that who all approved. I am doing it with php-long-polling. But here i am not getting how exactly i c
  20. Yes even i want to display the record according to 'last_id' but i can query in sql and php , but my only problem is to display as and when it updated. Here i stuck
  21. basically i want to pass a variable to this page along with timestamp. Timestamp is getting passed like this in client.js timestamp is getting passed like this function getContent(timestamp) { var queryString = {'timestamp' : timestamp}; $.ajax( { type: 'GET', url: 'http://localhost/php-long-polling/server/server.php', data: queryString, success: function(data){ // put result data into "obj" var obj = jQuery.parseJSON(data); // put the data_from_file into #response
  22. No, what i meant was, how to send that 'id' through url or post to this page??
  23. After many attempts i could do it like this in server.php, i did like this <?php /** * Server-side file. * This file is an infinitive loop. Seriously. * It gets the file data.txt's last-changed timestamp, checks if this is larger than the timestamp of the * AJAX-submitted timestamp (time of last ajax request), and if so, it sends back a JSON with the data from * data.txt (and a timestamp). If not, it waits for one seconds and then start the next while step. * * Note: This returns a JSON, containing the content of data.txt and the timestamp of the last data.txt change. * This ti
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.