protected function displayUser($rw) { if ($rw["photo"]) { $tmp_photo = "\n\t\t\t\t<div class='profile_photo'>\n\t\t\t\t\t<img src='" . $rw["photo"] . "' id='profile_photo_img' alt='" . $rw["displayName"] . "' />\n\t\t\t\t</div>\n\t\t\t"; } else { $tmp_photo = "\n\t\t\t\t<div class='profile_photo' id='profile_no_photo'>\n\t\t\t\t\t<div><!--[Photo_not_loaded]--></div>\n\t\t\t\t</div>\n\t\t\t"; } $tmp_bottom = ""; if ($this->app->getUser("id") == $rw[id]) { $tmp_bottom = "<tr><td></td><td><div class='centerButton'><a href='" . $this->app->makeLink(array("CID" => "profile", "page" => "change_profile"), null, 1) . "'><!--[Change_data_about_me]--></a></div></td></tr>"; } elseif ($this->app->getUser()) { $tmp_bottom = "<tr><td></td><td><div class='centerButton'><a href='" . $this->app->makeLink(array("CID" => "profile", "page" => "write_message", "to" => $rw[id]), null, 1) . "'><!--[Write_message]--></a></div></td></tr>"; } $out = "\n\t\t\t<h1>" . $rw["displayName"] . "</h1>\n\t\t\t<div class='user_profile'>\n\t\t\t<table class='info'>\n\t\t\t\t" . ($rw["fullName"] ? "<tr><td class='f'><!--[Name]-->:</td><td class='v'>" . $rw["fullName"] . "</td></tr>" : "") . "\n\t\t\t\t<tr><td class='f'><!--[Birth_date]-->:</td><td class='v'>" . printDate($rw["birth_dt"]) . "</td></tr>\n\t\t\t\t<tr><td class='f'><!--[Photo]-->:</td><td>" . $tmp_photo . "</td></tr>\n\t\t\t\t<tr><td class='f'><!--[Where_from]-->:</td><td class='v'>" . $rw["userGeoLinks"] . "</td></tr>\n\t\t\t\t" . ($rw["about"] ? "<tr><td class='f'><!--[About_me]-->:</td><td class='v about'>" . $rw["about"] . "</td></tr>" : "") . "\n\t\t\t\t" . ($rw["strench"] ? "<tr><td class='f'><!--[Rating_strench]-->:</td><td class='v'><span class='rating'>{$rw['rating']}</span> / <span class='strench'>{$rw['strench']}</span></td></tr>" : "") . "\n\t\t\t\t<tr><td class='f'><!--[Registered]-->:</td><td class='v'>" . printDate($rw["dt_added"]) . "</td></tr>\n\t\t\t\t<tr><td class='f'><!--[Activity]-->:</td><td class='v'><!--[Last_time_was_on_the_site_on]-->" . ($rw["dt_last_activity"] ? " " . printDateTime($rw["dt_last_activity"], "time") : ": <!--[never]-->") . "</td></tr>\n\t\t\t\t" . ($rw["contact_email"] ? "<tr><td class='f'><!--[Contact_email]-->: </td><td>[email]" . $rw["contact_email"] . "[/email]</td></tr>" : "") . "\n\t\t\t\t" . $tmp_bottom . "\n\t\t\t</table>\n\t\t\t</div>\n\t\t"; $this->data["title"] = $rw["displayName"]; $this->data["content"] = $out; }
if ($leave['signature_by'] != 0 and $leave['status'] == 1) { $class = 'success'; } if ($leave['signature_by'] != 0 and $leave['status'] == 0) { $class = 'danger'; } //This is canceled.. if ($leave['canceled'] == 1) { $class = 'warning'; } echo "<tr class='{$class}'>"; echo "<td>" . printDate($leave['date_submitted']) . "</td>"; echo "<td>" . get_leave_type($leave) . "</td>"; echo "<td>" . $leave['num_leaves'] . "</td>"; echo "<td>" . printDate($leave['date_starts']) . "</td>"; echo "<td>" . printDate($leave['date_ends']) . "</td>"; echo "<td>" . get_leave_status($leave) . "</td>"; echo "<td><a href='" . URL . "/?p=leaves|single&id=" . $leave['leave_id'] . "'><button type='button' class='btn btn-primary btn-circle'><i class='fa fa-eye'></i></button></a>  "; echo '<a href="' . URL . '/apps/leaves/files/' . $leave['filename'] . '"><button type="button" class="btn btn-success btn-circle"><i class="fa fa-arrow-circle-down"></i></button></a>'; if ($class == 'info') { // Not yer processed echo "  <a href='" . URL . "/?p=leaves|myleaves&cancel=" . $leave['leave_id'] . "'><button type='button' class='btn btn-danger btn-circle'><i class='fa fa-close'></i></button></a>"; } echo '</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div>
?> </div> <span style="<?php if ($content->get("deleted")) { ?> color: red;<?php } ?> "> <?php echo strip_tags(isset($query) && $query ? preg_replace('/(' . $query . ')/i', '<span style="background: yellow;border-radius: 2px;">$0</span>', $content->get("title")) : $content->get("title")); ?> </span> <span style="font-size: 0.8em;color: #333;"> at <?php echo printDate($content->get("date"), 2); ?> </span> <br /> <span style="font-size: 0.8em;color: grey;"> <?php echo strip_tags(substr($content->get("text"), 0, 500)); ?> </span> </div> <div style="clear: both;"> </div> </div> <?php $count++; }
} else { ?> <div class="form-group"> <label>Επεξεργάστηκε απο</label> <?php $user_leave_signed = get_leave_user($leave->signature_by); ?> <p class="form-control-static"><?php echo $user_leave_signed->last_name . ' ' . $user_leave_signed->first_name; ?> </p> </div> <div class="form-group"> <label>Ημερομηνία Επεξεργασίας</label> <p class="form-control-static"><?php echo printDate($leave->signature_date); ?> </p> </div> <?php } if ($leave->status == 0 or $leave->canceled == 1) { ?> <div class="form-group"> <label>Σχόλιο</label> <p class="form-control-static"><?php echo $leave->comments; ?> </p> </div> <?php
//On affiche les infos vraiment liées à l'emprunt if ($idActuel != $emprunt['id']) { $idActuel = $emprunt['id']; echo '<tr>'; echo '<td>' . (empty($emprunt['nom']) ? '<i>Inconnu</i>' : stripslashes(strtoupper($emprunt['nom']) . ' ' . $emprunt['prenom'])) . '</td>'; echo '<td>' . printDate($emprunt['date_emprunt'], true) . '</td>'; echo '<td' . (empty($emprunt['date_retour']) ? ' class="vide">' : '>' . printDate($emprunt['date_retour'], true)) . '</td>'; echo '<td>' . stripslashes($emprunt['etat_debut']) . '</td>'; echo '<td>' . (empty($emprunt['date_retour']) ? null : stripslashes($emprunt['etat_retour'])) . '</td>'; echo '</tr>'; } //Pour chaque réparation on rajoute une ligne en dessous de l'emprunt concerné if (!empty($emprunt['rid'])) { echo '<tr>'; echo '<td class="vide"></td>'; echo '<td>' . printDate($emprunt['date_reparation'], true) . '</td>'; echo '<td colspan="3">'; echo '<div class="' . (empty($emprunt['repare']) ? 'degrade' : 'dispo') . '">Réparation ' . (empty($emprunt['repare']) ? 'en attente' : 'effectuée') . ' / <div style="display:inline" class="' . (empty($emprunt['rembourse']) ? 'nondispo">Non ' : 'dispo">') . 'remboursée</div></div>'; echo $emprunt['prix'] !== null ? sprintf(' : %.2f €', $emprunt['prix']) : null; echo '</td>'; echo '</tr>'; } } exit; } else { if ($args[1][0] == 'liste_adherents' && isset($_POST['filtre'])) { //On récupère et met en forme le filtrage $filtres = make_filtres($_POST['filtre']); //Mise à jour des adherents $adherents = $pdo->query('SELECT id, nom, prenom, telephone, caution ' . 'FROM adherents ' . 'WHERE ' . 'id_saison = ' . $saison['id'] . ' ' . 'ORDER BY nom ASC, prenom ASC')->fetchAll(PDO::FETCH_ASSOC); //On liste les adhérents en regardant s'ils sont en accord avec le filtrage
if ($countDeleted > 0) { ?> <div class="show-deleted-content" data-date="<?php echo $tmpRealDate; ?> " style="position: absolute;top: 0px;right: 0px;padding: 5px;"> <?php echo $countDeleted; ?> deleted </div> <?php } ?> <?php echo printDate($tmpRealDate, 1); ?> </div> <?php echo $flush; ?> <?php } } else { ?> <div id="no-match-message" style="<?php if (count($contents) > 0) { ?> display: none;<?php } ?>
<div class="form-group"> <label>Ημερομηνία Υποβολής</label> <p class="form-control-static"><?php echo printDate($leave->date_submitted); ?> </p> </div> <div class="form-group"> <label>Αιτούμενες Ημέρες</label> <p class="form-control-static"><?php echo $leave->num_leaves; ?> </p> </div> <div class="form-group"> <label>Ημερομηνία Έναρξης</label> <p class="form-control-static"><?php echo printDate($leave->date_starts); ?> </p> </div> <div class="form-group"> <label>Ημερομηνία Λήξης</label> <p class="form-control-static"><?php echo printDate($leave->date_ends); ?> </p> </div> </div> </div> </div>
<?php function printDate() { $data = date("d-m-Y"); echo $data; } function printTime() { $czas = date("G:i"); echo $czas; } ?> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2"> </HEAD> <BODY> Dzisiaj jest <?php printDate(); ?> <BR> Godzina <?php printTime(); ?> </H2> </BODY> </HTML>
function printDateTime($dt, $mode = "") { $time = date("H:i", $dt); $date = date("Y-m-d", $dt); $ar = explode("-", $date); if ($mode != "time") { $out = printDate($dt, $mode) . ", " . $time; } elseif ($date == date("Y-m-d")) { $out = "<!--[today]--> <!--[at]--> " . $time; } elseif ($date == date("Y-m-d", time() - 86400)) { $out = "<!--[yesterday]--> <!--[at]--> " . $time; } else { $out = printDate($dt) . " <!--[at]--> " . $time; } return $out; }
function update_leave_days($leave_id) { //Ενημέρωση υπολοίπου ημερών άδειας global $db, $message_list; $leave = get_employee_leave($leave_id); $leave_user = get_user_by_leave($leave); if ($leave->signature_by != 0 and $leave->status == 1) { $subject = 'Η Αίτηση Αδείας σας Εγκρίθηκε'; $body = '<p>Η Αίτηση Αδείας σας Εγκρίθηκε</p>'; $body .= '<p>Αφορά την άδεια με τα παρακάτω στοιχεία: </p>'; $body .= '<p>- Ημέρομηνία Υποβολής: ' . printDate($leave->date_submitted) . '</p>'; $body .= '<p>- Ημέρες Αδείας: ' . $leave->num_leaves . '</p>'; $body .= '<p>- Ημερομηνία Έναρξης Άδειας: ' . printDate($leave->date_starts) . '</p>'; $body .= '<p>- Ημερομηνία Λήξης Άδειας: ' . printDate($leave->date_ends) . '</p>'; $remaining_leaves = intval(get_remaining_leaves_for_user($leave_user->id)); $remaining_leaves = $remaining_leaves - $leave->num_leaves; $query = $db->prepare('UPDATE leaves set remaining_leaves=:remaining_leaves where id =:id'); $query->bindValue(':remaining_leaves', $remaining_leaves, PDO::PARAM_INT); $query->bindValue(':id', $leave_user->id, PDO::PARAM_INT); $query->execute(); } if ($leave->signature_by != 0 and $leave->status == 0) { $subject = 'Η Αίτηση Αδείας σας Απορρίφθηκε'; $body = '<p>Η Αίτηση Αδείας σας Απορρίφθηκε</p>'; $body .= '<p>Αφορά την άδεια με τα παρακάτω στοιχεία: </p>'; $body .= '<p>- Ημέρομηνία Υποβολής: ' . printDate($leave->date_submitted) . '</p>'; $body .= '<p>- Ημέρες Αδείας: ' . $leave->num_leaves . '</p>'; $body .= '<p>- Ημερομηνία Έναρξης Άδειας: ' . printDate($leave->date_starts) . '</p>'; $body .= '<p>- Ημερομηνία Λήξης Άδειας: ' . printDate($leave->date_ends) . '</p>'; $body .= '<p>Λόγος Απόρριψης: ' . $leave->comments . '</p>'; } if (DEBUG) { // This is in development mode.. $address = LEAVES_DEBUG_USER_EMAIL; $receiver = LEAVES_DEBUG_USER_NAME; } else { $address = $leave_user->email; $receiver = $leave_user->first_name . ' ' . $leave_user->last_name; } email_send($address, $receiver, $subject, $body); }
protected function display_my_messages($rws) { $out .= "\n\t\t\t<form method='post' action='" . $this->app->makeLink() . "' id='messages_form'>\n\t\t\t<input type='hidden' name='action' value='delete_messages'>\n\t\t\t<table class='tbl_short'>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='checkbox'></th>\n\t\t\t\t\t<th><!--[Title]--></th>\n\t\t\t\t\t<th><!--[To_who]--></th>\n\t\t\t\t\t<th class='from'><!--[From]--></th>\n\t\t\t\t\t<th class='date'><!--[Date]--></th>\n\t\t\t\t</tr>\n\t\t"; foreach ($rws as $rw) { $out .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td><input type='checkbox' name='formData[sel][" . $rw["id"] . "]' value='1'></td>\n\t\t\t\t\t<td class='m'><a href='" . $this->app->makeLink(array("CID" => "profile", "page" => "show_message", "message_id" => $rw["id"])) . "'>" . $rw["title"] . "</a></td>\n\t\t\t\t\t<td class='v'><a href='" . $this->app->makeLink(array("CID" => "people", "user_id" => $rw["to"])) . "'>" . $rw["rw_to"]["displayName"] . "</a></td>\n\t\t\t\t\t<td class='v'><a href='" . $this->app->makeLink(array("CID" => "people", "user_id" => $rw["from"])) . "'>" . $rw["rw_from"]["displayName"] . "</a></td>\n\t\t\t\t\t<td class='v'>" . printDate($rw["dt"]) . "</td>\n\t\t\t\t</tr>\n\t\t\t"; } $out .= "\n\t\t\t</table>\n\t\t\t<div class='leftButton'><a href='javascript:void(0);' onclick='javascript:\$(\"#messages_form\").submit();'><!--[Delete_messages]--></a></div>\n\t\t"; $this->data["content"] = $out; }
//获得20130520到0531的天数,因为知乎日报开始自20130520 $march2013 = printDate("2013", "05"); $march2013_fixed = array(); for ($i = 19; $i <= 30; $i++) { $march2013_fixed[] = $march2013[$i]; } //获得2013年剩下的天数 $mon2013 = array(); for ($i = 6; $i <= 12; $i++) { $mon2013[] = printDate("2013", $i); } //获得2014年及其以后的天数 $monOther = array(); for ($i = 2014; $i <= $timeWithoutUnix_exploded[0]; $i++) { for ($j = 1; $j <= $timeWithoutUnix_exploded[1]; $j++) { $monOther[] = printDate($i, $j); } } $monOther_fixed = array(); /*$nowMon=array(); for ($i=0; $i < getMonthLastDay($timeWithoutUnix_exploded[1],$timeWithoutUnix_exploded[0])-$timeWithoutUnix_exploded[2]-2; $i++) { $monOther_fixed[]=$monOther[$timeWithoutUnix_exploded[1]-1][$i]; }*/ //剔除当月的多余部分 array_splice($monOther[count($monOther) - 1], 0, getMonthLastDay($timeWithoutUnix_exploded[1], $timeWithoutUnix_exploded[0]) - $timeWithoutUnix_exploded[2]); foreach ($monOther[count($monOther) - 1] as $key => $value) { $monOther[count($monOther) - 1][$key] = $value - (getMonthLastDay($timeWithoutUnix_exploded[1], $timeWithoutUnix_exploded[0]) - date("d")); } //将多个数组混合到一起 $totalMon = array_merge($march2013_fixed, $mon2013, $monOther); //释放内存
function printDateTime($date, $sentence = true) { $date = new DateTime($date); return printDate($date->getTimestamp(), $sentence); }