/**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     if (Yii::app()->getRequest()->getIsAjaxRequest() and $_GET['ajax'] == 1) {
         $response = array();
         $model = new AAddress();
         $model->city = 'Bengaluru';
         //get localities list -start
         $modelArr = ABangaloreLocalities::model()->findAll(array('condition' => 'is_deleted = "no"', 'order' => 'locality_name ASC'));
         $locality_array = array();
         foreach ($modelArr as $singleModel) {
             $locality_array[$singleModel->id] = $singleModel->locality_name;
         }
         $locality_array[""] = "Select any area";
         //get localities list -stop
         // Uncomment the following line if AJAX validation is needed
         // $this->performAjaxValidation($model);
         if (isset($_POST['AAddress'])) {
             $model->attributes = $_POST['AAddress'];
             $currDateTime = new DateTime();
             $model->creation_time = $currDateTime->format('Y-m-d H:i:s');
             $model->link = AppCommon::getUserDetailsId();
             $model->link_table = "user_details";
             if ($model->save()) {
                 //$this->redirect(array('view','id'=>$model->id));
                 //sending row html code with checked radio button
                 $response["isRecordSaved"] = 1;
                 $id_temp = $model->id;
                 $Loc_name_temp = $model->address2bangaloreLocalities->locality_name;
                 $address_temp = $model->getAddressString();
                 $response["html"] = '<tr><td>' . CHtml::activeRadioButton(new CheckoutFirstStageForm(), 'address', array('value' => $id_temp, 'required' => true, 'checked' => true, 'data-locality_name' => $Loc_name_temp, 'uncheckValue' => NULL)) . '</td><td>' . $address_temp . '</td><td>' . $Loc_name_temp . '</td><tr>';
                 $response["locality"] = $Loc_name_temp;
                 echo CJSON::encode($response);
                 Yii::app()->end();
             }
         }
         $response["html"] = $this->renderPartial('create', array('model' => $model, 'locality_array' => $locality_array), true, false);
         $response["isRecordSaved"] = 0;
         echo CJSON::encode($response);
         Yii::app()->end();
     }
 }
Exemplo n.º 2
0
 /**
  * Generates a radio button for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button.
  */
 public static function activeRadioButton($model, $attribute, $htmlOptions = array())
 {
     $label = TbArray::popValue('label', $htmlOptions, false);
     $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
     self::addCssClass('radio', $labelOptions);
     $input = parent::activeRadioButton($model, $attribute, $htmlOptions);
     return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
 }
Exemplo n.º 3
0
<div class="image_block">
    <?php 
echo CHtml::link(CHtml::image("/images/admin/del.png", "Удалить"), Yii::app()->createUrl('/news/default/deleteImage', array("id" => $data->id)), array('id' => $data->id, 'class' => 'deletePhoto'));
?>
    <div class="image">
        <a href="<?php 
echo '/' . $folder_upload . $data->filename;
?>
" class="thumb" rel="example_group">
                <span>
                    <?php 
echo CHtml::image('/' . $folder_upload . $data->filename);
?>
                </span>
        </a>
    </div>

    <?php 
if ($data->id == $cover_id) {
    echo CHtml::activeRadioButton($data, 'id', array('value' => $data->id, 'uncheckValue' => null, 'checked' => 'checked'));
    echo CHtml::label('Обложка', 'for');
} else {
    echo CHtml::activeRadioButton($data, 'id', array('value' => $data->id, 'uncheckValue' => null, 'checked' => ''));
    echo CHtml::label('Сделать обложкой', 'for');
}
?>
</div>
Exemplo n.º 4
0
 /**
  * (non-PHPdoc)
  * @see framework/CWidget::run()
  */
 public function run()
 {
     $cs = Yii::app()->getClientScript();
     list($name, $id) = $this->resolveNameID();
     if (isset($this->htmlOptions['id'])) {
         $id = $this->htmlOptions['id'];
     } else {
         $this->htmlOptions['id'] = $id;
     }
     if (isset($this->htmlOptions['name'])) {
         $name = $this->htmlOptions['name'];
     } else {
         $this->htmlOptions['name'] = $name;
     }
     if ($this->buttonType == 'buttonset') {
         echo CHtml::closeTag($this->htmlTag);
         $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').buttonset();");
     } else {
         switch ($this->buttonType) {
             case 'submit':
                 echo CHtml::submitButton($this->caption, $this->htmlOptions) . "\n";
                 break;
             case 'button':
                 echo CHtml::htmlButton($this->caption, $this->htmlOptions) . "\n";
                 break;
             case 'link':
                 echo CHtml::link($this->caption, $this->url, $this->htmlOptions) . "\n";
                 break;
             case 'radio':
                 if ($this->hasModel()) {
                     echo CHtml::activeRadioButton($this->model, $this->attribute, $this->htmlOptions);
                     echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
                 } else {
                     echo CHtml::radioButton($name, $this->value, $this->htmlOptions);
                     echo CHtml::label($this->caption, $id) . "\n";
                 }
                 break;
             case 'checkbox':
                 if ($this->hasModel()) {
                     echo CHtml::activeCheckbox($this->model, $this->attribute, $this->htmlOptions);
                     echo CHtml::label($this->caption, CHtml::activeId($this->model, $this->attribute)) . "\n";
                 } else {
                     echo CHtml::checkbox($name, $this->value, $this->htmlOptions);
                     echo CHtml::label($this->caption, $id) . "\n";
                 }
                 break;
             default:
                 throw new CException(Yii::t('zii', 'The button type "{type}" is not supported.', array('{type}' => $this->buttonType)));
         }
         $options = empty($this->options) ? '' : CJavaScript::encode($this->options);
         if (isset($this->onclick)) {
             if (strpos($this->onclick, 'js:') !== 0) {
                 $this->onclick = 'js:' . $this->onclick;
             }
             $click = CJavaScript::encode($this->onclick);
             $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options}).click({$click});");
         } else {
             $cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').button({$options});");
         }
     }
 }
