Jump to content

miz_luvly@hotmail.com

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

miz_luvly@hotmail.com's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi thanks guyz, I have managed to find the solution from dynamicdrive website. Once again thanks for your help.
  2. I have got a code which open links in the same window. Can someone tell me how to open links in a new window in the script below. Thanks in advance <script type="text/javascript"> <script type="text/javascript"> // 7 variables to control behavior var Car_Image_Width=140; var Car_Image_Height=225; var Car_Border=true; // true or false var Car_Border_Color="white"; var Car_Speed=4; var Car_Direction=true; // true or false var Car_NoOfSides=8; // must be 4, 6, 8 or 12 /* array to specify images and optional links. For 4 sided carousel specify at least 2 images For 6 sided carousel specify at least 3 For 8 sided carousel specify at least 4 For 12 sided carousel specify at least 6 If Link is not needed keep it "" */ Car_Image_Sources=new Array( "photo1.jpg","http://www.dynamicdrive.com", "photo2.jpg","http://www.javascriptkit.com", "photo3.jpg","", //this slide isn't linked "photo4.jpg","http://www.codingforums.com" // NOTE No comma after last line ); CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2); C_Coef=new Array( 3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4, 0, Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3); var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9; C_Pre_Img=new Array(Car_Image_Sources.length); var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW, C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2; function Carousel(){ if(document.getElementById){ for(i=0;i<Car_Image_Sources.length;i+=2){ C_Pre_Img[i]=new Image();C_Pre_Img[i].src=Car_Image_Sources[i]} C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1; Car_Div=document.getElementById("Carousel"); for(i=0;i<C_HalfNo;i++){ CW_I[i]=document.createElement("img");Car_Div.appendChild(CW_I[i]); CW_I[i].style.position="absolute"; CW_I[i].style.top=0+"px"; CW_I[i].style.height=Car_Image_Height+"px"; if(Car_Border){ CW_I[i].style.borderStyle="solid"; CW_I[i].style.borderWidth=1+"px"; CW_I[i].style.borderColor=Car_Border_Color} CW_I[i].src=Car_Image_Sources[2*i]; CW_I[i].lnk=Car_Image_Sources[2*i+1]; CW_I[i].onclick=C_LdLnk; CW_I[i].onmouseover=C_Stp; CW_I[i].onmouseout=C_Rstrt} CarImages()}} function CarImages(){ if(!C_Stppd){ C_TotalW=0; for(i=0;i<C_HalfNo;i++){ C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width); C_TotalW+=C_ClcW[i]} C_LeftOffset=(C_MaxW-C_TotalW)/2; for(i=0;i<C_HalfNo;i++){ CW_I[i].style.left=C_LeftOffset+"px"; CW_I[i].style.width=C_ClcW[i]+"px"; C_LeftOffset+=C_ClcW[i]} C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1); if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo)){ if(C_CrImg==Car_Image_Sources.length)C_CrImg=0; if(Car_Direction){ CW_I[C_HalfNo]=CW_I[0]; for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1]; CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg]; CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1]} else{ for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1]; CW_I[0]=CW_I[C_HalfNo]; CW_I[0].src=Car_Image_Sources[C_CrImg]; CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]} C_Angle=Car_Direction?Math.PI/C_HalfNo:0;C_CrImg+=2}} setTimeout("CarImages()",50)} function C_LdLnk(){if(this.lnk)window.location.href=this.lnk} function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;} function C_Rstrt(){C_Stppd=false} </script> <div id="Carousel" style="position:relative"> <img src="placeholder.gif" width="371" height="225"> </div> <p><font face="Arial" size="-2">Free DHTML scripts provided by<br><a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p> Create a div with transparent place holder in your html <div id="Carousel" style="position:relative"> <img src="placeholder.gif" width="404" height="202"> </div> placeholder width: 4 sided: 1.42 * carousel image width + 3 6 sided: 2 * carousel image width +4 8 sided: 2.62 * carousel image width + 5 12 sided: 3.87 * carousel image width + 7 placeholder height: carousel image height+2 Insert onload in body tag <body onload="Carousel()"> *********************************************************/ // 7 variables to control behavior var Car_Image_Width=140; var Car_Image_Height=225; var Car_Border=true; // true or false var Car_Border_Color="white"; var Car_Speed=4; var Car_Direction=true; // true or false var Car_NoOfSides=8; // must be 4, 6, 8 or 12 /* array to specify images and optional links. For 4 sided carousel specify at least 2 images For 6 sided carousel specify at least 3 For 8 sided carousel specify at least 4 For 12 sided carousel specify at least 6 If Link is not needed keep it "" */ Car_Image_Sources=new Array( "photo1.jpg","http://www.dynamicdrive.com", "photo2.jpg","http://www.javascriptkit.com", "photo3.jpg","", //this slide isn't linked "photo4.jpg","http://www.codingforums.com" // NOTE No comma after last line ); /***************** DO NOT EDIT BELOW **********************************/ CW_I=new Array(Car_NoOfSides/2+1);C_ClcW=new Array(Car_NoOfSides/2); C_Coef=new Array( 3*Math.PI/2,0,3*Math.PI/2,11*Math.PI/6,Math.PI/6,3*Math.PI/2,7*Math.PI/4, 0, Math.PI/4,3*Math.PI/2,5*Math.PI/3,11*Math.PI/6,0,Math.PI/6,Math.PI/3); var C_CoefOf=Car_NoOfSides==4?0:Car_NoOfSides==6?2:Car_NoOfSides==8?5:9; C_Pre_Img=new Array(Car_Image_Sources.length); var C_Angle=Car_Direction?Math.PI/(Car_NoOfSides/2):0,C_CrImg=Car_NoOfSides,C_MaxW,C_TotalW, C_Stppd=false,i,C_LeftOffset,C_HalfNo=Car_NoOfSides/2; function Carousel(){ if(document.getElementById){ for(i=0;i<Car_Image_Sources.length;i+=2){ C_Pre_Img[i]=new Image();C_Pre_Img[i].src=Car_Image_Sources[i]} C_MaxW=Car_Image_Width/Math.sin(Math.PI/Car_NoOfSides)+C_HalfNo+1; Car_Div=document.getElementById("Carousel"); for(i=0;i<C_HalfNo;i++){ CW_I[i]=document.createElement("img");Car_Div.appendChild(CW_I[i]); CW_I[i].style.position="absolute"; CW_I[i].style.top=0+"px"; CW_I[i].style.height=Car_Image_Height+"px"; if(Car_Border){ CW_I[i].style.borderStyle="solid"; CW_I[i].style.borderWidth=1+"px"; CW_I[i].style.borderColor=Car_Border_Color} CW_I[i].src=Car_Image_Sources[2*i]; CW_I[i].lnk=Car_Image_Sources[2*i+1]; CW_I[i].onclick=C_LdLnk; CW_I[i].onmouseover=C_Stp; CW_I[i].onmouseout=C_Rstrt} CarImages()}} function CarImages(){ if(!C_Stppd){ C_TotalW=0; for(i=0;i<C_HalfNo;i++){ C_ClcW[i]=Math.round(Math.cos(Math.abs(C_Coef[C_CoefOf+i]+C_Angle))*Car_Image_Width); C_TotalW+=C_ClcW[i]} C_LeftOffset=(C_MaxW-C_TotalW)/2; for(i=0;i<C_HalfNo;i++){ CW_I[i].style.left=C_LeftOffset+"px"; CW_I[i].style.width=C_ClcW[i]+"px"; C_LeftOffset+=C_ClcW[i]} C_Angle+=Car_Speed/720*Math.PI*(Car_Direction?-1:1); if((Car_Direction&&C_Angle<=0)||(!Car_Direction&&C_Angle>=Math.PI/C_HalfNo)){ if(C_CrImg==Car_Image_Sources.length)C_CrImg=0; if(Car_Direction){ CW_I[C_HalfNo]=CW_I[0]; for(i=0;i<C_HalfNo;i++)CW_I[i]=CW_I[i+1]; CW_I[C_HalfNo-1].src=Car_Image_Sources[C_CrImg]; CW_I[C_HalfNo-1].lnk=Car_Image_Sources[C_CrImg+1]} else{ for(i=C_HalfNo;i>0;i--)CW_I[i]=CW_I[i-1]; CW_I[0]=CW_I[C_HalfNo]; CW_I[0].src=Car_Image_Sources[C_CrImg]; CW_I[0].lnk=Car_Image_Sources[C_CrImg+1]} C_Angle=Car_Direction?Math.PI/C_HalfNo:0;C_CrImg+=2}} setTimeout("CarImages()",50)} function C_LdLnk(){if(this.lnk)window.location.href=this.lnk} function C_Stp(){this.style.cursor=this.lnk?"pointer":"default";C_Stppd=true;} function C_Rstrt(){C_Stppd=false} </script> <div id="Carousel" style="position:relative"> <img src="placeholder.gif" width="371" height="225"> </div> <p><font face="Arial" size="-2">Free DHTML scripts provided by<br><a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
  3. i need help to build a SQL query/statement to select only records with a date from now and 1 month before and also from now and two months before? is going to be something like: select * from table where month(date_of_entry )= month(now(-2)) thanks in advance
  4. thanks for the help i have managed to solve some of the problem but i am still having trouble when searching for repname and rep2 but it works fine when searching on its own or with customer_name or account_no. just to get it clear i want to know why there was a problem with 'ands' when the other search criteria works fine. i am the same error as above
  5. Hi i need help with the following the script. Its driving me crazy. when i try to search for rep_name together with rep2 and search for rep_name and grade i get the following error: when i try to search by grade the search page return blank i am really really confused. can someone point me into the right direction as to where i am going wrong. please refer to the 2 scripts below many thanks <?php require 'conn.php'; require 'page_header.php'; $end=time(); include "start_timer.php"; include "end_timer.php"; ?> <html> <head> <title>Searching Rep DB</title> </head> <body bgcolor=#ffffff> <a href="logout.php">Log out</a><br><br> <FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM> <h1 align=center>Searching Reports</h1> <b>Flease fill in 1 or any combination to refine search.</b> <table border="0" width=100%> <form method="get" action="process_advance_search_admin.php"> <tr> <td colspan=2>search by Account No:<input type=text name='account_no' size=10 maxlength=255></td> </tr> <tr> <td colspan=2>search by Customer Name:<input type=text name='customer_name' size=30 maxlength=255></td> </tr> <tr> <td colspan=2>search by Date:<input type=text name='date' size=30 maxlength=255></td> </tr> <tr> <td colspan=2>search by Rep2:<input type=text name='rep2' size=30 maxlength=255></td> </tr> <tr> <td colspan=2>search by Grade: <select name="grade"> <option value="" selected>Please choose </option> <option value="A">A</option> <option value="B">B</option> <option value="C">C</option> <option value="D">D</option> <option value="N">N</option> </select> </td> </tr> <tr> <td colspan=2>search by Rep: <select name="repname"> <option value="" selected>Please select Name </option> <!-- option value="Alan Fishwick">Alan Fishwick </option --> <option value="Andrew Dawson">Andrew Dawson </option> <option value="Dominic Condon">Dominic Condon </option> <option value="James Hynds">James Hynds </option> <option value="Mark Flowers">Mark Flowers </option> <option value="Peter Coatham">Peter Coatham </option> <option value="Ray Deal">Ray Deal </option> <option value="Telephone Sales">Telephone Sales </option> <option value="Tim Farmiloe">Tim Farmiloe </option></td> </select> </tr> <tr> <td><input type=submit name='all' value='Search All Reports'></td> </tr> </table> </form> <a href="backup_reports1.xls" target="_blank">Archive</a> (05/06-08/06) </html> <?php require 'conn.php'; require 'page_header.php'; $end=time(); include "start_timer.php"; include "end_timer.php"; echo '<a href="logout.php">Log out</a><br><br>'; if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['repname']!="") or ($_GET['GRADE']!="") or ($_GET['rep2']!="")) { $sql = "select distinct repactivity.*, customer_table.CUSTOMER_NAME, customer_table.GRADE, customer_table.address3, DATE_FORMAT(DATE_OF_ENTRY, '%d-%m-%Y %r') AS DATE_OF_ENTRY, concat(outstanding, ' ', outstanding2, ' ') AS follow_up from repactivity, customer_table where customer_table.ACCOUNT_NO=repactivity.account_no AND"; if ($_GET['account_no']!="") { $sql = $sql." repactivity.account_no LIKE '".$_GET['account_no']."%'"; } if ($_GET['customer_name']!="") { if ($_GET['account_no']!="") $sql = $sql." and"; $sql = $sql." CUSTOMER_NAME LIKE '".$_GET['customer_name']."%'"; } if ($_GET['date']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="")) $sql = $sql." and"; $sql = $sql." DATE_OF_APPROACH LIKE '%".$_GET['date']."%'"; } if ($_GET['grade']!="") { if ($_GET['repname']!="") $sql = $sql." and"; $sql = $sql." GRADE LIKE '".$_GET['grade']."%'"; } if ($_GET['rep2']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['repname']!="")) $sql = $sql." and"; $sql = $sql." rep2 LIKE '%".$_GET['rep2']."%'"; } if ($_GET['repname']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['rep2']!="")) $sql = $sql." and"; $sql = $sql." full_name LIKE '".$_GET['repname']."' Group by DATE_OF_ENTRY DESC"; } $result = mysql_query($sql); $number=mysql_num_rows($result); if (!$result) { echo 'Could not run query: ' . mysql_error(); } echo "<table border=1 bordercolor='tan' class='rep' width ='150%' " . "cellspacing='5'"."cellpadding='5'>\n"; echo "<tr border=1><th class='searchHeader'><caption> <b>Search Results</b><br>Total Reports = $number</caption> </th></tr>\n"; echo "<tr><td><b>Account No:</b></td> <td><b>Customer Name:</b></td> <td><b>Grade:</b></td> <td><b>Town:</b></td> <td><b>Date of Approach:</b></td> <td width='50%'><b>Report:</b></td> <td width='50%'><b>Outstanding:</b></td> <td><b>Type of Approach:</b></td> <td width='14%'><b>Rep Name: </b></td> <td width='14%'><b>Rep2: </b></td> <td><b>Date of entry: </b></td> <td><b>Updated Status:</b></td><td><b>No of follow-ups:</b></td> <td><b>View/add Follow-Up</b></td></tr>"; if ($result and !mysql_num_rows ($result)) { echo "<tr class='row1'><td>No results found that match the "; } else { while($row = mysql_fetch_array($result, MYSQL_BOTH)) { echo "<tr><!-- td>".$row['activity_id']."</td --> <td>".$row['account_no']."</td> <td>".$row['CUSTOMER_NAME']."</td> <td>".$row['GRADE']."</td> <td>".$row['address3']."</td> <td>".$row['DATE_OF_APPROACH']."</td> <td>".$row['report']."</td> <td>".$row['follow_up']."</td> <td>".$row['type_of_approach']."</td> <td>".$row['full_name']."</td> <td>".$row['rep2']."</td> <td>".$row['DATE_OF_ENTRY']."</td> <td>".$row['status']."</td> <td>".$row['reply']."</td> <td bgcolor='#FFFFFF'><a href='view_topic_report.php?activity_id=".$row['activity_id']."'>view here</a><BR></td></tr>"; // include ('view_topic_report.php?activity_id=$activity_id'); echo "</td>"; } } } ?>
  6. Hi all I have 2 scripts to display data in table format. the first script displays the main table with columns : account no, customer, report, rep name and view/add follow-up(this links to the second script) the second script is to display follow-ups. is there a way to display all the columns in a single table rather than having follow-ups to be on a seperate page. possibly merging the two scripts or some other way. Can someone plz help. I really cant make this to work. please refer check the two scripts below. I have done a html code of what i want, to make it more understandable. Anyhelp would be much appreciated. thanks the current displays is like this: <html> <head> </head> <body> <table border=1> <tr> <td> accouny no </td> <td> customer name </td> <td> report </td> <td> Rep name </td> <td> view/add follow-ups </td> </tr> <tr> <td> 12345 </td> <td> xyz </td> <td> abcd.... </td> <td> aaa </td> <td> <a href='followup.php?activity_id=".$row['activity_id']."'>view here</a> </td> </tr> </table> </body> </html> I am trying to display table in the following format: <html> <head> </head> <body> <table border=1> <tr> <td> accouny no </td> <td> customer name </td> <td> report </td> <td> Rep name </td> <td> follow-ups </td> </tr> <tr> <td> 12345 </td> <td> xyz </td> <td> abcd.... </td> <td> aaa </td> <td> 12/12/06 > Aaaa.... <br/> 22/1/07 > bbbb... <br/> </td> </tr> </table> </body> </html> Script 1 <?php require 'conn.php'; require 'page_header.php'; $end=time(); include "start_timer.php"; include "end_timer.php"; echo '<a href="logout.php">Log out</a><br><br>'; if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['repname']!="")) { $sql = "select distinct repactivity.*, customer_table.CUSTOMER_NAME, DATE_FORMAT(DATE_OF_ENTRY, '%d-%m-%Y %r') AS DATE_OF_ENTRY, concat(outstanding, ' ', outstanding2, ' ') AS outstanding from repactivity, customer_table where customer_table.account_no=repactivity.account_no AND"; if ($_GET['account_no']!="") { $sql = $sql." repactivity.account_no LIKE '".$_GET['account_no']."%'"; } if ($_GET['customer_name']!="") { if ($_GET['account_no']!="") $sql = $sql." and"; $sql = $sql." CUSTOMER_NAME LIKE '".$_GET['customer_name']."%'"; } if ($_GET['date']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="")) $sql = $sql." and"; $sql = $sql." DATE_OF_APPROACH LIKE '%".$_GET['date']."%'"; } if ($_GET['repname']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="")) $sql = $sql." and"; $sql = $sql." full_name LIKE '".$_GET['repname']."' Group by DATE_OF_ENTRY DESC"; } if ($_GET['rep2']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['rep2']!="")) $sql = $sql." and"; $sql = $sql." rep2 LIKE '".$_GET['rep2']."%' group by DATE_OF_ENTRY DESC"; } $result = mysql_query($sql); $number=mysql_num_rows($result); if (!$result) { echo 'Could not run query: ' . mysql_error(); } echo "<table border=1 bordercolor='tan' class='rep' width ='150%' " . "cellspacing='5'"."cellpadding='5'>\n"; echo "<tr border=1><th class='searchHeader'><caption> <b>Search Results</b><br>Total Reports = $number</caption> </th></tr>\n"; echo "<tr><td><b>Account No:</b></td> <td><b>Customer Name:</b></td> <td><b>Date of Approach:</b></td> <td width='50%'><b>Report:</b></td> <td width='50%'><b>Outstanding:</b></td> <td><b>Type of Approach:</b></td> <td width='14%'><b>Rep Name: </b></td> <td width='14%'><b>Rep2: </b></td> <td><b>Date of entry: </b></td> <td><b>Updated Status:</b></td><!-- td><b>Updated On:</b></td --> <td><b>View/add Follow-Up</b></td></tr>"; if ($result and !mysql_num_rows ($result)) { echo "<tr class='row1'><td>No results found that match the "; } else { while($row = mysql_fetch_array($result, MYSQL_BOTH)) { echo "<tr><!-- td>".$row['activity_id']."</td --> <td>".$row['account_no']."</td> <td>".$row['CUSTOMER_NAME']."</td> <td>".$row['DATE_OF_APPROACH']."</td> <td>".$row['report']."</td> <td>".$row['outstanding]."</td> <td>".$row['type_of_approach']."</td> <td>".$row['full_name']."</td> <td>".$row['rep2']."</td> <td>".$row['DATE_OF_ENTRY']."</td> <td>".$row['status']."</td> <!-- td>".$row['updated_on']."</td --> <td bgcolor='#FFFFFF'><a href='followup.php?activity_id=".$row['activity_id']."'>view here</a><BR></td></tr>"; // include ('view_topic_report.php?activity_id=$activity_id'); echo "</td>"; } } } ?> script 2 <?php //Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $activity_id=$_GET['activity_id']; //$sql="SELECT view $tbl_name.*, customer_table.customer_name, customer_table.account_no from $tbl_name, customer_table where $tbl_name.account_no='$account_no' ORDER BY DATE_OF_ENTRY DESC"; $sql="select * from $tbl_name where activity_id='$activity_id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <a href="logout.php">Logout</a><br> <FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"> <tr> <td bgcolor="#F8F7F1"><strong>Followup : </strong><? echo $rows['outstanding']; ?></td> </tr> <td bgcolor="#F8F7F1"><strong>By : </strong> <? echo $rows['full_name']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Date/time : </strong><? echo $rows['DATE_OF_ENTRY']; ?></td> </tr> </table></td> </tr> </table> <BR> <?php $tbl_name2="forum_answer"; // Switch to table "forum_answer" $sql2="SELECT * FROM $tbl_name2 WHERE question_id='$activity_id'"; $result2=mysql_query($sql2); while($rows=mysql_fetch_array($result2)){ ?> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td bgcolor="#F8F7F1"><strong>Update</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_id']; ?></td> </tr> <tr> <td width="18%" bgcolor="#F8F7F1"><strong>Name</strong></td> <td width="5%" bgcolor="#F8F7F1">:</td> <td width="77%" bgcolor="#F8F7F1"><? echo $rows['a_name']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Answer</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_answer']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Date/Time</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_datetime']; ?></td> </tr> </table></td> </tr> </table><br> <? } $sql3="SELECT $tbl_name.*, customer_table.customer_name, customer_table.account_no from $tbl_name, customer_table where customer_table.account_no=$tbl_name.account_no ORDER BY DATE_OF_ENTRY DESC"; $result3=mysql_query($sql3); $rows=mysql_fetch_array($result3); $view=$rows['view']; // if have no counter value set counter = 1 if(empty($view)){ $activity_id=$_GET['activity_id']; $view=1; $sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE activity_id='$activity_id'"; $result4=mysql_query($sql4); } // count more value $addview=$view+1; $sql5="update $tbl_name set view='$addview' WHERE activity_id='$activity_id'"; $result5=mysql_query($sql5); mysql_close(); ?> <BR> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="add_answer_reports.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td width="18%"><strong>Name</strong></td> <td width="3%">:</td> <td width="79%"><input name="a_name" type="text" id="a_name" size="45"></td> </tr> <tr> <td valign="top"><strong>Reply</strong></td> <td valign="top">:</td> <td><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td> </tr> <tr> <td valign="top"><strong>Status</strong></td> <td valign="top">:</td> <td valign="top"><select name="status"><?php echo $myrow["status"] ?> <option value="" selected>Select</option> <option value="Complete">Complete</option> <option value="Ongoing">Ongoing</option> <option value="Discussed with Ray">Discussed with Ray & closed</option> </select> </td> </tr> <tr> <td> </td> <td><input name="activity_id" type="hidden" value="<? echo $activity_id; ?>"></td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </table> </td> </form> </tr> </table> ?>
  7. hi guyz can some help solve the problem. Im really stuck :( thanks
  8. here is the code: [code] <?php require 'conn.php'; require 'page_header.php'; $end=time(); include "start_timer.php"; include "end_timer.php"; echo '<a href="logout.php">Log out</a><br><br>'; if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['repname']!="")) { $sql = "select distinct repactivity.*, customer_table.CUSTOMER_NAME, DATE_FORMAT(DATE_OF_ENTRY, '%d-%m-%Y %r') AS DATE_OF_ENTRY, concat(outstanding, ' ', outstanding2, ' ') AS outstanding from repactivity, customer_table where customer_table.account_no=repactivity.account_no AND"; if ($_GET['account_no']!="") { $sql = $sql." repactivity.account_no LIKE '".$_GET['account_no']."%'"; } if ($_GET['customer_name']!="") { if ($_GET['account_no']!="") $sql = $sql." and"; $sql = $sql." CUSTOMER_NAME LIKE '".$_GET['customer_name']."%'"; } if ($_GET['date']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="")) $sql = $sql." and"; $sql = $sql." DATE_OF_APPROACH LIKE '%".$_GET['date']."%'"; } if ($_GET['repname']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="")) $sql = $sql." and"; $sql = $sql." full_name LIKE '".$_GET['repname']."' Group by DATE_OF_ENTRY DESC"; } if ($_GET['rep2']!="") { if (($_GET['account_no']!="") or ($_GET['customer_name']!="") or ($_GET['date']!="") or ($_GET['rep2']!="")) $sql = $sql." and"; $sql = $sql." rep2 LIKE '".$_GET['rep2']."%' group by DATE_OF_ENTRY DESC"; } $result = mysql_query($sql); $number=mysql_num_rows($result); if (!$result) { echo 'Could not run query: ' . mysql_error(); } echo "<table border=1 bordercolor='tan' class='rep' width ='150%' " .     "cellspacing='5'"."cellpadding='5'>\n"; echo "<tr border=1><th class='searchHeader'><caption> <b>Search Results</b><br>Total Reports = $number</caption> </th></tr>\n"; echo "<tr><td><b>Account No:</b></td> <td><b>Customer Name:</b></td> <td><b>Date of Approach:</b></td> <td width='50%'><b>Report:</b></td> <td width='50%'><b>Outstanding:</b></td> <td><b>Type of Approach:</b></td> <td width='14%'><b>Rep Name: </b></td> <td width='14%'><b>Rep2: </b></td> <td><b>Date of entry: </b></td> <td><b>Updated Status:</b></td><!-- td><b>Updated On:</b></td --> <td><b>View/add Follow-Up</b></td></tr>"; if ($result and !mysql_num_rows ($result)) { echo "<tr class='row1'><td>No results found that match the ";   }   else   { while($row = mysql_fetch_array($result, MYSQL_BOTH)) { echo "<tr><!-- td>".$row['activity_id']."</td -->       <td>".$row['account_no']."</td>       <td>".$row['CUSTOMER_NAME']."</td>       <td>".$row['DATE_OF_APPROACH']."</td>       <td>".$row['report']."</td>       <td>".$row['outstanding]."</td>       <td>".$row['type_of_approach']."</td>               <td>".$row['full_name']."</td>       <td>".$row['rep2']."</td>       <td>".$row['DATE_OF_ENTRY']."</td>       <td>".$row['status']."</td>       <!-- td>".$row['updated_on']."</td -->       <td bgcolor='#FFFFFF'><a href='followup.php?activity_id=".$row['activity_id']."'>view here</a><BR></td></tr>";   //    include ('view_topic_report.php?activity_id=$activity_id'); echo "</td>"; } } } ?> [/code] Thanks
  9. now i am getting this error: Warning: include(view_topic_report.php?activity_id=$activity_id) [function.include]: failed to open stream: No such file or directory in /home/vhost/farmiloesinjamaica.co.uk/html/final/process_advance_search_admin.php on line 78
  10. can you give an example how to put it on one page. BTW i have tried the following but im getting error:unexpected T_VARIABLE, expecting ',' or ';'  ...  on line -> [quote]       <td>".$row['name]."</td>       <td>".$row['DATE_OF_ENTRY']."</td>       <td>".$row['status']."</td>              ->  <td> "$row['include "followup.php?activity_id=$activity_id";']."</td> [/quote]
  11. hi huggiebear thanks for the reply, i think i havent explained it properly. basically I have one script which displays a table (columns are Account No: Customer Name: Date of Approach: Report: Outstanding: Type of Approach etc) and want to display follow-up reports in the same table, but I have a seperate script for follow-up reports where name, follow-up report and time can be added. How can I show follow-up reports in a column on the same table. e.g. [quote] Account No|CustomerName|DateofApproach|  Report |  followup 0000             xyz                 00-00-0000          abc       name> report>date [/quote] I hope it makes more sense. Please advise me of any other ways to make this possible. Thanks
  12. Hi all, I have a system where reports are added by people. I have a textarea in the form where people write outstanding/follow-ups and updates it as and when required. I have created another table where updates are added with datetime, name, and status. the main report is displayed on the table (columns are Account No: Customer Name: Date of Approach: Report: Outstanding: Type of Approach etc) but currently follow-up are on a seperate page in a threaded discussion like format (can be accessed by clicking on a hyperlink). Problem if possible, I want follow-ups to be displayed in a column on the same table as the rest of the report. Also I want to keep the existing data when more info is added with datetime. I would really appreciate if someone could help me. thanks Heres the code for follow-ups [code] <?php //Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $activity_id=$_GET['activity_id']; //$sql="SELECT view $tbl_name.*, customer_table.customer_name, customer_table.account_no from $tbl_name, customer_table where $tbl_name.account_no='$account_no' ORDER BY DATE_OF_ENTRY DESC"; $sql="select * from $tbl_name where activity_id='$activity_id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?> <a href="logout.php">Logout</a><br> <FORM><INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);return true;"> </FORM> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"> <tr> <td bgcolor="#F8F7F1"><strong>Followup : </strong><? echo $rows['outstanding']; ?></td> </tr> <td bgcolor="#F8F7F1"><strong>By : </strong> <? echo $rows['full_name']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Date/time : </strong><? echo $rows['DATE_OF_ENTRY']; ?></td> </tr> </table></td> </tr> </table> <BR> <?php $tbl_name2="forum_answer"; // Switch to table "forum_answer" $sql2="SELECT * FROM $tbl_name2 WHERE question_id='$activity_id'"; $result2=mysql_query($sql2); while($rows=mysql_fetch_array($result2)){ ?> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td bgcolor="#F8F7F1"><strong>Update</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_id']; ?></td> </tr> <tr> <td width="18%" bgcolor="#F8F7F1"><strong>Name</strong></td> <td width="5%" bgcolor="#F8F7F1">:</td> <td width="77%" bgcolor="#F8F7F1"><? echo $rows['a_name']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Answer</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_answer']; ?></td> </tr> <tr> <td bgcolor="#F8F7F1"><strong>Date/Time</strong></td> <td bgcolor="#F8F7F1">:</td> <td bgcolor="#F8F7F1"><? echo $rows['a_datetime']; ?></td> </tr> </table></td> </tr> </table><br> <? } $sql3="SELECT $tbl_name.*, customer_table.customer_name, customer_table.account_no from $tbl_name, customer_table where customer_table.account_no=$tbl_name.account_no ORDER BY DATE_OF_ENTRY DESC"; $result3=mysql_query($sql3); $rows=mysql_fetch_array($result3); $view=$rows['view']; // if have no counter value set counter = 1 if(empty($view)){ $activity_id=$_GET['activity_id']; $view=1; $sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE activity_id='$activity_id'"; $result4=mysql_query($sql4); } // count more value $addview=$view+1; $sql5="update $tbl_name set view='$addview' WHERE activity_id='$activity_id'"; $result5=mysql_query($sql5); mysql_close(); ?> <BR> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="add_answer_reports.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td width="18%"><strong>Name</strong></td> <td width="3%">:</td> <td width="79%"><input name="a_name" type="text" id="a_name" size="45"></td> </tr> <tr> <td valign="top"><strong>Reply</strong></td> <td valign="top">:</td> <td><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td> </tr> <tr> <td valign="top"><strong>Status</strong></td> <td valign="top">:</td> <td valign="top"><select name="status"><?php echo $myrow["status"] ?>        <option value="" selected>Select</option>        <option value="Complete">Complete</option>        <option value="Ongoing">Ongoing</option>        <option value="Discussed with Ray">Discussed with Ray & closed</option>       </select> </td> </tr> <tr> <td>&nbsp;</td> <td><input name="activity_id" type="hidden" value="<? echo $activity_id; ?>"></td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td> </tr> </table> </td> </form> </tr> </table> <? /* if($_POST["Submit"]) { $activity_id=$_GET['activity_id']; $sql6= "update table reactivity set status=(select status from forum_answer) where activity_id='$activity_id'";       $result = mysql_query($sql); } */ ?> [/code]
×
×
  • 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.