Jump to content

sylunt1

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Posts posted by sylunt1

  1. there is a row called task_complete or something of that nature... it defaults to 0 (not done) when they user puts a check in the box next to the tasks then it will update the row with a 1.

     

    What I am thinking is what laffin wrote - but I dont know how to pass all the variables like that - if they check # 1, 6, 47 how do I pass task_id=1, task_id=6 and task_id=47 from the form to the processing page?  I think I am to the point where I confused myself as to wtf is going on :)

  2. Here is how I list out the tasks...

     

    if ($tasks_id != $previous_tasks_id){

      print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>';

     

      $previous_tasks_id = $tasks_id ;

     

    }

     

    Will this need to be modified as well?

  3. I have a form that prints out a list of tasks with a checkbox that the user marks when it is complete.

     

    Basically its like this:

     

    task 1  task desctiption  []done

    task 2  task desctiption  []done

    ...

    task 100  task desctiption  []done

     

    Each task has a unique task_id but I am confused how to enter this in the db.

     

    I want to be able to take the task_ids that have the check (value of 1) and update the db with this.

     

    Example

    Tasks 1, 5, 12,and 17 have a check

    so where task_id=1 and task_id=5 (etc...) update field to a 1.  I am just not sure how to get here...

     

     

    Thanks.

  4. it isnt echoing anything out - once I put the date modification stuff in there it wont echo anything else except an incorrect modified date.

     

    If the start is 01/01/2008 it echos 01/21/2008 - thats it.  I have put in markers before and after the code and those get echoed, but all the other variables go away...

  5. Hello:

     

    I am having issues with the below script.  It is not computing the date correctly and none of the other variables are getting passed to the db.  The object is to take tse_start (entered as mm/dd/yyyy) and add 28 days to it - this new date is to be entered as tse_estlive.  Any help is appreciated.

     

     

    <?PHP
    
    $tse_start   = $_POST['tse_start'];
    $tse_id   = $_POST['tse_id'];
    $tse_name = $_POST['tse_name'];
    $tse_mentorname = $_POST['tse_mentorname'];
    $tse_mgr  = $_POST['tse_mgr'];
    $tse_grpid   = $_POST['tse_grpid'];
    $tse_start   = $_POST['tse_start'];
    $tse_level = $_POST['tse_level'];
    $tse_weekorder  = $_POST['tse_weekorder'];
    $tse_bootdone   = $_POST['tse_bootdone'];
    
    
    $tse_start_db = date('Y-m-d', strtotime($tse_start));
    $tse_est_live_db = date('Y-m-d', strtotime('$tse_start_db +28 days'));
    
          $db = mysql_connect("$server", "$user", "$password");
          mysql_select_db('mentor', $db) or die ('Cannot connect to $db_Database : ' . mysql_error());
    
    echo "$tse_start_db";
    echo "$tse_name $tse_mentorname $tse_mgr $tse_grpid $tse_start_db $tse_estlive_db $tse_level $tse_weekorder $tse_bootdone";
    
    $sql =  "INSERT INTO tse (tse_name, tse_mentorname, tse_mgr, tse_grpid, tse_start, tse_estlive, tse_level, tse_weekorder, tse_bootdone)
             VALUES ('$tse_name', '$tse_mentorname', '$tse_mgr', '$tse_grpid', '$tse_start', '$tse_est_live_db', '$tse_level', '$tse_weekorder', '$tse_bootdone')";
    
    $sql_result = mysql_query($sql,$db) or die ('Could not insert data');
    
    
    echo('Data inserted successfully.');
    
    
    
    
    mysql_close($db);

  6. Hello...

     

    Here is what I am trying to do....

     

    I want to take $tse_start and add 28 days to it and have that be $tse_estlive which will then be inserted in to mysql.

     

    $tse_start is a date field that is being posted from a form on a previous page.

     

    I am thinking something like this... but as it is - no luck

     

    $tse_estlive  = mktime(0, 0, 0, $tse_start("m")  , $tse_start("d")+28, $tse_start("Y"));

     

    Any help is appreciated.

  7. <FORM ACTION="tsecomplete.php">
    <blockquote>
    
    
    
    <?php
    
    
          $db = mysql_connect("$server", "$user", "$password");
          mysql_select_db('mentor', $db) or die ('Cannot connect to $db_Database : ' . mysql_error());
    
       $id = $_GET['id'];
    
       $result = mysql_query ("SELECT tse.tse_id, tse.tse_name, tasks.tasks_id, tasks.tasks_task, tasks.tasks_week, tasks.tasks_day, tasks.tasks_order
                               FROM tse, tasks
                               WHERE tse.tse_id = $id
                               ORDER BY tasks.tasks_week, tasks.tasks_day, tasks.tasks_order") or die(mysql_error());
    
    
    
    while($row = mysql_fetch_array($result))
          {
    
    $tasksans_id = $row['tasksans_id'];
    $tasks_tsedone = $row['tasks_tsedone'];
    $tasks_date = $row['tasks_date'];
    $tasks_mdone = $row['tasks_mdone'];
    
    $tasks_id = $row['tasks_id'];
    $tasks_task = $row['tasks_task'];
    $tasks_week = $row['tasks_week'];
    $tasks_day = $row['tasks_day'];
    $tasks_order = $row['tasks_order'];
    $tasks_add1 = $row['tasks_add1'];
    $tasks_add2 = $row['tasks_add2'];
    $tasks_add3 = $row['tasks_add3'];
    $tasks_add4 = $row['tasks_add4'];
    
    $tse_id = $row['tse_id'];
    $tse_name = $row['tse_name'];
    $tse_weekorder  = $row['tse_weekorder'];
    
    $weeks_id = $row['weeks_id'];
    $weeks_1 = $row['weeks_1'];
    $weeks_2 = $row['weeks_2'];
    $weeks_3 = $row['weeks_3'];
    $weeks_4 = $row['weeks_4'];
    
    if($count==0){
    print'<br /><br /><center><b>TSE '.$tse_name.'</b></center>';
    $count=1;
    }
    
    
    if ($tasks_week != $previous_tasks_week){
       print '<br /><H3>Week ' . $tasks_week . '</H3><br />';
       $previous_tasks_week = $tasks_week ;
    
    }
    if ($tasks_day != $previous_tasks_day){
       print '<br /><b>Day ' . $tasks_day . '</b><br /><br />';
       $previous_tasks_day = $tasks_day ;
    }
    
    
    if ($tasks_id != $previous_tasks_id){
       print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>';
    
       $previous_tasks_id = $tasks_id ;
    
    }
    }
    
    
    ?>
    
    <br /><br />
    
    <INPUT TYPE=SUBMIT VALUE="submit">
    
    </FORM>
    
    
    </blockquote>
    
    <br /><br />
    </BODY>
    </HTML>
    
    

     

     

     

    what is supposed to happen....

     

    each task has an id (task_id) anything that is checked i want to update the status in the db from a 0 to a 1.  So the question is this... since every item is task_id how do I update multiple tasks to status 1?

  8. I have a form that has about 100 check boxes on it.  1 for each task id.  What I want is to update a mysql db when you click submit.  In other words... I want to take the boxes that are checked and enter that (the value will be 1 if checked) into the db according to the task id.

     

    How do I do this with the least effort (not defining each check with a different name staticly.)

     

    Currently I have :

     

    if ($tasks_id != $previous_tasks_id){

      print '<table width="90%" cellspacing="3" cellpadding="3" border="0"><tr><td width="30%" height="1">' . $tasks_id . '&nbsp- ' . $tasks_task . '</td><td halign="left" width="30%" height="1"><INPUT TYPE=CHECKBOX NAME="' . $tasks_id . '"" VALUE="1""> complete</td></tr></table>';

      $previous_tasks_id = $tasks_id ;

     

    }

     

    but Im not sure where to go from here.

     

    any help is appreciated.

     

  9. Hello...

     

    What I want to do is print the $tse_name once above the output from the if statements.  If I do another if statement it prints out 1 set of data - not everything as it does without the name.

     

    
       $id = $_GET['id'];
    
       $result = mysql_query ("SELECT tse.tse_id, tse.tse_name, tasks.tasks_id, tasks.tasks_task, tasks.tasks_week, tasks.tasks_day, tasks.tasks_order
                               FROM tse, tasks
                               WHERE tse.tse_id = $id
                               ORDER BY tasks.tasks_week, tasks.tasks_day, tasks.tasks_order") or die(mysql_error());
    
    
    while($row = mysql_fetch_array($result))
          {
    
    $tasksans_id = $row['tasksans_id'];
    $tasks_tsedone = $row['tasks_tsedone'];
    $tasks_date = $row['tasks_date'];
    $tasks_mdone = $row['tasks_mdone'];
    
    $tasks_id = $row['tasks_id'];
    $tasks_task = $row['tasks_task'];
    $tasks_week = $row['tasks_week'];
    $tasks_day = $row['tasks_day'];
    $tasks_order = $row['tasks_order'];
    $tasks_add1 = $row['tasks_add1'];
    $tasks_add2 = $row['tasks_add2'];
    $tasks_add3 = $row['tasks_add3'];
    $tasks_add4 = $row['tasks_add4'];
    
    $tse_id = $row['tse_id'];
    $tse_name = $row['tse_name'];
    $tse_weekorder  = $row['tse_weekorder'];
    
    $weeks_id = $row['weeks_id'];
    $weeks_1 = $row['weeks_1'];
    $weeks_2 = $row['weeks_2'];
    $weeks_3 = $row['weeks_3'];
    $weeks_4 = $row['weeks_4'];
    
    
    
    
    if ($tasks_week != $previous_tasks_week){
       print '<br /><br /><H3>Week ' . $tasks_week . '</H3><br />';
       $previous_tasks_week = $tasks_week ;
    
    }
    if ($tasks_day != $previous_tasks_day){
       print '<br /><b>Day ' . $tasks_day . '</b><br />';
       $previous_tasks_day = $tasks_day ;
    }
    
    
    if ($tasks_id != $previous_tasks_id){
       print '<br />' . $tasks_task . '<br />';
       $previous_tasks_id = $tasks_id ;
    
    }
    }
    
    
    
    

     

     

    Any help is appreciated  - Im sure it's something easy but I'm braindead at the moment.

     

  10. the code you provided does the same thing.... repeats 16 times

     

    the result (my code) looks like this...

     

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

    TSE Name: tsename

    Mentor: mntname

    Manager: mgrname

    Group: Networking

    TSE Level: 1

    TSE is a Mentor: No

    VI3 Class Date:

    Bootcamp Complete: Yes

    Est. Go Live Date:

    Go Live Date:

    VCP Date:

    VCP Version: 0.0

     

  11. The problem is that instead of returning 1 set of values it repeats the same thing over and over again.  I want one set of data - 1 time :)

     

     

    the $id comes from the previous page - that part works fine.

     

    I realize the loop starts here while($row = mysql_fetch_array($result)) - what I wanted to know was why it keeps repeating - where does it get stuck?

     

     

    Thanks

  12. I have been banging my head on this for hours... I am sure it is something stupid, but I can't find it.  I would appreciate it if someone could find the loop here and see what's going on...

     

     

    
    <?php
       include 'C:\Domains\syluntspace.com\wwwroot\vmware\inc\my.php';
    
          $db = mysql_connect("$server", "$user", "$password");
          mysql_select_db('mentor', $db) or die ('Cannot connect to $db_Database : ' . mysql_error());
    
       $tse_id = $_GET['id'];
    
       $result = mysql_query ("SELECT DATE_FORMAT(tse.tse_start, '%M %d, %Y') AS tse_start1, tse.tse_id, tse.tse_name, tse.tse_mentorname, tse.tse_mgr, tse.tse_grpid, DATE_FORMAT(tse.tse_vi3, '%M %d, %Y') AS tse_vi31, DATE_FORMAT(tse.tse_estlive, '%M %d, %Y') AS tse_estlive1, DATE_FORMAT(tse.tse_golive, '%M %d, %Y') AS tse_golive1, DATE_FORMAT(tse.tse_vcp, '%M %d, %Y') AS tse_vcp1, tse.tse_vcpver, tse.tse_ismentor, tse.tse_ismgr, tse.tse_level, tse.tse_weekorder, tse.tse_bootdone, sme.sme_id, sme.sme_name, mgmt.mgmt_id, mgmt.mgmt_name
                               FROM tse, sme, mgmt, weeks, weekorder
                               WHERE $id = tse.tse_id and sme.sme_id = tse.tse_grpid and mgmt.mgmt_id = tse.tse_mgr") or die(mysql_error());
    
    
    
    while($row = mysql_fetch_array($result))
          {
    
    $tse_id   = $row['tse_id'];
    $tse_name = $row['tse_name'];
    $tse_mentorname = $row['tse_mentorname'];
    $tse_mgr  = $row['tse_mgr'];
    $tse_grpid   = $row['tse_grpid'];
    $tse_start   = $row['tse_start1'];
    $tse_vi3  = $row['tse_vi3'];
    $tse_estlive = $row['tse_estlive1'];
    $tse_golive  = $row['tse_golive1'];
    $tse_vcp  = $row['tse_vcp1'];
    $tse_vcpver  = $row['tse_vcpver'];
    $tse_ismentor   = $row['tse_ismentor'];
    $tse_ismgr   = $row['tse_ismgr'];
    $tse_level = $row['tse_level'];
    $tse_weekorder  = $row['tse_weekorder'];
    $tse_bootdone   = $row['tse_bootdone'];
    $sme_id = $row['sme_id'];
    $sme_name = $row['sme_name'];
    $mgmt_id = $row['mgmt_id'];
    $mgmt_name = $row['mgmt_name'];
    
    echo '<table width="90%" cellspacing="1" cellpadding="1" border="0">
       <tr><td width="20%" height="1"><b>TSE Name:</b></td><td width="20%" height="1">' . $tse_name . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>Mentor:</b></td><td width="20%" height="1">' . $tse_mentorname . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>Manager:</b></td><td width="20%" height="1">' . $mgmt_name . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>Group:</b></td><td width="20%" height="1">' . $sme_name . '</td><td width="70%" height="1"></td></tr>
         <tr><td width="20%" height="1"><b>TSE Level:</b></td><td width="20%" height="1">' . $tse_level . '</td><td width="70%" height="1"></td></tr>';
    
    
    if ($tse_ismentor == '1'){
    echo     '<tr><td width="20%" height="1"><b>TSE is a Mentor:</b></td><td width="20%" height="1"> Yes </td><td width="70%" height="1"></td></tr>';
       }
       else{
    echo     '<tr><td width="20%" height="1"><b>TSE is a Mentor:</b></td><td width="20%" height="1"> No </td><td width="70%" height="1"></td></tr>';
       }
    
    
    echo  '<tr><td width="20%" height="1"><b>VI3 Class Date:</b></td><td width="20%" height="1">' . $tse_vi3 . '</td><td width="70%" height="1"></td></tr>';
    
    
        if ($tse_bootdone == '1'){
    echo     '<tr><td width="20%" height="1"><b>Bootcamp Complete:</b></td><td width="20%" height="1"> Yes </td><td width="70%" height="1"></td></tr>';
       }
       else{
    echo     '<tr><td width="20%" height="1"><b>Bootcamp Complete:</b></td><td width="20%" height="1"> No </td><td width="70%" height="1"></td></tr>';
       }
    
    echo   '<tr><td width="20%" height="1"><b>Est. Go Live Date:</b></td><td width="20%" height="1">' . $tse_estlive . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>Go Live Date:</b></td><td width="20%" height="1">' . $tse_golive . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>VCP Date:</b></td><td width="20%" height="1">' . $tse_vcp . '</td><td width="70%" height="1"></td></tr>
       <tr><td width="20%" height="1"><b>VCP Version:</b></td><td width="20%" height="1">' . $tse_vcpver . '</td><td width="70%" height="1"></td></tr></table>';
    
    
    
    
      }
    
    
    ?>
    

     

     

     

    Thanks in advance,

     

    Chris

  13. Greetings:

    I have a hopefully simple question.

    What I want to do is this...  If a date is 9999-12-12 then print a "-" - this part I have and it works fine.  But what I want to do is add a 2nd condition - if upgrade = 0 then use a different font.  I am not sure how to add another condition without printing the whole line again.

    Any help would be appreciated.


    [code]
    if ($exp_date == "December 31, 9999"){
    print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
    echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';
    }

    else{
    print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
    echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';

    } [/code]
  14. Hello...

    I am trying to do some basic js stuff and need a little help. I have the following code;

    [code]
    <script LANGUAGE="JavaScript">
    <!-- HIDE FROM OTHER BROWSERS

    var side = new Array("Oki 590-88", "Oki 590-79", "Oki 473C");
    var top = new Array("Manufacturer", "Description", "OEM Price", "HDC Price");
                                

    var manu = new Array("IBM", "IBM", "Okidata", "Okidata");
    var part = new Array(976, 726, 590, 473);
    var fits = new Array("2380, 2381, 2390, 2391", "3262, 5262", "590, 591", 120);
    var price = new Array("6.00", "6.25", "16.50", "10.75");

    document.write("<table border=1 width=95% cellspacing=0 height=1 cellpadding=1><tr><th>Manufacturer</th><th>Part</th><th>Fits Model</th><th>Price</th></tr>");

    for (i=0; i<manu.length; i++){

      
    document.write("<tr><td>", manu[i], "</td>",
    "<td>", part[i], "</td>",
    "<td>", fits[i], "</td>",
    "<td>", price[i], "</td></tr>")


    }
    document.write("</table>");

    // STOP HIDING FROM OTHER BROWSERS -->
    </SCRIPT>
    [/code]

    It does what it is supposed to do, but what I want is this:
    on the left column - if the item repeats I only want the word to show up one time - like this...

    item 1 product info price
    [empty] product info price
    item 2 product info price
    [empty] product info price

    How can I make it do that?


    Thanks,
    Chris
  15. Greetings:

    I am trying to figure out how to create anchors based on the 1st letter of a name field. What I have is a list of names (and other stuff after the name but that isnt relavant now) and those in the upper part of the food chain decided it would be nice to have the alphabet listed at the top of the page and each of the letters are a link to the 1st name beginning with that letter. I can do this with a static list, but I'm lost trying to do it from a dynamic list.

    Any help would be appreciated.

    Thanks,
    Chris
×
×
  • 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.