Exemplo n.º 1
1
 /**
  * (non-PHPdoc)
  * @see CPortlet::renderContent()
  */
 protected function renderContent()
 {
     $themesList = array_combine(Yii::app()->themeManager->themeNames, Yii::app()->themeManager->themeNames);
     echo CHtml::form('', 'post', array());
     echo CHtml::dropDownList('themeSelector', Yii::app()->theme->name, $themesList, $this->dropDownOptions);
     echo CHtml::endForm();
 }
 public function renderCheckoutForm(Payment $payment, Order $order, $return = false)
 {
     $settings = $payment->getPaymentSystemSettings();
     $mrhLogin = $settings['login'];
     $mrhPass1 = $settings['password1'];
     $culture = $settings['language'];
     $invId = $order->id;
     $invDesc = Yii::t('RobokassaModule.robokassa', 'Payment order #{id} on "{site}" website', ['{id}' => $order->id, '{site}' => Yii::app()->getModule('yupe')->siteName]);
     $outSum = Yii::app()->money->convert($order->getTotalPrice(), $payment->currency_id);
     $crc = md5("{$mrhLogin}:{$outSum}:{$invId}:{$mrhPass1}");
     $form = CHtml::form($settings['testmode'] ? "http://test.robokassa.ru/Index.aspx" : "https://merchant.roboxchange.com/Index.aspx");
     $form .= CHtml::hiddenField('MrchLogin', $mrhLogin);
     $form .= CHtml::hiddenField('OutSum', $outSum);
     $form .= CHtml::hiddenField('InvId', $invId);
     $form .= CHtml::hiddenField('Desc', $invDesc);
     $form .= CHtml::hiddenField('SignatureValue', $crc);
     $form .= CHtml::hiddenField('Culture', $culture);
     $form .= CHtml::submitButton(Yii::t('RobokassaModule.robokassa', 'Pay'));
     $form .= CHtml::endForm();
     if ($return) {
         return $form;
     } else {
         echo $form;
     }
 }
 /**
  * (non-PHPdoc)
  * @see CPortlet::renderContent()
  */
 protected function renderContent()
 {
     $translations = self::getLanguagesList();
     echo CHtml::form('', 'post', array());
     echo CHtml::dropDownList('languageSelector', Yii::app()->getLanguage(), $translations, $this->dropDownOptions);
     echo CHtml::endForm();
 }
Exemplo n.º 4
0
 function showsaveform()
 {
     //Show 'SAVE FORM' only when click the 'Save so far' button the first time, or when duplicate is found on SAVE FORM.
     global $errormsg, $thissurvey, $surveyid, $clang, $clienttoken, $thisstep;
     $redata = compact(array_keys(get_defined_vars()));
     $sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
     sendCacheHeaders();
     doHeader();
     echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata);
     echo "\n\n<!-- JAVASCRIPT FOR CONDITIONAL QUESTIONS -->\n" . "\t<script type='text/javascript'>\n" . "\t<!--\n" . "function checkconditions(value, name, type, evt_type)\n" . "\t{\n" . "\t}\n" . "\t//-->\n" . "\t</script>\n\n";
     echo CHtml::form(array("/survey/index"), 'post') . "\n";
     //PRESENT OPTIONS SCREEN
     if (isset($errormsg) && $errormsg != "") {
         $errormsg .= "<p>" . $clang->gT("Please try again.") . "</p>";
     }
     echo templatereplace(file_get_contents($sTemplatePath . "save.pstpl"), array(), $redata);
     //END
     echo "<input type='hidden' name='sid' value='{$surveyid}' />\n";
     echo "<input type='hidden' name='thisstep' value='{$thisstep}' />\n";
     echo CHtml::hiddenField('token', $clienttoken) . "\n";
     echo "<input type='hidden' name='saveprompt' value='Y' />\n";
     echo "</form>";
     echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata);
     echo "</html>\n";
     exit;
 }
Exemplo n.º 5
0
 public function run()
 {
     $currencyActvie = Currency::getActiveCurrencyArray(2);
     $currentCharCode = Currency::getCurrentCurrencyModel()->char_code;
     foreach ($currencyActvie as $char_code => $currencyName) {
         echo CHtml::hiddenField($char_code, $this->getOwner()->createLangUrl(Yii::app()->language, array('currency' => $char_code)), array('id' => 'currency_' . $char_code));
     }
     echo CHtml::form();
     $class = Yii::app()->theme->name != 'classic' ? 'currency' : 'currency-drop';
     echo CHtml::dropDownList('currency', $currentCharCode, $currencyActvie, array('onchange' => 'this.form.action=$("#currency_"+this.value).val(); this.form.submit(); return false;', 'class' => $class));
     echo CHtml::endForm();
 }
Exemplo n.º 6
0
 public static function getHTML()
 {
     $profilsList = array();
     foreach (Yii::app()->user->getState('profil') as $profil) {
         $profilsList[$profil] = Yii::t('common', $profil);
         asort($profilsList);
     }
     if (!Yii::app()->user->isAdmin() && array_merge($profilsList, array("administrator" => Yii::t('common', 'administrator'))) != User::model()->getArrayProfil()) {
         $profilsList['newProfil'] = "Demander un nouveau profil";
     }
     $controler = Yii::app()->getController()->getId();
     $action = Yii::app()->getController()->getAction()->getId();
     $html = CHtml::form(Yii::app()->createUrl("{$controler}/{$action}"), "POST", array('class' => "navbar-form pull-left"));
     $html .= CHtml::dropDownList("activeProfil", Yii::app()->user->getState('activeProfil'), $profilsList, array('id' => "profil", "style" => "width:150px; margin-top: -3px; margin-left: -25px;", "onchange" => "this.form.submit()"));
     $html .= CHtml::endForm();
     return $html;
 }
Exemplo n.º 7
0
 /**
  * Generate qiwi payment form.
  * @param StorePaymentMethod $method
  * @param Order $order
  * @return string
  */
 public function renderPaymentForm(StorePaymentMethod $method, Order $order)
 {
     $settings = $this->getSettings($method->id);
     $summ = Yii::app()->currency->convert($order->full_price, $method->currency_id);
     $html = '<div class="form">';
     $html .= CHtml::form('http://w.qiwi.ru/setInetBill_utf.do', 'get');
     $html .= CHtml::hiddenField('from', $settings['shop_id']);
     $html .= CHtml::hiddenField('summ', $summ);
     $html .= CHtml::hiddenField('com', $this->getPaymentComment($order));
     $html .= CHtml::hiddenField('txn_id', $order->id);
     $html .= '<div id="qiwi_phone_number">Номер телефона:<br/>';
     $html .= CHtml::textField('to', $order->user_phone);
     $html .= '</div>';
     $html .= $this->renderSubmit();
     $html .= CHtml::endForm();
     $html .= '</div>';
     return $html;
 }
Exemplo n.º 8
0
 function run($args)
 {
     extract($args);
     $redata = compact(array_keys(get_defined_vars()));
     $sTemplatePath = $_SESSION['survey_' . $surveyid]['templatepath'];
     sendCacheHeaders();
     doHeader();
     echo templatereplace(file_get_contents($sTemplatePath . "startpage.pstpl"), array(), $redata);
     echo "\n\n<!-- JAVASCRIPT FOR CONDITIONAL QUESTIONS -->\n" . "\t<script type='text/javascript'>\n" . "function checkconditions(value, name, type, evt_type)\n" . "\t{\n" . "\t}\n" . "\t</script>\n\n";
     echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post') . "\n";
     echo templatereplace(file_get_contents($sTemplatePath . "load.pstpl"), array(), $redata);
     //PRESENT OPTIONS SCREEN (Replace with Template Later)
     //END
     echo "<input type='hidden' name='loadall' value='reload' />\n";
     if (isset($clienttoken) && $clienttoken != "") {
         echo "<input type='hidden' name='token' value='{$clienttoken}' />\n";
     }
     echo "</form>";
     echo templatereplace(file_get_contents($sTemplatePath . "endpage.pstpl"), array(), $redata);
     doFooter();
     exit;
 }
Exemplo n.º 9
0
 /**
  * Generate robokassa payment form.
  * @param StorePaymentMethod $method
  * @param Order $order
  * @return string
  */
 public function renderPaymentForm(StorePaymentMethod $method, Order $order)
 {
     $settings = $this->getSettings($method->id);
     // Registration data
     $mrh_login = $settings['login'];
     $mrh_pass1 = $settings['password1'];
     $shp_order_key = $order->secret_key;
     $shp_payment_id = $method->id;
     // Order number
     $inv_id = $order->id;
     // Order description
     $inv_desc = Yii::t('core', "Оплата заказа #") . $order->id;
     // Order sum
     $out_sum = Yii::app()->currency->convert($order->full_price, $method->currency_id);
     // currency
     $in_curr = "PCR";
     // Language
     $culture = "ru";
     // Signature
     $crc = md5("{$mrh_login}:{$out_sum}:{$inv_id}:{$mrh_pass1}:Shp_orderKey={$shp_order_key}:Shp_pmId={$shp_payment_id}");
     if ($this->testingMode) {
         $html = CHtml::form('http://test.robokassa.ru/Index.aspx');
     } else {
         $html = CHtml::form('https://merchant.roboxchange.com/Index.aspx');
     }
     $html .= CHtml::hiddenField('MrchLogin', $mrh_login);
     $html .= CHtml::hiddenField('OutSum', $out_sum);
     $html .= CHtml::hiddenField('InvId', $inv_id);
     $html .= CHtml::hiddenField('Desc', $inv_desc);
     $html .= CHtml::hiddenField('SignatureValue', $crc);
     $html .= CHtml::hiddenField('Shp_orderKey', $shp_order_key);
     $html .= CHtml::hiddenField('Shp_pmId', $shp_payment_id);
     $html .= CHtml::hiddenField('IncCurrLabel', $in_curr);
     $html .= CHtml::hiddenField('Culture', $culture);
     $html .= $this->renderSubmit();
     $html .= CHtml::endForm();
     return $html;
 }
