423,688 Members | 1,879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,688 IT Pros & Developers. It's quick & easy.

i don't seem to find error, Undefined variable: EmpDefaultRestDay,week&getDataValues

P: 14
Expand|Select|Wrap|Line Numbers
  1. $optWeek = array(0=>'Please Select');
  2. for($i=1;$i<=52;$i++)
  3. {
  4. $optWeek[$i] = 'Wk - ' .  $i;
  5. }
  6.  
  7. for($i=-1;$i<=0;$i++)
  8. {
  9. $optYear[date("Y")+$i] =  date("Y")+$i;
  10. }
  11. $optDays = array(
  12.     '0'=>'Please Select',
  13.         'SUN'  => 'Sunday',
  14.         'MON'  => 'Monday',
  15.         'TUE'  => 'Tuesday',
  16.         'WED'  => 'Wednesday',
  17.         'THU'  => 'Thursday',
  18.         'FRI'  => 'Friday',
  19.         'SAT'  => 'Saturday',
  20. );
  21.  
  22.  
  23. $form = array(
  24.         'name'        => 'RestDay' ,
  25.     'id'        => 'restday',
  26. );
  27.  
  28. if(isset($getData[0]['ID'])){
  29. foreach($getData as $getDataValues)
  30. {
  31. $Week = array(
  32.         'name'          => 'Week['.$getDataValues['ID'].']',
  33.         'value'         => '' ,
  34.     'onchange'    => 'getDateOfWeek('.$getDataValues['ID'].');',
  35.     'id'        => 'week'. $getDataValues['ID'],
  36.  
  37. );
  38.  
  39.  
  40. $EmpDefaultRestDay = array(
  41.         'name'          => 'DefaultRestDay',
  42.         'value'         => (isset($getData[0])?$getData[0]['DefaultRestDay']:''),
  43.         'maxlength'     => '5',
  44.         'size'          => '5',
  45.         'readonly'      => 'readonly',
  46. );
  47. }
  48. }
  49. //}
  50. echo form_open('restday',$form);
  51. echo "<tr><td>";
  52. if(isset($getData[0]['ID']))
  53. echo form_input(array('name'=>'Year','value'=>$getData[0]['Year'],'readonly'=>'readonly', 'id'=>'year', 'size'=>'5'));
  54. else 
  55. echo form_dropdown('Year',$optYear, (isset($getData[0]['Year'])?$getData[0]['Year']:date("Y")), 'id="year"');
  56. echo "</td><td>";
  57. echo form_dropdown($Week,$optWeek,$getDataValues['Week']);
  58. echo "</td><td>";
  59. echo form_input($EmpDefaultRestDay);
  60. echo "</td></tr>";
  61. echo "</table>";
Nov 24 '15 #1
Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
the first two are conditional variables. i.e. they only exist if a specific condition is met.

for anything more detailed wed need the full error message.
Nov 25 '15 #2

P: 14
i corrected it is now working.
Nov 30 '15 #3

Post your reply

Sign in to post your reply or Sign up for a free account.