Exemplo n.º 5
0
					</div>
				</div>

				<div class="form-group">
					<label class="<?php 
echo $label_class;
?>
">Use Doctor Note</label>
					<div class="col-md-6 col-xs-12">
						<div class="form-control">
							<?php 
echo CHtml::activeRadioButton($model, 'doctor_note', array('value' => 0, 'style' => 'width:10px;'));
?>
							<label style="width:100px;">No</label>
							<?php 
echo CHtml::activeRadioButton($model, 'doctor_note', array('value' => 1));
?>
							<label>Yes</label>
						</div>						
					</div>
				</div>

				<div class="form-group">
					<label class="<?php 
echo $label_class;
?>
">Doctor Note</label>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::image($model->getLetter(), 'letter', array('height' => '50px'));
?>
Exemplo n.º 6
0
 /**
  * Generates a radio button for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button.
  */
 public static function activeRadioButton($model, $attribute, $htmlOptions = array())
 {
     $label = BsArray::popValue('label', $htmlOptions, false);
     $labelOptions = BsArray::popValue('labelOptions', $htmlOptions, array());
     $radioButton = parent::activeRadioButton($model, $attribute, $htmlOptions);
     self::addCssClass('radio', $labelOptions);
     return $label !== false ? self::tag('label', $labelOptions, $radioButton . ' ' . $label) : $radioButton;
 }
Exemplo n.º 7
0
 /**
  * Generates a radio button for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button.
  */
 public static function activeRadioButton($model, $attribute, $htmlOptions = array())
 {
     $label = TbArray::popValue('label', $htmlOptions, false);
     $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());
     $input = parent::activeRadioButton($model, $attribute, $htmlOptions);
     if (TbArray::popValue('useContainer', $htmlOptions, false)) {
         return self::tag('div', array('class' => 'radio'), self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions));
     } else {
         return self::createCheckBoxAndRadioButtonLabel($label, $input, $labelOptions);
     }
 }
?>
	<table class="table table-condensed table-striped" id="addressTable" style="table-layout: fixed;">
	<tbody>
	
	<tr>
		<th class="wordwrap" style="width: 10%;">Select</th>
		<th class="wordwrap" style="width: 60%;">Address</th>
		<th class="wordwrap" style="width: 30%;">Locality</th>
	</tr>
	
	<?php 
//array( addrId => array( locality, addrText ) )
foreach ($addressArray as $key => $value) {
    echo '<tr>';
    echo '<td>';
    echo CHtml::activeRadioButton($model, 'address', array('value' => $key, 'required' => true, 'data-locality_name' => $value[0], 'uncheckValue' => NULL));
    echo '</td>';
    echo '<td>';
    echo $value[1];
    echo '</td>';
    echo '<td>';
    echo $value[0];
    echo '</td>';
    echo '</tr>';
}
?>
	
	</tbody>
	</table>
	<?php 
echo $form->error($model, 'address', array(), false, false);
Exemplo n.º 9
0
    </div>

    </div>
    <div class="order_data">
        <div class="left">
            <div class="delivery rc5">
                <h2>Способ доставки</h2>
                <ul>
                    <?php 
foreach ($deliveryMethods as $delivery) {
    ?>
                        <li>
                            <label class="radio">
                                <?php 
    echo CHtml::activeRadioButton($this->form, 'delivery_id', array('checked' => $this->form->delivery_id == $delivery->id, 'uncheckValue' => null, 'value' => $delivery->id, 'data-price' => Yii::app()->currency->convert($delivery->price), 'data-free-from' => Yii::app()->currency->convert($delivery->free_from), 'onClick' => 'recountOrderTotalPrice(this);', 'checked' => 'checked'));
    ?>
                                <span><?php 
    echo CHtml::encode($delivery->name);
    ?>
</span>
                            </label>
                            <p><?php 
    echo $delivery->description;
    ?>
</p>
                        </li>
                    <?php 
}
?>
            </div>
		</div>
	</div>
	<div class="row" id="onlinepayment" style="display: none;">
		<div class="col-xs-1">
			<?php 
