Jump to content

Mufleeh

Members
  • Posts

    36
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Mufleeh's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi All, I have an issue with the session variable. shoppingcart.php is the first file executed and contains the following code, $postal_charges = get_meter_square() * $postageRate; $_SESSION['postalcharges'] = $postal_charges; and once the 'Proceed' button is pressed its re-directed to purchase.php as following, window.location='purchase.php'; In purchase.php the value of $_SESSION['postalcharges'] doesn't read. But if I go back and click on 'Proceed' again it reads. Moreover this happens only on Firefox latest one. Can anyone help me on this?
  2. Hi all, Firstly, I belie I am asking this question at the correct section of this forum. If not please advice me with regard. My problem is.... I am in the process of developing a Course Evaluation System for my final year project. System is to be built using PHP + MySQL. Briefly, I must be able to design a form, scan it using an image scanner and upload them to the server using my system for data analysis and reports generation. I mean this system must have the following functions, 1. Form design 2. Scan forms (using a scanner) 3. Extract data from scanned documents (using some OMR mechanisms) Leaving report generation things aside, I am wondering how can I use PHP to accomplish these tasks. I am allowed to use open source applications when ever possible like queXML and queFX that are developed for designing and OMR respectively. As I ran through them I realize the complexity of those applications and hardship of integrating them to mine. I believe an expert of PHP can advice on this matter...can you please? Thanks in advance, Mufleeh
  3. Hi, I am receiving below error message. PDOStatement::errorInfo(): Array ( [0] => 00000 [1] => 7 [2] => ERROR: syntax error at or near "." LINE 1: SELECT * .view_teachers_information, * .view_teachers_first_... ^ ) Regards, Mufleeh
  4. Hi, Firstly I'm really sorry for not submitting my question properly. Please refer below and check whether its possible to help me out. - I assume that "nic" is a unique ID for each teacher. - Yes it is - Is there only ONE record per teacher (or nic) in the "view_teachers_info" table or can there be multiple? - Only one record per teacher - Is there only ONE record per teacher (or nic) in the "view_teachers_first_school" table or can there be multiple? - Only one record per teacher - Is it possible for a record to exist in one of those tables associated with a "nic" but no record(s) in the other table for the same "nic"? If so, is there one table that will have at least one associated record for each "nic" or is there one table that should be considered the "primary"? That means if there is a record in the primary, but no associated record in the secondary, it should be included in the results. But, if an associated record exists in the secondary, but not the primary, it will not display in the results. All the records (teachers/nic) in view_teachers_info also in view_teachers_first_school. We can consider view_teachers_info as the primary table.
  5. Hi, Every views are linked with a field 'nic' and different fields from different views have to be retrieved. I tried doing that linking the keys in different views. But it seems like there is an issue. $query = $this->dbh->prepare("SELECT * FROM view_teachers_info, view_teachers_first_school, view_teachers_current_school WHERE view_teachers_info.nic IN (SELECT nic FROM view_teachers_current_school WHERE school_id = '$this->schoolId') AND view_teachers_current_school.nic = view_teachers_first_school.nic AND view_teachers_first_school.nic = view_teachers_information.nic ");
  6. Hi all, Thanks for the responses, I need different fields from those two views. In example I need the schoolname and grade from view_teachers_info and startdate from view_teachers_first_school. This seems to be not possible in the way you've suggested. Please advice. Regards, Mufleeh
  7. Hi, I have been using below 2 queries separately and they are working fine. Queries are from views, now I want them to be joined and display the data in one single table. I couldn't make it in the way I tried, can anyone please let me know a better way? $query = $this->dbh->prepare("SELECT * FROM view_teachers_info WHERE nic IN (SELECT nic FROM view_teachers_current_school WHERE school_id = '$this->schoolId')"); $query = $this->dbh->prepare("SELECT * FROM view_teachers_first_school WHERE nic IN (SELECT nic FROM view_teachers_current_school WHERE school_id = '$this->schoolId')"); What I tried was simply, $query = $this->dbh->prepare("SELECT * FROM view_teachers_info,view_teachers_first_school WHERE nic IN (SELECT nic FROM view_teachers_current_school WHERE school_id = '$this->schoolId')"); Regards, Mufleeh
  8. Hi, I am sorry its bit confusing to me. When I made it as below inside my php script, echo "var s1 = jQuery.parseJSON(".json_encode($stackDiv).");"; echo "var ticks = jQuery.parseJSON(".json_encode($stackCount).");"; Browser displays the data inside the arrays as below. var s1=jQuery.parseJSON([22,32,45,56]) var ticks=jQuery.parseJSON([12,35,32,11]) But how can I pass this into javascript out side the php (in the same page) and get the graph displayed?
  9. Hi, Thanks for your response. Do you mean that if I write the above code inside PHP then I can use those variables inside js as an Array? It doesn't work as I expected. I have given you how my code looks like, can you figure out what could we do? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="css/jquery.jqplot.css" /> <link rel="stylesheet" type="text/css" href="css/examples.css" /> <script language="javascript" type="text/javascript" src="js/jquery.js"></script> <script language="javascript" type="text/javascript" src="js/jquery.jqplot.js"></script> <script language="javascript" type="text/javascript" src="js/jqplot.barRenderer.js"></script> <script language="javascript" type="text/javascript" src="js/jqplot.categoryAxisRenderer.js"></script> </head> <body> <?php // PHP starts function myFunction(){ // function starts here //function codes here "var s1 = jQuery.parseJSON(".json_encode($stackDiv).");"; "var ticks = jQuery.parseJSON(".json_encode($stackCount).");"; ?> // PHP closed // java script outside PHP <script class="code" type="text/javascript">$(document).ready(function(){ plot1 = $.jqplot('chart1', [s1], { seriesDefaults:{ renderer:$.jqplot.BarRenderer, pointLabels: { show: true } }, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks } }, highlighter: { show: false } }); $('#chart1').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { $('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data); } ); });</script> <div id="chart1" style="margin-top:20px; margin-left:20px; width:300px; height:300px;"></div> <?php // PHP reopened } // myFunction function close other functions and codes ?> // PHP closed </body> </html>
  10. Hi, Thanks for your support. My arrays are one dimensional and stored in 2 variables like $arrayOne and $arrayTwo. As you see in the above java script(example) there are two variables s1 and ticks have been defined and made them equal to 2 arrays that comes in to the graph x and y. If we keep the js out of php we can't make it as below right? var s1= $arrayOne var ticks = $arrayTwo So how can I do this? Regards, Mufleeh
  11. well, I need to plot a graph using data retrieved from the data base. I have the data within 2 different arrays. This above js is the code to create the graph and I have to pass the data (which are in the arrays) to js. Is there any other way to do it?
  12. Hi All, I need to plot a graph retrieving data from my data base. I have done all the codings to get the data and store them to 2 different arrays.I though of using jquery to create the graphs. Below is the script has to be added to generated the grahp. I was wondering how to get this within the function in my php script. Can anyone help me fixing this? <script class="code" type="text/javascript">$(document).ready(function(){ var s1 = [2, 6, 7, 10]; var ticks = ['a', 'b', 'c', 'd']; plot1 = $.jqplot('chart1', [s1], { seriesDefaults:{ renderer:$.jqplot.BarRenderer, pointLabels: { show: true } }, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer, ticks: ticks } }, highlighter: { show: false } }); $('#chart1').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { $('#info1').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data); } ); });</script> <div id="chart1" style="margin-top:20px; margin-left:20px; width:300px; height:300px;"></div> Regards, Mufleeh
  13. Hi, I am sorry, I can not exactly understand what do you mean. I receive the above thing when I used ->errorInfo() in my coding. This is how I used it. print_r($this->dbh->errorInfo()); Regards, Mufleeh
  14. Hi, I need to plot a graph for Math teaches vs division for a given zone. I will be using js to draw the graph so I need to make up the table first. The table I need is some thing like this. Division1 Division2 Division3 Division4 Division5 No.Of teachers in division1 No.Of teachers in division2 No.Of teachers in division3 No.Of teachers in division4 No.Of teachers in division5 Below is how I select the zone,' <p><b>Select the Zone to Generate the Graph for Mathematics Teacher Distribution:</b></p> <form method="post" id="graphMathsTeacherbyDivision" action="<?php echo $_SERVER['SCRIPT_NAME']?>"> <select name="selectZone"> <?php foreach($this->allZones as $zone) { echo "<option"; echo " value='$zone[zone_id]' "; echo ">"; echo $zone['zone_id'].": ".$zone['zone_name']; echo "</option>"; }?> </select> <input type="submit" name='zone_id' value="Generate Graph"/> </form></br></br> Below is how I have written the query, $selectZone = $_POST['selectZone']; $query = $this->dbh->prepare("SELECT division_id FROM view_zone_division_district_province WHERE zone_id='$selectZone'"); $query->execute(); $divisions = $query->fetchall(); foreach($divisions as $div) { $queryMe = $this->dbh->prepare("SELECT nic FROM view_teachers_current_school_appointment WHERE appointment_category_name = 'Mathematics' AND census_id IN (SELECT census_id FROM view_schools WHERE division_id = '$div[division_id]')"); $queryMe->execute(); $count = $queryMe->fetchall(); } What I need to is to get the number of teachers from second query. I tried it writing count($count) but it doesn't give me the count. Please let me know how to do this? If you can please let me know below also, I need to create the table (as above) which gives the division and the respective number of teachers in that division. Please advice. Regards, Mufleeh
  15. Hi, It displays below error, Array ( [0] => 00000 [1] => [2] => ) 0Array ( [0] => 00000 [1] => [2] => ) 0Array ( [0] => 00000 [1] => [2] => ) 0Array ( [0] => 00000 [1] => [2] => ) 0
×
×
  • 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.