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"); }
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(); }
/** * 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; }
public function actionChange_option() { $option = Options::find()->where(['key' => $_GET['key']])->one(); $option->value = $_GET['val']; $option->save(); }
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"); }