Exemplo n.º 10
0
	public function renderFilter() 
	{
		$filter = isset($_GET['filter']) ? $_GET['filter'] : null;
		$details = isset($_GET['filterDetails']) ? $_GET['filterDetails'] : ''; 
		
		if(isset($_GET['filterButton'])) 
			unset($_GET['filterButton']);
			
		$tmpGet = $_GET;
		if (isset($tmpGet['filter'])) {
			if (isset($tmpGet['filterDetails']))
				unset($tmpGet['filterDetails']);
			unset($tmpGet['filter']);
		}
		
		echo CHtml::form( Y::url('site', $tmpGet), 'get');
		echo CHtml::dropDownList('filter',$filter,array(
			'inYear'=>'по годам', 'inWorkType'=>'по видам деятельности','inCity'=>'по городам'
		));
		
		if ($filter) { 
			
			if ($filter == 'inYear')
				$items = Y::years();
			if ($filter == 'inCity') 
				$items = City::model()->allWithHeader;
			if ($filter == 'inWorkType') 
				$items = PortfolioWorkType::model()->allWithHeader;
				
			if (isset($items))
				echo CHtml::dropDownList('filterDetails', $details, $items);
		}
		
		echo CHtml::submitButton('Отфильтровать', array('name'=>'filterButton'));
		echo CHtml::endForm();
	}
 public function renderCheckoutForm($subscription, $return = false)
 {
     $settings = $this->_getSettings();
     $mrhLogin = $settings['login'];
     $mrhPass1 = $settings['password1'];
     $culture = $settings['language'];
     $invId = $subscription->id;
     $invDesc = Yii::t('site', 'Оплата заказа №{id} на сайте "{site}"', ['{id}' => $subscription->order_num, '{site}' => Yii::app()->getModule('yupe')->siteName]);
     $outSum = $subscription->getTotalCost();
     $crc = md5("{$mrhLogin}:{$outSum}:{$invId}:{$mrhPass1}");
     $form = CHtml::form($settings['testmode'] ? "http://test.robokassa.ru/Index.aspx" : "https://merchant.roboxchange.com/Index.aspx", 'POST', array('id' => 'payment-form'));
     $form .= CHtml::hiddenField('MrchLogin', $mrhLogin);
     $form .= CHtml::hiddenField('OutSum', $outSum);
     $form .= CHtml::hiddenField('InvId', $invId);
     $form .= CHtml::hiddenField('Desc', $invDesc);
     $form .= CHtml::hiddenField('SignatureValue', $crc);
     $form .= CHtml::hiddenField('Culture', $culture);
     $form .= CHtml::endForm();
     if ($return) {
         return $form;
     } else {
         echo $form;
     }
 }
Exemplo n.º 12
0
<?php

echo CHtml::form(Yii::app()->request->url, 'post', array('onsubmit' => 'return submitForm(this);'));
?>

<div>
	移动至
	<strong>编号</strong> 
	<?php 
echo CHtml::textField('target_id', '', array('size' => '6'));
?>
			<?php 
echo CHtml::radioButtonList('pos', '2', array('1' => '之前', '2' => '之后'), array('separator' => '&nbsp;'));
?>
			
	<?php 
echo CHtml::submitButton('修改排序');
?>
			
</div>
<?php 
echo CHtml::endForm();
?>

