Ejemplo n.º 1
0
 }
 $users_in_cataloghistory = $catalognew_class->getUsersInCataloghistory($catalog);
 //$details .= "<br><b>Подтверждали: </b> ";
 foreach ($users_in_cataloghistory as $rows_user) {
     $data_user = array('user_id' => $rows_user["user"], 'userlogin' => $rows_user["userlogin"], 'star' => $rows_user["star"], 'action' => 'Редактирование');
     $tpl['catalognew']['show']['userwork'][] = $data_user;
 }
 if ($submitcataloghistory && $_SERVER['REQUEST_METHOD'] == 'POST') {
     $answercataloghistory = (array) request('answercataloghistory');
     if (!$tpl['user']['user_id']) {
         $tpl['submitcataloghistory']['error'][] = "Только авторизованные пользователи могут делать записи";
     } elseif (!sizeof($answercataloghistory)) {
         $tpl['submitcataloghistory']['error'][] = "Выберите значения!";
     } else {
         foreach ($answercataloghistory as $key => $value) {
             $rows = $catalognew_class->getUserFromHistory($key);
             $useradd = $rows["user"];
             $agreevalue = $value;
             if ($useradd != $tpl['user']['user_id']) {
                 $rows = $catalognew_class->getCataloghistoryagreement($key, $tpl['user']['user_id']);
                 if (!$rows) {
                     $catalognew_class->addCataloghistoryagreement($key, $value, $tpl['user']['user_id']);
                     $cataloghistory = $key;
                     $CatalogHistoryAgreement = $catalognew_class->CatalogHistoryAgreement($catalog, $cataloghistory, $useradd);
                     if ($CatalogHistoryAgreement) {
                         $tpl['submitcataloghistory']['error'][] = "Информация успешно записана";
                     }
                 } else {
                     $tpl['submitcataloghistory']['error'][] = "Вы уже голосовали";
                 }
             } else {