add $this->link as first parameter, change that line to following
while ($rows = mysqli_fetch_array($this->link,$result))
add $this->link as first parameter, change that line to following
while ($rows = mysqli_fetch_array($this->link,$result))
what do u mean by error, what kind of error it is?
What do you mean by link here? You can given only one value to href attribute. for two links you need 2 <a> tags.
if you want to open abc from fgh and fgh from abc, then you may place such links in that pages also
1)index.html
<a href=abc.html>abc</a>
<a href=fgh.html>fgh</a>
2) abc.html
.
.
<a href=fgh.html>go to fgh</a>
.
.
3) fgh.html
.
.
<a href=abc.html>go to abc</a>
.
.
If your text contains \ then user must type \. For single quote you may do following
$search=str_replace("'","''",$search);
$search=str_replace("\","\\",$search);
before one there are two single quotes not double quote
$search="q test\\''1";
I think this should work now, check query first.
$get_swork2 = "select ad.firstname, ad.lastname, ad.customerid, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, aj.email, sr.servicearea, sr.clientID, sr.customerid, datediff(current_date,max(sr.date)) days_passed ,max(sr.date) last_date
from servicesrendered sr
inner join additional_cars ad on sr.customerid=ad.customerid and sr.clientid=ad.clientid
inner join ajax_client aj on sr.customerid=aj.customerid
where sr.servicearea=' Oil Change ' and trim(aj.email) <>'' group by ad.firstname, ad.lastname, ad.customerid, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, aj.email, sr.servicearea, sr.clientID, sr.customerid";
$get_swork2_res = mysql_query($get_swork2);
if (mysql_num_rows($get_swork2_res) > 0)
{
while ( $swork2_info = mysql_fetch_array($get_swork2_res))
{
/////fetch data
$firstname = $swork2_info['firstname'];
$lastname = $swork2_info['lastname'];
$customerid = $swork2_info['customerid'];
$dhtmlgoodies_category = $swork2_info['dhtmlgoodies_category'];
$dhtmlgoodies_subcategory = $swork2_info['dhtmlgoodies_subcategory'];
$caryear = $swork2_info['caryear'];
$recipientAddr=$swork2_info['email'];
$days_passed=$swork2_info['days_passed'];
$date=$swork2_info['last_date'];
/*
//following php code not requied now so commented
$timestamp = strtotime($date);
$startDate=$timestamp;
$limit=90;//the number of days counting down from
$z=floor((time() - $startDate)/86400);
$days_left=$limit-abs($z);*/
if ($days_passed == 90)
{
$subject=" no days";
}
else if ($days_passed == 85)
{
$subject="5 days" ;
}
else if ($days_passed == 105)//if past 15 days
{
$subject="15 days";
}
else
{
continue;//we do not want to send mail if its not 0, 5 or -15, go to next record
}
///////send mail
//mail begins
$fromAddr = 'noreply@autotechpro.net';
$today_date = date("M-d-Y");
$today_is =date('l, F j, Y');
$email2 ='admin@autotechpro.net';
$subjectStr = 'Courtsey Automatic Oil Change reminder';
$mailBodyText = <<< HHHHHHHHHHHHHH
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>mail</title>
<style type="text/css">
h1, h2, td, p {
font-family: helvetica, arial, sans-serif;
}
</style>
</head>
<body>
Dear $firstname $lastname:<p>
This is an automatic courtsey Oil Change reminder. Our records indicate that as of today, …
<form name="Candidates_name" method=POST id='Candidates_name' onSubmit="return form_validation(this);">
in above line you pass self element as parameter using this keyword, which you can access in you js function.
<input type=text name=txt1 id=txt1 onblur='myformattext(this)'>
here it will pass txt1 element to function myformattext, when user leaves textbox txt1
this is keyword, and form is not,
Dear Virtues, what is the difference between Chevrolet, Mercedes and Rolls Royce?
1) id, name IS JUST for identifaction of form.
2) method may be post or get
3) onsubmit is event it will call js fucntion when form is submitted.
your form_validation function must return value (true/false). if it returns false the form will not submitted.
You may refer to w3schools.com pages, the explain it in very nice manner
If your data is not confidential, then go to phpmyadmin, export all four tables used in sql format, and attach that file here. I will run this query here and let you know the solution.
We will also manage 3 reminders in same code
You made 2 mistakes
1) you are not calling formvalid function, so I have kept its code in first validate function (no need of 2 functions)
2)you are trying to access meta7, meta8, meta9, actually you have only meta0 and meta1. checkbox value is different and checkbox index is different thing.
check following code
<HTML>
<TITLE>Vote</TITLE>
<HEAD>
<script LANGUAGE="JavaScript">
function form_validation(form)
{
ErrorText= "";
if ((form.name[0].checked==false) && (form.name[1].checked==false) && (form.name[2].checked==false) && (form.name[3].checked==false) && (form.name
[4].checked==false) && (form.name[5].checked==false) && (form.name[6].checked==false))
{
alert ("Please select candidate");
return false;
}
if ((form.meta[0].checked==false) && (form.meta[1].checked==false) )
{
alert ("Please select party");
return false;
}
return true;
}
</script>
<BODY>
<p style="color:blue">Please fill in the form below to select the desired name and Submit:</p>
<form name="Candidates_name" method=POST id='Candidates_name' onSubmit="return form_validation(this);">
<B>Candidates Name</B>:<br>
Men:<br>
<INPUT TYPE="radio" name="name" value="0" /><i>Mark</i><br/>
<INPUT TYPE="radio" name="name" value="1" /><i>Joe</i><br/>
<INPUT TYPE="radio" name="name" value="2" /><i>Gilbert</i><br/>
Women:<br>
<INPUT TYPE="radio" name="name" value="3" /><i>Laura</i><br/>
<INPUT TYPE="radio" name="name" value="4" /><i>Edith</i><br/>
<INPUT TYPE="radio" name="name" value="5" /><i>June</i><br/>
<INPUT TYPE="radio" name="name" value="6" /><i>Laxmi</i><br/></br>
Parties:<br>
<INPUT TYPE="radio" name="meta" value="7" /><i>Chief party</i><br/>
<INPUT TYPE="radio" name="meta" value="8" /><i>Main party</i><br/>
<input type="submit" value="Submit" >
<input type="reset" value="Reset">
</FORM>
</BODY>
</HTML>
POST will send values separetly and GET method will send values in URL (visible in address bar).
Both method will send data to your perl script.
in php we use $_POST for POST method
and $_GET for GET method
I m not sure about PERL
I m not sure, javascript can process submitted form or not. so will will need perl in html2 for storing html1 values in hidden fields.
when I opened page, I am not able to hover (no submenu displayed), so is it that the problem
Still I am not able to understand your problem.
what kind of menu tool you are going to use.
Usually I follow like
html1-> submit-> perl(save/fetch database) -> html2 -> submit -> perl (save/fetch)
what you want is
html1-> html2 (store html1 posted values in hidden variable using js) -> submit -> perl(save/fetch database)
In short you need to preserve html1 values in html2's form, using javascript in hidden element, so when you submit html2, it will submit values of both forms to perl script. Make sure you do not use same name of html elements in both forms.
Now I understand your problem as following. I hope I am right.
You want to send reminder mail to those customers who have changed vehicle oil 3 months back.
So I would follow given steps to achieve this.
1) select records which are getting 3 months old. today. (one single select query with proper join will extract all information required to send mail).
2) loop them to send mail (you already have mail logic, just you need to keep under loop).
Here is complete code, nothing else required, Here my first line is sql query, first lets run it in phpmyadmin, if it gives proper result than you may go for mail part. query may have some syntax error as I have no database here.
$get_swork2 = "select
ad.fistname, ad.lastname, ad.customerid, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, aj.email, sr.servicearea, sr.clientID, sr.customerid, max(sr.date) last_date
from servicesrendered sr inner join ajax_client aj on sr.clientId=aj.clientid and sr.customerid=aj.customerid
inner join additinal_cars ad on
sr.clientId=ad.clientid and sr.customerid=ad.customerid
where
sr.servicearea like '%Oil Change%' and trim(aj.email) <>''
having date_add(max(sr.date), interval 3 month)=current_date
group by
ad.fistname, ad.lastname, ad.customerid, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, aj.email, sr.servicearea, sr.clientID, sr.customerid";
$get_swork2_res = mysql_query($get_swork2);
if (mysql_num_rows($get_swork2_res) > 0)
{
while ( $swork2_info = mysql_fetch_array($get_swork2_res))
{
/////fetch data
$firstname = $swork2_info['firstname'];
$lastname = $swork2_info['lastname'];
$customerid = $swork2_info['customerid'];
$dhtmlgoodies_category = $swork2_info['dhtmlgoodies_category'];
$dhtmlgoodies_subcategory = $swork2_info['dhtmlgoodies_subcategory'];
$caryear = $swork2_info['caryear'];
$recipientAddr=$swork2_info['email'];
///////send mail
//mail begins
$fromAddr = 'noreply@autotechpro.net';
$today_date = date("M-d-Y");
$today_is =date('l, F j, Y');
$email2 ='admin@autotechpro.net';
$subjectStr = 'Courtsey Automatic Oil Change reminder';
$mailBodyText = …
2.input to php page, on this, I'm not following. could you please clarify?
I mean any thing you pass like 'oil change' or anything else
3. there is no output format, the code will be ran using cron job. In the code, an email is to be sent once all the variables have been selected, passed and crossed check. Then, a mail function is written into the code to perform that task. this part works fine. I have ran some test with manually coding in some values.
If you have tested that what is the problem? please tell to whom you want to send mails. also tell me where is clientid/customernumber in ajax_client and additional_cars
I think you are making it little complicated, This could be achevied using joining the table. So please post following
1) your table structure and
2) input to php page
3) output format expected
Also tell me what is the difference between your customerid and clientid
Dear Airshow, thanks for clarification
- If the forms are on the same page - easy - use javascript to read the value from one form field and write it into the other form field.
- If the forms are on different pages - slightly harder.
- Solution 1: Submit the form then use php (or other server-side scripting environment) to build the second page complete with value(s) written into its form. Tens of millions of web pages do this kind of thing every day.
- Solution 2: Submit the form then serve the second page with empty form fields. Also include some javascript to read values from the url and insert them into the empty fields. This solution is not commonly employed as it is only necessary where server-side scripting is not available.
Airshow
Dear Airhsow, Isn't it unnecessarily complicated approach now.
I was trying to explain same thing in my first post to this thread, according to the user requirement, and you felt it "unnecessarily complicated approach ".
what is the problem? what is structure of the array and table?
Anybody can not guess problem from what you have posted.
startdate is more than today'sdate and enddate is less than today'sdate
Above sentence is unlikely to happen, any way query is as follows
1
select * from tablename where current_date<start_date and enddate<current_date
2 if end date is null
select * from tablename where current_date<start_date and enddate is null
you must submit the form, action page will be your second page, where you want to display text. Here (second page) you can access fields by using GET or POST array.
ON LINE 90 check variable names properly
if (($Rstatus == ON) && ($Rvinc == R1) && ($Rmonth >= $current_month) && ($Ryear == $current_year))
on line 80 you must keep break under some condition. otherwise it will go out of loop after one record
have you tried it on different browsers
Thanks Divya its superfish I was looking for.
download
1) oracle express edition 10g. its oracle server
2) (optional) then download oracle sqldeveloper, its interface to work on your database, otherwise you may work with sql prompt to query your database.
search something about oracle tutorials on google.
If you want to learn basic sql then you may start with
http://www.w3schools.com/sql/default.asp
I am not sure but try with lang attribute
echo '<script lang="javascript">alert("Your project has timed out. Contact your project Manager")</script>';
anybody there?
make supplier plural add 's' before @ sign
'suppliers@%'
There was select keyword near = sign, thats why you might have got error, following should work.
UPDATE listing SET email= CONCAT(REPLACE(title, ' ','' ) , SUBSTR(email, INSTR(email, '@' ) ) ) WHERE email LIKE 'supplier@%'
<input type=file name=fl[] id=fl[]><br>
<input type=file name=fl[] id=fl[]><br>
<input type=file name=fl[] id=fl[]><br>
<input type=file name=fl[] id=fl[]><br>
<input type=file name=fl[] id=fl[]>
in php file you will get array of uploaded files. fl[0], fl[1], fl[2] like that
Dear friends
I need free vertical tree menu as shown in the link (green one)
http://dhtml-menu.com/menu/dhtml-floating-menu-sample.html
I have heard something related to FISH, fishmenu or starfish menu, I am not sure.
I have seen some fish named menu, but now I am not able to find that link or forgot exact name.
any help is highly appreciated.
Regards
Urtrivedi
adam_k's query will work well (for ESN 123). Here I am posting it without subquery and for all ESN
select a.ESN, a.TYPE,a.DATE,b.RMA
from tablename a
left join tablename b on a.ESN=b.ESN and b.TYPE=11
where a.type = 2
usually nvl is used with arithmetic operation (atleast I use for that), when you are not sure that column will contain null or not.
If you add two values where one of them is null, it will return null result even if second one is valid number.
assuming one row table with cola is null, colb =5
select cola+colb; //returns null
select nvl(cola,0)+colb;//returns 5
select nvl(cola,10)+colb;//returns 15
You are not getting my question. I will ask in other way round.
why you have not picked ?
123|4|2011-03-17|3
do no submit form to php before validating with javascript. look at the following code carefully.
<html><head>
<script language="javascript">
function validate()
{
if (document.finfo.testabc.value=='')
{
alert('enter some value');
return false;// this will not allow form to submit
}
return true;
}
</script>
</head><body>
<table>
<tr>
<td>
<form id="finfo" name="finfo" method=POST onsubmit='return validate()'>
<input type="text" name="testabc">
<input type="submit" value="info">
</form>
</td>
</tr>
</table>
</body></html>
Make that column unique in database, when you try to insert duplicate email it will give you error. So handle that error and give message to user.
select post_id, topic,body, dateposted order by dateposted desc limit 0,10
on what basis you chose following record for RMA
123|11|2011-03-01|3
IF your table do not have any record max will return null. since you can not add 1 to null, so i converted null to 0 then added 1,
In short if no record is there it will give 1 else it will return max + 1
i m not sure what are you asking but in your line no 13 of your topmost post, You can add img tag.
echo "<h3>Message: <br><img src='error.jpg' border=0>".$message['message_contents']."<br></h3>";
do not count, use max function
select ifnull(max(id),0)+1 as maxid from tablename
I think instead of giving update button in all rows. keep one update button at bottom.
Let user change everything across the rows and then let him press update button only once.
If you attempt to update table on so many events, it will impose extra load on your server.
you can use where condition to filter records
UPDATE listing SET email=SELECT CONCAT(REPLACE(title, ' ','' ) , SUBSTR(email, INSTR(email, '@' ) ) ) where email like 'supplier@%'
in your read message page you must use
$_GET['messageid']
see line 20 and 22 of your above code