<script type="text/javascript">
function submitForm(f) {
	targetId = $('#target_id').val();
	if (targetId.length == 0) {
		alert('请输入编号');
		$('#target_id').focus();
		return false;
Exemplo n.º 13
0
    <td><strong><?php 
eT("Questions");
?>
</strong></td>
    <td><strong><?php 
eT("Answers");
?>
</strong></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td style="padding: 3px;">
        <?php 
if (Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'update')) {
    ?>
            <?php 
    echo CHtml::form(array("admin/quotas/sa/new_answer/surveyid/{$iSurveyId}"), 'post');
    ?>
                <input name="submit" type="submit" class="quota_new btn btn-default"  value="<?php 
    eT("Add answer");
    ?>
" />
                <input type="hidden" name="sid" value="<?php 
    echo $iSurveyId;
    ?>
" />
                <input type="hidden" name="action" value="quotas" />
                <input type="hidden" name="quota_id" value="<?php 
    echo $quotalisting['id'];
    ?>
" />
                <input type="hidden" name="subaction" value="new_answer" />
Exemplo n.º 14
0
<div class="authPage">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <h2>Напоминание имени и пароля</h2>

            <p style="text-align: center; padding: 10px 0;">
                Введи в поле ниже email на который был зарегистрирован твой профиль и мы вышлем тебе информацию для
                восстановления пароля.
            </p>
            <?php 
ErrInfo::alerts(null);
?>
            <?php 
echo CHtml::form("", "post", ["class" => "form-horizontal"]);
?>
            <div class="form-group">
                <label for="email" class="col-sm-3 col-md-offset-1 control-label">Email:</label>

                <div class="col-sm-5">
                    <input type="email" class="form-control" id="email" name="passReset">
                </div>
            </div>
            <div class="row">
                <div class="col-md-12" style="text-align: center; padding: 10px 0;">
                    <input type="submit" class="btn btn-success" value="Напоминить"/>
                </div>
            </div>
            </form>
        </div>
    </div>
</div>
				                </ul>
				            </td>
				        </tr><tr>
				            <td>
				                <?php 
    echo CHtml::form(array("admin/survey/sa/expire/surveyid/{$surveyid}/"), 'post');
    ?>
				                    <p><input class="btn btn-default"  type='submit' value='<?php 
    eT("Expire survey");
    ?>
'/></p>
				                </form>
				            </td>
				            <td>
				                <?php 
    echo CHtml::form(array("admin/survey/sa/deactivate/surveyid/{$surveyid}/"), 'post');
    ?>
				                    <p><input  class="btn btn-default" type='submit' value='<?php 
    eT("Deactivate survey");
    ?>
'/></p>
				                    <input type='hidden' value='Y' name='ok' />
				                </form>
				            </td>
				        </tr>
				    </table>
				</div><br />
				<?php 
} else {
    ?>
	<div class="row">                             
Exemplo n.º 16
0
    <a href="javascript:void(0);" data-dismiss="alert" class="close">&times;</a>
    <?php 
    echo user()->getFlash('order_id_save_result_error');
    ?>
</div>
<?php 
}
?>

<h4><?php 
echo user()->getFlash('table_caption', t('category_list_table', 'admin'));
?>
</h4>

<?php 
echo CHtml::form(url('admin/category/updateOrderID'), 'post', array('class' => 'form-horizontal'));
?>
<table class="table table-striped table-bordered beta-list-table">
    <thead>
        <tr>
            <th class="span1 align-center"><?php 
echo $sort->link('orderid');
?>
</th>
            <th class="span1 align-center"><?php 
echo $sort->link('id');
?>
</th>
            <th class="span5"><?php 
echo $sort->link('name');
?>
Exemplo n.º 17
0
<?php $this->renderPartial('_menu'); ?>
<?php
$this->breadcrumbs = array(
    'Профиль' => array('/profile'),
    'Мои фото',
);?>
<h1>Мои фото</h1>
<?php $this->renderPartial('_flash'); ?>

<?php echo CHtml::link('Загрузить', array('/profile/photo')); ?>
<br><br>

<?php $mainphoto = $user->mainphoto; ?>
<?php if ($models) { ?>

<?php echo CHtml::form('', 'post'); ?>
<div class="allphotos">
    <?php
    foreach ($models as $model) {
        $this->renderPartial('_photosimple', compact('model', 'mainphoto'));
    } ?>
    <br clear="both"/>
    <?php echo CHtml::submitButton('Удалить отмеченные', array('confirm' => 'Вы уверены?', 'name' => 'deletephotos')); ?>
</div>
<?php echo CHtml::endForm(); ?>

<?
} else {
    echo 'Фотографий не найдено';
}
Exemplo n.º 18
0
<div class='header'><?php 
eT("Delete user");
?>
</div>
<div class='messagebox'>
    <?php 
echo CHtml::form(array("admin/user/sa/deluser"), 'post', array('name' => 'deluserform', 'id' => 'deluserform'));
?>
        <?php 
eT("Transfer the surveys of this user to: ");
?>
        <select name='transfer_surveys_to'>
            <?php 
if (count($users) > 0) {
    foreach ($users as $user) {
        $intUid = $user['uid'];
        $sUsersName = $user['users_name'];
        $selected = '';
        if ($intUid == $current_user) {
            $selected = ' selected="selected"';
        }
        if ($postuserid != $intUid) {
            ?>
                        <option value="<?php 
            echo $intUid;
            ?>
" <?php 
            echo $selected;
            ?>
> <?php 
            echo $sUsersName;
Exemplo n.º 19
0
 /**
  * Main function
  *
  * @param mixed $surveyid
  * @param mixed $args
  */
 function run($surveyid, $args)
 {
     global $errormsg;
     extract($args);
     if (!$thissurvey) {
         $thissurvey = getSurveyInfo($surveyid);
     }
     $LEMsessid = 'survey_' . $surveyid;
     $this->setJavascriptVar($surveyid);
     global $oTemplate;
     $sTemplatePath = $oTemplate->path;
     $sTemplateViewPath = $oTemplate->viewPath;
     //$sTemplatePath=getTemplatePath(Yii::app()->getConfig("defaulttemplate")).DIRECTORY_SEPARATOR;
     // TODO : check if necessary :
     /*
     if (isset ($_SESSION['survey_'.$surveyid]['templatepath']))
     {
         $sTemplatePath=$_SESSION['survey_'.$surveyid]['templatepath'];
     }
     */
     // $LEMdebugLevel - customizable debugging for Lime Expression Manager
     $LEMdebugLevel = 0;
     // LEM_DEBUG_TIMING;    // (LEM_DEBUG_TIMING + LEM_DEBUG_VALIDATION_SUMMARY + LEM_DEBUG_VALIDATION_DETAIL);
     $LEMskipReprocessing = false;
     // true if used GetLastMoveResult to avoid generation of unneeded extra JavaScript
     switch ($thissurvey['format']) {
         case "A":
             //All in one
             $surveyMode = 'survey';
             break;
         default:
         case "S":
             //One at a time
             $surveyMode = 'question';
             break;
         case "G":
             //Group at a time
             $surveyMode = 'group';
             break;
     }
     $radix = getRadixPointData($thissurvey['surveyls_numberformat']);
     $radix = $radix['separator'];
     $surveyOptions = array('active' => $thissurvey['active'] == 'Y', 'allowsave' => $thissurvey['allowsave'] == 'Y', 'anonymized' => $thissurvey['anonymized'] != 'N', 'assessments' => $thissurvey['assessments'] == 'Y', 'datestamp' => $thissurvey['datestamp'] == 'Y', 'deletenonvalues' => Yii::app()->getConfig('deletenonvalues'), 'hyperlinkSyntaxHighlighting' => ($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY, 'ipaddr' => $thissurvey['ipaddr'] == 'Y', 'radix' => $radix, 'refurl' => $thissurvey['refurl'] == "Y" && isset($_SESSION[$LEMsessid]['refurl']) ? $_SESSION[$LEMsessid]['refurl'] : NULL, 'savetimings' => $thissurvey['savetimings'] == "Y", 'surveyls_dateformat' => isset($thissurvey['surveyls_dateformat']) ? $thissurvey['surveyls_dateformat'] : 1, 'startlanguage' => isset(App()->language) ? App()->language : $thissurvey['language'], 'target' => Yii::app()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'surveys' . DIRECTORY_SEPARATOR . $thissurvey['sid'] . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR, 'tempdir' => Yii::app()->getConfig('tempdir') . DIRECTORY_SEPARATOR, 'timeadjust' => isset($timeadjust) ? $timeadjust : 0, 'token' => isset($clienttoken) ? $clienttoken : NULL);
     //Security Checked: POST, GET, SESSION, REQUEST, returnGlobal, DB
     $previewgrp = false;
     if ($surveyMode == 'group' && isset($param['action']) && $param['action'] == 'previewgroup') {
         $previewgrp = true;
     }
     $previewquestion = false;
     if ($surveyMode == 'question' && isset($param['action']) && $param['action'] == 'previewquestion') {
         $previewquestion = true;
     }
     //        if (isset($param['newtest']) && $param['newtest'] == "Y")
     //            setcookie("limesurvey_timers", "0");   //@todo fix - sometimes results in headers already sent error
     $show_empty_group = false;
     if ($previewgrp || $previewquestion) {
         $_SESSION[$LEMsessid]['prevstep'] = 2;
         $_SESSION[$LEMsessid]['maxstep'] = 0;
     } else {
         //RUN THIS IF THIS IS THE FIRST TIME , OR THE FIRST PAGE ########################################
         if (!isset($_SESSION[$LEMsessid]['step'])) {
             buildsurveysession($surveyid);
             //TODO : check if necessary
             //$sTemplatePath = $_SESSION[$LEMsessid]['templatepath'];
             if ($surveyid != LimeExpressionManager::getLEMsurveyId()) {
                 LimeExpressionManager::SetDirtyFlag();
             }
             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             $_SESSION[$LEMsessid]['step'] = 0;
             if ($surveyMode == 'survey') {
                 LimeExpressionManager::JumpTo(1, false, false, true);
             } elseif (isset($thissurvey['showwelcome']) && $thissurvey['showwelcome'] == 'N') {
                 $moveResult = LimeExpressionManager::NavigateForwards();
                 //$_SESSION[$LEMsessid]['step']=1;
             }
         } elseif ($surveyid != LimeExpressionManager::getLEMsurveyId()) {
             $_SESSION[$LEMsessid]['step'] = $_SESSION[$LEMsessid]['step'] < 0 ? 0 : $_SESSION[$LEMsessid]['step'];
             //$_SESSION[$LEMsessid]['step'] can not be less than 0, fix it always #09772
             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, false);
         }
         $totalquestions = $_SESSION['survey_' . $surveyid]['totalquestions'];
         if (!isset($_SESSION[$LEMsessid]['totalsteps'])) {
             $_SESSION[$LEMsessid]['totalsteps'] = 0;
         }
         if (!isset($_SESSION[$LEMsessid]['maxstep'])) {
             $_SESSION[$LEMsessid]['maxstep'] = 0;
         }
         if (isset($_SESSION[$LEMsessid]['LEMpostKey']) && isset($_POST['LEMpostKey']) && $_POST['LEMpostKey'] != $_SESSION[$LEMsessid]['LEMpostKey']) {
             // then trying to resubmit (e.g. Next, Previous, Submit) from a cached copy of the page
             // Does not try to save anything from the page to the database
             $moveResult = LimeExpressionManager::GetLastMoveResult(true);
             if (isset($_POST['thisstep']) && isset($moveResult['seq']) && $_POST['thisstep'] == $moveResult['seq']) {
                 // then pressing F5 or otherwise refreshing the current page, which is OK
                 $LEMskipReprocessing = true;
                 $move = "movenext";
                 // so will re-display the survey
             } else {
                 // trying to use browser back buttons, which may be disallowed if no 'previous' button is present
                 $LEMskipReprocessing = true;
                 $move = "movenext";
                 // so will re-display the survey
                 $invalidLastPage = true;
                 $backpopup = gT("Please use the LimeSurvey navigation buttons or index.  It appears you attempted to use the browser back button to re-submit a page.");
             }
         }
         if (isset($move) && $move == "clearcancel") {
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, false, true);
             //$backpopup=gT("Clear all need confirmation.");
         }
         if (isset($move)) {
             if (!in_array($move, array("clearall", "changelang", "saveall", "reload"))) {
                 $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step'];
             } else {
                 // Accepted $move without error
                 $_SESSION[$LEMsessid]['prevstep'] = $move;
             }
         } else {
             //$_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step']-1; // Is this needed ?
         }
         if (!isset($_SESSION[$LEMsessid]['prevstep'])) {
             $_SESSION[$LEMsessid]['prevstep'] = $_SESSION[$LEMsessid]['step'] - 1;
             // this only happens on re-load
         }
         if (isset($_SESSION[$LEMsessid]['LEMtokenResume'])) {
             LimeExpressionManager::StartSurvey($thissurvey['sid'], $surveyMode, $surveyOptions, false, $LEMdebugLevel);
             if (isset($_SESSION[$LEMsessid]['maxstep']) && $_SESSION[$LEMsessid]['maxstep'] > $_SESSION[$LEMsessid]['step']) {
                 LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['maxstep'], false, false);
             }
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, false);
             // if late in the survey, will re-validate contents, which may be overkill
             unset($_SESSION[$LEMsessid]['LEMtokenResume']);
         } else {
             if (!$LEMskipReprocessing) {
                 //Move current step ###########################################################################
                 if (isset($move) && $move == 'moveprev' && ($thissurvey['allowprev'] == 'Y' || $thissurvey['questionindex'] > 0)) {
                     $moveResult = LimeExpressionManager::NavigateBackwards();
                     if ($moveResult['at_start']) {
                         $_SESSION[$LEMsessid]['step'] = 0;
                         unset($moveResult);
                         // so display welcome page again
                     }
                 }
                 if (isset($move) && $move == "movenext") {
                     $moveResult = LimeExpressionManager::NavigateForwards();
                 }
                 if (isset($move) && $move == 'movesubmit') {
                     if ($surveyMode == 'survey') {
                         $moveResult = LimeExpressionManager::NavigateForwards();
                     } else {
                         // may be submitting from the navigation bar, in which case need to process all intervening questions
                         // in order to update equations and ensure there are no intervening relevant mandatory or relevant invalid questions
                         if ($thissurvey['questionindex'] == 2) {
                             // Must : save actual page , review whole before set finished to true (see #09906), index==1 seems to don't need it : (don't force move)
                             LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
                         }
                         $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['totalsteps'] + 1, false);
                     }
                 }
                 if (isset($move) && $move == 'changelang') {
                     // jump to current step using new language, processing POST values
                     $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false, true, true, true);
                     // do process the POST data
                 }
                 if (isset($move) && isNumericInt($move) && $thissurvey['questionindex'] == 1) {
                     $move = (int) $move;
                     if ($move > 0 && ($move <= $_SESSION[$LEMsessid]['step'] || isset($_SESSION[$LEMsessid]['maxstep']) && $move <= $_SESSION[$LEMsessid]['maxstep'])) {
                         $moveResult = LimeExpressionManager::JumpTo($move, false);
                     }
                 } elseif (isset($move) && isNumericInt($move) && $thissurvey['questionindex'] == 2) {
                     $move = (int) $move;
                     $moveResult = LimeExpressionManager::JumpTo($move, false, true, true);
                 }
                 if (!isset($moveResult) && !($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] == 0)) {
                     // Just in case not set via any other means, but don't do this if it is the welcome page
                     $moveResult = LimeExpressionManager::GetLastMoveResult(true);
                     $LEMskipReprocessing = true;
                 }
             }
         }
         if (isset($moveResult) && isset($moveResult['seq'])) {
             // With complete index, we need to revalidate whole group bug #08806. It's actually the only mode where we JumpTo with force
             if ($moveResult['finished'] == true && $move != 'movesubmit' && $thissurvey['questionindex'] == 2) {
                 //LimeExpressionManager::JumpTo(-1, false, false, true);
                 LimeExpressionManager::StartSurvey($surveyid, $surveyMode, $surveyOptions);
                 $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['totalsteps'] + 1, false, false, false);
                 // no preview, no save data and NO force
                 if (!$moveResult['mandViolation'] && $moveResult['valid'] && empty($moveResult['invalidSQs'])) {
                     $moveResult['finished'] = true;
                 }
             }
             if ($moveResult['finished'] == true) {
                 $move = 'movesubmit';
             } else {
                 $_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1;
                 // step is index base 1
                 $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
             }
             if ($move == "movesubmit" && $moveResult['finished'] == false) {
                 // then there are errors, so don't finalize the survey
                 $move = "movenext";
                 // so will re-display the survey
                 $invalidLastPage = true;
             }
         }
         // We do not keep the participant session anymore when the same browser is used to answer a second time a survey (let's think of a library PC for instance).
         // Previously we used to keep the session and redirect the user to the
         // submit page.
         if ($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] == 0) {
             $_SESSION[$LEMsessid]['test'] = time();
             display_first_page();
             Yii::app()->end();
             // So we can still see debug messages
         }
         // TODO FIXME
         if ($thissurvey['active'] == "Y") {
             Yii::import("application.libraries.Save");
             $cSave = new Save();
         }
         if ($thissurvey['active'] == "Y" && Yii::app()->request->getPost('saveall')) {
             $bTokenAnswerPersitance = $thissurvey['tokenanswerspersistence'] == 'Y' && isset($surveyid) && tableExists('tokens_' . $surveyid);
             // must do this here to process the POSTed values
             $moveResult = LimeExpressionManager::JumpTo($_SESSION[$LEMsessid]['step'], false);
             // by jumping to current step, saves data so far
             if (!isset($_SESSION[$LEMsessid]['scid']) && !$bTokenAnswerPersitance) {
                 $cSave->showsaveform();
                 // generates a form and exits, awaiting input
             } else {
                 // Intentional retest of all conditions to be true, to make sure we do have tokens and surveyid
                 // Now update lastpage to $_SESSION[$LEMsessid]['step'] in SurveyDynamic, otherwise we land on
                 // the previous page when we return.
                 $iResponseID = $_SESSION[$LEMsessid]['srid'];
                 $oResponse = SurveyDynamic::model($surveyid)->findByPk($iResponseID);
                 $oResponse->lastpage = $_SESSION[$LEMsessid]['step'];
                 $oResponse->save();
             }
         }
         if ($thissurvey['active'] == "Y" && Yii::app()->request->getParam('savesubmit')) {
             // The response from the save form
             // CREATE SAVED CONTROL RECORD USING SAVE FORM INFORMATION
             $popup = $cSave->savedcontrol();
             if (isset($errormsg) && $errormsg != "") {
                 $cSave->showsaveform();
                 // reshow the form if there is an error
             }
             $moveResult = LimeExpressionManager::GetLastMoveResult(true);
             $LEMskipReprocessing = true;
             // TODO - does this work automatically for token answer persistence? Used to be savedsilent()
         }
         //Now, we check mandatory questions if necessary
         //CHECK IF ALL CONDITIONAL MANDATORY QUESTIONS THAT APPLY HAVE BEEN ANSWERED
         global $notanswered;
         if (isset($moveResult) && !$moveResult['finished']) {
             $unansweredSQList = $moveResult['unansweredSQs'];
             if (strlen($unansweredSQList) > 0) {
                 $notanswered = explode('|', $unansweredSQList);
             } else {
                 $notanswered = array();
             }
             //CHECK INPUT
             $invalidSQList = $moveResult['invalidSQs'];
             if (strlen($invalidSQList) > 0) {
                 $notvalidated = explode('|', $invalidSQList);
             } else {
                 $notvalidated = array();
             }
         }
         // CHECK UPLOADED FILES
         // TMSW - Move this into LEM::NavigateForwards?
         $filenotvalidated = checkUploadedFileValidity($surveyid, $move);
         //SEE IF THIS GROUP SHOULD DISPLAY
         $show_empty_group = false;
         if ($_SESSION[$LEMsessid]['step'] == 0) {
             $show_empty_group = true;
         }
         $redata = compact(array_keys(get_defined_vars()));
         //SUBMIT ###############################################################################
         if (isset($move) && $move == "movesubmit") {
             //                setcookie("limesurvey_timers", "", time() - 3600); // remove the timers cookies   //@todo fix - sometimes results in headers already sent error
             if ($thissurvey['refurl'] == "Y") {
                 if (!in_array("refurl", $_SESSION[$LEMsessid]['insertarray'])) {
                     $_SESSION[$LEMsessid]['insertarray'][] = "refurl";
                 }
             }
             resetTimers();
             //Before doing the "templatereplace()" function, check the $thissurvey['url']
             //field for limereplace stuff, and do transformations!
             $thissurvey['surveyls_url'] = passthruReplace($thissurvey['surveyls_url'], $thissurvey);
             $thissurvey['surveyls_url'] = templatereplace($thissurvey['surveyls_url'], array(), $redata, 'URLReplace', false, NULL, array(), true);
             // to do INSERTANS substitutions
             //END PAGE - COMMIT CHANGES TO DATABASE
             if ($thissurvey['active'] != "Y") {
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                 }
                 sendCacheHeaders();
                 doHeader();
                 echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpageI', false, NULL, array(), true);
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y" && $assessments) {
                     echo templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessmentI', false, NULL, array(), true);
                 }
                 // fetch all filenames from $_SESSIONS['files'] and delete them all
                 // from the /upload/tmp/ directory
                 /* echo "<pre>";print_r($_SESSION);echo "</pre>";
                    for($i = 1; isset($_SESSION[$LEMsessid]['files'][$i]); $i++)
                    {
                    unlink('upload/tmp/'.$_SESSION[$LEMsessid]['files'][$i]['filename']);
                    }
                    */
                 // can't kill session before end message, otherwise INSERTANS doesn't work.
                 $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, NULL, array(), true);
                 $completed .= "<br /><strong><font size='2' color='red'>" . gT("Did Not Save") . "</font></strong><br /><br />\n\n";
                 $completed .= gT("Your survey responses have not been recorded. This survey is not yet active.") . "<br /><br />\n";
                 if ($thissurvey['printanswers'] == 'Y') {
                     // 'Clear all' link is only relevant for survey with printanswers enabled
                     // in other cases the session is cleared at submit time
                     $completed .= "<a href='" . Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}/move/clearall") . "'>" . gT("Clear Responses") . "</a><br /><br />\n";
                 }
             } else {
                 if ($thissurvey['usecookie'] == "Y" && $tokensexist != 1) {
                     setcookie("LS_" . $surveyid . "_STATUS", "COMPLETE", time() + 31536000);
                     //Cookie will expire in 365 days
                 }
                 $content = '';
                 $content .= templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpage', false, NULL, array(), true);
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                     if ($assessments) {
                         $content .= templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                     }
                 }
                 //Update the token if needed and send a confirmation email
                 if (isset($_SESSION['survey_' . $surveyid]['token'])) {
                     submittokens();
                 }
                 //Send notifications
                 sendSubmitNotifications($surveyid);
                 $content = '';
                 $content .= templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata, 'SubmitStartpage', false, NULL, array(), true);
                 //echo $thissurvey['url'];
                 //Check for assessments
                 if ($thissurvey['assessments'] == "Y") {
                     $assessments = doAssessment($surveyid);
                     if ($assessments) {
                         $content .= templatereplace(file_get_contents($sTemplateViewPath . "assessment.pstpl"), array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                     }
                 }
                 if (trim(str_replace(array('<p>', '</p>'), '', $thissurvey['surveyls_endtext'])) == '') {
                     $completed = "<br /><span class='success'>" . gT("Thank you!") . "</span><br /><br />\n\n" . gT("Your survey responses have been recorded.") . "<br /><br />\n";
                 } else {
                     $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitAssessment', false, NULL, array(), true);
                 }
                 // Link to Print Answer Preview  **********
                 if ($thissurvey['printanswers'] == 'Y') {
                     $url = Yii::app()->getController()->createUrl("/printanswers/view/surveyid/{$surveyid}");
                     $completed .= "<br /><br />" . "<a class='printlink' href='{$url}'  target='_blank'>" . gT("Print your answers.") . "</a><br />\n";
                 }
                 //*****************************************
                 if ($thissurvey['publicstatistics'] == 'Y' && $thissurvey['printanswers'] == 'Y') {
                     $completed .= '<br />' . gT("or");
                 }
                 // Link to Public statistics  **********
                 if ($thissurvey['publicstatistics'] == 'Y') {
                     $url = Yii::app()->getController()->createUrl("/statistics_user/action/surveyid/{$surveyid}/language/" . $_SESSION[$LEMsessid]['s_lang']);
                     $completed .= "<br /><br />" . "<a class='publicstatisticslink' href='{$url}' target='_blank'>" . gT("View the statistics for this survey.") . "</a><br />\n";
                 }
                 //*****************************************
                 $_SESSION[$LEMsessid]['finished'] = true;
                 $_SESSION[$LEMsessid]['sid'] = $surveyid;
                 sendCacheHeaders();
                 if (isset($thissurvey['autoredirect']) && $thissurvey['autoredirect'] == "Y" && $thissurvey['surveyls_url']) {
                     //Automatically redirect the page to the "url" setting for the survey
                     header("Location: {$thissurvey['surveyls_url']}");
                 }
                 doHeader();
                 echo $content;
             }
             $redata['completed'] = $completed;
             // @todo Remove direct session access.
             $event = new PluginEvent('afterSurveyComplete');
             if (isset($_SESSION[$LEMsessid]['srid'])) {
                 $event->set('responseId', $_SESSION[$LEMsessid]['srid']);
             }
             $event->set('surveyId', $surveyid);
             App()->getPluginManager()->dispatchEvent($event);
             $blocks = array();
             foreach ($event->getAllContent() as $blockData) {
                 /* @var $blockData PluginEventContent */
                 $blocks[] = CHtml::tag('div', array('id' => $blockData->getCssId(), 'class' => $blockData->getCssClass()), $blockData->getContent());
             }
             $redata['completed'] = implode("\n", $blocks) . "\n" . $redata['completed'];
             $redata['thissurvey']['surveyls_url'] = $thissurvey['surveyls_url'];
             echo templatereplace(file_get_contents($sTemplateViewPath . "completed.pstpl"), array('completed' => $completed), $redata, 'SubmitCompleted', false, NULL, array(), true);
             echo "\n";
             if (($LEMdebugLevel & LEM_DEBUG_TIMING) == LEM_DEBUG_TIMING) {
                 echo LimeExpressionManager::GetDebugTimingMessage();
             }
             if (($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
                 echo "<table><tr><td align='left'><b>Group/Question Validation Results:</b>" . $moveResult['message'] . "</td></tr></table>\n";
             }
             echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata, 'SubmitEndpage', false, NULL, array(), true);
             doFooter();
             // The session cannot be killed until the page is completely rendered
             if ($thissurvey['printanswers'] != 'Y') {
                 killSurveySession($surveyid);
             }
             exit;
         }
     }
     $redata = compact(array_keys(get_defined_vars()));
     // IF GOT THIS FAR, THEN DISPLAY THE ACTIVE GROUP OF QUESTIONSs
     //SEE IF $surveyid EXISTS ####################################################################
     if ($surveyExists < 1) {
         //SURVEY DOES NOT EXIST. POLITELY EXIT.
         echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata);
         echo "\t<center><br />\n";
         echo "\t" . gT("Sorry. There is no matching survey.") . "<br /></center>&nbsp;\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata);
         doFooter();
         exit;
     }
     createFieldMap($surveyid, 'full', false, false, $_SESSION[$LEMsessid]['s_lang']);
     //GET GROUP DETAILS
     if ($surveyMode == 'group' && $previewgrp) {
         //            setcookie("limesurvey_timers", "0"); //@todo fix - sometimes results in headers already sent error
         $_gid = sanitize_int($param['gid']);
         LimeExpressionManager::StartSurvey($thissurvey['sid'], 'group', $surveyOptions, false, $LEMdebugLevel);
         $gseq = LimeExpressionManager::GetGroupSeq($_gid);
         if ($gseq == -1) {
             echo gT('Invalid group number for this survey: ') . $_gid;
             exit;
         }
         $moveResult = LimeExpressionManager::JumpTo($gseq + 1, true);
         if (is_null($moveResult)) {
             echo gT('This group contains no questions.  You must add questions to this group before you can preview it');
             exit;
         }
         if (isset($moveResult)) {
             $_SESSION[$LEMsessid]['step'] = $moveResult['seq'] + 1;
             // step is index base 1?
         }
         $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
         $gid = $stepInfo['gid'];
         $groupname = $stepInfo['gname'];
         $groupdescription = $stepInfo['gtext'];
     } else {
         if ($show_empty_group || !isset($_SESSION[$LEMsessid]['grouplist'])) {
             $gid = -1;
             // Make sure the gid is unused. This will assure that the foreach (fieldarray as ia) has no effect.
             $groupname = gT("Submit your answers");
             $groupdescription = gT("There are no more questions. Please press the <Submit> button to finish this survey.");
         } else {
             if ($surveyMode != 'survey') {
                 if ($previewquestion) {
                     $_qid = sanitize_int($param['qid']);
                     LimeExpressionManager::StartSurvey($surveyid, 'question', $surveyOptions, false, $LEMdebugLevel);
                     $qSec = LimeExpressionManager::GetQuestionSeq($_qid);
                     $moveResult = LimeExpressionManager::JumpTo($qSec + 1, true, false, true);
                     $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
                 } else {
                     $stepInfo = LimeExpressionManager::GetStepIndexInfo($moveResult['seq']);
                 }
                 $gid = $stepInfo['gid'];
                 $groupname = $stepInfo['gname'];
                 $groupdescription = $stepInfo['gtext'];
             }
         }
     }
     if ($previewquestion) {
         $_SESSION[$LEMsessid]['step'] = 0;
         //maybe unset it after the question has been displayed?
     }
     if ($_SESSION[$LEMsessid]['step'] > $_SESSION[$LEMsessid]['maxstep']) {
         $_SESSION[$LEMsessid]['maxstep'] = $_SESSION[$LEMsessid]['step'];
     }
     // If the survey uses answer persistence and a srid is registered in SESSION
     // then loadanswers from this srid
     /* Only survey mode used this - should all?
        if ($thissurvey['tokenanswerspersistence'] == 'Y' &&
        $thissurvey['anonymized'] == "N" &&
        isset($_SESSION[$LEMsessid]['srid']) &&
        $thissurvey['active'] == "Y")
        {
        loadanswers();
        }
        */
     //******************************************************************************************************
     //PRESENT SURVEY
     //******************************************************************************************************
     $okToShowErrors = !$previewgrp && (isset($invalidLastPage) || $_SESSION[$LEMsessid]['prevstep'] == $_SESSION[$LEMsessid]['step']);
     Yii::app()->getController()->loadHelper('qanda');
     setNoAnswerMode($thissurvey);
     //Iterate through the questions about to be displayed:
     $inputnames = array();
     foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) {
         $gid = $gl['gid'];
         $qnumber = 0;
         if ($surveyMode != 'survey') {
             $onlyThisGID = $stepInfo['gid'];
             if ($onlyThisGID != $gid) {
                 continue;
             }
         }
         // TMSW - could iterate through LEM::currentQset instead
         //// To diplay one question, all the questions are processed ?
         foreach ($_SESSION[$LEMsessid]['fieldarray'] as $key => $ia) {
             ++$qnumber;
             $ia[9] = $qnumber;
             // incremental question count;
             if (isset($ia[10]) && $ia[10] == $gid || !isset($ia[10]) && $ia[5] == $gid) {
                 if ($surveyMode == 'question' && $ia[0] != $stepInfo['qid']) {
                     continue;
                 }
                 $qidattributes = getQuestionAttributeValues($ia[0]);
                 if ($ia[4] != '*' && ($qidattributes === false || !isset($qidattributes['hidden']) || $qidattributes['hidden'] == 1)) {
                     continue;
                 }
                 //Get the answers/inputnames
                 // TMSW - can content of retrieveAnswers() be provided by LEM?  Review scope of what it provides.
                 // TODO - retrieveAnswers is slow - queries database separately for each question. May be fixed in _CI or _YII ports, so ignore for now
                 list($plus_qanda, $plus_inputnames) = retrieveAnswers($ia, $surveyid);
                 if ($plus_qanda) {
                     $plus_qanda[] = $ia[4];
                     $plus_qanda[] = $ia[6];
                     // adds madatory identifyer for adding mandatory class to question wrapping div
                     // Add a finalgroup in qa array , needed for random attribute : TODO: find a way to have it in new quanda_helper in 2.1
                     if (isset($ia[10])) {
                         $plus_qanda['finalgroup'] = $ia[10];
                     } else {
                         $plus_qanda['finalgroup'] = $ia[5];
                     }
                     $qanda[] = $plus_qanda;
                 }
                 if ($plus_inputnames) {
                     $inputnames = addtoarray_single($inputnames, $plus_inputnames);
                 }
                 //Display the "mandatory" popup if necessary
                 // TMSW - get question-level error messages - don't call **_popup() directly
                 if ($okToShowErrors && $stepInfo['mandViolation']) {
                     list($mandatorypopup, $popup) = mandatory_popup($ia, $notanswered);
                 }
                 //Display the "validation" popup if necessary
                 if ($okToShowErrors && !$stepInfo['valid']) {
                     list($validationpopup, $vpopup) = validation_popup($ia, $notvalidated);
                 }
                 // Display the "file validation" popup if necessary
                 if ($okToShowErrors && isset($filenotvalidated)) {
                     list($filevalidationpopup, $fpopup) = file_validation_popup($ia, $filenotvalidated);
                 }
             }
             if ($ia[4] == "|") {
                 $upload_file = TRUE;
             }
         }
         //end iteration
     }
     if ($surveyMode != 'survey' && isset($thissurvey['showprogress']) && $thissurvey['showprogress'] == 'Y') {
         if ($show_empty_group) {
             $percentcomplete = makegraph($_SESSION[$LEMsessid]['totalsteps'] + 1, $_SESSION[$LEMsessid]['totalsteps']);
         } else {
             $percentcomplete = makegraph($_SESSION[$LEMsessid]['step'], $_SESSION[$LEMsessid]['totalsteps']);
         }
     }
     if (!(isset($languagechanger) && strlen($languagechanger) > 0) && function_exists('makeLanguageChangerSurvey')) {
         $languagechanger = makeLanguageChangerSurvey($_SESSION[$LEMsessid]['s_lang']);
     }
     //READ TEMPLATES, INSERT DATA AND PRESENT PAGE
     sendCacheHeaders();
     doHeader();
     /**
      * Question Index
      */
     $aQuestionindexbuttons = null;
     $aQuestionindexbuttonsmenu = null;
     if (!$previewgrp && !$previewquestion) {
         if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) {
             //$aQuestionindex = $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode);
             $aQuestionindexmenu = $this->createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode);
         } elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) {
             //$aQuestionindex = $this->createFullQuestionIndex($LEMsessid, $surveyMode);
             $aQuestionindexmenu = $this->createFullQuestionIndexMenu($LEMsessid, $surveyMode);
         }
         //$questionindex = (isset($aQuestionindex['menulist']))?$aQuestionindex['menulist']:'';
         $questionindexmenu = isset($aQuestionindexmenu['menulist']) ? $aQuestionindexmenu['menulist'] : '';
         //$aQuestionindexbuttons = (isset($aQuestionindex['buttons']))?$aQuestionindex['buttons']:'';
         $aQuestionindexbuttonsmenu = isset($aQuestionindexmenu['buttons']) ? $aQuestionindexmenu['buttons'] : '';
     }
     /////////////////////////////////
     // First call to templatereplace
     echo "<!-- SurveyRunTimeHelper -->";
     $redata = compact(array_keys(get_defined_vars()));
     echo templatereplace(file_get_contents($sTemplateViewPath . "startpage.pstpl"), array(), $redata);
     $aPopup = array();
     // We can move this part where we want now
     if (isset($backpopup)) {
         $aPopup[] = $backpopup;
         // If user click reload: no need other popup
     } else {
         if (isset($popup)) {
             $aPopup[] = $popup;
         }
         if (isset($vpopup)) {
             $aPopup[] = $vpopup;
         }
         if (isset($fpopup)) {
             $aPopup[] = $fpopup;
         }
     }
     Yii::app()->clientScript->registerScript("showpopup", "showpopup=" . (int) Yii::app()->getConfig('showpopups') . ";", CClientScript::POS_HEAD);
     //if(count($aPopup))
     Yii::app()->clientScript->registerScript('startPopup', "startPopups=" . json_encode($aPopup) . ";", CClientScript::POS_HEAD);
     //ALTER PAGE CLASS TO PROVIDE WHOLE-PAGE ALTERNATION
     if ($surveyMode != 'survey' && $_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep'] || isset($_SESSION[$LEMsessid]['stepno']) && $_SESSION[$LEMsessid]['stepno'] % 2) {
         if (!isset($_SESSION[$LEMsessid]['stepno'])) {
             $_SESSION[$LEMsessid]['stepno'] = 0;
         }
         if ($_SESSION[$LEMsessid]['step'] != $_SESSION[$LEMsessid]['prevstep']) {
             ++$_SESSION[$LEMsessid]['stepno'];
         }
         if ($_SESSION[$LEMsessid]['stepno'] % 2) {
             echo "<script type=\"text/javascript\">\n" . "  \$(\"body\").addClass(\"page-odd\");\n" . "</script>\n";
         }
     }
     $hiddenfieldnames = implode("|", $inputnames);
     if (isset($upload_file) && $upload_file) {
         echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('enctype' => 'multipart/form-data', 'id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off', 'class' => 'survey-form-container surveyRunTimeUploadFile')) . "\n\n            <!-- INPUT NAMES -->\n            <input type='hidden' name='fieldnames' value='{$hiddenfieldnames}' id='fieldnames' />\n";
     } else {
         echo CHtml::form(array("/survey/index", "sid" => $surveyid), 'post', array('id' => 'limesurvey', 'name' => 'limesurvey', 'autocomplete' => 'off', 'class' => 'survey-form-container  surveyRunTime')) . "\n\n            <!-- INPUT NAMES -->\n            <input type='hidden' name='fieldnames' value='{$hiddenfieldnames}' id='fieldnames' />\n";
     }
     // <-- END FEATURE - SAVE
     // The default submit button
     echo CHtml::htmlButton("default", array('type' => 'submit', 'id' => "defaultbtn", 'value' => "default", 'name' => 'move', 'class' => "submit noview", 'style' => 'display:none'));
     if ($surveyMode == 'survey') {
         if (isset($thissurvey['showwelcome']) && $thissurvey['showwelcome'] == 'N') {
             //Hide the welcome screen if explicitly set
         } else {
             echo templatereplace(file_get_contents($sTemplateViewPath . "welcome.pstpl"), array(), $redata) . "\n";
         }
         if ($thissurvey['anonymized'] == "Y") {
             echo templatereplace(file_get_contents($sTemplateViewPath . "privacy.pstpl"), array(), $redata) . "\n";
         }
     }
     // <-- START THE SURVEY -->
     if ($surveyMode != 'survey') {
         echo templatereplace(file_get_contents($sTemplateViewPath . "survey.pstpl"), array(), $redata);
     }
     // runonce element has been changed from a hidden to a text/display:none one. In order to workaround an not-reproduced issue #4453 (lemeur)
     // We don't need runonce actually (140228): the script was updated and replaced by EM see #08783 (grep show no other runonce)
     // echo "<input type='text' id='runonce' value='0' style='display: none;'/>";
     $showpopups = Yii::app()->getConfig('showpopups');
     //Display the "mandatory" message on page if necessary
     if (!$showpopups && $stepInfo['mandViolation'] && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more mandatory questions have not been answered. You cannot proceed until these have been completed.") . "</p>";
     }
     //Display the "validation" message on page if necessary
     if (!$showpopups && !$stepInfo['valid'] && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid.") . "</p>";
     }
     //Display the "file validation" message on page if necessary
     if (!$showpopups && isset($filenotvalidated) && $filenotvalidated == true && $okToShowErrors) {
         echo "<p class='errormandatory alert alert-danger' role='alert'>" . gT("One or more uploaded files are not in proper format/size. You cannot proceed until these files are valid.") . "</p>";
     }
     $_gseq = -1;
     foreach ($_SESSION[$LEMsessid]['grouplist'] as $gl) {
         $gid = $gl['gid'];
         ++$_gseq;
         $groupname = $gl['group_name'];
         $groupdescription = $gl['description'];
         if ($surveyMode != 'survey' && $gid != $onlyThisGID) {
             continue;
         }
         $redata = compact(array_keys(get_defined_vars()));
         Yii::app()->setConfig('gid', $gid);
         // To be used in templaterplace in whole group. Attention : it's the actual GID (not the GID of the question)
         echo "\n\n<!-- START THE GROUP (in SurveyRunTime ) -->\n";
         echo "\n\n<div id='group-{$_gseq}'";
         $gnoshow = LimeExpressionManager::GroupIsIrrelevantOrHidden($_gseq);
         if ($gnoshow && !$previewgrp) {
             echo " style='display: none;'";
         }
         echo " class='row'>\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "startgroup.pstpl"), array(), $redata);
         echo "\n";
         if (!$previewquestion && trim($redata['groupdescription']) == "") {
             echo templatereplace(file_get_contents($sTemplateViewPath . "groupdescription.pstpl"), array(), $redata);
         }
         echo "\n";
         echo "\n\n<!-- PRESENT THE QUESTIONS (in SurveyRunTime )  -->\n";
         foreach ($qanda as $qa) {
             // Test if finalgroup is in this qid (for all in one survey, else we do only qanda for needed question (in one by one or group by goup)
             if ($gid != $qa['finalgroup']) {
                 continue;
             }
             $qid = $qa[4];
             $qinfo = LimeExpressionManager::GetQuestionStatus($qid);
             $lastgrouparray = explode("X", $qa[7]);
             $lastgroup = $lastgrouparray[0] . "X" . $lastgrouparray[1];
             // id of the last group, derived from question id
             $lastanswer = $qa[7];
             $n_q_display = '';
             if ($qinfo['hidden'] && $qinfo['info']['type'] != '*') {
                 continue;
                 // skip this one
             }
             $aReplacement = array();
             $question = $qa[0];
             //===================================================================
             // The following four variables offer the templating system the
             // capacity to fully control the HTML output for questions making the
             // above echo redundant if desired.
             $question['sgq'] = $qa[7];
             $question['aid'] = !empty($qinfo['info']['aid']) ? $qinfo['info']['aid'] : 0;
             $question['sqid'] = !empty($qinfo['info']['sqid']) ? $qinfo['info']['sqid'] : 0;
             //===================================================================
             $question_template = file_get_contents($sTemplateViewPath . 'question.pstpl');
             // Fix old template : can we remove it ? Old template are surely already broken by another issue
             if (preg_match('/\\{QUESTION_ESSENTIALS\\}/', $question_template) === false || preg_match('/\\{QUESTION_CLASS\\}/', $question_template) === false) {
                 // if {QUESTION_ESSENTIALS} is present in the template but not {QUESTION_CLASS} remove it because you don't want id="" and display="" duplicated.
                 $question_template = str_replace('{QUESTION_ESSENTIALS}', '', $question_template);
                 $question_template = str_replace('{QUESTION_CLASS}', '', $question_template);
                 $question_template = "<div {QUESTION_ESSENTIALS} class='{QUESTION_CLASS} {QUESTION_MAN_CLASS} {QUESTION_INPUT_ERROR_CLASS}'" . $question_template . "</div>";
             }
             $redata = compact(array_keys(get_defined_vars()));
             $aQuestionReplacement = $this->getQuestionReplacement($qa);
             echo templatereplace($question_template, $aQuestionReplacement, $redata, false, false, $qa[4]);
         }
         if ($surveyMode == 'group') {
             echo "<input type='hidden' name='lastgroup' value='{$lastgroup}' id='lastgroup' />\n";
             // for counting the time spent on each group
         }
         if ($surveyMode == 'question') {
             echo "<input type='hidden' name='lastanswer' value='{$lastanswer}' id='lastanswer' />\n";
         }
         echo "\n\n<!-- END THE GROUP -->\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "endgroup.pstpl"), array(), $redata);
         echo "\n\n</div>\n";
         Yii::app()->setConfig('gid', '');
     }
     LimeExpressionManager::FinishProcessingGroup($LEMskipReprocessing);
     echo LimeExpressionManager::GetRelevanceAndTailoringJavaScript();
     LimeExpressionManager::FinishProcessingPage();
     /**
      * Navigator
      */
     if (!$previewgrp && !$previewquestion) {
         $aNavigator = surveymover();
         $moveprevbutton = $aNavigator['sMovePrevButton'];
         $movenextbutton = $aNavigator['sMoveNextButton'];
         $navigator = $moveprevbutton . ' ' . $movenextbutton;
         $redata = compact(array_keys(get_defined_vars()));
         echo "\n\n<!-- PRESENT THE NAVIGATOR -->\n";
         echo templatereplace(file_get_contents($sTemplateViewPath . "navigator.pstpl"), array(), $redata);
         echo "\n";
         if ($thissurvey['active'] != "Y") {
             echo "<p style='text-align:center' class='error'>" . gT("This survey is currently not active. You will not be able to save your responses.") . "</p>\n";
         }
         if ($surveyMode != 'survey' && $thissurvey['questionindex'] == 1) {
             $this->createIncrementalQuestionIndex($LEMsessid, $surveyMode);
             $this->createIncrementalQuestionIndexMenu($LEMsessid, $surveyMode);
         } elseif ($surveyMode != 'survey' && $thissurvey['questionindex'] == 2) {
             $this->createFullQuestionIndex($LEMsessid, $surveyMode);
             $this->createFullQuestionIndexMenu($LEMsessid, $surveyMode);
         }
         echo "<input type='hidden' name='thisstep' value='{$_SESSION[$LEMsessid]['step']}' id='thisstep' />\n";
         echo "<input type='hidden' name='sid' value='{$surveyid}' id='sid' />\n";
         echo "<input type='hidden' name='start_time' value='" . time() . "' id='start_time' />\n";
         $_SESSION[$LEMsessid]['LEMpostKey'] = mt_rand();
         echo "<input type='hidden' name='LEMpostKey' value='{$_SESSION[$LEMsessid]['LEMpostKey']}' id='LEMpostKey' />\n";
         if (isset($token) && !empty($token)) {
             echo "\n<input type='hidden' name='token' value='{$token}' id='token' />\n";
         }
     }
     if (($LEMdebugLevel & LEM_DEBUG_TIMING) == LEM_DEBUG_TIMING) {
         echo LimeExpressionManager::GetDebugTimingMessage();
     }
     if (($LEMdebugLevel & LEM_DEBUG_VALIDATION_SUMMARY) == LEM_DEBUG_VALIDATION_SUMMARY) {
         echo "<table><tr><td align='left'><b>Group/Question Validation Results:</b>" . $moveResult['message'] . "</td></tr></table>\n";
     }
     echo "</form>\n";
     echo templatereplace(file_get_contents($sTemplateViewPath . "endpage.pstpl"), array(), $redata);
     echo "\n";
     doFooter();
 }
