Jump to content

rockindano30

Members
  • Posts

    141
  • Joined

  • Last visited

    Never

Everything posted by rockindano30

  1. ah.... this is getting me can't see the error....... ahhhhhhhhh
  2. k there is a colum in both table employees has emp_id as pk and emp_keys has is as fk. and still nothing passing through
  3. no still does not pass it. i even try printing out the $emp_id to see if it gets it from table and it does not display it
  4. i have tried $emp_id by itself before and can't get it. this is where i'm trying to set it or get it and at the start of the code i also get it using this $emp_id=$_GET["emp_id"]; //the format is $variable = $r["nameofmysqlcolumn"]; $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; $emp_id=$r["emp_id"]; //////getting this emp_id from the query ?> <p style="padding:0px; text-decoration:underline">Your Search Results are below:</p><br /> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr><td width="20%"><strong>Department:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> </tr>
  5. no thats one of the problems, it does not set.
  6. Hello all, Well I'm trying to get my script to work and I'm stuck and can't get around it or figure it out. I have three tables. employees(emp_id, Fname, Lname, email, dept_id) //emp_id is pk and dept_id is fk departments(dept_id,deptname,phone) // dept_id pk emp_keys (kid,emp_id, access, key_num) //kid is pk emp_id is fk now i want to delete an employee from employees and also delete their key(s) from key table. this is my code in my search page. <?php $search=addslashes($search); $search2=addslashes($search2); //get the mysql and store them in $result $query = "select Fname,Lname, email, dept, group_concat(key_num separator ' - ') as key_num, group_concat(accss separator ' - ') as accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2' and departments.dept_id= employees.dept_id and emp_keys.emp_id=employees.emp_id group by employees.emp_id"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if ($num_result < 1) print "<p>No employee found by that name.<br />Please make sure that you typed in the employee's name correctly.<br />Or there is no keys asigned to that employee.</p>"; else { //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; $emp_id=$r["emp_id"]; ?> <p style="padding:0px; text-decoration:underline">Your Search Results are below:</p><br /> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr><td width="20%"><strong>Department:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> </tr> <tr><td width="20%"><strong>Name:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> </tr> <tr><td width="20%"><strong>Email:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> </tr> <tr><td width="20%"><strong>Key #:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> </tr> <tr><td width="20%"><strong>Key Access:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $accss; ?></font></td> </tr> <tr><td width="20%"> </td> <td width="80%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?></td> </tr> </table> <?php }//end while loop } } ?> this is my code in my delete.php page <?php ///bla bla bla connect to bd..... //select which database you want to edit mysql_select_db("bldg_keys"); $emp_id = $_GET[emp_id]; $dept_id=$_GET[dept_id]; $query = "DELETE Fname,Lname,email,dept,key_num,accss FROM emp_keys, departments, employees WHERE departments.dept_id=employees.dept_id and emp_keys.emp_id=employees.emp_id"; // $query = "DELETE FROM employees WHERE emp_id=$empid"; $result = mysql_query($query) or die ("Error in query: $query.".mysql_error()); print "<p>Employee has been removed permanently from our database.<br />"; print "Click <a href=\"index.php\">HERE</a> to go to home page.</p>"; ?> im trying to pass the emp_id from search.php page to delete. but i'm stuck cause it is not getting the emp_id. can anybody see whats wrong here? i can't. and this is the error i get in my delete.php page Error in query: DELETE Fname,Lname,email,dept,key_num,accss FROM emp_keys, departments, employees WHERE departments.dept_id=employees.dept_id and emp_keys.emp_id=employees.emp_id.Unknown table 'fname' in MULTI DELETE Thanks in advance.
  7. one more thing i get this error at delete.php page: Error in query: DELETE Fname,Lname,email,dept,key_num,accss FROM emp_keys, departments, employees WHERE departments.dept_id=employees.dept_id and emp_keys.emp_id=employees.emp_id.Unknown table 'fname' in MULTI DELETE
  8. Hello all, Well I'm trying to get my script to work and I'm stuck and can't get around it or figure it out. I have three tables. employees(emp_id, Fname, Lname, email, dept_id) //emp_id is pk and dept_id is fk departments(dept_id,deptname,phone) // dept_id pk emp_keys (kid,emp_id, access, key_num) //kid is pk emp_id is fk now i want to delete an employee from employees and also delete their key(s) from key table. this is my code in my search page. <?php $search=addslashes($search); $search2=addslashes($search2); //get the mysql and store them in $result $query = "select Fname,Lname, email, dept, group_concat(key_num separator ' - ') as key_num, group_concat(accss separator ' - ') as accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2' and departments.dept_id= employees.dept_id and emp_keys.emp_id=employees.emp_id group by employees.emp_id"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if ($num_result < 1) print "<p>No employee found by that name.<br />Please make sure that you typed in the employee's name correctly.<br />Or there is no keys asigned to that employee.</p>"; else { //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; $emp_id=$r["emp_id"]; ?> <p style="padding:0px; text-decoration:underline">Your Search Results are below:</p><br /> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr><td width="20%"><strong>Department:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> </tr> <tr><td width="20%"><strong>Name:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> </tr> <tr><td width="20%"><strong>Email:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> </tr> <tr><td width="20%"><strong>Key #:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> </tr> <tr><td width="20%"><strong>Key Access:</strong></td> <td width="80%"><font face="Arial, Helvetica, sans-serif"><?php print $accss; ?></font></td> </tr> <tr><td width="20%"> </td> <td width="80%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?></td> </tr> </table> <?php }//end while loop } } ?> this is my code in my delete.php page <?php ///bla bla bla connect to bd..... //select which database you want to edit mysql_select_db("bldg_keys"); $emp_id = $_GET[emp_id]; $dept_id=$_GET[dept_id]; $query = "DELETE Fname,Lname,email,dept,key_num,accss FROM emp_keys, departments, employees WHERE departments.dept_id=employees.dept_id and emp_keys.emp_id=employees.emp_id"; // $query = "DELETE FROM employees WHERE emp_id=$empid"; $result = mysql_query($query) or die ("Error in query: $query.".mysql_error()); print "<p>Employee has been removed permanently from our database.<br />"; print "Click <a href=\"index.php\">HERE</a> to go to home page.</p>"; ?> im trying to pass the emp_id from search.php page to delete. but i'm stuck cause it is not getting the emp_id. can anybody see whats wrong here? i can't. Thanks in advance.
  9. i tried it but only displays one key number instead of three and no key access info.
  10. one more thing, for every key it has to display what doors does it open.
  11. "hello me, its me again..." i have this web app i'm working on and it should display an employee' firstname, lastname, email, their department, keynum, and access to what door. so i have three tables: employees(emp_id,Fname,Lname,email,dept_id) /////dept_id foreign key and emp_id is primary departments(dept_id,dept_name,Phone) emp_keys(kid,emp_id,accss) /////kid is primary and emp_id is foreign now i have it working where it displays the needed info, but now lets say for example and employee has three keys, it will display the same employee three times, where i just want it to display the employee's name email department once and key_nums N times the number of keys. here's my code "ch... ch... ch... check it out..." mysql_select_db("bldg_keys"); $search=$_POST["search"]; $search2=$_POST["search2"]; if(!isset($search) || empty($search) || !isset($search2) || empty($search2)) { print"<p>Your search was not sucessfull due for one of the followings:<br />"; print "Make sure that you have the first and last name filled.<br />"; print "Make sure that you spelled the employee's name currectly.</p>"; } else{ $emp_id=$_GET["emp_id"]; //get the mysql and store them in $result //change whatevertable to the mysql table you're using //change whatevercolumn to the column in the table you want to search ////departments.emp_id='$emp_id', // $query = "select Fname,Lname, email, dept, key_num, accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2'"; $query = "select Fname,Lname, email, dept, key_num, accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2' and departments.dept_id= employees.dept_id and emp_keys.emp_id=employees.emp_id"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if ($num_result < 1) print "<p>No employee found by that name.<br />Please make sure that you typed in the employee's name correctly.</p>"; else { //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; //display the row //display the row ?> <tr> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr> <td width="14%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> <td width="17%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> <td width="28%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif"><?php print $accss ?></font></td> <td width="50%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?> </td> </tr> </table> <?php }//end while loop ?> <?php } } ?>
  12. Thank you man!!!! ;D ;D it worked. i was using or trying to get it by using the emp_id and thats wrong and didn't noticed it. thanks
  13. hello i have a problem here. i have this web app i'm working on and it should display an employee' firstname, lastname, email, their department, keynum, and access to what door. so i have three tables: employees(emp_id,Fname,Lname,email,dept_id) /////dept_id foreign key and emp_id is primary departments(dept_id,dept_name,Phone) emp_keys(kid,emp_id,accss) /////kid is primary and emp_id is foreign so here is part of my code: this web app is to search for employees by names or for keys by key number ///bla bla bla connection to db here /// /// /// <?php //this is where i'm trying to get all info from all tables //problem is this will print the same employee six time because there are six departments //so doesn't know when to stop //maybe i'm join the tables wrong....... $query = "select Fname,Lname, email, dept, key_num, accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2'"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if ($num_result < 1) print "<p>No employee found by that name.<br />Please make sure that you typed in the employee's name correctly.</p>"; else { ?> <table width="95%" border="0" cellspacing="2" cellpadding="2"> <tr> <table width="100%" border="0" cellpadding="1" cellspacing="0" style="border-bottom:1px solid #000033;"> <tr style="color:#ffffff; font-size:12px" align="left" bgcolor="#fc8200"> <td width="14%" colspan="1"><font face="Arial, Helvetica, sans-serif">Dept</font></td> <td width="17%" colspan="1"><font face="Arial, Helvetica, sans-serif">Employee</font></td> <td width="28%" colspan="1"><font face="Arial, Helvetica, sans-serif">Email</font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif">Key #</font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif">Department Access</font></td> <td><font face="Arial, Helvetica, sans-serif">Remove</font></td> </tr> </table> </tr> <?php //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; //display the row //display the row ?> <tr> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr> <td width="14%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> <td width="17%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> <td width="28%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif"><?php print $accss ?></font></td> <td width="50%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?> </td> </tr> </table> </tr> <?php }//end while loop ?> <?php } } ?> PHPFreaks any Help??? Thanks in advance.
  14. hello i have a problem here. i have this web app i'm working on and it should display an employee' firstname, lastname, email, their department, keynum, and access to what door. so i have three tables: employees(emp_id,Fname,Lname,email,dept_id) /////dept_id foreign key and emp_id is primary departments(dept_id,dept_name,Phone) emp_keys(kid,emp_id,accss) /////kid is primary and emp_id is foreign so here is part of my code: this web app is to search for employees by names or for keys by key number ///bla bla bla connection to db here /// /// /// <?php //this is where i'm trying to get all info from all tables //problem is this will print the same employee six time because there are six departments //so doesn't know when to stop //maybe i'm join the tables wrong....... $query = "select Fname,Lname, email, dept, key_num, accss FROM departments, employees, emp_keys where Fname like '%$search%' and Lname like '$search2'"; $result = mysql_query($query); $num_result = mysql_num_rows($result); if ($num_result < 1) print "<p>No employee found by that name.<br />Please make sure that you typed in the employee's name correctly.</p>"; else { ?> <table width="95%" border="0" cellspacing="2" cellpadding="2"> <tr> <table width="100%" border="0" cellpadding="1" cellspacing="0" style="border-bottom:1px solid #000033;"> <tr style="color:#ffffff; font-size:12px" align="left" bgcolor="#fc8200"> <td width="14%" colspan="1"><font face="Arial, Helvetica, sans-serif">Dept</font></td> <td width="17%" colspan="1"><font face="Arial, Helvetica, sans-serif">Employee</font></td> <td width="28%" colspan="1"><font face="Arial, Helvetica, sans-serif">Email</font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif">Key #</font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif">Department Access</font></td> <td><font face="Arial, Helvetica, sans-serif">Remove</font></td> </tr> </table> </tr> <?php //grab all the content while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $dept=$r["dept"]; $Fname=$r["Fname"]; $Lname=$r["Lname"]; $email=$r["email"]; $key_num=$r["key_num"]; $accss=$r["accss"]; //display the row //display the row ?> <tr> <table width="100%" border="0" cellpadding="1" cellspacing="0" class="table1"> <tr> <td width="14%"><font face="Arial, Helvetica, sans-serif"><?php print $dept; ?></font></td> <td width="17%"><font face="Arial, Helvetica, sans-serif" style="color:#CC6600"><?php print $Fname." ".$Lname; ?></font></td> <td width="28%"><font face="Arial, Helvetica, sans-serif"><?php print $email; ?></font></td> <td width="10%"><font face="Arial, Helvetica, sans-serif"><?php print $key_num; ?></font></td> <td width="50%"><font face="Arial, Helvetica, sans-serif"><?php print $accss ?></font></td> <td width="50%"> <?php print"<a href='delete.php?emp_id={$emp_id['emp_id']}'>Remove</a><br />";?> </td> </tr> </table> </tr> <?php }//end while loop ?> <?php } } ?> PHPFreaks any Help??? Thanks in advance.
  15. i have been working for a week on other projects though. you know i have more than one to work on. lol problem is i can't seem to retrieve my events from my db. i know i'm missing a for loop or something.
  16. wow its been a little over a week since my last post and still no answer. where is the help??????????????????? i need to get this thing done and i am very stuck here.
  17. WOW ITS BEEN WEEKS SINCE MY LAST POST AND NO ONE HAS EVEN BOTHERED TO REPLY. WHERE'S THE HELP WHEN NEEDED? WHAT IS THIS FORUM FOR?
  18. ginger, well its a calendar that should show a pop up floating box with the name of the event and a link to cal.php page with will give more info to that event. well it works. the calendar works and the floating box that suppose to show the title of the event works as well. i have the calendar db with events and floating box does show the first title of the first event that is in the array $date. so my problem is going through that array and displaying the event in the proper date in the calendar. don't know if i am making sense or not.
  19. hello all trying to finish my event calendar but stuck on asigning the events to linking days. help??????????? here is my code. <?php // Get values from query string $day = $_GET["day"]; $month = $_GET["month"]; $year = $_GET["year"]; $sel = $_GET["sel"]; $what = $_GET["what"]; if($day == "") $day = date("j"); if($month == "") $month = date("m"); if($year == "") $year = date("Y"); $currentTimeStamp = strtotime("$year-$month-$day"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp); $counter = 0; $numEventsThisMonth = 0; $hasEvent = false; $todaysEvents = ""; ?> <table width="100%" border='0' cellspacing='0' cellpadding='0'> <tr align="center"> <td width="87" colspan='1' align="center"><input type='button' value='<<' onClick='goLastMonth(<?php echo $month . ", " . $year; ?>)'> </td> <td colspan='5' align="center"><span class='title'><?php echo $monthName . " " . $year; ?></span><br> </td> <td width="87" colspan='1' align='center'><input type='button' value='>>' onClick='goNextMonth(<?php echo $month . ", " . $year; ?>)'> </td> </tr> <tr> <td class='style2'>S</td> <td width='80' class='style2'>M</td> <td width='80' class='style2'>T</td> <td width='80' class='style2'>W</td> <td width='80' class='style2'>T</td> <td width='80' class='style2'>F</td> <td class='style2'>S</td> </tr> <?php $numDays = date("t", $currentTimeStamp); for($i = 1; $i < $numDays+1; $i++, $counter++) { $timeStamp = strtotime("$year-$month-$i"); if($i == 1) { // Workout when the first day of the month is $firstDay = date("w", $timeStamp); for($j = 0; $j < $firstDay; $j++, $counter++) echo "<td align='center'> </td>"; } //end if if(!($db = @ mysql_connect('localhost', 'username', 'password'))) { echo 'Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time.'; exit; } //select which database you want to edit mysql_select_db("edinburg_site"); $event_id = $_GET["event_id"]; if(!isset($event_id)) { $query = "SELECT * FROM calendar order by dateevent asc LIMIT 20"; $result = mysql_query($query); while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; $event_id=$r["event_id"]; $date=$r["dateevent"]; $title=$r["title"]; print $date."<br />"; } //prints out all days here................... if($counter % 7 == 0) print "</tr><tr align='center'>"; if(date("w", $timeStamp) == 0 || date("w", $timeStamp) == 6) print "<td width='50' class='weekend' align='left'>$i</td>"; else if($i == date("d") && $month == date("m") && $year == date("Y")) print "<td width='50' class='today' align='left'><div id=\"links\"><a href\"\">$i<span>$title</span></a></div></td>"; else print "<td width='50' class='normal' align='left'><div id=\"links\"><a href\"\">$i<span>$title</span></a></div></td>"; if(isset($date) && $date==$i) print "there is an event on today"; }//end if/////////////////////////// }//end of for loop ?> </table>
  20. im working on a calendar. i have the calendar done but stuck on making it a active event calendar. i want the days that have events to be links. i have it customized with css but missing the links and events here is the code: <?php // Get values from query string $day = $_GET["day"]; $month = $_GET["month"]; $year = $_GET["year"]; $sel = $_GET["sel"]; $what = $_GET["what"]; if($day == "") $day = date("j"); if($month == "") $month = date("m"); if($year == "") $year = date("Y"); $currentTimeStamp = strtotime("$year-$month-$day"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp); $counter = 0; $numEventsThisMonth = 0; $hasEvent = false; $todaysEvents = ""; ?> <table width="100%" border='0' cellspacing='0' cellpadding='0'> <tr align="center"> <td colspan='1' align="center"><input type='button' value='<<' onClick='goLastMonth(<?php echo $month . ", " . $year; ?>)'> </td> <td colspan='5' align="center"><span class='title'><?php echo $monthName . " " . $year; ?></span><br> </td> <td width='20' colspan='1' align='right'><input type='button' value='>>' onClick='goNextMonth(<?php echo $month . ", " . $year; ?>)'> </td> </tr> <tr> <td class='style2'>S</td> <td width='18' class='style2'>M</td> <td width='35' class='style2'>T</td> <td width='37' class='style2'>W</td> <td width='35' class='style2'>T</td> <td width='67' class='style2'>F</td> <td class='style2'>S</td> </tr> <?php $numDays = date("t", $currentTimeStamp); for($i = 1; $i < $numDays+1; $i++, $counter++) { $timeStamp = strtotime("$year-$month-$i"); if($i == 1) { // Workout when the first day of the month is $firstDay = date("w", $timeStamp); for($j = 0; $j < $firstDay; $j++, $counter++) echo "<td align='center'> </td>"; } //end if if(!($db = @ mysql_connect('localhost', 'username', 'password'))) { echo 'Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time.'; exit; } //select which database you want to edit mysql_select_db("db name"); $event_id = $_GET["event_id"]; if(!isset($event_id)) { $query = "SELECT * FROM calendar"; $result = mysql_query($query); while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $event_id=$r["event_id"]; $date=$r["dateevent"]; // for ($k=0; $k<count($date); $k++) // if($i==$date) // // print $i; } //prints out all days here................... if($counter % 7 == 0) echo "</tr><tr align='center'>"; if(date("w", $timeStamp) == 0 || date("w", $timeStamp) == 6) echo "<td width='50' class='weekend' align='center'>$i</td>"; else if($i == date("d") && $month == date("m") && $year == date("Y")) echo "<td width='50' class='today' align='center'>$i</td>"; /*else if($i==$date) echo "<td width='50' class='normal' align='center' style=\"background-color:black\"><a href=''>$i</a></td>"; */ else echo "<td width='50' class='normal' align='center'>$i</td>"; }//end if/////////////////////////// }//end of for loop ?> </table> HELP!!!!!!! PLEASE!!!!!!!!!!!!! ANYONE!!!!!!!!!!!!!!
  21. you can start by making your interface and buttons in photoshop and then using flash to do the animation and actionscript really thats all you need. check this site out. http://www.gotoandlearn.com
  22. hello all, i'm currently working on a event calendar and i am stuck. i want it to display events on days that events are taking place. and those days to be links. here is cal code: <?php // Get values from query string $day = $_GET["day"]; $month = $_GET["month"]; $year = $_GET["year"]; $sel = $_GET["sel"]; $what = $_GET["what"]; if($day == "") $day = date("j"); if($month == "") $month = date("m"); if($year == "") $year = date("Y"); $currentTimeStamp = strtotime("$year-$month-$day"); $monthName = date("F", $currentTimeStamp); $numDays = date("t", $currentTimeStamp); $counter = 0; $numEventsThisMonth = 0; $hasEvent = false; $todaysEvents = ""; ?> <table width="100%" border='0' cellspacing='0' cellpadding='0'> <tr align="center"> <td colspan='1' align="center"><input type='button' value='<<' onClick='goLastMonth(<?php echo $month . ", " . $year; ?>)'> </td> <td colspan='5' align="center"><span class='title'><?php echo $monthName . " " . $year; ?></span><br> </td> <td width='20' colspan='1' align='right'><input type='button' value='>>' onClick='goNextMonth(<?php echo $month . ", " . $year; ?>)'> </td> </tr> <tr> <td class='style2'>S</td> <td width='18' class='style2'>M</td> <td width='35' class='style2'>T</td> <td width='37' class='style2'>W</td> <td width='35' class='style2'>T</td> <td width='67' class='style2'>F</td> <td class='style2'>S</td> </tr> <?php $numDays = date("t", $currentTimeStamp); for($i = 1; $i < $numDays+1; $i++, $counter++) { $timeStamp = strtotime("$year-$month-$i"); if($i == 1) { // Workout when the first day of the month is $firstDay = date("w", $timeStamp); for($j = 0; $j < $firstDay; $j++, $counter++) echo "<td align='center'> </td>"; } //end if if(!($db = @ mysql_connect('localhost', 'username', 'password'))) { echo 'Error: Could not connect to our database sorry for any inconvience.<br /> Please try at a later time.'; exit; } //select which database you want to edit mysql_select_db("db name"); $event_id = $_GET["event_id"]; if(!isset($event_id)) { $query = "SELECT * FROM calendar"; $result = mysql_query($query); while($r=mysql_fetch_array($result)) { //the format is $variable = $r["nameofmysqlcolumn"]; //modify these to match your mysql table columns $event_id=$r["event_id"]; $date=$r["dateevent"]; // for ($k=0; $k<count($date); $k++) // if($i==$date) // // print $i; } //prints out all days here................... if($counter % 7 == 0) echo "</tr><tr align='center'>"; if(date("w", $timeStamp) == 0 || date("w", $timeStamp) == 6) echo "<td width='50' class='weekend' align='center'>$i</td>"; else if($i == date("d") && $month == date("m") && $year == date("Y")) echo "<td width='50' class='today' align='center'>$i</td>"; /*else if($i==$date) echo "<td width='50' class='normal' align='center' style=\"background-color:black\"><a href=''>$i</a></td>"; */ else echo "<td width='50' class='normal' align='center'>$i</td>"; }//end if/////////////////////////// }//end of for loop ?> </table> stuck on getting days to be active as links. help!!!!!!!!
×
×
  • 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.