Exemplo n.º 1
0
 /**
  * Генерация форм ввода зависимых от языка
  */
 protected function getInputLangBlocks($lang)
 {
     $html = parent::getInputLangBlocks($lang);
     // title
     $title = $this->inputHelper->textBox('title[' . $lang . ']', 'title', 'title', 200, false, $this->originalInsertValue['title'][$lang]);
     $html .= $this->inputHelper->createFormRow($title, false, 'Заголовок');
     // text
     $text = $this->inputHelper->textarea('text[' . $lang . ']', 'text', 'text', 50000, false, $this->originalInsertValue['text'][$lang]);
     $html .= $this->inputHelper->createFormRow($text, false, 'Текст');
     return $html;
 }
 protected function updateExecute()
 {
     parent::updateExecute();
     $queryContactsUnitsTypes = "UPDATE `ContactsUnitsTypes` SET ";
     $queryContactsUnitsTypes .= "`type` = '" . $this->insertValue['alias'] . "', ";
     $queryContactsUnitsTypes .= "`sequence` = '" . $this->insertValue['sequence'] . "', ";
     $queryContactsUnitsTypes .= "`show` = '" . $this->insertValue['show'] . "'";
     $queryContactsUnitsTypes .= " WHERE `type`='" . $this->editElement . "';";
     $queryContactsUnitsTypes_Lang = array();
     foreach ($this->langArray as $langData) {
         if (isset($this->insertValue['typeName'][$langData['lang']]) && $this->insertValue['typeName'][$langData['lang']] != null && $this->insertValue['typeName'][$langData['lang']] != "") {
             $query = "INSERT INTO `ContactsUnitsTypes_Lang` SET ";
             $query .= "`type` = '" . $this->insertValue['alias'] . "', ";
             $query .= "`lang` = '" . $langData['lang'] . "', ";
             $query .= "`typeName` = '" . $this->insertValue['typeName'][$langData['lang']] . "', ";
             $query .= "`topText` = " . InputValueHelper::mayByNull($this->insertValue['topText'][$langData['lang']]) . ", ";
             $query .= "`bottomText` = " . InputValueHelper::mayByNull($this->insertValue['bottomText'][$langData['lang']]) . "; ";
             $queryContactsUnitsTypes_Lang[] = $query;
         }
     }
     $queryContactsUnitsTypes_LangDel = "DELETE FROM  `ContactsUnitsTypes_Lang` WHERE  `type` = '" . $this->editElement . "';";
     if ($this->SQL_HELPER->insert($queryContactsUnitsTypes)) {
         $this->SQL_HELPER->insert($queryContactsUnitsTypes_LangDel);
         foreach ($queryContactsUnitsTypes_Lang as $queryContactsUnitsTypes_Lg) {
             $this->SQL_HELPER->insert($queryContactsUnitsTypes_Lg);
         }
         $this->uploadImage();
     } else {
         echo 'Данные не были добавлены. Попробуйте позже.';
     }
 }
Exemplo n.º 3
0
 protected function getData()
 {
     parent::getData();
     $query = "SELECT * FROM `Feedbacks` WHERE `id`='" . $this->editElement . "';";
     $this->data = $this->SQL_HELPER->select($query, 1);
     $query = "SELECT `parentFeedback` FROM `FeedbacksIsComments` WHERE `feedback`='" . $this->editElement . "';";
     $this->feedbackData = $this->SQL_HELPER->select($query, 1);
 }
 /**
  * Выполнение изменения в таблице
  */
 protected function updateExecute()
 {
     parent::updateExecute();
     $querylist = "UPDATE `MaterialsCategoriesList` SET ";
     $queryList .= "`name`='" . $this->insertValue['alias'] . "', ";
     $queryList .= "`showFullMaterialsText`='" . $this->insertValue['showFullMaterialsText'] . "', ";
     $queryList .= "`showShortMaterialsText`='" . $this->insertValue['showShortMaterialsText'] . "', ";
     $queryList .= "`showCategories`='" . $this->insertValue['showCategories'] . "', ";
     $queryList .= "`showCreated`='" . $this->insertValue['showCreated'] . "', ";
     $queryList .= "`showChange`='" . $this->insertValue['showChange'] . "',";
     $queryList .= "`categorialsAsURL`='" . $this->insertValue['categorialsAsURL'] . "', ";
     $queryList .= "`titleAsURL`='" . $this->insertValue['titleAsURL'] . "', ";
     $queryList .= "`showAllOnPage`='" . $this->insertValue['showAllOnPage'] . "', ";
     $queryList .= "`onPage`='" . $this->insertValue['onPage'] . "', ";
     $queryList .= "`maxPages`='" . $this->insertValue['maxPages'] . "'";
     $querylist .= "WHERE `name`='" . $this->editElement . "';";
     $queryList_Lang = array();
     foreach ($this->langArray as $langData) {
         if (isset($this->insertValue['name'][$langData['lang']]) && $this->insertValue['name'][$langData['lang']] != null && $this->insertValue['name'][$langData['lang']] != "" && isset($this->insertValue['description'][$langData['lang']]) && $this->insertValue['description'][$langData['lang']] != null && $this->insertValue['description'][$langData['lang']] != "") {
             $query = "INSERT INTO `MaterialsCategoriesList_Lang` SET ";
             $query .= "`list`='" . $this->insertValue['alias'] . "', ";
             $query .= "`lang`='" . $langData['lang'] . "', ";
             $query .= "`name`='" . $this->insertValue['name'][$langData['lang']] . "', ";
             $query .= "`description`='" . $this->insertValue['description'][$langData['lang']] . "';";
             $queryList_Lang[] = $query;
         }
     }
     $queryCategoriesInList = array();
     foreach ($this->insertValue['categories'] as $category => $sequence) {
         if ($sequence != null && $sequence != '') {
             $queryInList = "INSERT INTO `MaterialsCategoriesInList` SET ";
             $queryInList .= "`category`='" . $category . "', ";
             $queryInList .= "`list`='" . $this->insertValue['alias'] . "', ";
             $queryInList .= "`sequence`='" . $sequence . "' ";
             $queryInList .= ";";
             $queryCategoriesInList[] = $queryInList;
         }
     }
     $queryList_LangDel = "DELETE FROM  `MaterialsList_Lang` WHERE  `list` =  '" . $this->editElement . "';";
     $this->SQL_HELPER->insert($queryList_LangDel);
     $queryCategoriesInListDel = "DELETE FROM `MaterialsCategoriesInList` WHERE `list` =  '" . $this->editElement . "';";
     $this->SQL_HELPER->insert($queryCategoriesInListDel);
     $this->SQL_HELPER->insert($querylist);
     foreach ($queryList_Lang as $queryList_Lg) {
         $this->SQL_HELPER->insert($queryList_Lg);
     }
     foreach ($queryCategoriesInList as $queryCategoriesInL) {
         $this->SQL_HELPER->insert($queryCategoriesInL);
     }
 }
 protected function updateExecute()
 {
     parent::updateExecute();
     $queryContactsWorkers = "UPDATE `ContactsWorkers` SET ";
     $queryContactsWorkers .= "`worker` = '" . $this->insertValue['alias'] . "', ";
     $queryContactsWorkers .= "`post` = '" . $this->insertValue['post'] . "', ";
     $queryContactsWorkers .= "`email1` = '" . $this->insertValue['email1'] . "', ";
     $queryContactsWorkers .= "`email2` = '" . $this->insertValue['email2'] . "', ";
     $queryContactsWorkers .= "`phoneText1` = '" . $this->insertValue['phoneText1'] . "', ";
     $queryContactsWorkers .= "`phone1` = '" . $this->insertValue['phone1'] . "', ";
     $queryContactsWorkers .= "`phoneText2` = '" . $this->insertValue['phoneText2'] . "', ";
     $queryContactsWorkers .= "`phone2` = '" . $this->insertValue['phone2'] . "', ";
     $queryContactsWorkers .= "`additional1` = '" . $this->insertValue['additional1'] . "', ";
     $queryContactsWorkers .= "`additional2` = '" . $this->insertValue['additional2'] . "' ";
     $queryContactsWorkers .= " WHERE `worker`='" . $this->editElement . "';";
     $queryContactsWorkers_LangDel = "DELETE FROM  `ContactsWorkers_Lang` WHERE  `worker` = '" . $this->editElement . "';";
     $queryContactsWorkers_Lang = array();
     foreach ($this->langArray as $langData) {
         if (isset($this->insertValue['fio'][$langData['lang']]) && $this->insertValue['fio'][$langData['lang']] != null && $this->insertValue['fio'][$langData['lang']] != "") {
             $queryLang = "INSERT INTO `ContactsWorkers_Lang` SET ";
             $queryLang .= "`worker`='" . $this->insertValue['alias'] . "', ";
             $queryLang .= "`lang`='" . $langData['lang'] . "', ";
             $queryLang .= "`fio`='" . $this->insertValue['fio'][$langData['lang']] . "', ";
             $queryLang .= "`info`='" . $this->insertValue['info'][$langData['lang']] . "';";
             $queryContactsWorkers_Lang[] = $queryLang;
         }
     }
     $queryContactsUnitsWokersDel = "DELETE FROM `ContactsUnitsWokers` WHERE `worker` = '" . $this->editElement . "';";
     $queryContactsUnitsWokers = array();
     if ($this->insertValue['units'] != null) {
         foreach ($this->insertValue['units'] as $unit) {
             $query = "INSERT INTO `ContactsUnitsWokers` SET ";
             $query .= "`unit`='" . $unit . "', ";
             $query .= "`worker`='" . $this->insertValue['alias'] . "';";
             $queryContactsUnitsWokers[] = $query;
         }
     }
     if ($this->SQL_HELPER->insert($queryContactsWorkers)) {
         //        echo var_dump($queryContactsWorkers) .'<hr>';
         $this->SQL_HELPER->insert($queryContactsWorkers_LangDel);
         //        echo var_dump($queryContactsWorkers_LangDel) .'<hr>';
         foreach ($queryContactsWorkers_Lang as $queryContactsWorkers_Lg) {
             //        echo var_dump($queryContactsWorkers_Lg) .'<hr>';
             $this->SQL_HELPER->insert($queryContactsWorkers_Lg);
         }
         $this->SQL_HELPER->insert($queryContactsUnitsWokersDel);
         //        echo var_dump($queryContactsUnitsWokersDel) .'<hr>';
         foreach ($queryContactsUnitsWokers as $queryContactsUnitsWoker) {
             $this->SQL_HELPER->insert($queryContactsUnitsWoker);
             //        echo var_dump($queryContactsUnitsWoker) .'<hr>';
         }
     } else {
         echo 'Данные не были добавлены. Попробуйте позже.';
     }
 }
 private function setDayTime($day)
 {
     $keyHS = $day . 'H_s';
     $keyMS = $day . 'M_s';
     $keyHE = $day . 'H_e';
     $keyME = $day . 'M_e';
     $this->insertValue[$keyHS] = parent::getPostValue($keyHS);
     $this->insertValue[$keyMS] = parent::getPostValue($keyMS);
     $this->insertValue[$keyHE] = parent::getPostValue($keyHE);
     $this->insertValue[$keyME] = parent::getPostValue($keyME);
     if ($this->insertValue[$keyHS] != null && $this->insertValue[$keyHE] != null) {
         $this->insertValue[$keyMS] = "0";
         $this->insertValue[$keyME] = "0";
     }
 }
 protected function updateExecute()
 {
     parent::updateExecute();
     $queryWorkersPosts = "UPDATE `ContactsWorkersPosts` SET ";
     $queryWorkersPosts .= "`post`='" . $this->insertValue['alias'] . "', ";
     $queryWorkersPosts .= "`sequence`=" . InputValueHelper::mayByNull($this->insertValue['sequence']) . "";
     $queryWorkersPosts .= " WHERE `post`='" . $this->editElement . "';";
     $queryWorkersPosts_Lang = array();
     foreach ($this->langArray as $langData) {
         if (isset($this->insertValue['postName'][$langData['lang']]) && $this->insertValue['postName'][$langData['lang']] != null && $this->insertValue['postName'][$langData['lang']] != "") {
             $queryLang = "INSERT INTO `ContactsWorkersPosts_Lang` SET ";
             $queryLang .= "`post`='" . $this->insertValue['alias'] . "',";
             $queryLang .= "`lang`='" . $langData['lang'] . "',";
             $queryLang .= "`postName`='" . $this->insertValue['postName'][$langData['lang']] . "';";
             $queryWorkersPosts_Lang[] = $queryLang;
         }
     }
     $queryContactsUnitsTypes_LangDel = "DELETE FROM  `ContactsWorkersPosts_Lang` WHERE  `post` = '" . $this->editElement . "';";
     if ($this->SQL_HELPER->insert($queryWorkersPosts)) {
         $this->SQL_HELPER->insert($queryContactsUnitsTypes_LangDel);
         foreach ($queryWorkersPosts_Lang as $queryWorkersPosts_Lg) {
             $this->SQL_HELPER->insert($queryWorkersPosts_Lg);
         }
     } else {
         echo 'Данные не были добавлены. Попробуйте позже.';
     }
 }
 protected function getData()
 {
     parent::getData();
     $query = "SELECT * FROM `MaterialsCategories` WHERE `alias`='" . $this->editElement . "';";
     $this->data = $this->SQL_HELPER->select($query, 1);
     $query = "SELECT * FROM `MaterialsCategories_Lang` WHERE `category`='" . $this->editElement . "';";
     $this->categoryLangData = $this->SQL_HELPER->select($query);
     $query = "SELECT * FROM `MaterialsCategoriesInList` WHERE `category`='" . $this->editElement . "';";
     $this->categoryListsData = $this->SQL_HELPER->select($query);
 }
Exemplo n.º 9
0
 protected function getData()
 {
     parent::getData();
     $query = "SELECT * FROM `FeedbacksListIP` WHERE `ip`='" . $this->editElement . "';";
     $this->data = $this->SQL_HELPER->select($query, 1);
 }