Exemplo n.º 20
0
eT("Corner lines");
?>
</option>
                        <option value='boxes'
                            <?php 
if ($queXMLEdgeDetectionFormat == "boxes") {
    ?>
                                selected='selected'
                                <?php 
}
?>
                            ><?php 
eT("Corner boxes");
?>
</option>
                   </select>
                </li>

            <input type='hidden' name='ok' value='Y' />
            <input type='submit' value="<?php 
eT("queXML PDF export");
?>
" />
        </form>
             <?php 
echo CHtml::form(array("admin/export/sa/quexmlclear/surveyid/{$surveyid}/"), 'post', array('class' => 'form44'));
echo CHtml::htmlButton(gT('Reset to default settings'), array('type' => 'submit'));
?>
        </form>
    </div><br />&nbsp;
Exemplo n.º 21
0
<?php

echo CHtml::form();
?>
    <div id="langdrop">
        <?php 
//        echo CHtml::dropDownList('_lang', $currentLang, array(
//            'en_us' => 'English', 'zh_cn' => 'Chinese'), array('submit' => ''));
?>
    </div>
<?php 
//unset($_SESSION);
//echo Yii::app()->language;
?>
<li class="container3d relative">
    <a role="button" href="#" class="color_dark" id="lang_button"><img class="d_inline_middle m_right_10" src="<?php 
