Jump to content

kmark

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by kmark

  1. Its not an id field, its just if I number employee levels and I want to add one at the top it pushes everything down one. Works great by the way if I get rid of the quotes. Thanks
  2. Hi, I'm wondering if there is a way that I can increment all the values in a specific field by one by just using a single query. So the original records are: Name Number Mark 3 Kevin 10 and i want... Name Number Mark 4 Kevin 11
  3. OK...So back to basics. Users Enter goals for any given year (example: 2004, 2006, 2007). They didn't have to enter them for every year. So then at the main page i want to have a drop down menu that only display the years that they have completed goals for if they are in the last 3 years. The output in this example would be <select name="year"> <option value="2006">2006</option> <option value="2007">2007</option> </select> I hope this helps clarify
  4. It actually has nothing to do with whether the goal was met. All I need as I said is it to look though the database and find if there are any goals entered where the year matches the any of the last 3 years (there is a field called "year" in the database). Then the tricky part which is to have the years matched (for example 2006 and 2008) and put them in the menu: <option value="2006">2006</option> <option value="2008">2008</option> I can think of a way to do this which would be to loop through the database 3 times searching far each different year each time, but i'm am wondering if i could do this one query.
  5. your link should read: print '<a href="viewfull.php?id='.$row['therowID'].'">View</a>'; its currently using the counter not the ID
  6. Im a trying to write a function that will look through a database to see if a user has completed previous goals in the last 3 years and if so add those years to the drop down menu. But only the add the years that they have completed goals in. I can't think of an efficient way to do this other that looping through the database 3 times. Is there a better way? Code is below //==================================== //Year Menu Function //==================================== function yearMenu($session){ $menu = '<select name="year">';//Add beginning select tag $thisYear = date("Y"); $sql = "SELECT * FROM tblGoals WHERE userID = '$session'"; $result = $db->Execute($sql); if($result->RecordCount() == 0){//No Previous Years so just show this year $menu .= '<option value="'.thisYear.'">'.$thisYear.'</option>'; }else{ while(!$result->EOF){ NEED HELP HERE $result -> MoveNext(); } } $menu .= '</select>';//Add closing select tag return $menu } Any help is appreciated
  7. thanks i changed the variable scope and it works fine global $db;
  8. i am using adodb and am receiving the following error message Fatal error: Call to a member function on a non-object in e:\web\public_html\****\manager.php on line 59 the object is being used in a function - does that matter? Code is below <? include("../adodb/adodb.inc.php"); $db =& ADONewConnection('odbc_mssql'); $dsn = "Driver={SQL Server};Server=myserver;Database=mydb;"; $db->Connect($dsn,'useruser','password'); //URL Variable Validation Not posted //Generate Table function function managerTable($table, $order, $type, $extra=FALSE){ $extrax = (empty($extra)) ? $type : $extra; print '<table><tr><td colspan="3" align="right"><a href="'.strtolower($extrax).'Action.php">Add A '.$type.'</a></td></tr>'; $table .= (empty($order)) ? '' : ' ORDER BY userAdded'; $sql = "SELECT * FROM $table"; $result = $db->Execute($sql); if($result->RecordCount() == 0){ print '<tr><td>No Data</td></tr>'; }else{ while(!$result->EOF){ print '<tr><td>'.$result->fields[1].'</td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'">Edit</a></td><td><a href="'.strtolower($extrax).'Action.php?id='.$result->fields[0].'&action=1" onclick="return confirm(\'Are you sure you want to delete this '.$type.'?\');">Delete</a></td></tr>'; } } print '</table>'; } require_once('inc/header.php'); managerTable($paramA,$paramB,$paramC,$paramD); require_once('inc/footer.php');
  9. all date formatting option are at http://ca3.php.net/date
  10. date("D F j, Y", strtotime($theDate)); would output: Friday Jun 13, 2008 if $thedate = 2008-06-13
  11. Theres nothing wrong in the post above, im just saying you cant use a variable that isn't set in a error statement because it isn't set. but if it is set like the links you showed above then you should have no problem but you will have to add some code so that the row info is output. Where you have: //echo out all values in $row you need to write some code to output the values eg: print $row['firstName'].' '.$row['lastName']; where firstName and lastName are fields in your database This would print John Smith if John Smith was the first and last name in your table for the specified row. Make Sense?
  12. that would be because $_GET['full'] isn't set. It doesn't make sense to check if $_GET['full'] isset and then if it isn't try and use it in the error message.
  13. hmmmm, i guess what i'm trying to avoid is having to loop through all the employees and check if they are assigned or not and the run a query for each employee. So what im thinking is would it be better if when the form is submitted all the assignments to that manager are deleted and the just run the one Insert query i have above? I think this makes sense but let me know what you think.
  14. your line 36 should read echo "An Error has occurred in sending the value of ".$_GET['full']; OR echo "An Error has occurred in sending the value of {$_GET['full']}";
  15. Your third line shoul be: if (isset($_GET['full'])) {
  16. Hi, I have a page in my application where managers are assigned employees. Currently you click on the managers name and that takes you to a page where all the employees are listed with a checkbox beside their name. If the checkbox is checked then that employee is assigned to that manager using the code below (MSSQL database). if(count($_POST['link'])) { $sql = "INSERT INTO tblAssignment (employeeID1, employeeeID2) (SELECT $id, ". implode (') UNION (SELECT '. $id .', ', $_POST['link']) .")"; } That is working fine What i just realized now is that employees can be unassigned-unchecked (deleted from the assignment table) and I don't want to have duplicate entries either. What would be the best way to filter the checkboxes to make sure that if a box has been unchecked that the row gets deleted or if it stays checked that it does not get entered again?
  17. Thanks Jon, I realize the liability in this, I just wanted to make sure that the process itself did not have a glaring holes besides the obvious.
  18. K, I read your post and realize that nothing is ever 100% safe. The holes I see in this are the security of the machine receiving the emails, and the link to the decrypt page. But aside from that, i guess I'm referring to on the online side of things is this a horrible process, or is this just not ideal?
  19. I have a small client who wishses to recieve credit card info online. He does not expect a lot of orders but would like the capability. So rather than have him paying authorize.net or someone like that percentages on transactions and monthly fees, i thought of a system that I thought would work and wondered if you saw any holes init. They user has filled their cart and everything they reach the payment info page that is secured by SSL. They enter their credit card info that is needed and hit submit. The payment process page which is also secured by SSL then takes the CC# and info and encrypts it, the encypted info is then emailed to the store owner. He before hand is given a orphaned link to a SSL secured decrypt page that he can login to and enter the encrypted information Then the submission will be processed on an SSL secured page and he will recieve the unencrypted information on the page. He then enters that info into his payment terminal in his store. He then deletes the email with the encrypted CC info. Is there a major security risk in this process?
  20. you need to tell the form where to go to process the info. fill in the action attribute in the form tag eg action="formprocess.php"
  21. the problem with the earlier example was the quotes in the post var should be $_POST[$del] however the other posted solution is much better.
  22. How about when the form is submitted looping through them again but testing to see if they are checked //Submit Part while($edit = mysql_fetch_array($nres)) {//loop through the same table $del = $edit['id']; if($_POST['$del'] == 'checked'){ //Delete Statement } } //Form part while($edit = mysql_fetch_array($nres)) { $del = $edit['id']; echo "<input type='checkbox' id='$del' name='$del' value='checked' />"; }
  23. Hi i was just dealing with something like this. My solution ended up being moving session_start(); to the very top of the login page. Why this make a difference I have no idea but it did. So instead of //Form and login has already been validated then... session_start(); $_SESSION['this'] = 'that'; header('Location:here.php'); I use... session_start(); //Form validation login procedure etc....then $_SESSION['this'] = 'that'; header('Location:here.php'); Let me know if this works for you
×
×
  • 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.