Skip to content

Instantly share code, notes, and snippets.

@usual-tools
Last active August 29, 2015 13:56
Show Gist options
  • Save usual-tools/9205302 to your computer and use it in GitHub Desktop.
Save usual-tools/9205302 to your computer and use it in GitHub Desktop.
初日と終了日が同じ場合に日べつ種類を「単日」にする。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