echo CHtml::activeRadioButton($model, 'paymentMethod', array('value' => 2, 'required' => true, 'uncheckValue' => NULL, 'float' => 'left'));
?>
		</div>
		<div class="col-xs-10">
			<p>Online payment PayU Money</p>
		</div>
	</div>
	<div class="row" id="cod">
		<div class="col-xs-1">
			<?php 
echo CHtml::activeRadioButton($model, 'paymentMethod', array('value' => 3, 'required' => true, 'uncheckValue' => NULL, 'float' => 'left'));
?>
		</div>
		<div class="col-xs-10">
			<p>Cash on delivery</p>
		</div>
	</div>
	<?php 
echo $form->error($model, 'paymentMethod', array(), false, false);
//client validation made false due to radio button
?>
	</div>
	</div>
	
</div>
	
Exemplo n.º 11
0
          <label for="<?php 
        echo "ans_ext_{$ans->id_voting_answer}";
        ?>
" class="checkbox">
          <?php 
        echo CHtml::activeCheckBox($ans, 'name[]', array('value' => $ans->id_voting_answer, 'id' => "ans_ext_{$ans->id_voting_answer}", 'uncheckValue' => null));
        ?>
        <?php 
    } else {
        ?>
          <label for="<?php 
        echo "ans_ext_{$ans->id_voting_answer}";
        ?>
" class="radio">
          <?php 
        echo CHtml::activeRadioButton($ans, 'name', array('value' => $ans->id_voting_answer, 'id' => "ans_ext_{$ans->id_voting_answer}", 'uncheckValue' => null));
        ?>
        <?php 
    }
    ?>
        <?php 
    echo $ans->name;
    ?>
        </label>
      </li>
    <?php 
}
?>
    </ul> 
    <div>
    <?php 
Exemplo n.º 12
0
	
	<div class="simple">
	<?php echo CHtml::activeCheckBox($exportar,'usuarios'); ?>
	Usuarios<br/>
	</div>
	
	<div class="simple">
	<?php echo CHtml::activeCheckBox($exportar,'visitas'); ?>
	Visitas<br/>
	</div>
	
	</br><h5>Elija el formato en el que desea exportar:</h5>
	
	<!--Botones de radio para el tipo de archivo-->
	<div class="simple">
			<?php echo  CHtml::activeRadioButton($exportar,'opcion',array('value'=>0)) . 'XML';
				  echo  CHtml::activeRadioButton($exportar,'opcion',array('value'=>1)) . 'SQL'; ?>
	</div></br>
	
	<div class="action">
	<?php echo CHtml::submitButton('Exportar'); ?>
	</div>
	 
	<?php echo CHtml::endForm(); ?>
</div>

<?php if(Yii::app()->user->hasFlash('informacion')):?>
    <div class="info">
        <?php echo Yii::app()->user->getFlash('informacion'); ?>
    </div></br>
<?php endif; ?>
Exemplo n.º 13
0
?>
				<?php 
echo CHtml::label(Yii::t('core', 'unsignedZerofill'), 'Column_attribute_unsignedzerofill');
?>
				--->
			</td>
		</tr>
		<tr>
			<td />
			<td colspan="2">
				<?php 
echo $radio_options[3];
?>
				<!---
				<?php 
echo CHtml::activeRadioButton($column, 'attribute', array('value' => 'on update current_timestamp', 'id' => CHtml::$idPrefix . 'Column_attribute_on_update_current_timestamp'));
?>
				<?php 
echo CHtml::label(Yii::t('core', 'onUpdateCurrentTimestamp'), 'Column_attribute_on_update_current_timestamp');
?>
				--->
			</td>
		</tr>
		<?php 