echo F::themeUrl();
?>
/images/flag_<?php 
echo Yii::app()->language;
?>
.jpg" alt=""><?php 
echo Yii::app()->language;
?>
</a>
    <ul class="dropdown_list type_2 top_arrow color_light">
        <li>
            <?php 
echo CHtml::link(CHtml::image(F::themeUrl() . '/images/flag_zh_cn.jpg', '', array('class' => 'd_inline_middle')) . 'Chinese', array('/site/default/index', 'lang' => 'zh_cn'), array('class' => 'tr_delay_hover color_light'));
?>
        </li>
 /**
  * Installer::stepCreateDb()
  * Create database.
  * @return
  */
 function stepCreateDb()
 {
     // check status. to be called only when database don't exist else rdirect to proper link.
     if (!Yii::app()->session['databaseDontExist']) {
         $this->redirect($this->createUrl('installer/welcome'));
     }
     $aData['clang'] = $clang = $this->lang;
     $aData['model'] = $model = new InstallerConfigForm();
     $aData['title'] = $clang->gT("Database configuration");
     $aData['descp'] = $clang->gT("Please enter the database settings you want to use for LimeSurvey:");
     $aData['classesForStep'] = array('off', 'off', 'off', 'on', 'off', 'off');
     $aData['progressValue'] = 40;
     $aDbConfig = self::_getDatabaseConfig();
     extract($aDbConfig);
     // unset database name for connection, since we want to create it and it doesn't already exists
     $aDbConfig['sDatabaseName'] = '';
     self::_dbConnect($aDbConfig, $aData);
     $aData['adminoutputForm'] = '';
     // Yii doesn't have a method to create a database
     $createDb = true;
     // We are thinking positive
     switch ($sDatabaseType) {
         case 'mysqli':
         case 'mysql':
             try {
                 $this->connection->createCommand("CREATE DATABASE `{$sDatabaseName}` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci")->execute();
             } catch (Exception $e) {
                 $createDb = false;
             }
             break;
         case 'mssql':
         case 'odbc':
             try {
                 $this->connection->createCommand("CREATE DATABASE [{$sDatabaseName}];")->execute();
             } catch (Exception $e) {
                 $createDb = false;
             }
             break;
         case 'postgres':
             try {
                 $this->connection->createCommand("CREATE DATABASE \"{$sDatabaseName}\" ENCODING 'UTF8'")->execute();
             } catch (Exception $e) {
                 $createdb = false;
             }
             break;
         default:
             try {
                 $this->connection->createCommand("CREATE DATABASE {$sDatabaseName}")->execute();
             } catch (Exception $e) {
                 $createDb = false;
             }
             break;
     }
     //$this->load->dbforge();
     if ($createDb) {
         $sDsn = self::_getDsn($sDatabaseType, $sDatabaseLocation, $sDatabasePort, $sDatabaseName, $sDatabaseUser, $sDatabasePwd);
         $this->connection = new CDbConnection($sDsn, $sDatabaseUser, $sDatabasePwd);
         Yii::app()->session['populatedatabase'] = true;
         Yii::app()->session['databaseexist'] = true;
         unset(Yii::app()->session['databaseDontExist']);
         $aData['adminoutputText'] = "<tr bgcolor='#efefef'><td colspan='2' align='center'> <br />" . "<strong><font class='successtitle'>\n" . $clang->gT("Database has been created.") . "</font></strong><br /><br />\n" . $clang->gT("Please continue with populating the database.") . "<br /><br />\n";
         $aData['adminoutputForm'] = CHtml::form(array('installer/populatedb'), 'post') . "<input class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' type='submit' name='createdbstep2' value='" . $clang->gT("Populate database") . "' /></form>";
     } else {
         $model->addError('dblocation', $clang->gT('Try again! Connection with database failed.'));
         $this->render('/installer/dbconfig_view', $aData);
     }
     $aData['title'] = $clang->gT("Database settings");
     $aData['descp'] = $clang->gT("Database settings");
     $aData['classesForStep'] = array('off', 'off', 'off', 'off', 'on', 'off');
     $aData['progressValue'] = 60;
     $this->render('/installer/dbsettings_view', $aData);
 }
