urtrivedi 276 Nearly a Posting Virtuoso

in your login.php , add 2 line before if function, do it show 1 or not

 $row=mysql_num_rows($result);
 echo "total rows ->" .$row "<-";
 die('stop');
  if($row==1)
urtrivedi 276 Nearly a Posting Virtuoso
function validate(form, minlength, maxlength) 
{
    var userInput = form.elements[0].value

    if(userInput.length >= minlength && userInput.length <= maxlength)
    {
        return true;
    }
    else
    {
        alert("Please input between " + minlength + " and " + maxlength + " characters");
        return false;
    }
} <-- this is missing
urtrivedi 276 Nearly a Posting Virtuoso

i think, dont use header, just print json_encode

urtrivedi 276 Nearly a Posting Virtuoso

apphp data grid is one avaialble tool

urtrivedi 276 Nearly a Posting Virtuoso

I think you should have posted this topic to business exchange forum, You wil find good responder in that forum.

urtrivedi 276 Nearly a Posting Virtuoso

what error u getting

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

You can do this by using php code,
First you have to loop through attribute table and create dynamic query.

Then exucute that query to get the desired result

Bukhari1986 commented: right +0
urtrivedi 276 Nearly a Posting Virtuoso
select ProductID , max(case when AttributeID=1 then AttributeValue else null end) Color
, max(case when AttributeID=2 then AttributeValue else null end) Size from tblProductAttribute 
group by ProductID
urtrivedi 276 Nearly a Posting Virtuoso

yoru query is fine for that purpose, so what your query do not show or what wrong it shows?

urtrivedi 276 Nearly a Posting Virtuoso

what is ur target, what u want to achive

urtrivedi 276 Nearly a Posting Virtuoso

union will merge 2 result in one, if common rows showed only once

urtrivedi 276 Nearly a Posting Virtuoso
SELECT * FROM `Cater Gid` where Cater like '%$term' UNION SELECT * FROM `Cater Food` where Cater like '%$term'

you forgot single qute near like word on right side

urtrivedi 276 Nearly a Posting Virtuoso

remove quotes around

urtrivedi 276 Nearly a Posting Virtuoso

i dont think so, on web devlpment link on top
if you click it,
then there is blue button lauch chat room.

I guess, its allowd for all users.

but your query is having problem,
copy it from queto to quote, and run it in phpmyadmin,

see error and solve that mysql error first

urtrivedi 276 Nearly a Posting Virtuoso

u can chat on web development room, i m there if u wish

urtrivedi 276 Nearly a Posting Virtuoso

what error it gives?

urtrivedi 276 Nearly a Posting Virtuoso

can u paste sturcture of both table here

urtrivedi 276 Nearly a Posting Virtuoso

cater gid and cater food, must have same number of columsn and of same data type.
If it is not the case
then select column name properly in both queries

urtrivedi 276 Nearly a Posting Virtuoso
 $sql = mysql_query("SELECT * FROM `Cater Gid` where Cater like '%$term UNION SELECT * FROM `Cater Food` where Cater like '%$term")  ;
urtrivedi 276 Nearly a Posting Virtuoso

You need to focus on javascript /jquery to make it user interactive.

Php will play role at the time of loading or saving from /to server.

urtrivedi 276 Nearly a Posting Virtuoso

I suggest simple keep name tag as following for all file input elements, do not give number in html form. This way you will get file upload array in upload_file.php. you can user var_dump to see how file array is built. Accordingly you can write your code.

name="userfile[]" ;//correct

name="userfile['01']" ; not good practice

urtrivedi 276 Nearly a Posting Virtuoso

create 2 dimentional array

$ar[0][0]='Driver`s seat';
$ar[0][1]='';
$ar[0][2]='';
$ar[0][3]='';
$ar[0][4]='';

$ar[1][0]='1';
$ar[1][1]='2';
$ar[1][2]='';
$ar[1][3]='3';
$ar[1][4]='4';

$totrows=count($ar);
echo "<table>";
for ($i=0;$i<$totrows;$i++)
{
    echo "<tr>";
    for($j=0;$j<5;$j++)
        echo "<td>".$ar[$i][$j]."</td>";
    echo "</tr>";
}
echo "</table>";
urtrivedi 276 Nearly a Posting Virtuoso

www.ccavenue.com

urtrivedi 276 Nearly a Posting Virtuoso

In case of oracle/mysql you can do following and even in mssql

