Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
初日と終了日が同じ場合に日べつ種類を「単日」にする。http://www.7-2.jp/contents/881
<?php
// 初日と終了日が同じ場合に日べつ種類を「単日」にする
// first_date 初日
// last_date 終了日
// single_day 単日
// multi_day 複数日
// の場合
if ( !empty($this->data['Notice']['first_date']) && $this->data['Notice']['first_date']==$this->data['Notice']['last_date'] ) {
$last_date_kind = 'single_day';
} else {
$last_date_kind = 'multi_day';
}
?>
<p><input type="radio" name="last_date_kind" value="single_day" <?php if ( $last_date_kind=='single_day' ) { ?> checked="checked"<?php } ?> id="last_date_kind_single_day">単日</p>
<p><input type="radio" name="last_date_kind" value="multi_day" <?php if ( $last_date_kind=='multi_day' ) { ?> checked="checked"<?php } ?> id="last_date_kind_multi_day">複数日</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment