cis notified web server of a job completion; upload form interface and validation...
[living-lab-site.git] / application / views / user / register_view.php
index dd97e2e..eedc199 100644 (file)
@@ -7,7 +7,7 @@ function _set_value($userdata, $field, $default = '')
                return $post_value;
 
        return ($post_value === $default 
-               ? $userdata[ str_replace('-','_',$field) ]
+               ? ''.$userdata[ str_replace('-','_',$field) ]
                : $post_value);
 }
 
@@ -17,15 +17,10 @@ else
        echo form_open_multipart("user/account/$redirect");
 ?>
 
-<?php if ($userdata): ?>
-<input type="hidden" name="user-id" value="<?php echo $userdata['id'] ?>" />
-<input type="hidden" name="username" value="<?php echo $userdata['username'] ?>" />
-<?php endif ?>
-
 <table class="form">
        <tr>
                <td></td>
-               <td><span class="required"><?php echo $this->lang->line('user_note_required_fields') ?></span></td>
+               <td><span class="required"><?php echo $this->lang->line('ui_required_fields') ?></span></td>
        </tr>
        
        <tr><td></td><td>&nbsp;</td></tr>
@@ -119,6 +114,19 @@ else
        </tr>
        <tr><td></td><td><?php echo form_error('last-name') ?></td></tr>
        
+       <tr>
+               <th><?php echo $this->lang->line('user_sex'). ' <span class="required">*</span> : ' ?></th>
+               <td>
+                       <?php echo form_dropdown('sex', 
+                               array(
+                                       '0'=> $this->lang->line('user_sex_male'),
+                                       '1'=> $this->lang->line('user_sex_female')),
+                               _set_value($userdata, 'sex', '0')
+                       ) ?>
+               </td>
+       </tr>
+       <tr><td></td><td><?php echo form_error('sex') ?></td></tr>
+       
        <tr>
                <th><?php echo $this->lang->line('user_birth_date'). ' : ' ?></th>
                <td>
@@ -187,6 +195,23 @@ else
        
        <tr><td></td><td>&nbsp;</td></tr>
        
+  <?php if (! $userdata): ?>
+       <tr>
+               <th><?php echo $this->lang->line('ui_captcha'). ' <span class="required">*</span> : ' ?></th>
+               <td>
+                       <div><?php echo $this->lang->line('ui_captcha_instructions') ?></div>
+                       <div><span id="container-captcha"><?php echo $captcha ?></span>
+                               <input type="button" id="button-change-captcha"
+                                          value="<?php echo $this->lang->line('ui_change_captcha') ?>" />
+                       </div>
+                       <p><input type="text" name="captcha" size="16" value="" /></p>
+               </td>
+       </tr>
+       <tr><td></td><td><?php echo form_error('captcha') ?></td></tr>
+       
+       <tr><td></td><td>&nbsp;</td></tr>
+  <?php endif ?>
+       
        <tr>
                <td></td>
                <td>
@@ -211,5 +236,11 @@ else
                        buttonImage: "<?php echo site_url('img/calendar.gif') ?>",
                        buttonImageOnly: true
                });
+               
+               $('#button-change-captcha')
+                       .click(function() {
+                               $('#container-captcha')
+                                       .load('<?php echo site_url('user/ajax_get_captcha') ?>');
+                       });
        });
 </script>
\ No newline at end of file