select MatchId
, sum(case when SelectionName='Home win' then  Odds else 0 end )home_win
, sum(case when SelectionName='Draw' then  Odds else 0 end ) draw
, sum(case when SelectionName='Away win' then  Odds else 0 end )away_win
, sum(case when SelectionName='Under 2.5' then  Odds else 0 end ) under_25
, sum(case when SelectionName='Over 2.5' then  Odds else 0 end ) over_25
group by matchid
urtrivedi 276 Nearly a Posting Virtuoso

You can use vlookup function for the same purpose

http://www.techonthenet.com/excel/formulas/vlookup.php

urtrivedi 276 Nearly a Posting Virtuoso

I have changed some lines in your searchform.html.php
1) I created javascript searchorprint function
2) I named form as frm
3) I changed type from "submit" to "button"
4) on click on button I called function searchorprint

<?php
include '../templete/header.php';
?>

<script language="javascript" type="text/javascript">
     function searchorprint(type){
     if(type=='s')
     {
        document.frm.action='view.html.php';
        document.frm.submit();
     }
     if(type=='p')
     {
        document.frm.action='print.html.php';
        document.frm.submit();
     }


     }
</script>
<div>
    <h6>Sales Report by Main Vendor</h6>
</div>

<form action="" method="POST" name='frm' id='frm' >
<table class="tdtable" id="tdtable">
                  <tr>
                  <td>Main Vendor Name </td>
                  <td>
                      <select name="mvendor" id="mvcode"><option value="">Mian Vendor</option>
                    <?php foreach ($mvcode as $mvcodes): ?>
                        <option value="<?php htmlout($mvcodes['MVCode']); ?>">
                            <?php htmlout($mvcodes['MVName']); ?></option>
                    <?php endforeach; ?>
                    </select>

                  </td>

              </tr>           
      <tr>
        <td>Date[From]:</td>
        <td><input type="text" id="datepicker1" name="datefrom" /></td>
      </tr>
      <tr>
        <td>Date[To]:</td>
        <td><input type="text" id="datepicker2" name="dateto" /></td>
      </tr>    
</table>
    <div>
        <input type="button" value="Search" name="search" onclick="javascript:searchorprint('s')">
        <input type="button" value="Print" name="print"  onclick="javascript:searchorprint('p')">
    </div>
</form>
urtrivedi 276 Nearly a Posting Virtuoso

on refresh post data will remain same and even not empty, because on refresh same data will be resubmitted,

One solution is to use cookie.

See my previous reply to this thread

http://www.daniweb.com/web-development/php/threads/455250/upon-loading-form-autosubmits-empty-fields-to-database#post1978017

urtrivedi 276 Nearly a Posting Virtuoso

You can put it in some common page that you include in all your pages. I am not sure about putting in tomcat configuration

urtrivedi 276 Nearly a Posting Virtuoso

In login page you can check time if userid password is fine and time is between 05:00hr to 10:00 hr, allow user to access pages otherwise disallow

If there is no login page. You may put same check in all pages

urtrivedi 276 Nearly a Posting Virtuoso

Such things happens in self submitting page.
I used cookies to solve this kind of problem.
for example when user clicks save before submitting set one cookie say "saveinfo" to 1 , using javascript,

Now along with isset using php $_COOKIE['saveinfo'] ==1,

in the end of page using javascript again to set saveinfo to 0,

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

in begining of index.php, you may add this 2 line and run your page, you may able to see any error if it is there.

error_reporting(E_ALL); 
ini_set("display_errors", 1); 
urtrivedi 276 Nearly a Posting Virtuoso

Adobe acrobat professinal allows you to edit using touch up text tool. You can not format like word doucment but minor changes can be done easily.
Acrobat Reader will not allow.

I am not sure about any other pdf editor software

urtrivedi 276 Nearly a Posting Virtuoso

change line 69 in your first post

from

 `post_date` AS `date`

 to 


 DATE_FORMAT(`post_date`, '%a., %b %D, %Y %l: %i %p') AS `post_date`
