Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //users/view.ctp (this has the first form
- <div class="users view">
- <h2><?php echo __('Profile for:') .' '. $user['User']['first_name'] .' '. $user['User']['last_name'];?></h2>
- <h3>Passport Photos</h3>
- <?php echo $html->image("placeholder.png", array("alt" => "ProfileImage")); ?>
- <h3><?php echo __('Account Info') ?></h3>
- <label for="email"><?php __('Email'); ?>:</label>
- <div id="email"><?php if(!empty($user['User']['email'])){echo $user['User']['email'];}else{echo 'click to add';} ?></div>
- <label for="password"><?php echo __('Password'); ?>:</label>
- <?php if($activeUser['User']['id'] == $user['User']['id']){?>
- <div id="password">
- <?php echo '<a href="#passwordChange" title="Click to change Password"/>'. __("Click to change Password",true).'</a>';?>
- </div><!-- END password section -->
- <div id="passwordChange">
- <?php echo $form->create('User', array( 'action' =>'updatePass' ));?>
- <fieldset>
- <legend><?php __('Change Password');?></legend>
- <?php
- $options = array('type'=>'password', 'div' => array('class' => 'required'));
- echo $form->input(__('old_password', true), $options);
- $options = array('div' => array('class' => 'required'), 'error' => array('confirmPassword' => __('Passwords do not match please try again',true), 'noempty' => __('Please provide a password',true)));
- echo $form->input(__('password', true), $options);
- $options = array('type'=>'password', 'div' => array('class' => 'required'));
- echo $form->input(__('confirmation_password', true), $options);
- echo $form->hidden('User.id', array('value' => $user['User']['id']));
- ?>
- </fieldset>
- <?php echo $ajax->submit(__('Change Password', true), array('url' => array('controller' => 'users', 'action' => 'updatePass'),
- 'update' => 'storage',
- 'complete' => '$("#UserUpdatePassForm input[type=password]").val(""); '));
- $form->end();?>
- <a href="#">Cancel</a>
- </div>
- <?php }else{?>
- <div id="password">
- ••••••••••
- </div><!-- END password section -->
- <?php }?>
- <?php if( $activeUser['Group']['name'] != 'customer' && $activeUser['Group']['name'] != 'partner' ) { ?>
- <label for="last_login"><?php __('Last Login'); ?>:</label>
- <div id="last_login"><?php echo $time->timeAgoInWords($user['User']['last_login']); ?></div>
- <!-- END last login -->
- <?php } ?>
- <h3><?php echo __('Student Info') ?></h3>
- <label for="first_name"><?php __('First Name'); ?>:</label>
- <div id="first_name"><?php if(!empty($user['User']['first_name'])){echo $user['User']['first_name'];}else{echo 'click to add';} ?></div>
- <label for="middle_name"><?php __('Middle Name'); ?>:</label>
- <div id="middle_name"><?php if(!empty($user['User']['middle_name'])){echo $user['User']['middle_name'];}else{echo 'click to add';} ?></div>
- <label for="last_name"><?php __('Last Name'); ?>:</label>
- <div id="last_name"><?php if(!empty($user['User']['last_name'])){echo $user['User']['last_name'];}else{echo 'click to add';} ?></div>
- <label for="nickname"><?php __('Nickname'); ?>:</label>
- <div id="nickname"><?php if(!empty($user['User']['nickname'])){echo $user['User']['nickname'];}else{echo 'click to add';} ?></div>
- <label for="gender"><?php __('Gender'); ?>:</label>
- <div id="gender"><?php
- if(!empty($user['User']['gender'])){
- if($user['User']['gender'] == '1'){
- __('Male');
- } else {
- __('Female');
- }
- }else{
- echo 'click to add';
- } ?></div>
- <label for="birthdate"><?php __('Birthdate'); ?>:</label>
- <div id="birthdate"><?php echo $time->timeAgoInWords($user['User']['birthdate']); ?></div>
- <h3><?php echo __('Nationality & Residence') ?></h3>
- <label for="birth_city"><?php __('Birth City'); ?>:</label>
- <div id="birth_city"><?php if(!empty($user['User']['birth_city'])){echo $user['User']['birth_city'];}else{echo 'click to add';} ?></div>
- <label for="birth_country"><?php __('Birth Country'); ?>:</label>
- <div id="birth_country"><?php if(!empty($user['User']['birth_country'])){echo $user['User']['birth_country'];}else{echo 'click to add';} ?></div>
- <label for="citizenship"><?php __('citizenship'); ?>:</label>
- <div id="citizenship"><?php if(!empty($user['User']['citizenship'])){echo $user['User']['citizenship'];}else{echo 'click to add';} ?></div>
- <label for="residence"><?php __('residence'); ?>:</label>
- <div id="residence"><?php if(!empty($user['User']['residence'])){echo $user['User']['residence'];}else{echo 'click to add';} ?></div>
- <h3><?php echo __('Address & Phone') ?></h3>
- <label for="street_1"><?php __('Street Address'); ?>:</label>
- <div id="street_1"><?php if(!empty($user['Address']['street_1'])){echo $user['Address']['street_1'];}else{echo 'click to add';} ?></div>
- <label for="street_2"><?php __('Street Address line 2'); ?>:</label>
- <div id="street_2"><?php if(!empty($user['Address']['street_2'])){echo $user['Address']['street_2'];}else{echo 'click to add';} ?></div>
- <label for="city"><?php __('City'); ?>:</label>
- <div id="city"><?php if(!empty($user['Address']['city'])){echo $user['Address']['city'];}else{echo 'click to add';} ?></div>
- <label for="state"><?php __('State/Province'); ?>:</label>
- <div id="state"><?php if(!empty($user['Address']['state'])){echo $user['Address']['state'];}else{echo 'click to add';} ?></div>
- <label for="zip"><?php __('Zip'); ?>:</label>
- <div id="zip"><?php if(!empty($user['Address']['zip'])){echo $user['Address']['zip'];}else{echo 'click to add';} ?></div>
- <label for="country"><?php __('Country'); ?>:</label>
- <div id="country"><?php if(!empty($user['Address']['country'])){echo $user['Address']['country'];}else{echo 'click to add';} ?></div>
- <label for="home_phone"><?php __('Home Phone Number'); ?>:</label>
- <div id="home_phone"><?php if(!empty($user['User']['home_phone'])){echo $user['User']['home_phone'];}else{echo 'click to add';} ?></div>
- <label for="nearest_airport"><?php __('Nearest Airport'); ?>:</label>
- <div id="nearest_airport"><?php if(!empty($user['User']['nearest_airport'])){echo $user['User']['nearest_airport'];}else{echo 'click to add';} ?></div>
- <?php if( $activeUser['Group']['name'] != 'customer' && $activeUser['Group']['name'] != 'partner' ) { ?>
- <h3><?php __('Group'); ?>:</h3>
- <div id="group_id"><?php echo $user['Group']['name'];?></div>
- <?php } ?>
- </div>
- <?php
- $applications['Application'] = $user['Application'];
- echo $this->element('my_apps' , array('applications' => $applications, 'formms' => $formms));
- if($user['User']['id'] == $activeUser['User']['id']){
- echo $ajax->editor('email', '/updateItem/'.$user['User']['id'].'/email', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('first_name', '/updateItem/'.$user['User']['id'].'/first_name', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('middle_name', '/updateItem/'.$user['User']['id'].'/middle_name', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('last_name', '/updateItem/'.$user['User']['id'].'/last_name', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('nickname', '/updateItem/'.$user['User']['id'].'/nickname', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('gender', '/updateItem/'.$user['User']['id'].'/gender', array(
- 'indicator' => 'Saving...',
- 'data' => "{'0':'".__('Select One',true)."','1':'".__('Male',true)."','2':'".__('Female',true)."'}",
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('birth_city', '/updateItem/'.$user['User']['id'].'/birth_city', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('birth_country', '/updateItem/'.$user['User']['id'].'/birth_country', array(
- 'indicator' => 'Saving...',
- 'data' => $countries->asJson(),
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('citizenship', '/updateItem/'.$user['User']['id'].'/citizenship', array(
- 'indicator' => 'Saving...',
- 'data' => $countries->asJson(),
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('residence', '/updateItem/'.$user['User']['id'].'/residence', array(
- 'indicator' => 'Saving...',
- 'data' => $countries->asJson(),
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('street_1', '/userAddress/'.$user['User']['id'].'/street_1', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('street_2', '/userAddress/'.$user['User']['id'].'/street_2', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('city', '/userAddress/'.$user['User']['id'].'/city', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('state', '/userAddress/'.$user['User']['id'].'/state', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('country', '/userAddress/'.$user['User']['id'].'/country', array(
- 'indicator' => 'Saving...',
- 'data' => $countries->asJson(),
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('zip', '/userAddress/'.$user['User']['id'].'/zip', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('home_phone', '/updateItem/'.$user['User']['id'].'/home_phone', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('nearest_airport', '/updateItem/'.$user['User']['id'].'/nearest_airport', array(
- 'indicator' => 'Saving...',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- echo $ajax->editor('group_id', '/updateItem/'.$user['User']['id'].'/group_id', array(
- 'indicator' => 'Saving...',
- 'data' => "{'1':'super-admin','2':'admin','3':'partner','4':'advisor','5':'operator','6':'customer'}",
- 'type' => 'select',
- 'cancel' => __('cancel', true),
- 'submit' => __('save', true),
- "onblur" => 'cancel',
- 'tooltip' => __('Click to edit...', true),
- ));
- }
- ?>
- // elements/my_apps.ctp (this contains the second form
- <div class="applications index">
- <h2><?php __('Applications');?></h2>
- <?php echo $form->create('Applications', array( 'url' => array('controller' => 'applications', 'action' => 'assign', 'id' => null))); ?>
- <fieldset>
- <legend><?php __('Assign Application to User');?></legend>
- <?php
- $options = array('--' => __('Select One',true), 'test' => 'test', 'test2' => 'test2');
- foreach($formms as $formm){
- $options[$formm['Form']['id']] = $formm['Form']['name'];
- }
- echo $form->label('Application.form_id', __('Form Name',true).":");
- echo $form->select('Application.form_id', $options, $selected = '--');
- echo $form->hidden('Application.user_id', array('value' => $user['User']['id']));
- ?>
- </fieldset>
- <?php echo $form->submit(__('Assign', true));
- echo $form->end();?>
- <!--
- ###this is what i have tried printing out but still the "form" tags are removed by the time it is rendered
- <form action="/high-school-app/applications/assign" method="post" id="ApplicationAssignForm">
- <fieldset>
- <legend>Assign Application to User</legend>
- <label for="AppplicationFormId">Form Name:</label>
- <select id="AppplicationFormId" name="data[Application][form_id]">
- <option value=""></option>
- <option selected="selected" value="--">Select One</option>
- <option value="test">test</option>
- <option value="test2">test2</option>
- </select>
- <input type="hidden" id="AppplicationUserId" value="" name="data[Application][user_id]">
- </fieldset>
- <div class="submit">
- <input type="submit" value="Assign">
- </div>
- </form>
- -->
- <?php
- if(empty($applications['Application'])){?>
- <span class="centered"><?php __('Currently you have no Applications. Once one is assigned to you it will appear here. If this is not what you expected please call +49 30 84 39 39 0 or send us an');
- echo $html->link(__('e-mail',true), 'mailto:info@ayusa.de');
- ?></span>
- <?php } else {?>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <th><?php __('Application Name');?></th>
- <th><?php __('Started');?></th>
- <th><?php __('Complete');?></th>
- <th class="actions"><?php __('Actions');?></th>
- </tr>
- <?php
- $i = 0;
- foreach ($applications as $application):
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- ?>
- <tr<?php echo $class;?>>
- <td>
- <?php echo $application['Form']['FormName'][0]['name']; ?>
- </td>
- <td>
- <?php echo $time->timeAgoInWords($application['Application']['created']); ?>
- </td>
- <td>
- %%%%
- </td>
- <td class="actions">
- <?php echo $html->link(__('View', true), array('action' => 'view', $application['Application']['id'])); ?>
- <?php echo $html->link(__('Delete', true), array('action' => 'delete', $application['Application']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $application['Application']['id'])); ?>
- </td>
- </tr>
- <?php endforeach; ?>
- </table>
- <?php }?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement