Example #1
0
 public function delete($id)
 {
     if (About::destroy($id)) {
         return redirect()->back()->with('msg', 'Текст о компании удален');
     }
     return redirect()->back()->with('warning', 'Не удалось удалить');
 }
 public function postEdit(Request $request)
 {
     $this->validate($request, About::$rules);
     $about = About::getAbout();
     $about->fill($request->all());
     $about->save();
     return redirect()->action('AboutController@getEdit');
 }
Example #3
0
 public function homepage()
 {
     $params = array('logo' => Title::findOrFail(1), 'timer' => Timer::findOrFail(1), 'about' => About::findOrFail(1), 'contacts' => Contact::where('enabled', '=', true)->orderBy('id', 'ASC')->get(), 'grouped' => GroupRepository::grouped(), 'offices' => Office::where('enabled', '=', true)->orderBy('position', 'ASC')->get(), 'title' => 'TWIGA – крупнейшая независимая коммуникационная группа в России и странах СНГ');
     /*if (Request::has('r')) {
     			$r = Request::get('r');
     			Session::set('r', $r);
     
     			return redirect('/#' . $r);
     		}*/
     $view = Agent::isTablet() || Request::has('t') ? 'tablet.homepage' : (Agent::isMobile() || Request::has('m') ? 'mobile.homepage' : 'index.homepage');
     return view($view, $params);
 }
Example #4
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = About::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, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'name_en', $this->name_en])->andFilterWhere(['like', 'name_pt', $this->name_pt])->andFilterWhere(['like', 'intro_en', $this->intro_en])->andFilterWhere(['like', 'intro_pt', $this->intro_pt])->andFilterWhere(['like', 'content_en', $this->content_en])->andFilterWhere(['like', 'content_pt', $this->content_pt]);
     return $dataProvider;
 }
Example #5
0
 public function save(Request $request)
 {
     $sid = Session::get('session_id');
     $name = Input::get('name');
     $phone = Input::get('phone');
     $address = Input::get('address');
     $weixin_no = Input::get('weixin_no');
     $blog = Input::get('blog');
     $weibo = Input::get('weibo');
     $company = Input::get('company');
     $jobs = Input::get('jobs');
     $city = Input::get('city');
     $country = Input::get('country');
     $title = Input::get('title');
     $email = Input::get('email');
     $content = 'Hi,我的名字是' . $name . ',目前在' . $company . '工作,任职为' . $jobs;
     $user = Models\User::find($sid);
     $user->name = $name;
     $user->phone = $phone;
     $user->address = $address;
     $user->save();
     $user_info = Models\User_info::find($sid);
     $user_info->title = $title;
     $user_info->company = $company;
     $user_info->jobs = $jobs;
     $user_info->email = $email;
     $user_info->city = $city;
     $user_info->country = $country;
     $user_info->about_no = $sid;
     $user_info->save();
     $about = Models\About::find($sid);
     $about->name = $name;
     $about->content = $content;
     $about->main_email = $email;
     $about->blog = $blog;
     $about->weibo = $weibo;
     $about->weixin_no = $weixin_no;
     $about->save();
     // print_r(Input::all());
     return view('admin.about.index')->with('nav_class', 'start active');
 }
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        $about = \App\Models\About::find(1);
        if ($about) {
            $about->delete();
        }
        \App\Models\About::create(['id' => 1, 'text' => '
                <h1>О Компании</h1>

                <p>Если вас интересуют системы безопасности, а именно охранной и пожарной сигнализации, видеонаблюдения, контроля и управления доступом, видеодомофоны, GSM сигнализации, турникеты, шлагбаумы, балларды, то компания &laquo;Система ПРО&raquo; станет для вас настоящим помощником. Мы занимаемся:</p>

                <ul>
                    <li>профессиональным монтажом систем безопасности. Наши специалисты имеют в своем арсенале огромный опыт проведения подобных работ, и самое современное оборудование;</li>
                    <li>пуско-наладочными работами, которые подразумевают не только подключение необходимого оборудования, но и его диагностику;</li>
                    <li>сдачей систем безопасности в эксплуатацию. Только в том случае, если все оборудование полностью соответствует требованиям заказчика, оно допускается до работы. Мы полностью исключаем возможность появления каких-то сбоев в работе в течение гарантийного срока эксплуатации;</li>
                    <li>последующим техническим обслуживанием. Мы регулярно производим проверку наших систем безопасности, и производим их ремонт и диагностику в течение всего цикла жизни.</li>
                </ul>

                <p>Наши специалисты занимаются не только созданием типовых проектов, но и индивидуальных, которые на все сто процентов учитывают и удовлетворяют требования заказчика.</p>

            ']);
    }
Example #7
0
 /**
  * Finds the About model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return About the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = About::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #8
0
 public function getAbout()
 {
     return $this->hasOne(About::className(), ['id' => 'id']);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     About::insert(['description' => 'Descripcion de la empresa', 'mision' => 'Mision de la empresa', 'vision' => 'Vision de la empresa', 'history' => 'Historia breve de la empresa', 'youtube_url' => 'https://www.youtube.com/embed/sGbxmsDFVnE', 'image' => 'images/logo.jpg']);
 }
 public function aboutUpdate(UpdateAboutRequest $request)
 {
     $about = About::all()->first();
     $about->description = $request['description'];
     $about->mision = $request['mision'];
     $about->vision = $request['vision'];
     $about->history = $request['history'];
     $about->youtube_url = $request['youtube_url'];
     if (isset($request['image'])) {
         $about->image = $this->file_service->upload($request->file('image'), 'about');
     }
     $about->save();
     Session::flash('message', 'Se actualizaron los datos!');
     Session::flash('alert-class', 'alert-success');
     return redirect()->back();
 }
Example #11
0
 public function about()
 {
     $about = About::all()->first();
     return view('external.about', compact('about'));
 }
Example #12
0
 public function about(About $about)
 {
     $this->data['about'] = $about->getActive();
     return view('pages.about', $this->data);
 }