示例#1
0
 /**
  * @return array[int]Date
  */
 public function Dates()
 {
     $current = $this->_begin->GetDate();
     $end = $this->_end->GetDate();
     $dates = array($current);
     for ($day = 0; $current->Compare($end) < 0; $day++) {
         $current = $current->AddDays(1);
         $dates[] = $current;
     }
     return $dates;
 }
示例#2
0
 /**
  * @return Date[]
  */
 public function Dates()
 {
     $current = $this->_begin->GetDate();
     if ($this->_end->IsMidnight()) {
         $end = $this->_end->AddDays(-1)->GetDate();
     } else {
         $end = $this->_end->GetDate();
     }
     $dates = array($current);
     for ($day = 0; $current->Compare($end) < 0; $day++) {
         $current = $current->AddDays(1);
         $dates[] = $current;
     }
     return $dates;
 }
示例#3
0
         $sess_date = $date->GetNowFull();
         $sess_ip = "";
         $sess_user_id = "";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($sess_date);
     $date->ConvertToFullDate();
     $session = new Session();
     $session->SetDatabase($database);
     $session->SetId($sess_id);
     $session->SetActive($sess_active);
     $session->SetName($date->GetDate());
     $session->SetIp($sess_ip);
     $session->SetUser($sess_user_id);
     if ($session->Update()) {
         $message = $screen_module_name . " alterado com sucesso.";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 4) {
     $session = new Session();
     $session->SetDatabase($database);
     $session->SetId($sess_id);
     if ($session->Delete()) {
         $date = new Date();
         $message = $screen_module_name . " excluído com sucesso.";
         }
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($para_date);
     $date->ConvertToFullDate();
     if ($date->VerifyDate()) {
         $message = $date->GetMessage();
         $message_position = 2;
     } else {
         $paragraph = new Paragraph();
         $paragraph->SetDatabase($database);
         $paragraph->SetId($para_id);
         $paragraph->SetText(str_replace("\"", "\\\"", $para_text));
         $paragraph->SetDate($date->GetDate());
         $paragraph->SetOrder($para_order);
         $paragraph->SetUser($para_user_id);
         $paragraph->SetPage($para_page_id);
         if ($paragraph->Update()) {
             $message_position = 6;
             $message = $screen_module_name . " alterado com sucesso.";
         } else {
             $message_position = 6;
             $message = "Problemas na operação.";
         }
     }
 }
 if ($action == 4) {
     $paragraph = new Paragraph();
     $paragraph->SetDatabase($database);
示例#5
0
         }
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetDate($mess_date);
     $date->ConverToFullDate();
     if ($date->VerifyDate()) {
         $message = $date->GetMessage();
         $message_position = 2;
     } else {
         $message = new Message();
         $message->SetDatabase($database);
         $message->SetId($mess_id);
         $message->SetText(str_replace("\"", "\\\"", $mess_text));
         $message->SetDate($date->GetDate());
         $message->SetUser($mess_user_id);
         $message->SetTopic($mess_topc_id);
         if ($message->Update()) {
             $message_position = 6;
             $message = $screen_module_name . " alterado com sucesso.";
         } else {
             $message_position = 6;
             $message = "Problemas na operação.";
         }
     }
 }
 if ($action == 4) {
     $message = new Message();
     $message->SetDatabase($database);
     $message->SetId($mess_id);
示例#6
0
         $shou_id = "";
         $shou_date = $date->GetNowFull();
         $shou_text = "";
         $shou_user_id = "";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($shou_date);
     $date->ConvertToFullDate();
     $shout = new Shout();
     $shout->SetDatabase($database);
     $shout->SetId($shou_id);
     $shout->SetDate($date->GetDate());
     $shout->SetText($shou_text);
     $shout->SetUser($shou_user_id);
     $shou_id = $shout->GetId();
     $shou_date = $shout->GetConverted();
     $shou_text = $shout->GetText();
     $shou_user_id = $shout->GetUser();
     if ($shout->Update()) {
         $message = $screen_module_name . " alterado com sucesso.";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 4) {
     $shout = new Shout();
     $shout->SetDatabase($database);
示例#7
0
 /**
  * @return Date
  */
 public function FirstDay()
 {
     return $this->date->GetDate();
 }
示例#8
0
         $news_date = $date->GetNowFull();
         $news_text = "";
         $news_user_id = "";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($news_date);
     $date->ConvertToFullDate();
     $news = new News();
     $news->SetDatabase($database);
     $news->SetId($news_id);
     $news->SetTitle($news_title);
     $news->SetDate($date->GetDate());
     $news->SetText($news_text);
     $news->SetUser($news_user_id);
     $news_id = $news->GetId();
     $news_title = $news->GetTitle();
     $news_date = $news->GetDate();
     $news_text = $news->GetText();
     $news_user_id = $news->GetUser();
     if ($news->Update()) {
         $message = $screen_module_name . " alterada com sucesso.";
     } else {
         $message = "Problemas na operação.";
     }
 }
 if ($action == 4) {
     $date = new Date();
示例#9
0
 public function IsDateReservable(Date $date)
 {
     return !$date->GetDate()->LessThan(Date::Now()->GetDate());
 }
示例#10
0
         }
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($page_date);
     $date->ConvertToFullDate();
     if ($date->VerifyDate()) {
         $message = $date->GetMessage();
         $message_position = 2;
     } else {
         $page = new Page();
         $page->SetDatabase($database);
         $page->SetId($page_id);
         $page->SetNumber($page_number);
         $page->SetDate($date->GetDate());
         $page->SetUser($page_user_id);
         $page->SetArticle($page_arti_id);
         if ($page->Update()) {
             $message_position = 5;
             $message = $screen_module_name . " alterada com sucesso.";
         } else {
             $message_position = 5;
             $message = "Problemas na operação.";
         }
     }
 }
 if ($action == 4) {
     $page = new Page();
     $page->SetDatabase($database);
     $page->SetId($page_id);
示例#11
0
 public function GetDateReturnsDateAsOfMidnight()
 {
     $date = new Date('2009-10-10 10:10:10');
     $onlyDate = $date->GetDate();
     $this->assertEquals(0, $onlyDate->Hour());
     $this->assertEquals(0, $onlyDate->Minute());
     $this->assertEquals(0, $onlyDate->Second());
 }
示例#12
0
         }
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetDate($arti_date);
     $date->ConvertToDate();
     if ($date->VerifyDate()) {
         $message = $date->GetMessage();
         $message_position = 2;
     } else {
         $article = new Article();
         $article->SetDatabase($database);
         $article->SetId($arti_id);
         $article->SetTitle($arti_title);
         $article->SetDate($date->GetDate());
         $article->SetUser($arti_user_id);
         $article->SetSubject($arti_subj_id);
         if ($article->Update()) {
             $message_position = 5;
             $message = $screen_module_name . " alterado com sucesso.";
         } else {
             $message_position = 5;
             $message = "Problemas na operação.";
         }
     }
 }
 if ($action == 4) {
     $article = new Article();
     $article->SetDatabase($database);
     $article->SetId($arti_id);
示例#13
0
     }
 }
 if ($action == 3) {
     $date = new Date();
     $date->SetConverted($topc_date);
     $date->ConvertToDate();
     if ($date->VerifyDate()) {
         $message = $date->GetMessage();
         $message_position = 2;
     } else {
         $topic = new Topic();
         $topic->SetDatabase($database);
         $topic->SetId($topc_id);
         $topic->SetTitle(str_replace("\"", "\\\"", $topc_title));
         $topic->SetText(str_replace("\"", "\\\"", $topc_text));
         $topic->SetDate($date->GetDate());
         $topic->SetLevel($topc_level);
         $topic->SetUser($topc_user_id);
         $topic->SetTopic($topc_topc_id);
         if ($topic->Update()) {
             $message_position = 7;
             $message = $screen_module_name . " alterado com sucesso.";
         } else {
             $message_position = 7;
             $message = "Problemas na operação.";
         }
     }
 }
 if ($action == 4) {
     $topic = new Topic();
     $topic->SetDatabase($database);