public function actionIndex() { $session = new CHttpSession(); $otpr = $stopt = 0; if (isset($_POST['input_email']) && $_POST['input_email'] !== '') { $model = SegScheduledTours::model()->findByPk($_POST['sid'] * 1); //$_POST['sid']*1); $tour = SegTourroutes::model()->findByAttributes(array('cityid' => $model->city_id, 'id_tour_categories' => $_POST['tid'] * 1)); ///// $starttime = str_replace('00:00', '00', $model->starttime); $tourdate = $this->dateEn($model->date); if (!empty($model->duration)) { $stopt = $model->duration; } else { $stopt = $tour->standard_duration; } $stoptime = date("H:i", strtotime($model->date . ' ' . $model->starttime) + $stopt * 60) . ' Uhr'; $tour_guest = ''; $tour_name = $model->city_ob->seg_cityname . ' ' . $tour->name; ////lang $text_lang = $model->language_ob->germanname; if (is_null($model->language_id)) { $lang = SegLanguagesGuides::model()->with('languages')->findAll('users_id=' . $model->guide1_id); $zp = $text_lang = ''; foreach ($lang as $val) { $text_lang .= $zp . $val->languages->germanname; $zp = ', '; } } //// ////point $meetingpoint = $tour->meetingpoint_description; if (Yii::app()->language == 'en') { $meetingpoint = $tour->meetingpoint_description_en; } $session['city_en'] = $model->city_ob->webadress_en; $session['city_name'] = $model->city_ob->seg_cityname; if (is_array($_POST['input_email'])) { $mailtext = array('city_name' => $model->city_ob->seg_cityname, 'city_en' => $model->city_ob->webadress_en, 'tour_date' => $tourdate, 'tour_starttime' => $starttime, 'tour_stoptime' => $stoptime, 'tour_guest' => $_POST['guest'], 'tour_name' => $tour_name, 'tour_lang' => $text_lang, 'tour_guide_name' => $model->user_ob->guidename, 'tour_guide_tel' => $model->user_ob->contact_ob->phone, 'contact_name' => $_POST['contact_name'], 'contact_street' => $_POST['contact_street'], 'contact_city' => $_POST['contact_city'], 'contact_land' => $_POST['contact_land'], 'contact_tel' => $_POST['contact_tel'], 'contact_email' => $_POST['contact_email'], 'meetingpoint' => $meetingpoint); foreach ($_POST['input_email'] as $k => $email) { $msg = $this->renderPartial('tour_mail', $mailtext, TRUE); if ($this->sendMail($email, 'Cherrytours: ' . $tour_name, $msg)) { $otpr++; } } } //$otpr=0; $session['text_link'] = 'Einladungen werden nicht gesendet. Fehler-Mail-Server.'; if ($otpr > 0) { $session['text_link'] = 'Bestätigung per Email versendet'; echo '<meta http-equiv="refresh" content="0">'; exit; } } $this->render('mail_success', array('text_link' => $session['text_link'], 'city_en' => $session['city_en'], 'city_name' => $session['city_name'])); }
public function actionShow($id) { $id_control = Yii::app()->user->id; // $update_user = User::model()->findByPk($id_user); $role_control = User::model()->findByPk($id_control)->id_usergroups; // $id_guide = SegGuidesdata::model()->findByPk($update_user->id_guide)->idseg_guidesdata; if ($role_control == 1) { $this->layout = "root"; } if ($role_control == 2) { $this->layout = "admin"; } if ($role_control == 3) { $this->layout = "office"; } if ($role_control == 5) { $this->layout = "guide"; } $model = $this->loadModel($id); //city //$citie->seg_cityname = ''; $j = 0; $criteria_city = new CDbCriteria(); $criteria_city->condition = 'users_id=:users_id'; $criteria_city->params = array(':users_id' => $model->guide1_id); $city = SegGuidesCities::model()->find($criteria_city); if (isset($city)) { $criteria_c = new CDbCriteria(); $criteria_c->condition = 'idseg_cities=:idseg_cities'; $criteria_c->params = array(':idseg_cities' => $city->cities_id); $citie = SegCities::model()->find($criteria_c); $model->city_id_all = $citie->seg_cityname; $j = $citie->idseg_cities; } else { $model->city_id_all = 'no element'; } //language if ($model->language_id == NULL) { $i = 0; $criteria_language = new CDbCriteria(); $criteria_language->condition = 'users_id=:users_id'; $criteria_language->params = array(':users_id' => $model->guide1_id); $language = SegLanguagesGuides::model()->findAll($criteria_language); if (isset($language)) { foreach ($language as $item) { $criteria_i = new CDbCriteria(); $criteria_i->condition = 'id_languages=:id_languages'; $criteria_i->params = array(':id_languages' => $item->languages_id); $languages = Languages::model()->findAll($criteria_i); $model->language_id_all[$i] = $languages; $i++; } } else { $model->language_id_all[0] = 'no element'; } } else { $criteria_i = new CDbCriteria(); $criteria_i->condition = 'id_languages=:id_languages'; $criteria_i->params = array(':id_languages' => $model->language_id); $language = Languages::model()->find($criteria_i); $model->language_id_all[0] = $language; } //tour canegories + tourroute //$tourroute_id_all; $z = 0; $criteria_tour = new CDbCriteria(); $criteria_tour->condition = 'usersid=:usersid'; $criteria_tour->params = array(':usersid' => $model->guide1_id); $tourcats = SegGuidesTourroutes::model()->findAll($criteria_tour); if (isset($tourcats)) { foreach ($tourcats as $tourroute) { $criteria_t = new CDbCriteria(); $criteria_t->condition = 'id_tour_categories=:id_tour_categories AND cityid=:cityid'; $criteria_t->params = array(':id_tour_categories' => $tourroute->tourroutes_id, ':cityid' => $j); $tourroutes = SegTourroutes::model()->find($criteria_t); $model->tourroute_id_all[$z] = $tourroutes->name; $z++; } } else { $model->tourroute_id_all[0] = 'no element'; } $this->render('show', array('model' => $model)); }
else $ichel .= '<i class="fa fa-user cgray"></i>'; } if ($ii > 6) $ichel .= '</ul>'; $rest = $tnmax; if ($sv > 0) $rest = $tnmax - $sv; $ichel .= '<br><strong>' . $rest . Yii::t('api', 'bt_freepl'); ' </strong>'; $opt_guest = ''; $n = 0; while ($n < $rest) { $n++; $opt_guest .= '<option value="' . $n . '">' . $n . '</option>'; } } if (is_null($model->language_id)) { //$lang = Languages::model()->findAll(); $lang = SegLanguagesGuides::model()->with('languages')->findAll('users_id=' . $model->guide1_id); $opt_lang =''; foreach ($lang as $val) { $sel = ''; $opt_lang .= '<option value="' . $val->languages->id_languages . '" ' . $sel . '>' . $val->languages->germanname . '</option>'; }; $input_lang = '<select id="pick_lang" class="form-control" name="SegScheduledTours[language_id]">' . $opt_lang . '</select>'; } else { $input_lang = '<input type="text" id="pick_lang" disabled="true" class="form-control" value="' . $model->language_ob->germanname . '">'; } ?> <header class="page-book"> <nav id="navbar-mobile" class="navbar"> <div class="container"> <div class="navbar-header">
public function actionAjax_Show() { if (!Yii::app()->request->isAjaxRequest) { echo "No data"; exit; } $id= $_POST['id']; $model=$this->loadST($id); //city //$citie->seg_cityname = ''; $j=0; $criteria_city = new CDbCriteria; $criteria_city->condition = 'users_id=:users_id'; $criteria_city->params = array(':users_id' => $model->guide1_id); $city = SegGuidesCities::model()->find($criteria_city); if(isset($city)){ $criteria_c = new CDbCriteria; $criteria_c->condition = 'idseg_cities=:idseg_cities'; $criteria_c->params = array(':idseg_cities' => $city->cities_id); $citie = SegCities::model()->find($criteria_c); $model->city_id_all = $citie->seg_cityname; $j = $citie->idseg_cities; }else{ $model->city_id_all = 'no element'; } //language if($model->language_id==NULL){ $i=0; $criteria_language = new CDbCriteria; $criteria_language->condition = 'users_id=:users_id'; $criteria_language->params = array(':users_id' => $model->guide1_id); $language = SegLanguagesGuides::model()->findAll($criteria_language); if(isset($language)){ foreach($language as $item){ $criteria_i = new CDbCriteria; $criteria_i->condition = 'id_languages=:id_languages'; $criteria_i->params = array(':id_languages' => $item->languages_id); $languages = Languages::model()->findAll($criteria_i); $model->language_id_all[$i] = $languages; $i++; } }else{ $model->language_id_all[0] = 'no element'; } }else{ $criteria_i = new CDbCriteria; $criteria_i->condition = 'id_languages=:id_languages'; $criteria_i->params = array(':id_languages' => $model->language_id); $language = Languages::model()->find($criteria_i); $model->language_id_all[0] = $language; } //tour canegories + tourroute //$tourroute_id_all; $z=0; $criteria_tour = new CDbCriteria; $criteria_tour->condition = 'usersid=:usersid'; $criteria_tour->params = array(':usersid' => $model->guide1_id); $tourcats = SegGuidesTourroutes::model()->findAll($criteria_tour); if(isset($tourcats)){ foreach($tourcats as $tourroute){ $criteria_t = new CDbCriteria; $criteria_t->condition = 'id_tour_categories=:id_tour_categories AND cityid=:cityid'; $criteria_t->params = array(':id_tour_categories' => $tourroute->tourroutes_id, ':cityid'=>$j); $tourroutes = SegTourroutes::model()->find($criteria_t); $model->tourroute_id_all[$z] = $tourroutes->name; $z++; } }else{ $model->tourroute_id_all[0] = 'no element'; } $result=$this->renderPartial('ajaxshow',array('model'=>$model)); }
</div> <div class="col-md-4"> <div class="form-group"> <label for="input_time" class="control-label">Zeit</label> <input type="text" id="input_time" class="form-control" disabled="true" value="<?php echo $model->starttime; ?> "> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="pick_lang" class="control-label">Sprache</label> <?php if (is_null($model->language_id)) { echo $form->dropDownList($model, 'language_id', CHtml::listData(SegLanguagesGuides::model()->with('languages')->findAll('users_id=' . $model->guide1_id), 'languages_id', 'languages.germanname'), array('id' => 'pick_lang', 'class' => 'form-control')); } else { echo '<input type="text" id="pick_lang" disabled="true" class="form-control" value="' . $model->language_ob->germanname . '">'; } ?> </div> </div> </div> </div> </div> <div class="row title"> <div class="col-md-2">2.</div> <div class="col-md-10">DATEN EINGEBEN</div> </div>
<label for="input_date" class="control-label">Date</label> <input type="text" id="input_date" class="form-control" disabled="true" value="<?php echo $model->date; ?>"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="input_time" class="control-label">Zeit</label> <input type="text" id="input_time" class="form-control" disabled="true" value="<?php echo $model->starttime; ?>"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="pick_lang" class="control-label">Sprache</label> <?php if(is_null($model->language_id)){ echo $form->dropDownList($model,'language_id', CHtml::listData (SegLanguagesGuides::model()->with('languages')->findAll('users_id='.$model->guide1_id),'languages_id', 'languages.germanname'), array('id'=>'pick_lang', 'class'=>'form-control')); } else { echo '<input type="text" id="pick_lang" disabled="true" class="form-control" value="'.$model->language_ob->germanname.'">'; } ?> </div> </div> </div> </div> </div>