Exemplo n.º 23
0
    <h3><?php 
    eT("Import a VV survey file");
    ?>
</h3>
    <?php 
}
?>

        <div class="row">
            <div class="col-lg-12 content-right">

<?php 
if ($tableExists) {
    ?>
    <?php 
    echo CHtml::form(array('admin/dataentry/sa/vvimport/surveyid/' . $surveyid), 'post', array('enctype' => 'multipart/form-data', 'id' => 'vvexport', 'class' => 'form-horizontal'));
    ?>

    <div class="panel panel-primary" id="pannel-1" style="opacity: 1; top: 0px;">
        <div class="panel-heading">
            <h4 class="panel-title">
                <?php 
    eT("General");
    ?>
            </h4>
        </div>

        <div class="panel-body">
            <div class="form-group">
                <label for="csv_vv_file" class="col-sm-2 control-label">
                    <?php 
Exemplo n.º 24
0
<div class="row">
    <div class="col-md-3">
        <?php 
$this->renderPartial('/installer/sidebar_view', compact('progressValue', 'classesForStep'));
?>
    </div>
    <div class="col-md-9">
        <h2><?php 
echo $title;
?>
</h2>

        <?php 
echo CHtml::form(array("installer/welcome"), 'post', array('class' => 'form-vertical'));
?>
            <legend><?php 
eT('Language selection');
?>
</legend>
            <div class="row">
                <div class='form-group'>
                    <div class="span6 col-md-12">
                        <?php 
echo CHtml::label(gT('Please select your preferred language:'), 'installerLang', array('class' => 'control-label'));
?>
                        <br/><br/>
                    </div>
                    <div class="col-md-3">
                        <?php 
echo CHtml::dropDownList('installerLang', 'en', $languages, array('id' => 'installerLang', 'class' => 'form-control', 'encode' => false));
?>
Exemplo n.º 25
0
 /**
  * Причины банов
  * @throws CHttpException
  */
 public function actionReasons()
 {
     // Проверка прав
     if (Yii::app()->user->isGuest) {
         throw new CHttpException(403, "У Вас недостаточно прав");
     }
     // Задаем лайоут
     $this->layout = '//layouts/column2';
     // Вывод модальки с деталями группы
     if (isset($_POST['groupid'])) {
         $gid = intval($_POST['groupid']);
         // Выбираем все причины
         $reasons = Reasons::model()->findAll();
         // Выбираем группу причин по ID
         $group = ReasonsSet::model()->findByPk($gid);
         $js = CHtml::form('', 'post', array('id' => 'form' . $gid));
         $js .= "<table class=\"table table-bordered table-condensed\"><thead><tr><th colspan=3 style=\"vertical-align: middle\">Название группы " . CHtml::textField('groupname', $group->setname) . "</th></tr><tr><th>Причина</th><th>Срок бана</th><th>Действия</th></thead><tbody>";
         foreach ($reasons as $reason) {
             $server = ReasonsToSet::model()->findByAttributes(array('setid' => $gid, 'reasonid' => $reason->id));
             $js .= "<tr id=\"reason{$reason->id}\">";
             $js .= "<td>";
             $js .= CHtml::encode($reason->reason);
             $js .= "</td>";
             $js .= "<td>";
             $js .= CHtml::encode($reason->static_bantime);
             $js .= "</td>";
             $js .= "<td>";
             $js .= CHtml::checkBox('active[]', $server !== NULL ? TRUE : FALSE, array('value' => $reason->id, 'id' => 'active' . $reason->id));
             $js .= "</td>";
             $js .= "</tr>";
         }
         $js .= "<tr><td colspan=3 style=\"text-align: center\">";
         $js .= CHtml::hiddenField('gid', $gid);
         $js .= CHtml::button('Сохранить', array('class' => 'btn btn-primary save', 'onclick' => '$.post(\'\', $(\'#form' . $gid . '\').serialize(), function(data){eval(data);});'));
         $js .= "</td></tr>";
         $js .= "</tbody></table>";
         $js .= CHtml::endForm();
         Yii::app()->end("\$('#loading').hide();\$('.modal-header').html('<h2>Причины банов для группы \"{$group->setname}\"</h2>');\$('.modal-body').html('{$js}');\$('#reasons-modal').modal('show');");
     }
     // Сохранение деталей группы
     if (isset($_POST['active'])) {
         //Yii::app()->end($_POST['gid']);
         // Если не выбрали причины
         if (empty($_POST['active'])) {
             Yii::app()->end("alert('Выберите причины!');");
         }
         // Если не введено название группы
         if (empty($_POST['groupname'])) {
             Yii::app()->end("alert('Введите название группы!');");
         }
         // Ищем группу
         $set = ReasonsSet::model()->findByPk($_POST['gid']);
         // Если группы нет, возвращаем ошибку
         if ($set === NULL) {
             Yii::app()->end("alert('Ошибка! Группа причин под ID " . intval($_POST['gid']) . " не найдена');");
         }
         // Если изменено название группы, то обновляем в базе и на странице
         $other = "";
         if ($_POST['groupname'] != $set->setname) {
             $set->setname = CHtml::encode($_POST['groupname']);
             if ($set->save()) {
                 $other = "\$('#rgroup{$_POST['gid']}').children('td:first').html('" . CHtml::encode($_POST['groupname']) . "');";
             }
             //Yii::app()->end(var_dump($set->errors()));
         }
         // Ищем и предварительно удаляем все записи для этой группы причин
         if (ReasonsToSet::model()->findAllByAttributes(array('setid' => intval($_POST['gid'])))) {
             ReasonsToSet::model()->deleteAllByAttributes(array('setid' => intval($_POST['gid'])));
         }
         // Циклим и записываем в базу новые причины для этой группы
         foreach ($_POST['active'] as $r) {
             $rts = new ReasonsToSet();
             $rts->setid = intval($_POST['gid']);
             $rts->reasonid = intval($r);
             if ($rts->save()) {
                 $rts->unsetAttributes();
             }
         }
         Yii::app()->end($other . "\$('#reasons-modal').modal('hide');alert('Сохранено!');");
     }
     $this->render('reasons', array('reasons' => new CActiveDataProvider('Reasons', array('criteria' => array('order' => '`static_bantime` DESC'))), 'reasonsset' => new CActiveDataProvider('ReasonsSet')));
 }
echo $form->dropDownList($model, 'student_transaction_shift_id', Shift::items(), array('empty' => '-----------Select---------', 'tabindex' => 14));
?>
<span class="status">&nbsp;</span>
        <?php 
echo $form->error($model, 'student_transaction_shift_id');
?>
	</div>

    </div>

    <div class="row">
	      <?php 
echo $form->labelEx($photo, 'student_photos_path');
?>
	      <?php 
CHtml::form('', 'post', array('enctype' => 'multipart/form-data'));
?>
	      <?php 
echo CHtml::activeFileField($photo, 'student_photos_path', array('tabindex' => 15));
?>
<span class="status">&nbsp;</span>
		<?php 
if (isset($photo->student_photos_path)) {
    echo CHtml::image(Yii::app()->baseUrl . '/stud_images/' . $photo->student_photos_path, "", array("width" => "50px", "height" => "50px"));
}
?>
	
	      <?php 
CHtml::endForm();
?>
</div>
Exemplo n.º 27
0
    ?>
</th>
            </tr>
        </thead>
        <tbody>
            <?php 
    for ($i = 0; $i < count($usr_arr); $i++) {
        $usr = $usr_arr[$i];
        if ($usr['project_id'] == $project_id) {
            $project = Project::model()->findAllByPk($usr['project_id']);
            ?>
                    <tr>

                        <td style="padding:3px;">
                            <?php 
            echo CHtml::form(array("admin/pquery/sa/mod/prjid/{$project_id}/vid/{$vendor_project_id}"), 'post');
            ?>
            
                            <input type='image' src='<?php 
            echo $imageurl;
            ?>
edit_16.png' alt='<?php 
            $clang->eT("Edit this Query");
            ?>
' />
                            <input type='hidden' name='action' value='modifyquery' />
                            <input type='hidden' name='query_id' value='<?php 
            echo $usr['id'];
            ?>
' />
                            </form>
            <h3>
                <?php eT("Survey quota");?>: <?php eT("Add answer");?>
            </h3>

            <?php if (count($question_answers) == $x): ?>
                <div class="jumbotron message-box">
                        <h2><?php eT("All answers are already selected in this quota.");?></h2>
                        <p>
                            <input class="btn btn-lg btn-success" type="submit" onclick="window.open('<?php echo $this->createUrl("admin/quotas/sa/index/surveyid/$iSurveyId");?>', '_top')" value="<?php eT("Continue");?>"/>
                        </p>
                </div>
            <?php else:?>
                <div class="jumbotron message-box">
                        <h2><?php echo sprintf(gT("New answer for quota '%s'"), $quota_name);?></h2>
                        <p class="lead"><?php eT("Select answer:");?></p>
                        <?php echo CHtml::form(array("admin/quotas/sa/insertquotaanswer/surveyid/{$iSurveyId}"), 'post', array('#'=>'quota_'.sanitize_int($_POST['quota_id']))); ?>
                            <p>
                                <select name="quota_anscode" size="15">
                                    <?php
                                        while (list($key,$value) = each($question_answers))
                                        {
                                            if (!isset($value['rowexists'])) echo '<option value="'.$key.'">'.strip_tags(substr($value['Display'],0,40)).'</option>';
                                        }
                                    ?>
                                </select>
                            </p>
                            <p>

                                <input class="btn btn-lg btn-success" name="submit" type="submit" class="submit btn btn-default" value="<?php eT("Next");?>" />
                                <input type="hidden" name="sid" value="<?php echo $iSurveyId;?>" />
                                <input type="hidden" name="action" value="quotas" />
echo $this->createUrl("/admin/export/sa/resources/export/label/lid/{$lid}");
?>
", "_blank")'
                            value="<?php 
$clang->eT("Export resources as ZIP archive");
?>
"  />
                    </li>
                </ul>
                <input type='hidden' name='lid' value='<?php 
echo $lid;
?>
' />
            </form>
            <?php 
echo CHtml::form(array('admin/labels/sa/importlabelresources'), 'post', array('id' => 'importlabelresources', 'class' => 'form30', 'name' => 'importlabelresources', 'enctype' => 'multipart/form-data', 'onsubmit' => 'return validatefilename(this, "' . $clang->gT('Please select a file to import!', 'js') . '");'));
?>
                <ul>
                    <li>
                        <label for='the_file'><?php 
$clang->eT("Select ZIP file:");
?>
</label>
                        <input id='the_file' name="the_file" type="file" />
                    </li>
                    <li>
                        <label>&nbsp;</label>
                        <input type='button' value='<?php 
$clang->eT("Import resources ZIP archive");
?>
'
Exemplo n.º 30
0
Arquivo: form.php Projeto: yupe/yupe
<?php

echo CHtml::form(['/payment/payment/process', 'id' => $payment->id]);
echo CHtml::hiddenField('order', $order->id);
echo CHtml::endForm();