Beispiel #1
0
 $stage_doc = __paramInit('int', 'doc');
 if ($action == 'arbitration') {
     $overtime = strtotime($sbr->data['dateEndLC'] . ' - ' . pskb::ARBITRAGE_PERIOD_DAYS . ' day');
     // Сб, Вс не рабочие дни
     if (date('w', $overtime) == 0 || date('w', $overtime) == 6) {
         $d = date('w', $overtime) == 6 ? 1 : 2;
         $overtime = $overtime - $d * 3600 * 24;
     }
     if (time() > $overtime) {
         header_location_exit('/' . sbr::NEW_TEMPLATE_SBR . "/?id={$sbr->id}");
     }
     if (!($iagree = __paramInit('bool', NULL, 'iagree'))) {
         $attachedfiles_arb = new attachedfiles($_POST['attachedfiles_session']);
         $attachedfiles_files_arb = $attachedfiles_arb->getFiles();
         if ($attachedfiles_files_arb) {
             $attachedfiles_files_arb = attachedfiles::getInitJSON($attachedfiles_files_arb);
         }
         $stage->error['arbitrage']['iagree'] = 'Необходимо подтверждение';
     } elseif ($stage->status != sbr_stages::STATUS_NEW) {
         $descr = stripslashes($_POST['descr']);
         $attachedfiles_arb = new attachedfiles($_POST['attachedfiles_session']);
         $attachedfiles_files_arb = $attachedfiles_arb->getFiles();
         if ($stage->arbitrage($descr, $attachedfiles_files_arb)) {
             header_location_exit('/' . sbr::NEW_TEMPLATE_SBR . "/?id={$sbr->id}");
         }
     }
     $attachedfiles_arb = new attachedfiles($_POST['attachedfiles_session']);
     $attachedfiles_files_arb = $attachedfiles_arb->getFiles(array(1, 3), null, true);
     if (is_array($attachedfiles_files_arb)) {
         foreach ($attachedfiles_files_arb as &$arbFile) {
             $arbFile['tsize'] = iconv('CP1251', 'UTF-8', $arbFile['tsize']);