if ($column->isNewRecord) {
    ?>
			<tr id="<?php 
    echo CHtml::$idPrefix;
    ?>
settingSize">
				<td>
Exemplo n.º 14
0
			<label class="einsatzzweck"><?php 
echo CHtml::activeRadioButton($anlegenformmodel, "typ", array("value" => Veranstaltung::$TYP_PROGRAMM, "uncheckValue" => null));
?>
 <div>Programmdiskussion</div></label>
			<div class="einsatzzweck_erkl">
				Folgendes ist hier voreingestellt <sup>1</sup>:
				<ul>
					<li>Es heißt "Kapitel" und "Änderungswünsche"</li>
					<li>Die Zeilennummerierung ist fortlaufend durch alle Kapitel</li>
					<li>Nummerierung der Änderungswünsche fortlaufend über die Kapitel hinweg.</li>
					<li>Keine Freischaltung von Änderungswünschen nötig</li>
				</ul>
			</div>

			<label class="einsatzzweck"><?php 
echo CHtml::activeRadioButton($anlegenformmodel, "typ", array("value" => Veranstaltung::$TYP_PARTEITAG, "uncheckValue" => null));
?>
 <div>Parteitag</div></label>
			<div class="einsatzzweck_erkl">
				Folgendes ist hier voreingestellt <sup>1</sup>:
				<ul>
					<li>Es heißt "Anträge" und "Änderungsanträge"</li>
					<li>Neue Zeilennummerierung bei jedem Antrag</li>
					<li>Nummerierung der Änderungsanträge pro Antrag separat</li>
					<li>Freischaltung von Anträgen und Änderungsanträgen nötig</li>
				</ul>
			</div>

			<div class="weiter">
				<button class="btn btn-primary" id="weiter-1"><span class='icon-chevron-right'></span> Weiter</button>
			</div>
Exemplo n.º 15
0
 /**
  * Renders a radio button for a model attribute.
  * This method is a wrapper of {@link CHtml::activeRadioButton}.
  * Please check {@link CHtml::activeRadioButton} for detailed information
  * about the parameters for this method.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button
  */
 public function radioButton($model, $attribute, $htmlOptions = array())
 {
     return CHtml::activeRadioButton($model, $attribute, $htmlOptions);
 }
Exemplo n.º 16
0
 /**
  * Generates a radio button for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated radio button.
  */
 public static function activeRadioButton($model, $attribute, $htmlOptions = array())
 {
     $label = self::popOption('label', $htmlOptions, false);
     $labelOptions = self::popOption('labelOptions', $htmlOptions, array());
     $radioButton = CHtml::activeRadioButton($model, $attribute, $htmlOptions);
     $labelOptions = self::addClassName('radio', $labelOptions);
     return $label !== false ? self::tag('label', $labelOptions, $radioButton . $label) : $radioButton;
 }
Exemplo n.º 17
0
 /**
  * Renders the typeahead field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     TbArray::defaultValue('id', $id, $this->htmlOptions);
     TbArray::defaultValue('name', $name, $this->htmlOptions);
     if ($this->hasModel()) {
         echo $this->inputType == 'radio' ? CHtml::activeRadioButton($this->model, $this->attribute, $this->htmlOptions) : CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo $this->inputType == 'radio' ? CHtml::radioButton($this->name, $this->value, $this->htmlOptions) : CHtml::checkBox($this->name, $this->value, $this->htmlOptions);
     }
 }
 echo '<td>';
 echo '<a target="_blank" href="' . AppCommon::getSiteBaseUrl() . '/tiffin/view/id/' . $tiffinObj->name . '-' . $tiffinObj->id . '">' . '<img src="' . $imagePath . '" alt="Loading..." style="width: 70px; float: left; height: 70px; margin-right: 5px; margin-bottom: 5px;"></a>' . '<b>' . $tiffinObj->name . '</b>' . '<p style="font-size: 80%;">' . $tiffinObj->contents . '</p>';
 echo '</td>';
 echo '<td>';
 echo $row->quantity;
 echo '<br>';
 echo '<a style="color:red;" href="' . $goBackLink . '"><u>Edit</u></a>';
 echo '</td>';
 echo '<td>';
 echo '<table class="table-condensed" style="table-layout: fixed;">';
 echo '<tbody>';
 /* @var $value APriceTime */
 foreach ($row->allowedAPriceTimeObjArray as $value) {
     echo '<tr>';
     echo '<td>';
     echo CHtml::activeRadioButton($row, '[' . $key . ']selectedPriceTimeId', array('value' => $value->id, 'required' => true, 'data-perunitprice' => $value->price_after_discount, 'data-quantity' => $row->quantity, 'uncheckValue' => NULL, 'float' => 'left'));
     echo '</td>';
     echo '<td>';
     echo '<p style="font-size: 80%;"><span style="color:blue;"><b>' . AppCommon::getDetailedDateString($value->order_delivery_time) . '</b></span> at <span style="color:red;"><b><i class="fa fa-inr"></i> ' . ' ' . $value->price_after_discount . '</b></span> per item' . '</p>';
     echo '</td>';
     echo '</tr>';
 }
 echo '</tbody>';
 echo '</table>';
 echo $form->error($row, '[' . $key . ']selectedPriceTimeId', array(), false, false);
 //client validation made false due to radio button
 echo '</td>';
 //echo '<td>';
 //echo '<b><i class="fa fa-inr"></i> '.' '.$row->totalPrice.' </b>';
 //echo '</td>';
 echo '</tr>';