urtrivedi 276 Nearly a Posting Virtuoso
select 
        tbl_centre.centre_id,
                    tbl_centre.centre_no,
                    tbl_centre.centre_name,
                    tbl_region.region,
                    tbl_net.qualification,
                    sum(CASE WHEN tbl_net.qualification=0 THEN 1 ELSE 0 END ) QUALS, 
                    sum(CASE WHEN tbl_net.qualification=1 THEN 1 ELSE 0 END ) AWARDS, 

    from
        tbl_centre

    left join
        tbl_net_centre ON tbl_centre.centre_id = tbl_net_centre.centre_id

    left join
        tbl_net ON tbl_net_centre.ntwrk_cd = tbl_net.network_code

   left join
                    tbl_region ON tbl_centre.region_code = tbl_region.region_ID

    where
                    tbl_centre.reg_status = 'R'
    and
                    tbl_net_centre.net_reg_stts in ('R','P')
    and
                    tbl_region.region_ID ='3'


    group by tbl_centre.centre_id

    HAVING IFNULL(sum(CASE WHEN tbl_net.qualification=0 THEN 1 ELSE 0 END ),0) >0 AND 
                    IFNULL(Sum(CASE WHEN tbl_net.qualification=1 THEN 1 ELSE 0 END ),0) > 0 
    limit 1000;
urtrivedi 276 Nearly a Posting Virtuoso

out of all this code (in your first post here), also post code which you use to call all that functions, and which pariticular function gives you date in default format.

urtrivedi 276 Nearly a Posting Virtuoso

give your sample data also for some records, so that we can understand what data your columns hold,

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso
      $sql = "SELECT 'nom' FROM test WHERE coord='$coord'"; 
    $req = mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error()); 
    $row=mysql_fetch_assoc($req);
echo $row['nom'];
urtrivedi 276 Nearly a Posting Virtuoso
<?php 
$pass="80"; //this you can pass from html form to the query

$query="select sum(case when percentagescore>='$pass' then 1 else 0 end ) / count(*)*100 pass_percent,
               sum(case when percentagescore<'$pass' then 1 else 0 end ) / count(*)*100 fail_percent
        from tablename";

?>
urtrivedi 276 Nearly a Posting Virtuoso

Cookie is passed from server, when u set cookiejar, you are specifying cookie file for that session,
to request other things in same session, the curl must know the session cookie, so all next time we use cookiefile option to read same cookie file.

Nothing to do with id and all

urtrivedi 276 Nearly a Posting Virtuoso

There are others problems in your, first you can not use "return" as name of any html item, its gives error
second you dont have any bottles html anywhere, so in price function I commented first 3 lines to test my code.

function Price(data) {

//document.getElementById("productprice").value = data.options[data.selectedIndex].id;

//newValue = (parseInt(document.form.bottles.value) * parseInt(document.form.price.value)); 
//document.form.total.value = newValue;

var w = document.getElementById("product").selectedIndex;
var str=document.getElementById("product").options[w].text;

var n=str.split(":");

document.form.quantity.value = n[1];
}
urtrivedi 276 Nearly a Posting Virtuoso

Actually I wanted your html code ,
you run ur page, then right click, view source, copy that source and paste it here

urtrivedi 276 Nearly a Posting Virtuoso
<iframe width="450" height="350" src="http://www.youtube.com/embed/sqzSlbZ4BCE" frameborder="0" allowfullscreen></iframe>
urtrivedi 276 Nearly a Posting Virtuoso

What sql you writing and what error are u getting.

urtrivedi 276 Nearly a Posting Virtuoso
    function Price(data) {

    document.getElementById("productprice").value = data.options[data.selectedIndex].id;

    newValue = (parseInt(document.form.bottles.value) * parseInt(document.form.price.value)); 
    document.form.total.value = newValue;

    var w = document.getElementById("product").selectedIndex;
    var str=document.getElementById("product").options[w].text;

    var n=str.split(":");

    document.form.quantity.value = n[1];
    }
urtrivedi 276 Nearly a Posting Virtuoso

send me html code

urtrivedi 276 Nearly a Posting Virtuoso

Use like keyword instead of equal to

"select * from maintable where key  like '%" & TextBox3.Text & "%'"
urtrivedi 276 Nearly a Posting Virtuoso

You posted in php, so I replied php code, and the code you have written is in javascript. Now Following is the javascript code.

    function Price(data) {

    document.getElementById("productprice").value = data.options[data.selectedIndex].id;

    newValue = (parseInt(document.form.bottles.value) * parseInt(document.form.price.value)); 
    document.form.total.value = newValue;

    var str=document.getElementById("product").innerHTML;
    var n=str.split(":");

    document.form.quantity.value = n[1];
    }