示例#1
0
 public function actionGet_callme()
 {
     $tel = $_GET['tel'];
     $request = new Request();
     $request->telephone = (string) $tel;
     $request->dt_add = (string) time();
     $request->save();
     $email = Options::find()->where(['key' => 'email_to_prod'])->one();
     mail($email->value, "Заявка с вашего сайта", "Заказ звонка на номер {$tel}", "Content-type: text/html; charset=UTF-8\r\n");
 }
示例#2
0
 public function actionIndex()
 {
     $options = Options::find()->where(['key' => 'mainpage'])->one();
     $pageId = $options->value;
     $page = Pages::find()->where(['id' => $pageId])->one();
     //$content = $this->getBlocks($page);
     //$con = $this->render('index', ['content' => $content, 'page' => $page]);
     Template::get_header($page);
     $this->getBlocks($page);
     Template::get_footer();
 }
示例#3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Options::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'key', $this->key])->andFilterWhere(['like', 'value', $this->value]);
     return $dataProvider;
 }
示例#4
0
 public function actionChange_option()
 {
     $option = Options::find()->where(['key' => $_GET['key']])->one();
     $option->value = $_GET['val'];
     $option->save();
 }
示例#5
0
 public function actionGet_order_zam()
 {
     $tel = $_GET['tel'];
     $request = new Request();
     $request->telephone = (string) $tel;
     $request->dt_add = (string) time();
     $request->save();
     $email = Options::find()->where(['key' => 'email_to_prod'])->one();
     mail($email->value, "Заказ с вашего сайта", "С вашего сайта заказали выезд замерщика:<br>Телефон для связ: {$tel}", "Content-type: text/html; charset=UTF-8\r\n");
 }