Created
September 24, 2014 14:34
-
-
Save taleeb35/4954bb42a900dcff30e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="controls form"> | |
<?php echo $this->Form->create('Control'); ?> | |
<?php $week_days = array(1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday", 7 => "Sunday"); ?> | |
<?php $month_days = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, | |
14 => 14, 15 => 15, 16 => 16, 17 => 17, 18 => 18, 19 => 19, 20 => 20, 21 => 21, 22 => 22, 23 => 23, 24 => 24, | |
25 => 25, 26 => 26, 27 => 27, 28 => 28, 29 => 29, 30 => 30, 31 => 31); ?> | |
<fieldset> | |
<legend><?php echo __('Add Control'); ?></legend> | |
<?php | |
echo $this->Form->input('name',array('label' => 'Task Title')); | |
echo $this->Form->input('description',array('label' => 'Task Description')); | |
echo $this->Ck->load('Control.description'); | |
echo $this->Form->input('associated_standards'); | |
echo $this->Ck->load('Control.AssociatedStandards'); | |
/* echo $this->Form->input('testing_procedure'); | |
echo $this->Ck->load('Control.TestingProcedure'); | |
echo $this->Form->input('success_criteria'); | |
echo $this->Ck->load('Control.SuccessCriteria'); */ | |
echo $this->Form->input('control_frequency_id', array('id' => 'frequency')); ?> | |
<div id="weekly" style="margin-left: -10px;"> | |
<?php echo $this->Form->input('day_of_week',array('type' => 'select','options' => $week_days)); ?> | |
</div> | |
<div id="monthly" style="margin-left: -10px;"> | |
<?php echo $this->Form->input('day_of_month',array('type' => 'select', 'options' => $month_days)); ?> | |
</div> | |
<?php echo $this->Form->input('owner_id'); ?> | |
<?php //echo $this->Form->input('risk_level_id'); ?> | |
</fieldset> | |
<?php echo $this->Form->end(__('Submit'));?> | |
</div> | |
<div class="actions"> | |
<h3><?php echo __('Actions'); ?></h3> | |
<ul> | |
<li><?php echo $this->Html->link(__('List Controls'), array('action' => 'index'));?></li> | |
</ul> | |
</div> | |
<script type="text/javascript"> | |
$('#weekly,#monthly').hide(); | |
$('#frequency').change(function(){ | |
var selection = $("option:selected", this).text(); | |
switch(selection) { | |
case 'Weekly': | |
$('#weekly').show(); | |
$('#monthly').hide(); | |
break; | |
case 'Monthly': | |
$('#monthly').show(); | |
$('#weekly').hide(); | |
break; | |
default: | |
$('#weekly,#monthly').hide(); | |
break; | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment