function editPage($id) { include_once 'login.php'; include_once 'database_conn.php'; include_once 'showEventFunction.php'; $pageHeader = "Event Edit Page"; $sql = "SELECT * FROM te_events WHERE eventID = {$id}"; $rslt = mysqli_query($conn, $sql) or die(mysqli_error($conn)); // error message return if return empty result $row = mysqli_fetch_row($rslt); $venues = getFromDb($conn, "SELECT * FROM te_venue"); $categories = getFromDb($conn, "SELECT * FROM te_category"); $output = "<h1>{$pageHeader}</h1>"; $i = 1; $output .= "<form id=\"editForm\" action=\"handleEditPage.php\" method=\"post\">"; $output .= "<table border=0 >"; $output .= createRowData("Title", createTextField("title", $row[$i++])); $output .= createRowData("Description", createTextArea("desc", $row[$i++], 5, 40)); $output .= createRowData("Venue Name", createCombobox("venue", $row[$i++], $venues)); $output .= createRowData("Category", createCombobox("category", $row[$i++], $categories)); $output .= createRowData("Start Time", createDate("startTime", $row[$i++])); $output .= createRowData("End Time", createDate("endTime", $row[$i++])); $output .= createRowData("Price", createTextField("price", $row[$i++])); $output .= "<tr><td><input type=\"submit\" name=\"submit\" value=\"Submit\"></td></tr>"; $output .= "<input type=\"hidden\" name=\"e_id\" value=\"{$id}\">"; $output .= "</table></form>"; mysqli_free_result($rslt); mysqli_close($conn); return $output; }
/** * * Counts holidays per week for a given timeframe. * @param int $domain * @param int $start * @param int $end * @return multitype:number */ public static function getCountPerWeek($domain, $start, $end) { $holidays = HolidayQuery::create()->filterByDomain($domain)->filterByDate($start, Criteria::GREATER_EQUAL)->filterByDate($end, Criteria::LESS_EQUAL)->find(); $holidaysWeeks = array(); foreach ($holidays as $holiday) { $date = createDate($holiday->getDate()); $key = $date->format('W-Y'); if (array_key_exists($key, $holidaysWeeks)) { $holidaysWeeks[$key] = $holidaysWeeks[$key] + 1; } else { $holidaysWeeks[$key] = 1; } } return $holidaysWeeks; }
function searchPage() { include_once 'login.php'; include_once 'database_conn.php'; include_once 'showEventFunction.php'; $pageHeader = "Search Page"; $backURL = "<br/><a href = \"index.php\">Back to Home</a>"; $venues = getFromDb($conn, "SELECT * FROM te_venue"); $categories = getFromDb($conn, "SELECT * FROM te_category"); $output = "<h1>{$pageHeader}</h1>"; $output .= "<form id=\"searchForm\" action=\"handleSearchPage.php\" method=\"post\">"; $output .= "<table border=0 >"; $output .= createRowData("Title", createTextField("title", "")); $output .= createRowData("Venue Name", createCombobox("venue", "", $venues)); $output .= createRowData("Category", createCombobox("category", "", $categories)); $output .= createRowData("Start Time", createDate("startTime", "")); $output .= createRowData("End Time", createDate("endTime", "")); $output .= createRowData("Price", createTextField("price", "")); $output .= "<tr><td><input type=\"submit\" name=\"submit\" value=\"Search\"></td></tr>"; $output .= "</table></form>"; return $output . $backURL; }
preg_match("|\\[status:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[status:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["status"] . " " . $status[$matches[1]]; } if (ereg("\\[priority:([0-9])\\]", $listUpdates->upd_comments[$i])) { preg_match("|\\[priority:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[priority:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["priority"] . " " . $priority[$matches[1]]; } if (ereg("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", $listUpdates->upd_comments[$i])) { preg_match("|\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["due_date"] . " " . $matches[1]; } $abbrev = substr($listUpdates->upd_comments[$i], 0, 100); echo "<b>" . $j . ".</b> <i>" . createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession']) . "</i> {$abbrev}"; if (100 < strlen($listUpdates->upd_comments[$i])) { echo "...<br>"; } else { echo "<br>"; } $j++; } echo "<br>" . buildLink("../meetings/historymeeting.php?type=1&item={$id}", $strings["show_details"], LINK_INSIDE); } else { echo $strings["no_items"]; } echo "</td></tr>"; $block1->closeContent(); $block1->closeToggle(); $block1->closeForm();
<?php #Application name: PhpCollab #Status page: 0 $checkSession = "true"; include "../includes/library.php"; include "../includes/jpgraph/jpgraph.php"; include "../includes/jpgraph/jpgraph_gantt.php"; $tmpquery = "WHERE tas.id = '" . $task . "'"; $taskDetail = new request(); $taskDetail->openTasks($tmpquery); $tmpquery = "WHERE pro.id = '" . $taskDetail->tas_project[0] . "'"; $projectDetail = new request(); $projectDetail->openProjects($tmpquery); $projectDetail->pro_created[0] = createDate($projectDetail->pro_created[0], $timezoneSession); $projectDetail->pro_name[0] = str_replace('"', '"', $projectDetail->pro_name[0]); $projectDetail->pro_name[0] = str_replace("'", "'", $projectDetail->pro_name[0]); $graph = new GanttGraph(); $graph->SetBox(); $graph->SetMarginColor("white"); $graph->SetColor("white"); $graph->title->Set($strings["task"] . " " . $taskDetail->tas_name[0]); $graph->subtitle->Set("(" . $strings["created"] . ": " . $taskDetail->tas_created[0] . ")"); $graph->title->SetFont(FF_FONT1); $graph->SetColor("white"); $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); $graph->scale->week->SetFont(FF_FONT0); $graph->scale->year->SetFont(FF_FONT1); $tmpquery = "WHERE subtas.task = '{$task}' AND subtas.start_date != '--' AND subtas.due_date != '--' AND tas.published != '1' ORDER BY subtas.due_date"; $listTasks = new request();
//--- header --- $breadcrumbs[] = buildLink("../clients/listclients.php?", $strings["organizations"], LINK_INSIDE); $breadcrumbs[] = $strings["organizations"]; //--- content ---- require_once "../themes/" . THEME . "/header.php"; $block1 = new block(); $block1->form = "ecD"; $block1->openForm("../projects/listprojects.php#" . $block1->form . "Anchor"); $block1->headingToggle($strings["organization"] . " : " . $clientDetail->org_name[0]); $block1->openPaletteIcon(); $block1->paletteIcon(0, "remove", $strings["delete"]); $block1->paletteIcon(1, "edit", $strings["edit"]); $block1->closePaletteIcon(); $block1->openContent(); $block1->contentTitle($strings["details"]); $block1->contentRow($strings["name"], $clientDetail->org_name[0]); $block1->contentRow($strings["address"], $clientDetail->org_address1[0]); $block1->contentRow($strings["phone"], $clientDetail->org_phone[0]); $block1->contentRow($strings["url"], buildLink($clientDetail->org_url[0], $clientDetail->org_url[0], LINK_OUT)); $block1->contentRow($strings["email"], buildLink($clientDetail->org_email[0], $clientDetail->org_email[0], LINK_MAIL)); $block1->contentTitle($strings["details"]); $block1->contentRow($strings["comments"], nl2br($clientDetail->org_comments[0])); $block1->contentRow($strings["created"], createDate($clientDetail->org_created[0], $_SESSION['timezoneSession'])); $block1->closeContent(); $block1->closeToggle(); $block1->closeForm(); $block1->openPaletteScript(); $block1->paletteScript(0, "remove", "../clients/deleteclients.php?id=" . $clientDetail->org_id[0] . "", "true,true,false", $strings["delete"]); $block1->paletteScript(1, "edit", "../clients/editclient.php?id=" . $clientDetail->org_id[0] . "", "true,true,false", $strings["edit"]); $block1->closePaletteScript("", ""); require_once "../themes/" . THEME . "/footer.php";
$block1->openForm("../reports/listreports.php#" . $block1->form . "Anchor"); $block1->heading($strings["my_reports"]); $block1->openPaletteIcon(); $block1->paletteIcon(0, "add", $strings["add"]); $block1->paletteIcon(1, "remove", $strings["delete"]); $block1->closePaletteIcon(); $block1->sorting("reports", $sortingUser->sor_reports[0], "rep.name ASC", $sortingFields = array(0 => "rep.name", 1 => "rep.created")); $tmpquery = "WHERE rep.owner = '" . $_SESSION['idSession'] . "' ORDER BY {$block1->sortingValue}"; $listReports = new request(); $listReports->openReports($tmpquery); $comptListReports = count($listReports->rep_id); if ($comptListReports != "0") { $block1->openResults(); $block1->labels($labels = array(0 => $strings["name"], 1 => $strings["created"]), "false"); for ($i = 0; $i < $comptListReports; $i++) { $block1->openRow($listReports->rep_id[$i]); $block1->checkboxRow($listReports->rep_id[$i]); $block1->cellRow(buildLink("../reports/resultsreport.php?id=" . $listReports->rep_id[$i], $listReports->rep_name[$i], LINK_INSIDE)); $block1->cellRow(createDate($listReports->rep_created[$i], $_SESSION['timezoneSession'])); } $block1->closeResults(); } else { $block1->noresults(); } $block1->closeFormResults(); $block1->block_close(); $block1->openPaletteScript(); $block1->paletteScript(0, "add", "../reports/createreport.php?", "true,true,true", $strings["add"]); $block1->paletteScript(1, "remove", "../reports/deletereports.php?", "false,true,true", $strings["delete"]); $block1->closePaletteScript($comptListReports, $listReports->rep_id); require_once "../themes/" . THEME . "/footer.php";
} $block0->closeContent(); $block0->block_close(); if ($comptListProjects != "0") { for ($j = 0; $j < $comptListProjects; $j++) { $projectTitle = $listProjects->pro_name[$j]; $projectId = $listProjects->pro_id[$j]; $projectPriority = $listProjects->pro_priority[$j]; $blockProject = new block(); $blockProject->headingForm(buildLink("../projects/viewproject.php?id=" . $projectId, $projectTitle, LINK_INSIDE)); $blockProject->openContent(); // correct order???? $blockProject->contentTitle($strings["details"]); $blockProject->contentRow($strings["priority"], "<img src=\"../themes/" . THEME . "/gfx_priority/" . $projectPriority . ".gif\" alt=\"\"> " . $priority[$projectPriority]); $blockProject->contentRow($strings["created"], createDate($listProjects->pro_created[$j], $_SESSION['timezoneSession'])); $blockProject->contentRow($strings["modified"], createDate($listProjects->pro_modified[$j], $_SESSION['timezoneSession'])); if ($listProjects->pro_org_id[$j] == "1") { $blockProject->contentRow($strings["organization"], $strings["none"]); } else { $blockProject->contentRow($strings["organization"], buildLink("../clients/viewclient.php?id=" . $listProjects->pro_org_id[$j], $listProjects->pro_org_name[$j], LINK_INSIDE)); } $blockProject->contentRow($strings["status"], $status[$listProjects->pro_status[$j]]); $queryTask = " WHERE tas.project = '{$projectId}'"; $tmpqueryTask = "{$queryTask} ORDER BY tas.due_date"; $blockProject->closeContent(); $blockProject->heading_close(); $listTasks = new request(); $listTasks->openTasks($tmpqueryTask); $comptListTasks = count($listTasks->tas_id); $blockProject->openResults("false"); $blockProject->labels($labels = array(0 => $strings["task"], 1 => $strings["priority"], 2 => $strings["status"], 3 => $strings["due_date"], 4 => $strings["completed"], 5 => $strings["assigned_to"], 6 => $strings["published"]), "true");
} } $block1->contentRow($strings["project"], buildLink("../projects/viewproject.php?id=" . $requestDetail->sr_project[0], $requestDetail->sr_pro_name[0], LINK_INSIDE)); $block1->contentRow($strings["subject"], $requestDetail->sr_subject[0]); $block1->contentRow($strings["priority"], $requestPriority); $block1->contentRow($strings["status"], $status); $block1->contentRow($strings["date"], $requestDetail->sr_date_open[0]); $block1->contentRow($strings["user"], buildLink($requestDetail->sr_mem_email_work[0], $requestDetail->sr_mem_name[0], LINK_MAIL)); $block1->contentRow($strings["message"], nl2br($requestDetail->sr_message[0])); $block1->contentTitle($strings["responses"]); if ($teamMember == "true" || $_SESSION['profilSession'] != "0") { $block1->contentRow("", buildLink("../support/addpost.php?id=" . $requestDetail->sr_id[0], $strings["add_support_response"], LINK_INSIDE)); } for ($i = 0; $i < $comptListPosts; $i++) { $block1->contentRow($strings["posted_by"], buildLink($listPosts->sp_mem_email_work[$i], $listPosts->sp_mem_name[$i], LINK_MAIL)); $block1->contentRow($strings["date"], createDate($listPosts->sp_date[$i], $_SESSION['timezoneSession'])); if ($teamMember == "true" || $_SESSION['profilSession'] == "0") { $block1->contentRow(buildLink("../support/deleterequests.php?action=deleteP&id=" . $listPosts->sp_id[$i], $strings["delete_message"], LINK_INSIDE), nl2br($listPosts->sp_message[$i])); } else { $block1->contentRow("", nl2br($listPosts->sp_message[$i])); } $block1->contentRow("", "", "true"); } if ($status == $requestStatus[0]) { $status = "new"; } elseif ($status == $requestStatus[1]) { $status = "open"; } elseif ($status == $requestStatus[2]) { $status = "complete"; } $block1->closeContent();
exit; } $bouton[5] = "over"; $titlePage = $strings["bulletin_board_topic"]; require_once "include_header.php"; $tmpquery = "WHERE pos.topic = '" . $detailTopic->top_id[0] . "' ORDER BY pos.created DESC"; $listPosts = new request(); $listPosts->openPosts($tmpquery); $comptListPosts = count($listPosts->pos_id); $idStatus = $detailTopic->top_status[0]; echo "<table cellspacing=\"0\" width=\"90%\" cellpadding=\"3\">\n<tr><th colspan=\"4\">" . $strings["information"] . ":</th></tr>\n<tr><th>" . $strings["subject"] . ":</th><td>" . $detailTopic->top_subject[0] . "</td><th>" . $strings["posts"] . ":</th><td>" . $detailTopic->top_posts[0] . "</td></tr>\n<tr><th>" . $strings["project"] . ":</th><td>" . $projectDetail->pro_name[0] . "</td><th>" . $strings["last_post"] . ":</th><td>" . createDate($detailTopic->top_last_post[0], $_SESSION['timezoneSession']) . "</td></tr>\n<tr><th> </th><td> </td><th>" . $strings["retired"] . ":</th><td>{$statusTopicBis[$idStatus]}</td></tr>\n<tr><th>" . $strings["owner"] . ":</th><td colspan=\"3\"><a href=\"mailto:" . $detailTopic->top_mem_email_work[0] . "\">" . $detailTopic->top_mem_login[0] . "</a></td></tr>\n<tr><td colspan=\"4\"> </td></tr>\n<tr><th colspan=\"4\">" . $strings["discussion"] . ":</th></tr>\n<tr><td colspan=\"4\" align=\"right\"><a href=\"threadpost.php?id={$id}\">" . $strings["post_reply"] . "</a></td></tr>"; if ($comptListPosts != "0") { for ($i = 0; $i < $comptListPosts; $i++) { if (!($i % 2)) { $class = "odd"; } else { $class = "even"; } echo "<tr><td colspan=\"4\" class=\"{$class}\"> </td></tr>\n<tr class=\"{$class}\"><th>" . $strings["posted_by"] . " :</th><td>" . $listPosts->pos_mem_name[$i] . "</td><td colspan=\"2\" align=\"right\">"; if ($detailProject->pro_owner[0] == $_SESSION['idSession'] || $_SESSION['profilSession'] == "0" || $listPosts->pos_member[$i] == $_SESSION['idSession']) { echo "<a href=\"../projects_site/showallthreads.php?id={$id}&action=delete&post=" . $listPosts->pos_id[$i] . "\">" . $strings["delete_message"] . "</a>"; } else { echo " "; } echo "</td></tr>\n<tr class=\"{$class}\"><th>" . $strings["email"] . " :</th><td colspan=\"3\"><a href=\"mailto:" . $listPosts->pos_mem_email_work[$i] . "\">" . $listPosts->pos_mem_email_work[$i] . "</a></td></tr>\n<tr class=\"{$class}\"><th nowrap>" . $strings["when"] . " :</th><td colspan=\"3\">" . createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']) . "</td></tr>\n<tr class=\"{$class}\"><th>" . $strings["message"] . " :</th><td colspan=\"3\">" . nl2br($listPosts->pos_message[$i]) . "</td></tr>"; } } else { echo "<tr><td colspan=\"4\" class=\"ListOddRow\">" . $strings["no_items"] . "</td></tr>"; } echo "</table>"; require_once "include_footer.php";
} if ($taskDetail->tas_start_date[0] != "") { echo "<tr><td>" . $strings["start_date"] . " :</td><td>" . $taskDetail->tas_start_date[0] . "</td></tr>"; } if ($taskDetail->tas_due_date[0] != "") { echo "<tr><td>" . $strings["due_date"] . " :</td><td>" . $taskDetail->tas_due_date[0] . "</td></tr>"; } echo "<tr><td>" . $strings["updates_task"] . " :</td><td>"; $tmpquery = "WHERE upd.type='1' AND upd.item = '{$id}' ORDER BY upd.created DESC"; $listUpdates = new request(); $listUpdates->openUpdates($tmpquery); $comptListUpdates = count($listUpdates->upd_id); if ($comptListUpdates != "0") { $j = 1; for ($i = 0; $i < $comptListUpdates; $i++) { echo "<b>" . $j . ".</b> <i>" . createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession']) . "</i><br>" . nl2br($listUpdates->upd_comments[$i]); echo "<br>"; $j++; } } else { echo $strings["no_items"]; } echo "</td></tr>\n</table>\n<hr>"; echo "<form accept-charset=\"UNKNOWN\" method=\"post\" action=\"../projects_site/clienttaskdetail.php?action=update\" name=\"clientTaskUpdate\" enctype=\"multipart/form-data\"><input name=\"id\" type=\"HIDDEN\" value=\"{$id}\">"; echo "<table cellspacing=\"0\" cellpadding=\"3\">\n<tr><th colspan=\"2\">" . $strings["client_change_status"] . "</th></tr>\n<tr><td>" . $strings["status"] . " :</td><td>"; if ($taskDetail->tas_status[0] == "0") { echo "<input checked value=\"checkbox\" name=\"checkbox\" type=\"checkbox\">"; } else { echo "<input value=\"checkbox\" name=\"checkbox\" type=\"checkbox\">"; } echo " {$status['0']}</td></tr>\n<tr valign=\"top\"><td>" . $strings["comments"] . " :</td><td><textarea cols=\"40\" name=\"comments\" rows=\"5\">" . $taskDetail->tas_comments[0] . "</textarea></td></tr><tr align=\"top\"><td> </td><td><input name=\"submit\" type=\"submit\" value=\"" . $strings["save"] . "\"></td></tr>\n</table>\n</form>";
<?php require 'dbadapter.php'; include_once 'header.php'; if (createBill("bill", 300, 15, 1)) { echo "<p>Bill created</p>"; } if (createDate("trash", 21, 1)) { echo "<p>Date created</p>"; } if (createPurchase("Dish Soap", 21, "2014-10-06", 1, 1)) { echo "<p>Purchase created</p>"; } if (createRoom(50, 1, 1)) { echo "<p>Room created</p>"; } include_once 'footer.php';
$comptListTopics = count($listTopics->top_id); if ($comptListTopics != "0") { $block1->openResults(); $block1->labels($labels = array(0 => $strings["topic"], 1 => $strings["owner"], 2 => $strings["posts"], 3 => $strings["last_post"], 4 => $strings["status"], 5 => $strings["published"]), "true"); for ($i = 0; $i < $comptListTopics; $i++) { $idStatus = $listTopics->top_status[$i]; $idPublish = $listTopics->top_published[$i]; $block1->openRow(); $block1->checkboxRow($listTopics->top_id[$i]); $block1->cellRow($blockPage->buildLink("../topics/viewtopic.php?id=" . $listTopics->top_id[$i], $listTopics->top_subject[$i], in)); $block1->cellRow($blockPage->buildLink($listTopics->top_mem_email_work[$i], $listTopics->top_mem_login[$i], mail)); $block1->cellRow($listTopics->top_posts[$i]); if ($listTopics->top_last_post[$i] > $lastvisiteSession) { $block1->cellRow("<b>" . createDate($listTopics->top_last_post[$i], $timezoneSession) . "</b>"); } else { $block1->cellRow(createDate($listTopics->top_last_post[$i], $timezoneSession)); } $block1->cellRow($statusTopic[$idStatus]); if ($sitePublish == "true") { $block1->cellRow($statusPublish[$idPublish]); } $block1->closeRow(); } $block1->closeResults(); } else { $block1->noresults(); } $block1->closeFormResults(); $block1->openPaletteScript(); if ($teamMember == "true") { $block1->paletteScript(0, "add", "../topics/addtopic.php?project=" . $projectDetail->pro_id[0] . "", "true,true,true", $strings["add"]);
} $block1->headingForm($strings["post_to_discussion"] . " : " . $detailTopic->top_subject[0]); $block1->openContent(); $block1->contentTitle($strings["info"]); $block1->contentRow($strings["project"], buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0] . " (#" . $projectDetail->pro_id[0] . ")", LINK_INSIDE)); $block1->contentRow($strings["organization"], $projectDetail->pro_org_name[0]); $block1->contentRow($strings["owner"], buildLink("../users/viewuser.php?id=" . $projectDetail->pro_mem_id[0], $projectDetail->pro_mem_name[0], LINK_INSIDE) . " (" . buildLink($projectDetail->pro_mem_email_work[0], $projectDetail->pro_mem_login[0], LINK_MAIL) . ")"); if ($sitePublish == "true") { $block1->contentRow($strings["published"], $statusPublish[$idPublish]); } $block1->contentRow($strings["retired"], $statusTopicBis[$idStatus]); $block1->contentRow($strings["posts"], $detailTopic->top_posts[0]); $block1->contentRow($strings["last_post"], createDate($detailTopic->top_last_post[0], $_SESSION['timezoneSession'])); $block1->contentTitle($strings["details"]); $block1->contentRow($strings["message"], "<textarea rows=\"10\" style=\"width: 400px; height: 160px;\" name=\"tpm\" cols=\"47\"></textarea>"); $block1->contentRow("", "<input type=\"SUBMIT\" value=\"" . $strings["save"] . "\">"); $block1->contentTitle($strings["posts"]); for ($i = 0; $i < $comptListPosts; $i++) { $block1->contentRow($strings["posted_by"], buildLink($listPosts->pos_mem_email_work[$i], $listPosts->pos_mem_name[$i], LINK_MAIL)); if ($listPosts->pos_created[$i] > $_SESSION['lastvisiteSession']) { $block1->contentRow($strings["when"], "<b>" . createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']) . "</b>"); } else { $block1->contentRow($strings["when"], createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession'])); } $block1->contentRow("", nl2br($listPosts->pos_message[$i])); $block1->contentRow("", "", "true"); } $block1->closeContent(); $block1->headingForm_close(); $block1->closeForm(); require_once "../themes/" . THEME . "/footer.php";
/** * Execute the console command. * * @return mixed */ public function handle() { $client = new Client(); $crawler = $client->request('GET', 'http://www.cmc.edu/news/events'); $status_code = $client->getResponse()->getStatus(); if ($status_code == 200) { echo '200 OK<br>'; } $time2 = null; $crawler->filter('div.article')->each(function ($node) { $title = trimWhiteSpace($node->filter('h4')->text()); //title $url = "http://www.cmc.edu" . $node->filter('h4 a')->attr('href'); //url $times = $node->filter('p span')->each(function ($node2, $count) { //save the values of time in array if ($count = 0 && $node2->attr('content')) { $times[0] = $node2->attr('content'); return $times; } if ($count = 1 && $node2->attr('content')) { $times[1] = $node2->attr('content'); return $times; } $count++; }); $times = array_slice(array_filter($times), 0); //array gets messy, cleaned up $time1 = substr(str_replace("T", " ", $times[0][1]), 0, -6); //remove T, and remove last 6 digits of time $date = substr($time1, 0, 10); //get date of start if (isset($times[1][1])) { $time2 = substr(str_replace("T", " ", $times[1][1]), 0, -6); //second time } echo "<br>"; $id = DB::table('email_articles')->where('post_date', $date)->value('article_id'); if (EventAndNews::where('title', '=', $title)->exists()) { echo $title . " already exists"; } else { $event = new EventAndNews(); $event->article_id = $id; $event->title = $title; $event->url = $url; $event->time1 = $time1; if (isset($time2)) { $event->time2 = $time2; } $event->type = 'event'; $event->save(); echo "stored!"; } }); $client = new Client(); $crawler = $client->request('GET', 'http://www.cmc.edu/news/news-releases'); $status_code = $client->getResponse()->getStatus(); if ($status_code == 200) { echo '200 OK<br>'; } $crawler->filter('div.view-content > div')->each(function ($node) { $imgUrl = null; $title = $node->filter('h4 a')->text(); //title $url = "http://www.cmc.edu" . $node->filter('h4 a')->attr('href'); //url if ($node->filter('a img')->count()) { $imgUrl = $node->filter('img')->attr('src'); //img src } $date = $node->filter('p')->text(); $date = createDate($date); //date $id = DB::table('email_articles')->where('post_date', $date)->value('article_id'); if (EventAndNews::where('title', '=', $title)->exists()) { echo $title . " exists"; echo "<br>"; } else { $event = new EventAndNews(); $event->article_id = $id; $event->title = $title; $event->url = $url; if (isset($imgUrl)) { $event->imgUrl = $imgUrl; } $event->time1 = $date; $event->type = 'news'; $event->save(); echo "stored: " . $title; } }); }
$comptListAssign = count($listAssign->ass_id); $block3->openResults($checkbox = "false"); $block3->labels($labels = array(0 => $strings["comment"], 1 => $strings["assigned_by"], 2 => $strings["to"], 3 => $strings["assigned_on"]), "false"); for ($i = 0; $i < $comptListAssign; $i++) { $block3->openRow(); $block3->checkboxRow($listAssign->ass_id[$i], $checkbox = "false"); if ($listAssign->ass_comments[$i] != "") { $block3->cellRow($listAssign->ass_comments[$i]); } else { if ($listAssign->ass_assigned_to[$i] == "0") { $block3->cellRow($strings["task_unassigned"]); } else { $block3->cellRow($strings["task_assigned"] . " " . $listAssign->ass_mem2_name[$i] . " (" . $listAssign->ass_mem2_login[$i] . ")"); } } $block3->cellRow(buildLink($listAssign->ass_mem1_email_work[$i], $listAssign->ass_mem1_login[$i], LINK_MAIL)); if ($listAssign->ass_assigned_to[$i] == "0") { $block3->cellRow($strings["unassigned"]); } else { $block3->cellRow(buildLink($listAssign->ass_mem2_email_work[$i], $listAssign->ass_mem2_login[$i], LINK_MAIL)); } $block3->cellRow(createDate($listAssign->ass_assigned[$i], $_SESSION['timezoneSession'])); $block3->closeRow(); } $block3->closeResults(); $block3->closeToggle(); $block3->closeFormResults(); $block3->headingForm_close(); $block3->closeForm(); //was missing ???? require_once "../themes/" . THEME . "/footer.php";
$block1->paletteIcon(1, "edit", $strings["edit"]); } $block1->paletteIcon(2, "export", $strings["export"]); $block1->closePaletteIcon(); $block1->openContent(); $block1->contentTitle($strings["user_details"]); $block1->contentRow($strings["user_name"], $userDetail->mem_login[0]); $block1->contentRow($strings["full_name"], $userDetail->mem_name[0]); $block1->contentRow($strings["organization"], $userDetail->mem_org_name[0]); $block1->contentRow($strings["email"], $userDetail->mem_email_work[0]); $block1->contentRow($strings["work_phone"], $userDetail->mem_phone_work[0]); $block1->contentRow($strings["home_phone"], $userDetail->mem_phone_home[0]); $block1->contentRow($strings["mobile_phone"], $userDetail->mem_mobile[0]); $block1->contentRow($strings["fax"], $userDetail->mem_fax[0]); $block1->contentRow($strings["comments"], nl2br($userDetail->mem_comments[0])); $block1->contentRow($strings["account_created"], createDate($userDetail->mem_created[0], $_SESSION['timezoneSession'])); $block1->contentTitle($strings["information"]); $tmpquery = "SELECT tas.id FROM " . $tableCollab["tasks"] . " tas LEFT OUTER JOIN " . $tableCollab["projects"] . " pro ON pro.id = tas.project WHERE tas.assigned_to = '" . $userDetail->mem_id[0] . "' AND tas.status IN(0,2,3) AND pro.status IN(0,2,3)"; compt($tmpquery); $valueTasks = $countEnregTotal; $block1->contentRow($strings["tasks"], $valueTasks); $z = "(Client on project site)"; if ($userDetail->mem_log_connected[0] > $dateunix - 5 * 60) { $connected_result = $strings["yes"] . " " . $z; } else { $connected_result = $strings["no"]; } $block1->contentRow($strings["connected"], $connected_result); $block1->closeContent(); $block1->closeForm(); $block1->openPaletteScript();
$block1->contentRow($strings["project"], $blockPage->buildLink("../projects/viewproject.php?id=" . $projectDetail->pro_id[0], $projectDetail->pro_name[0], in)); $block1->contentRow($strings["organization"], $blockPage->buildLink("../clients/viewclient.php?id=" . $projectDetail->pro_org_id[0], $projectDetail->pro_org_name[0], in)); $block1->contentRow($strings["header_note"], nl2br($detailInvoice->inv_header_note[0])); $block1->contentRow($strings["footer_note"], nl2br($detailInvoice->inv_footer_note[0])); $block1->contentRow($strings["date_invoice"], $detailInvoice->inv_date_sent[0]); $block1->contentRow($strings["due_date"], $detailInvoice->inv_due_date[0]); $block1->contentRow($strings["status"], $invoiceStatus[$detailInvoice->inv_status[0]]); $block1->contentRow($strings["total_ex_tax"], $detailInvoice->inv_total_ex_tax[0]); $block1->contentRow($strings["tax_rate"], $detailInvoice->inv_tax_rate[0]); $block1->contentRow($strings["tax_amount"], $detailInvoice->inv_tax_amount[0]); $block1->contentRow($strings["total_inc_tax"], $detailInvoice->inv_total_inc_tax[0]); if ($sitePublish == "true") { $block1->contentRow($strings["published"], $statusPublish[$detailInvoice->inv_published[0]]); } $block1->contentRow($strings["created"], createDate($detailInvoice->inv_created[0], $timezoneSession)); $block1->contentRow($strings["modified"], createDate($detailInvoice->inv_modified[0], $timezoneSession)); $block1->closeContent(); $block1->closeToggle(); $block1->closeForm(); $block1->openPaletteScript(); $block1->paletteScript(0, "remove", "../invoicing/deleteinvoices.php?id=" . $detailInvoice->inv_id[0] . "&client=" . $projectDetail->pro_org_id[0] . "", "true,true,false", $strings["delete"]); $block1->paletteScript(2, "export", "exportinvoice.php?id={$id}", "true,true,false", $strings["export"]); if ($sitePublish == "true") { $block1->paletteScript(3, "add_projectsite", "../invoicing/viewinvoice.php?addToSite=true&id=" . $detailInvoice->inv_id[0] . "&action=publish", "true,true,true", $strings["add_project_site"]); $block1->paletteScript(4, "remove_projectsite", "../invoicing/viewinvoice.php?removeToSite=true&id=" . $detailInvoice->inv_id[0] . "&action=publish", "true,true,true", $strings["remove_project_site"]); } $block1->paletteScript(5, "edit", "../invoicing/editinvoice.php?id=" . $detailInvoice->inv_id[0], "true,true,false", $strings["edit"]); $block1->closePaletteScript("", ""); $block2 = new block(); $block2->form = "invoiceItems"; $block2->openForm("../invoicing/viewinvoice.php?id={$id}&" . session_name() . "=" . session_id() . "#" . $block2->form . "Anchor");
<tr> <td> </td> <td valign="top">Registered Date </td> <td valign="top" class="normal_black"> <table cellpadding="0" cellspacing="0"> <tr> <td width="255" height="20" class="normal_text">From</td> <td width="277" class="normal_text">To</td> </tr> <tr> <td><?php echo createDate('reg_date_from', $reg_date_from); ?> </td> <td><?php echo createDate('reg_date_to', $reg_date_to); ?> </td> </tr> </table> </td> </tr> <tr> <td> </td> <td width="126">Status</td> <td class="comment"><select name="seeker_status" id="seeker_status"> <option value="1,0" <?php if ($seeker_status == "1,0") { echo "selected"; } ?>
if ($comptListTasks != '0') { $dump_buffer .= $strings['tasks'] . $crlf; $dump_buffer .= '"' . $strings['name'] . '";"' . $strings['description'] . '";"' . $strings['owner'] . '";"' . $strings['priority'] . '";"' . $strings['status'] . '";"' . $strings['created'] . '";"' . $strings['start_date'] . '";"' . $strings['due_date'] . '";"' . $strings['complete_date'] . '";"' . $strings['completion'] . '";"' . $strings['scope_creep'] . '";"' . $strings['estimated_time'] . '";"' . $strings['actual_time'] . '";"' . $strings['published'] . '";"' . $strings['comments'] . '";"' . $strings['assigned'] . '";"' . $strings['assigned_to'] . '"' . $crlf; for ($i = 0; $i < $comptListTasks; $i++) { if ($listTasks->tas_assigned_to[$i] == '0') { $listTasks->tas_mem_login[$i] = $strings['unassigned']; } // get actual time for task $taskActualTime = new request(); $actual_time = $taskActualTime->getTaskTime($i); $idStatus = $listTasks->tas_status[$i]; $idPriority = $listTasks->tas_priority[$i]; $idPublish = $listTasks->tas_published[$i]; $complValue = $listTasks->tas_completion[$i] > 0 ? $listTasks->tas_completion[$i] . '0 %' : $listTasks->tas_completion[$i] . ' %'; if ($listTasks->tas_complete_date[$i] != '' && $listTasks->tas_complete_date[$i] != '--' && $listTasks->tas_due_date[$i] != '--') { $diff = diff_date($listTasks->tas_complete_date[$i], $listTasks->tas_due_date[$i]); } $dump_buffer .= '"' . $listTasks->tas_name[$i] . '";"' . $listTasks->tas_description[$i] . '";"' . $listTasks->tas_mem2_login[$i] . '";"' . $priority[$idPriority] . '";"' . $status[$idStatus] . '";"' . createDate($listTasks->tas_created[$i], $_SESSION['timezoneSession']) . '";"' . $listTasks->tas_start_date[$i] . '";"' . $listTasks->tas_due_date[$i] . '";"' . $listTasks->tas_complete_date[$i] . '";"' . $complValue . '";"' . $diff . '";"' . $listTasks->tas_estimated_time[$i] . '";"' . $actual_time . '";"' . $statusPublish[$idPublish] . '";"' . $listTasks->tas_comments[$i] . '";"' . $listTasks->tas_assigned[$i] . '";"' . $listTasks->tas_mem_login[$i] . '"' . $crlf; } } $filename = $strings['project'] . $projectDetail->pro_id[0]; $ext = 'csv'; $mime_type = 'text/x-csv'; // Send headers header('Content-Type: ' . $mime_type); // lem9: we need "inline" instead of "attachment" for IE 5.5 $content_disp = USR_BROWSER_AGENT == 'IE' ? 'inline' : 'attachment'; header('Content-Disposition: ' . $content_disp . '; filename="' . $filename . '.' . $ext . '"'); header('Pragma: no-cache'); header('Expires: 0'); echo $dump_buffer;
$titlePage = $strings["bulletin_board_topic"]; include "include_header.php"; $tmpquery = "WHERE pos.topic = '" . $detailTopic->top_id[0] . "' ORDER BY pos.created DESC"; $listPosts = new request(); $listPosts->openPosts($tmpquery); $comptListPosts = count($listPosts->pos_id); $idStatus = $detailTopic->top_status[0]; echo "<table cellspacing='0' width='90%' cellpadding='3'>\n<tr><th colspan='4'>" . $strings["information"] . ":</th></tr>\n<tr><th>" . $strings["subject"] . ":</th><td>" . $detailTopic->top_subject[0] . "</td><th>" . $strings["posts"] . ":</th><td>" . $detailTopic->top_posts[0] . "</td></tr>\n<tr><th>" . $strings["project"] . ":</th><td>" . $projectDetail->pro_name[0] . "</td><th>" . $strings["last_post"] . ":</th><td>" . createDate($detailTopic->top_last_post[0], $timezoneSession) . "</td></tr>\n<tr><th> </th><td> </td><th>" . $strings["retired"] . ":</th><td>{$statusTopicBis[$idStatus]}</td></tr>\n<tr><th>" . $strings["owner"] . ":</th><td colspan='3'><a href='mailto:" . $detailTopic->top_mem_email_work[0] . "'>" . $detailTopic->top_mem_login[0] . "</a></td></tr>\n<tr><td colspan='4'> </td></tr>\n<tr><th colspan='4'>" . $strings["discussion"] . ":</th></tr>"; if ($detailTopic->top_status[0] == "1") { echo "<tr><td colspan='4' align='right'><a href='threadpost.php?id={$id}&" . session_name() . "=" . session_id() . "'>" . $strings["post_reply"] . "</a></td></tr>"; } if ($comptListPosts != "0") { for ($i = 0; $i < $comptListPosts; $i++) { if (!($i % 2)) { $class = "odd"; } else { $class = "even"; } echo "<tr><td colspan='4' class='{$class}'> </td></tr>\n<tr class='{$class}'><th>" . $strings["posted_by"] . " :</th><td>" . $listPosts->pos_mem_name[$i] . "</td><td colspan='2' align='right'>"; if ($detailProject->pro_owner[0] == $idSession || $profilSession == "0" || $listPosts->pos_member[$i] == $idSession) { echo "<a href='../projects_site/showallthreads.php?id={$id}&" . session_name() . "=" . session_id() . "&action=delete&post=" . $listPosts->pos_id[$i] . "'>" . $strings["delete_message"] . "</a>"; } else { echo " "; } echo "</td></tr>\n<tr class='{$class}'><th>" . $strings["email"] . " :</th><td colspan='3'><a href='mailto:" . $listPosts->pos_mem_email_work[$i] . "'>" . $listPosts->pos_mem_email_work[$i] . "</a></td></tr>\n<tr class='{$class}'><th nowrap>" . $strings["when"] . " :</th><td colspan='3'>" . createDate($listPosts->pos_created[$i], $timezoneSession) . "</td></tr>\n<tr class='{$class}'><th>" . $strings["message"] . " :</th><td colspan='3'>" . nl2br($listPosts->pos_message[$i]) . "</td></tr>"; } } else { echo "<tr><td colspan='4' class='ListOddRow'>" . $strings["no_items"] . "</td></tr>"; } echo "</table>"; include "include_footer.php";
$projectDetail = new request(); $projectDetail->openProjects($tmpquery); require_once "../topics/noti_newpost.php"; } // header("Location: showallthreads.php?id=$id"); // exit; } $bouton[5] = "over"; $titlePage = $strings["post_reply"]; require_once "include_header.php"; $idStatus = $detailTopic->top_status[0]; echo "<form accept-charset=\"UNKNOWN\" method=\"POST\" action=\"../projects_site/threadpost.php?action=add\" name=\"post\" enctype=\"application/x-www-form-urlencoded\"><input name=\"id\" type=\"hidden\" value=\"{$id}\">"; echo "<table cellspacing=\"0\" width=\"90%\" cellpadding=\"3\">\n<tr><th colspan=\"4\">" . $detailTopic->top_subject[0] . "</th></tr>\n<tr><th colspan=\"4\">" . $strings["information"] . "</th></tr>\n<tr><th>" . $strings["project"] . ":</th><td>" . $projectDetail->pro_name[0] . "</td><th>" . $strings["posts"] . ":</th><td>" . $detailTopic->top_posts[0] . "</td></tr>\n<tr><th> </th><td> </td><th>" . $strings["last_post"] . ":</th><td>" . createDate($detailTopic->top_last_post[0], $_SESSION['timezoneSession']) . "</td></tr>\n<tr><th> </th><td> </td><th>" . $strings["retired"] . ":</th><td>{$statusTopicBis[$idStatus]}</td></tr>\n<tr><th>" . $strings["owner"] . ":</th><td colspan=\"3\"><a href=\"mailto:" . $detailTopic->top_mem_email_work[0] . "\">" . $detailTopic->top_mem_login[0] . "</a></td></tr>\n<tr><td colspan=\"4\"> </td></tr>\n<tr><th colspan=\"4\">" . $strings["enter_message"] . "</th></tr>\n<tr><th nowrap>* " . $strings["message"] . ":</th><td colspan=\"3\"><textarea cols=\"60\" name=\"messageField\" rows=\"6\"></textarea></td></tr>\n<tr><td class=\"FormLabel\"> </td><td colspan=\"3\"><input name=\"submit\" type=\"submit\" value=\"" . $strings["save"] . "\"></td></tr>\n</form>"; $tmpquery = "WHERE pos.topic = '" . $detailTopic->top_id[0] . "' ORDER BY pos.created DESC"; $listPosts = new request(); $listPosts->openPosts($tmpquery); $comptListPosts = count($listPosts->pos_id); if ($comptListPosts != "0") { for ($i = 0; $i < $comptListPosts; $i++) { if (!($i % 2)) { $class = "odd"; } else { $class = "even"; } echo "<tr><td colspan=\"4\" class=\"{$class}\"> </td></tr>\n<tr class=\"{$class}\"><th>" . $strings["posted_by"] . " :</th><td>" . $listPosts->pos_mem_name[$i] . "</td><td colspan=\"2\" align=\"right\"><a href=\"../projects_site/threadpost.php?id={$id}&action=delete&post=" . $listPosts->pos_id[$i] . "\">" . $strings["delete_message"] . "</a></td></tr>\n<tr class=\"{$class}\"><th>" . $strings["email"] . " :</th><td colspan=\"3\"><a href=\"mailto:" . $listPosts->pos_mem_email_work[$i] . "\">" . $listPosts->pos_mem_email_work[$i] . "</a></td></tr>\n<tr class=\"{$class}\"><th nowrap>" . $strings["when"] . " :</th><td colspan=\"3\">" . createDate($listPosts->pos_created[$i], $_SESSION['timezoneSession']) . "</td></tr>\n<tr class=\"{$class}\"><th>" . $strings["message"] . " :</th><td colspan=\"3\">" . nl2br($listPosts->pos_message[$i]) . "</td></tr>"; } } else { echo "<tr><td colspan=\"4\" class=\"ListOddRow\">" . $strings["no_items"] . "</td></tr>"; } echo "</table>"; require_once "include_footer.php";
$listUpdates->openUpdates($tmpquery); $comptListUpdates = count($listUpdates->upd_id); for ($i = 0; $i < $comptListUpdates; $i++) { if (ereg("\\[status:([0-9])\\]", $listUpdates->upd_comments[$i])) { preg_match("|\\[status:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[status:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["status"] . " " . $status[$matches[1]]; } if (ereg("\\[priority:([0-9])\\]", $listUpdates->upd_comments[$i])) { preg_match("|\\[priority:([0-9])\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[priority:([0-9])\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["priority"] . " " . $priority[$matches[1]]; } if (ereg("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", $listUpdates->upd_comments[$i])) { preg_match("|\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]|i", $listUpdates->upd_comments[$i], $matches); $listUpdates->upd_comments[$i] = ereg_replace("\\[datedue:([0-9]{4}-[0-9]{1,2}-[0-9]{1,2})\\]", "", $listUpdates->upd_comments[$i] . "<br>"); $listUpdates->upd_comments[$i] .= $strings["due_date"] . " " . $matches[1]; } $block1->contentRow($strings["posted_by"], buildLink($listUpdates->upd_mem_email_work[$i], $listUpdates->upd_mem_name[$i], LINK_MAIL)); if ($listUpdates->upd_created[$i] > $_SESSION['lastvisiteSession']) { $block1->contentRow($strings["when"], "<b>" . createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession']) . "</b>"); } else { $block1->contentRow($strings["when"], createDate($listUpdates->upd_created[$i], $_SESSION['timezoneSession'])); } $block1->contentRow("", nl2br($listUpdates->upd_comments[$i])); $block1->contentRow("", "", "true"); } $block1->closeContent(); $block1->headingForm_close(); $block1->closeForm(); require_once "../themes/" . THEME . "/footer.php";
} echo "\t<table cellpadding='0' cellspacing='0' border='0'>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["project"] . " :</th>\n\t\t\t\t<td> " . $projectDetail->pro_name[0] . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel' valign='top'>" . $strings["description"] . " : </th>\n\t\t\t\t<td> " . nl2br($projectDetail->pro_description[0]) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["status"] . " :</th>\n\t\t\t\t<td> {$status[$idStatus]}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["priority"] . " :</th>\n\t\t\t\t<td> {$priority[$idPriority]}</td>\n\t\t\t</tr>"; //Dispaly project active phase if ($projectDetail->pro_phase_set[0] != "0") { echo "\t<tr><th nowrap valign='top' class='FormLabel'>" . $strings["current_phase"] . " :</td><td>"; $tmpquery = "WHERE pha.project_id = '" . $projectDetail->pro_id[0] . "' AND status = '1'"; $currentPhase = new request(); $currentPhase->openPhases($tmpquery); $comptCurrentPhase = count($currentPhase->pha_id); if ($comptCurrentPhase == 0) { echo "" . $strings["no_current_phase"] . " "; } else { for ($i = 0; $i < $comptCurrentPhase; $i++) { if ($i != $comptCurrentPhase) { $pnum = $i + 1; echo "{$pnum}." . $currentPhase->pha_name[$i] . " "; } } } echo "</td></tr>"; } //------------------------------------------------------------------------------------------- echo "\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["url_dev"] . " :</th>\n\t\t\t\t<td> <a href='" . $projectDetail->pro_url_dev[0] . "' target='_blank'>" . $projectDetail->pro_url_dev[0] . "</a></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["url_prod"] . " :</th>\n\t\t\t\t<td> <a href='" . $projectDetail->pro_url_prod[0] . "' target='_blank'>" . $projectDetail->pro_url_prod[0] . "</a></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["created"] . " :</th>\n\t\t\t\t<td> " . createDate($projectDetail->pro_created[0], $timezoneSession) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<th nowrap class='FormLabel'>" . $strings["modified"] . " :</th>\n\t\t\t\t<td> " . createDate($projectDetail->pro_modified[0], $timezoneSession) . "</td>\n\t\t\t</tr>\n\t\t\t</table>"; $tmpquery = "WHERE tea.project = '{$projectSession}' AND tea.member = '" . $projectDetail->pro_owner[0] . "'"; $detailContact = new request(); $detailContact->openTeams($tmpquery); if ($detailContact->tea_published[0] == "0" && $detailContact->tea_project[0] == $projectSession) { echo "<br/><div>" . $strings["contact_projectsite"] . ", <a href=\"contactdetail.php?{$transmitSid}&id=" . $projectDetail->pro_owner[0] . "\">" . $projectDetail->pro_mem_name[0] . "</a>.</div>"; } } include "include_footer.php";
if ($query != "") { $query .= " AND tas.due_date >= '{$S_SDATE}'"; } else { $query .= "tas.due_date >= '{$S_SDATE}'"; } } if ($S_DUEDATE != "ALL" && $S_EDATE != "--") { if ($query != "") { $query .= " AND tas.due_date <= '{$S_EDATE}'"; } else { $query .= "tas.due_date <= '{$S_EDATE}'"; } } $query .= ")"; } $reportDetail->rep_created[0] = createDate($reportDetail->rep_created[0], $timezoneSession); $graph = new GanttGraph(); $graph->SetBox(); $graph->SetMarginColor("white"); $graph->SetColor("white"); $graph->title->Set($strings["report"] . " " . $reportDetail->rep_name[0]); $graph->subtitle->Set("(" . $strings["created"] . ": " . $reportDetail->rep_created[0] . ")"); $graph->title->SetFont(FF_FONT1); $graph->SetColor("white"); $graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK); $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY); $graph->scale->week->SetFont(FF_FONT0); $graph->scale->year->SetFont(FF_FONT1); $tmpquery = "{$queryStart} {$query} ORDER BY tas.name"; $listTasks = new request(); $listTasks->openTasks($tmpquery);
* Copyright (c) 2003 by the NetOffice developers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ $checkSession = true; require_once '../includes/library.php'; // load the jpgraph classes require_once '../includes/jpgraph/jpgraph.php'; require_once '../includes/jpgraph/jpgraph_gantt.php'; $tmpquery = "WHERE pro.id = '" . $project . "'"; $projectDetail = new request(); $projectDetail->openProjects($tmpquery); $projectDetail->pro_created[0] = createDate($projectDetail->pro_created[0], $_SESSION['timezoneSession']); $projectDetail->pro_name[0] = str_replace('"', '"', $projectDetail->pro_name[0]); $projectDetail->pro_name[0] = str_replace("'", "'", $projectDetail->pro_name[0]); // set up the graph $graph = new GanttGraph(0, 0, 'auto'); $graph->SetBox(); $graph->SetShadow(); $graph->SetMarginColor('gainsboro'); $graph->SetMargin(10, 30, 25, 25); // Set the Locale if you get errors with your environment //$graph->scale->SetDateLocale('C'); // Add title $graph->title->Set(' ' . $projectDetail->pro_name[0]); $graph->title->SetFont(FF_FONT1, FS_BOLD, 12); $graph->title->SetMargin(10); $graph->title->SetBox('linen');
public function calcClockings(&$list, $userid, $start, $end) { $this->employee = UserQuery::create()->filterById($userid)->findOne(); $domain = $this->employee->getDomain(); $vacationDays = HolidayQuery::create()->filterByDomain($domain)->filterByDate($start, Criteria::GREATER_EQUAL)->filterByDate($end, Criteria::LESS_EQUAL)->find(); $this->holidays = array(); foreach ($vacationDays as $day) { $key = dayKey($day->getDate()); $this->holidays[$key] = $day; } // Get flexitime $this->flexitime = ClockingQuery::create()->filterByUserId($userid)->filterByStart($start, Criteria::LESS_THAN)->filterByVisibility(0)->withColumn('SUM(flexitime)', 'flexitimeSum')->findOne()->getFlexitimeSum(); $this->holidaysWeeks = Holiday::getCountPerWeek($domain, $start, $end); // Calculate weektime for first item $first = $list->getFirst(); if ($first == null) { // No items at all, stop here return; } $weekday = date('N', $first->getStart()); $currentWeek = date('W', $first->getStart()); $currentYear = date('Y', $first->getStart()); // Count any holiday as 'work done' $weekKey = $currentWeek . '-' . $currentYear; if (!array_key_exists($weekKey, $this->holidaysWeeks)) { $this->holidaysWeeks[$weekKey] = 0; } $this->worktime = $this->holidaysWeeks[$weekKey] * $this->employee->getDailyTime(); if ($weekday > 1) { $weekstart = createDate($first->getStart()); $weekstart->modify('midnight this week'); $weekend = createDate($first->getStart()); $weekend->modify('midnight this week +7 days'); $week = ClockingQuery::create()->filterByStart($weekstart->getTimestamp(), Criteria::GREATER_THAN)->filterByStart($weekend->getTimestamp(), Criteria::LESS_THAN)->filterByUser($this->employee)->filterByVisibility(0)->find(); $this->calcList($week); } $connection = Propel::getConnection(ClockingPeer::DATABASE_NAME); $connection->beginTransaction(); try { $this->calcList($list); $connection->commit(); } catch (Exception $e) { $connection->rollBack(); throw $e; } }
#Application name: PhpCollab #Status page: 0 $checkSession = "true"; include "../includes/library.php"; $bouton[5] = "over"; $titlePage = $strings["bulletin_board"]; include "include_header.php"; $tmpquery = "WHERE topic.project = '{$projectSession}' AND topic.published = '0' ORDER BY topic.last_post DESC"; $listTopics = new request(); $listTopics->openTopics($tmpquery); $comptListTopics = count($listTopics->top_id); $block1 = new block(); $block1->heading($strings["bulletin_board"]); if ($comptListTopics != "0") { echo "<table cellspacing=\"0\" width=\"90%\" border=\"0\" cellpadding=\"3\" cols=\"4\" class=\"listing\">\n<tr><th>" . $strings["topic"] . "</th><th>" . $strings["posts"] . "</th><th>" . $strings["owner"] . "</th><th class=\"active\">" . $strings["last_post"] . "</th></tr>"; for ($i = 0; $i < $comptListTopics; $i++) { if (!($i % 2)) { $class = "odd"; $highlightOff = $block1->oddColor; } else { $class = "even"; $highlightOff = $block1->evenColor; } echo "<tr class=\"{$class}\" onmouseover=\"this.style.backgroundColor='" . $block1->highlightOn . "'\" onmouseout=\"this.style.backgroundColor='" . $highlightOff . "'\"><td><a href=\"showallthreads.php?{$transmitSid}&id=" . $listTopics->top_id[$i] . "\">" . $listTopics->top_subject[$i] . "</a></td><td>" . $listTopics->top_posts[$i] . "</td><td>" . $listTopics->top_mem_name[$i] . "</td><td>" . createDate($listTopics->top_last_post[$i], $timezoneSession) . "</td></tr>"; } echo "</table>\n<hr />\n"; } else { echo "<table cellspacing=\"0\" border=\"0\" cellpadding=\"2\"><tr><td colspan=\"4\">" . $strings["no_items"] . "</td></tr></table><hr>"; } echo "<br/><br/>\n<a href=\"createthread.php?{$transmitSid}\" class=\"FooterCell\">" . $strings["create_topic"] . "</a>"; include "include_footer.php";
function con_config_side_save($idcat, $idside, $idtpl, $idtplconf, $idsidelang, $idcatside, $idcatnew, $author, $title, $meta_keywords, $summary, $online, $user_protected, $view, $created, $lastmodified, $startdate, $starttime, $enddate, $endtime, $meta_author, $meta_description, $meta_robots, $meta_redirect_time, $meta_redirect, $meta_redirect_url, $rewrite_use_automatic, $rewrite_url, $idlay, $use_redirect = true) { global $db, $client, $sess, $perm, $lang, $cms_db, $cfg_client, $cms_lang, $val_ct; global $idcatside, $idside; if (!(is_numeric($idtpl) || is_int($idtpl))) { return; } if (!(is_numeric($idtplconf) || is_int($idtplconf))) { return; } if (empty($title)) { $title = $cms_lang['con_defaulttitle']; } $rewrite_use_automatic = $rewrite_use_automatic > 0 ? 1 : 0; rewriteGenerateMapping(); if ($rewrite_use_automatic) { $rewrite_url = rewriteGenerateUrlString($title); $rewrite_url = rewriteMakeUniqueStringForLang('idcatside', $idcatside, $rewrite_url); } else { $rewrite_url = rewriteGenerateUrlString($rewrite_url, true); } // idcatside für rechte $idcatside_for_rights = $idcatside; $idcat_for_rights = $idcat; if (!is_array($idcatnew)) { $idcatnew['0'] = $idcat; } $start = createDate($startdate, $starttime); $end = createDate($enddate, $endtime); $meta_redirect = $meta_redirect == '1' ? '1' : '0'; $meta_redirect_url = $meta_redirect_url == 'http://' || $meta_redirect_url == '' ? '' : $meta_redirect_url; set_magic_quotes_gpc($title); set_magic_quotes_gpc($summary); set_magic_quotes_gpc($meta_author); set_magic_quotes_gpc($meta_description); set_magic_quotes_gpc($meta_keywords); set_magic_quotes_gpc($meta_robots); set_magic_quotes_gpc($meta_redirect_url); if (empty($idside)) { //echo "new page";exit; // Seite erstellen $sql = "INSERT INTO {$cms_db['side']} (idclient) VALUES ('{$client}')"; $db->query($sql); // neue idside suchen $idside = mysql_insert_id(); // Seite in alle Ordner einfügen foreach ($idcatnew as $value) { //sortindex suchen $sql = "SELECT MAX(sortindex) AS sortindex FROM " . $cms_db['cat_side'] . " WHERE idcat='{$value}'"; $db->query($sql); if ($db->next_record()) { $sortindex = $db->f('sortindex') + 1; } else { $sortindex = 1; } $sql = "SELECT * FROM {$cms_db['cat_side']} WHERE idcat='{$value}' AND is_start='1'"; $db->query($sql); $is_start = $db->next_record() ? '0' : '1'; $sql = "INSERT INTO {$cms_db['cat_side']} (idcat, idside, sortindex, is_start) VALUES ('{$value}', '{$idside}', '{$sortindex}', '{$is_start}')"; $db->query($sql); } // idcatside suchen $sql = "SELECT idcatside FROM {$cms_db['cat_side']} WHERE idside='{$idside}'"; $idcatside = array(); getIdList($sql, $idcatside, '', 'idcatside'); // für jede Sprache erstellen $a_languages = get_languages_by_client($client); foreach ($a_languages as $tmp_lang) { if ($tmp_lang == $lang) { $side_online = $online; $side_start = $start; $side_end = $end; } else { $side_online = 0; $side_start = time(); $side_end = time(); } //TODO Problems to update template in multilang pages $catobject =& sf_factoryGetObject('PAGE', 'Cat'); $catobject->loadByIdcatIdlang($idcatnew['0'], $tmp_lang); $cat_is_protected = $catobject->getIsProtected(); if ($cat_is_protected) { $side_online = $side_online | 0x4; } if ($tmp_lang == $lang) { $tmp_meta_description = $meta_description; $tmp_meta_keywords = $meta_keywords; $tmp_meta_robots = $meta_robots; } else { $cfg_lang = $val_ct->get_by_group('cfg_lang', $client, $tmp_lang); $tmp_meta_description = htmlentities($cfg_lang['meta_description'], ENT_COMPAT, 'UTF-8'); $tmp_meta_keywords = htmlentities($cfg_lang['meta_keywords'], ENT_COMPAT, 'UTF-8'); $tmp_meta_robots = htmlentities($cfg_lang['meta_robots'], ENT_COMPAT, 'UTF-8'); } $sql = 'INSERT INTO ' . $cms_db['side_lang']; $sql .= ' (idside, idlang, title, meta_keywords, summary, created, lastmodified, author, meta_redirect, meta_redirect_url,'; $sql .= ' user_protected, online, start, end, meta_author, meta_description, meta_robots, meta_redirect_time, rewrite_use_automatic, rewrite_url) '; $sql .= 'VALUES ('; $sql .= " '{$idside}', '{$tmp_lang}', '{$title}', '{$tmp_meta_keywords}', '{$summary}', '{$created}', '{$lastmodified}', '{$author}', "; $sql .= " '{$meta_redirect}', '{$meta_redirect_url}', '{$user_protected}', '{$side_online}', '{$side_start}', '{$side_end}', "; $sql .= " '{$meta_author}', '{$tmp_meta_description}', '{$tmp_meta_robots}', '{$meta_redirect_time}', '{$rewrite_use_automatic}', '{$rewrite_url}')"; $db->query($sql); } // idsidelang für die Templateerstellung raussuchen $sql = "SELECT idsidelang FROM " . $cms_db['side_lang'] . " WHERE idside='{$idside}'"; $tmp_idsidelang = array(); $affectedrows = getIdList($sql, $tmp_idsidelang, '', 'idsidelang'); //print_r($tmp_idsidelang);exit; // Template erstellen if ($affectedrows) { foreach ($tmp_idsidelang as $value) { con_config_tpl_save($idtpl, $idlay, '', $value, $idtplconf); } //exit; } // Seite für Frontend erzeugen if ($cfg_client['publish'] == '1') { foreach ($a_languages as $tmp_lang) { $sql = 'INSERT INTO ' . $cms_db['code'] . "(idlang, idcatside, changed) VALUES ('{$tmp_lang}', '" . $idcatside['0'] . "', '1')"; $db->query($sql); } } // Event fire_event('con_side_new', array('idside' => $idside, 'name' => $title)); // Content aus Cache löschen sf_factoryCallMethod('UTILS', 'DbCache', null, null, 'flushByGroup', array('frontend', 'content')); // Danach ins Frontend? // ermittle redirect-url if ($view) { $url_location = $sess->url($cfg_client['htmlpath'] . $cfg_client['contentfile'] . '?lang=' . $lang . '&idcatside=' . $idcatside['0'] . '&view=' . $view); } else { $url_location = $sess->url("main.php?area=con_editframe&idcatside=" . $idcatside['0']); } $idcatside = $idcatside['0']; } else { // handle $online-Angabe // 0 -> offline setzen // 1 -> online setzen // 2 -> zeitsteuerung setzen switch ((int) $online) { case 0: $change_online = 'online & 0xFC'; break; case 1: $change_online = '((online & 0xFC) | 0x01)'; break; case 2: $change_online = '((online & 0xFC) | 0x02)'; break; default: $change_online = '0'; break; } // update der 'side_lang' Tabelle $sql = 'UPDATE ' . $cms_db['side_lang'] . ' '; $sql .= 'SET'; $sql .= " title='{$title}', meta_keywords='{$meta_keywords}', summary='{$summary}', meta_redirect='{$meta_redirect}', "; $sql .= " meta_redirect_url='{$meta_redirect_url}', user_protected = '{$user_protected}', online = {$change_online}, start='{$start}', "; $sql .= " end='{$end}', meta_author='{$meta_author}', meta_description='{$meta_description}', meta_robots='{$meta_robots}', "; $sql .= " meta_redirect_time = '{$meta_redirect_time}', rewrite_use_automatic = '{$rewrite_use_automatic}', rewrite_url = '{$rewrite_url}' "; $sql .= 'WHERE idsidelang = ' . $idsidelang; $db->query($sql); // in welchem Ordner existiert die Seite? $sql = 'SELECT idcat FROM ' . $cms_db['cat_side'] . ' WHERE idside = ' . $idside; $tmp_idcat = array(); getIdList($sql, $tmp_idcat, 'idcat'); if (is_array($tmp_idcat)) { // Seite in neue Ordner einfügen foreach ($idcatnew as $value) { if (!in_array($value, $tmp_idcat)) { $sql = 'SELECT * FROM ' . $cms_db['cat_side'] . ' WHERE idcat = ' . $value . ' AND is_start = 1'; $db->query($sql); $is_start = $db->next_record() ? '0' : '1'; //sortindex suchen $sql = "SELECT MAX(sortindex) AS sortindex FROM " . $cms_db['cat_side'] . " WHERE idcat='{$value}'"; $db->query($sql); if ($db->next_record()) { $sortindex = $db->f('sortindex') + 1; } else { $sortindex = 1; } if ($value == $idcatnew['0'] && !in_array($idcat, $idcatnew)) { $sql = 'UPDATE ' . $cms_db['cat_side'] . ' '; $sql .= 'SET'; $sql .= ' idcat = ' . $value . ','; $sql .= ' sortindex = ' . $sortindex . ','; $sql .= ' is_start = ' . $is_start . ' '; $sql .= 'WHERE idcat = ' . $idcat; $sql .= ' AND idside = ' . $idside; $db->query($sql); if (in_array($idcat, $idcatnew)) { unset($tmp_idcat[$idcat]); } //alte kategorie neu sortieren if (!function_exists('con_reindex_page_sort')) { include_once 'inc/fnc.con.php'; } con_reindex_page_sort($idcat); } else { //sortindex suchen $sql = "SELECT MAX(sortindex) AS sortindex FROM " . $cms_db['cat_side'] . " WHERE idcat='{$value}'"; $db->query($sql); if ($db->next_record()) { $sortindex = $db->f('sortindex') + 1; } else { $sortindex = 1; } $sql = 'INSERT INTO ' . $cms_db['cat_side'] . ' '; $sql .= ' (idcat , idside , is_start, sortindex) '; $sql .= 'VALUES'; $sql .= " ({$value}, {$idside}, {$is_start}, {$sortindex}) "; $db->query($sql); } } } // Seite aus nicht benutzen Ordnern löschen // jb_todo: rechte löschen?? foreach ($tmp_idcat as $value) { if (!in_array($value, $idcatnew)) { // suche alle idcatsides, die nicht mehr existieren $sql = 'SELECT idcatside FROM ' . $cms_db['cat_side'] . " WHERE idcat='{$value}' AND idside='{$idside}'"; $db->query($sql); $db->next_record(); // lösche alte 'code' Einträge $sql = 'DELETE FROM ' . $cms_db['code'] . " WHERE idcatside='" . $db->f('idcatside') . "'"; $db->query($sql); // lösche alte 'cat_side' Einträge $sql = 'DELETE FROM ' . $cms_db['cat_side'] . " WHERE idside='{$idside}' AND idcat='{$value}'"; $db->query($sql); // falls kein Startartikel mehr vorhanden neuen setzen $sql = 'SELECT * FROM ' . $cms_db['cat_side'] . " WHERE idcat='{$value}' AND is_start='1'"; $db->query($sql); if (!$db->affected_rows()) { $sql = 'UPDATE ' . $cms_db['cat_side'] . " SET is_start = '1' WHERE idcat='{$value}' ORDER BY sortindex LIMIT 1"; $db->query($sql); } //sortindex neu sortieren if (!function_exists('con_reindex_page_sort')) { include_once 'inc/fnc.con.php'; } con_reindex_page_sort($value); // jb_todo: // lösche alte 'tpl_conf' Einträge // muß noch eingetragen werden //Event fire_event('get_unused_idcatside_by_save_side', array('idside' => $idside, 'idcat' => $value, 'idcatside' => $db->f('idcatside'))); } } } // Template konfigurieren $have_perm_save_configdata = $perm->have_perm(27, 'side', $idcatside_for_rights, $idcat_for_rights); // if ($idtplconf == '0' && $idtpl != '0') { // $sql = 'SELECT idsidelang FROM ' . $cms_db['side_lang'] . " WHERE idside = $idside"; // $tmp_idsidelang = array(); // $affected_rows = getIdList($sql, $tmp_idsidelang, '', 'idsidelang'); // //print_r($tmp_idsidelang);exit; // // // Template erstellen // if ($affected_rows) { // foreach ($tmp_idsidelang as $value) { // con_config_tpl_save($idtpl, $idlay, '', $value, $idtplconf, $have_perm_save_configdata); // } // } // } // else { con_config_tpl_save($idtpl, $idlay, '', $idsidelang, $idtplconf, $have_perm_save_configdata); // } // Rechte setzen if ($perm->have_perm(22, 'side', $idcatside_for_rights, $idcat_for_rights)) { global $backend_cms_gruppenids, $backend_cms_gruppenrechte, $backend_cms_gruppenrechtegeerbt, $backend_cms_gruppenrechteueberschreiben; $perm->set_group_rights('side', $idcatside_for_rights, $backend_cms_gruppenids, $backend_cms_gruppenrechte, $backend_cms_gruppenrechtegeerbt, $backend_cms_gruppenrechteueberschreiben, '', 0x7ffd0000, $idcat_for_rights, 0x7ffd0000); } if ($perm->have_perm(14, 'cat', $idcat_for_rights)) { global $frontend_cms_gruppenids, $frontend_cms_gruppenrechte, $frontend_cms_gruppenrechtegeerbt, $frontend_cms_gruppenrechteueberschreiben; $perm->set_group_rights('frontendpage', $idcatside_for_rights, $frontend_cms_gruppenids, $frontend_cms_gruppenrechte, $frontend_cms_gruppenrechtegeerbt, $frontend_cms_gruppenrechteueberschreiben, '', 68719476735.0, $idcat_for_rights, 4294967295.0); } // Codestatus ändern change_code_status($idcatside_for_rights, 1, 'idcatside'); // Event fire_event('con_side_edit', array('idside' => $idside, 'name' => $title)); // Content aus Cache löschen sf_factoryCallMethod('UTILS', 'DbCache', null, null, 'flushByGroup', array('frontend', 'content')); // ermittle redirect-url if ($view) { $url_location = $sess->url($cfg_client['htmlpath'] . $cfg_client['contentfile'] . '?lang=' . $lang . '&idcatside=' . $idcatside . '&view=' . $view); } else { $url_location = $sess->url('main.php?area=con'); } } // Cache-Group Frontend löschen sf_factoryCallMethod('UTILS', 'DbCache', null, null, 'flushByGroup', array('frontend')); if ($use_redirect) { redirect_page($url_location); } }
$comptListTopics = count($listTopics->top_id); if ($comptListTopics != "0") { $block1->openResults(); $block1->labels($labels = array(0 => $strings["topic"], 1 => $strings["owner"], 2 => $strings["posts"], 3 => $strings["last_post"], 4 => $strings["status"], 5 => $strings["published"]), "true"); for ($i = 0; $i < $comptListTopics; $i++) { $idStatus = $listTopics->top_status[$i]; $idPublish = $listTopics->top_published[$i]; $block1->openRow($listTopics->top_id[$i]); $block1->checkboxRow($listTopics->top_id[$i]); $block1->cellRow(buildLink("../topics/viewtopic.php?id=" . $listTopics->top_id[$i], $listTopics->top_subject[$i], LINK_INSIDE)); $block1->cellRow(buildLink($listTopics->top_mem_email_work[$i], $listTopics->top_mem_login[$i], LINK_MAIL)); $block1->cellRow($listTopics->top_posts[$i]); if ($listTopics->top_last_post[$i] > $_SESSION['lastvisiteSession']) { $block1->cellRow("<b>" . createDate($listTopics->top_last_post[$i], $_SESSION['timezoneSession']) . "</b>"); } else { $block1->cellRow(createDate($listTopics->top_last_post[$i], $_SESSION['timezoneSession'])); } $block1->cellRow($statusTopic[$idStatus]); if ($sitePublish == "true") { $block1->cellRow($statusPublish[$idPublish]); } $block1->closeRow(); } $block1->closeResults(); } else { $block1->noresults(); } $block1->closeFormResults(); $block1->openPaletteScript(); if ($teamMember == "true") { $block1->paletteScript(0, "add", "../topics/addtopic.php?project=" . $projectDetail->pro_id[0] . "", "true,true,true", $strings["add"]);