<?php
/* @var $this MenuItemController */
/* @var $model MenuItem */
/* @var $form CActiveForm */
?>

<div id="communicationsbox" style="height:525px; background-color:#f7eee1;">
<?php
    foreach(Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
    }
?>

  <div id="form_wrapper">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'menu-item-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        <table width="800" cellspacing="0" cellpadding="4">
      <tbody>
          
          <tr>
          <td width="146">
		<?php echo $form->labelEx($model,'parent_id'); ?></td>
          <td width="632">
              <?php
                 
              ?>
		<?php echo $form->dropDownList($model,'parent_id',CHtml::listData(MenuItem::model()->findAll(array('condition'=>'isActive =  "Y" ','order'=>'menu_title')), 'id', 'menu_title'),array('prompt'=>'Select parent menu')); ?>
		<?php echo $form->error($model,'parent_id'); ?>
              </td>
	</tr>
          
        <tr>
          <td width="146">
		<?php echo $form->labelEx($model,'menu_title'); ?></td>
          <td width="632">
		<?php echo $form->textField($model,'menu_title',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'menu_title'); ?>
              </td>
	</tr>
	<tr>
          <td width="146"><?php echo $form->labelEx($model,'isLink'); ?></td>
          <td width="632">
		<?php echo $form->dropDownList($model,'isLink',array('Y'=>'Yes','N'=>'No')); ?>
		<?php echo $form->error($model,'isLink'); ?>
	</td>
	</tr>
	<tr>
          <td width="146"><?php echo $form->labelEx($model,'href'); ?></td>
          <td width="632">
		<?php echo $form->textField($model,'href',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'href'); ?></td>
	</tr>
	<tr>
          <td width="146"><?php echo $form->labelEx($model,'sortOrder'); ?></td>
          <td width="632">
		<?php echo $form->textField($model,'sortOrder'); ?>
		<?php echo $form->error($model,'sortOrder'); ?></td>
	</tr>
	<tr>
          <td width="146">
		</td>
          <td width="632"><?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?></td>
	</tr>
        </tbody>
    </table>

<?php $this->endWidget(); ?>

</div><!-- form -->
</div>