コード例 #1
0
ファイル: plan2html.php プロジェクト: enascimento/carmack
         $entry_txt .= "y";
     } else {
         $entry_txt .= "ies";
     }
     $titles .= "<h3>" . mon_to_fullstring($month) . " ({$entry_txt})</h3><ul>\n";
     $titles_empty = "";
     foreach ($title_list as $idx => $title_pair) {
         $hash = $title_pair["hash"];
         $title = $title_pair["title"];
         if ($title) {
             // spew out the list of empty titles if we have any
             if ($titles_empty != "") {
                 $titles .= "\t<li>{$titles_empty}</li>\n";
                 $titles_empty = "";
             }
             $titles .= "\t<li>" . date_to_string(substr($hash, 1, 20)) . " - <a href=\"#{$hash}\">{$title}</a></li>\n";
         } else {
             // add this entry to the list of empty titles
             $m = substr($hash, 5, 2);
             $d = substr($hash, 7, 2);
             $titles_empty .= "<a href=\"#{$hash}\">{$d}</a> ";
         }
     }
     if ($titles_empty != "") {
         $titles .= "\t<li>{$titles_empty}</li>\n";
     }
     $titles .= "</ul>\n\n";
 }
 $titles .= "\n\n";
 fputs($fp, $head);
 fputs($fp, $titles);
コード例 #2
0
ファイル: plan2tex.php プロジェクト: enascimento/carmack
 $fp = fopen($output_file, "w");
 $head = starttex(".plan {$key}", "", "\\rightmark", "");
 $head .= "\\begin{document}\n" . title2tex(".plan ({$key})");
 $body = "";
 $last_month = "";
 $titles_by_month = array();
 // Sort by date
 asort($list);
 foreach ($list as $file) {
     // Read the file in, extract date
     $fp_plan = fopen($dir . $file, "r");
     $data_plan = ltrim(fread($fp_plan, filesize($dir . $file)));
     fclose($fp_plan);
     $date_from_file = substr($file, 11, 8);
     $month = substr($date_from_file, 4, 2);
     $date = date_to_string($date_from_file);
     if ($date_from_file < "19960701") {
         continue;
     }
     if ($month != $last_month) {
         $body .= "\\chapter{" . $mon_full[$month] . "}\n";
         $last_month = $month;
     }
     // Pull out a title if we can
     $title = "";
     // A string of text followed by 2 line breaks
     if (preg_match("/^(.*?)(\n\n|\r\n\r\n)/", $data_plan, $matches)) {
         $tmp = $matches[1];
         // Has to be smaller than 90 for a title, and not start with * or +
         if (strlen($tmp) < 90 && !preg_match("/^(\\*|\\+)/", $tmp)) {
             $data_plan = ltrim(substr($data_plan, strlen($tmp) + 2, strlen($data_plan)));
コード例 #3
0
ファイル: users.php プロジェクト: joran98/laclef-webapp
        echo '<div class="ink-dropdown">';
        echo '<button class="ink-button toggle" data-target="#dropdown-' . $user['uid'] . '">' . get_tag_icon_html(0) . ' ' . '<i class="icon-caret-down"></i></button>';
        echo '<ul id="dropdown-' . $user['uid'] . '" class="dropdown-menu">';
        foreach ($user['tags'] as $tag) {
            echo '<li style="font-weight : normal;"><a href="tag?uid=' . $tag['uid'] . '">' . get_tag_icon_html($tag['type']) . ' ' . $tag['uid'] . '</a></li>';
        }
        echo '</ul></div>';
    }
    ?>
						    <?php 
    if (count($user['equipments']) > 0) {
        echo '<div class="ink-dropdown">';
        echo '<button class="ink-button toggle" data-target="#dropdown-equipments' . $user['uid'] . '">' . '<i class="icon-tablet"></i>' . ' ' . '<i class="icon-caret-down"></i></button>';
        echo '<ul id="dropdown-equipments' . $user['uid'] . '" class="dropdown-menu">';
        foreach ($user['equipments'] as $equipment) {
            echo '<li style="font-weight : normal;"><a href="equipment?id=' . $equipment['id'] . '"> ' . $equipment['name'] . '</a>' . ' ' . _("jusqu'au") . ' ' . date_to_string($equipment['end']) . '</li>';
        }
        echo '</ul></div>';
    }
    ?>
						</td>
			    </tr>
			  <?php 
}
?>
			</tbody>
    </table>
    <nav class="ink-navigation"><ul class="pagination rounded shadowed grey"></ul></nav>
  </div>
</section>
<div>
コード例 #4
0
ファイル: order.php プロジェクト: xmar/laclef-webapp
    }
    echo '</ul></div>';
}
?>
    <?php 
if (count($client['jobs']) > 0) {
    echo '<div class="ink-dropdown">';
    echo '<button class="ink-button toggle" data-target="#dropdown-jobs' . $client['uid'] . '">' . '<i class="fa fa-cube"></i>' . _(" Mes impressions 3D ") . '<i class="icon-caret-down"></i></button>';
    echo '<ul id="dropdown-jobs' . $client['uid'] . '" class="dropdown-menu">';
    foreach ($client['jobs'] as $job) {
        if ($job['status'] == 0) {
            echo '<li><a href="job?id=' . $job['id'] . '"> <i class="icon-circle ink-label error invert"></i> ' . $job['file'] . ' ' . _("livré") . ' ' . date_to_string($job['delivery']) . '</a></li>';
        } elseif ($job['status'] == 1) {
            echo '<li><a href="job?id=' . $job['id'] . '"> <i class="icon-circle ink-label warning invert"></i> ' . $job['file'] . ' ' . _("livré") . ' ' . date_to_string($job['delivery']) . '</a></li>';
        } else {
            echo '<li><a href="job?id=' . $job['id'] . '"> <i class="icon-circle ink-label success invert"></i> ' . $job['file'] . ' ' . _("livré") . ' ' . date_to_string($job['delivery']) . '</a></li>';
        }
    }
    echo '</ul></div>';
}
?>
	</div>
</div>
<div class="ink-shade">
	<div id="messageModal" class="ink-modal" data-trigger="#messageModal">
		<div class="modal-header">
			<button class="modal-close ink-dismiss"></button>
			<h3><?php 
echo _('Envoyer un message');
?>
</h3>
コード例 #5
0
ファイル: prescasy.php プロジェクト: rpodgorny/attendance
echo monthname($_GET["month"]) . " " . $_GET["year"];
?>
</h2>

<table>
<tr>
	<th>datum</th>
	<th>druh dne</th>
	<th>přesčas</th>
	<th>poznamka</th>
</tr>

<?php 
$total = 0;
for ($day = 1; checkdate($_GET["month"], $day, $_GET["year"]); $day++) {
    $date = date_to_string($_GET["year"], $_GET["month"], $day);
    $time = db_get_condition("overtimes", "time", "date='" . $date . "' AND employee='" . $_GET["employee"] . "'");
    if (!$time) {
        continue;
    }
    $time = datetime_to_secs($time);
    if ($time == 0) {
        continue;
    }
    $daytype = weekdayname($_GET["year"], $_GET["month"], $day);
    if (db_get_condition("vacancies", "date", "date='" . $date . "'")) {
        $daytype .= " + svatek";
    }
    $note = db_get_condition("comments", "text", "date='" . $date . "' AND employee='" . $_GET["employee"] . "'");
    $total += $time;
    echo "<tr>";
コード例 #6
0
 	$cl = "";
 }
 */
 $cl = "";
 $box_alternate ^= 1;
 $output_file = $conf->user . "_interview_" . substr($date_key, 0, 4) . "_" . $clean_title_in . ".html";
 $output_path = "../{$output_file}";
 // add_to_timeline( $timestamp, $type, $title, $url )
 add_to_timeline(substr($date_key, 0, 8), "Interview", $title_in, $output_file);
 $titles .= "<li{$cl}><span class=\"strong\">" . date_to_string($date_key) . "</span> - {$organization_in} - <a href=\"{$output_file}\"> {$title_in} </a> - \n{$synopsis_in}</li> \n";
 /*
 	SUB PAGE
 */
 $fp_out = fopen($output_path, "w");
 $head_out = preg_replace(array("/@keywords/", "/@title/"), array($conf->keywords . ", interview", "{$conf->title} - {$title_in} (" . date_to_string($date_key) . ")"), $conf->header);
 $head_out .= "<h1>{$title_in}</h1><p></p>\r\n<h2>Overview</h2>\r\n<p>\r\n\t<span class=\"strong\">Date: </span> " . date_to_string($date_key) . " <br />\r\n\t<span class=\"strong\">Original URL: </span> <a href=\"{$url_in}\">{$url_in}</a> <br />\r\n\t<span class=\"strong\">Synopsis: </span> {$synopsis_in} <br />\r\n</p>";
 $body_out = "<h2>Questions</h2>";
 $sections_out = "";
 $sections_cnt = 0;
 $questions_cnt = 0;
 preg_match_all("/<(.+?)( .+?)?>(.+?)<\\/\\1>\r/s", $text_in, $tags_out, PREG_SET_ORDER);
 for ($i = 0; $i < count($tags_out); $i++) {
     $tag = $tags_out[$i][1];
     $tag_args = $tags_out[$i][2];
     $tag_text = trim($tags_out[$i][3]);
     $tag_text = preg_replace("/\n/", "<br />\n", $tag_text);
     //$tag_text = "<p>{$tag_text}</p>";
     //$tag_text = preg_replace( "/\n/", "</p><p>\n", $tag_text );
     $tag_text = wordwrap($tag_text, 80, "\n");
     switch ($tag) {
         case "desc":
コード例 #7
0
ファイル: widgets.php プロジェクト: joran98/laclef-webapp
foreach ($jobs as $job) {
    ?>
						<tr>
							<td><a href="/models/<?php 
    echo $job['file'];
    ?>
"><?php 
    echo $job['file'];
    ?>
</td>
							<td><?php 
    echo $job['firstname'];
    ?>
</td>
							<td><?php 
    echo date_to_string($job['delivery']);
    ?>
</td>
							<?php 
    if ($job['status'] == 0) {
        echo '<td><span class="ink-label error">' . _("Non traité") . '</span></td>';
    } elseif ($job['status'] == 1) {
        echo '<td><span class="ink-label warning">' . _("Traitement") . '</span></td>';
    } else {
        echo '<td><span class="ink-label success">' . _("Livré") . '</span></td>';
    }
    ?>
						</tr>
					<?php 
}
?>
コード例 #8
0
 private function _request_auth()
 {
     ZResponse::getInstance()->setCode(401)->setMessage('Unauthorized')->setHeader('Date', date_to_string(date_create(DATE_RSS)))->setHeader('WWW-Authenticate', 'Basic realm="Secure area"');
     throw new ZControllerException('Unauthorized', ZControllerException::EXC_AUTH);
 }
コード例 #9
0
ファイル: slash2html.php プロジェクト: enascimento/carmack
fclose($fp);
$output_file = "../slashdot.html";
$fp = fopen($output_file, "w");
$head = preg_replace(array("/@keywords/", "/@title/"), array($conf->keywords . ", slashdot", "{$conf->title} - Slashdot archive"), $conf->header);
$head .= read_file("template/slashdot.html");
$titles = "<h2>Article List</h2>\n<ul>\n";
ksort($sids);
foreach ($sids as $sid_key => $sid_info) {
    $titles .= "\t<li>" . sidkey_to_date($sid_key) . " - <a href=\"#s{$sid_key}\">{$sid_info['title']}</a></li>\n";
}
$titles .= "</ul>\n\n";
$body = "<h2>Comments</h2>\n";
ksort($sids);
foreach ($sids as $sid_key => $sid_info) {
    $body .= "\t<h3><a href=\"#s{$sid_key}\"><img src=\"dot.png\" alt=\"\" /></a><a id=\"s{$sid_key}\"></a> <a href=\"{$sid_info['url']}\">{$sid_info['title']}</a></h3>\n\n\t<div class=\"highlight_block\">\n";
    ksort($posts[$sid_key]);
    foreach ($posts[$sid_key] as $date => $post_list) {
        foreach ($post_list as $idx => $post_info) {
            add_to_timeline(substr($date, 0, 8), "Slashdot", "{$post_info['article']} - {$post_info['title']}", "slashdot.html#s{$sid_key}");
            $body .= "\t\t<h4>" . date_to_string($date) . " - <a href=\"{$post_info['url']}\">{$post_info['title']}</a></h4><div>{$post_info['post']}</div>\n";
        }
    }
    $body .= "\t</div>\n";
}
$body .= "<p></p>";
fputs($fp, $head);
fputs($fp, $titles);
fputs($fp, $body);
fputs($fp, $conf->footer);
fclose($fp);
chmod($output_file, 0666);
コード例 #10
0
ファイル: interview2tex.php プロジェクト: enascimento/carmack
$head .= "\\begin{document}\n" . title2tex("Interviews");
$body = "";
ksort($interview_list);
foreach ($interview_list as $date_key => $file) {
    $fp_in = fopen($file, "r");
    $url_in = rtrim(fgets($fp_in, 1024));
    $title_in = rtrim(fgets($fp_in, 1024));
    $synopsis_in = rtrim(fgets($fp_in, 1024));
    $organization_in = rtrim(fgets($fp_in, 1024));
    $interviewer_in = rtrim(fgets($fp_in, 1024));
    $text_in = fread($fp_in, filesize($file));
    /*
    	MAIN PAGE
    */
    $body .= "\\chapter{" . html2tex($title_in) . "}\n";
    $body .= "This interview was conducted by {$interviewer_in} for {$organization_in} on " . date_to_string($date_key) . ".\n\n";
    $body .= "\\url{" . $url_in . "}\n\n";
    $body .= "\\section*{Interview}\n\n";
    $sections_out = "";
    $sections_cnt = 0;
    $questions_cnt = 0;
    preg_match_all("/<(.+?)( .+?)?>(.+?)<\\/\\1>\r/s", $text_in, $tags_out, PREG_SET_ORDER);
    for ($i = 0; $i < count($tags_out); $i++) {
        $tag = $tags_out[$i][1];
        $tag_args = ltrim(rtrim($tags_out[$i][2]));
        $tag_text = ltrim(rtrim($tags_out[$i][3]));
        switch ($tag) {
            case "desc":
                $body .= "\\section*{Prologue}\n" . html2tex($tag_text) . "\n\\section*{Questions}\n";
                break;
            case "q":
コード例 #11
0
ファイル: plan_compile.php プロジェクト: enascimento/carmack
        if (preg_match("/" . $conf->user . "_plan_(....)(..)(..)\\.txt/", $file, $matches)) {
            $year = $matches[1];
            $month = $matches[2];
            $day = $matches[3];
            $plans_mon["{$year}{$month}"][] = $file;
            $plans_yr["{$year}"][] = $file;
        }
    }
    closedir($dh);
}
foreach ($plans_yr as $key => $list) {
    $output_file = $conf->user . "_plan_" . $key . ".txt";
    $fp = fopen($output_file, "w");
    asort($list);
    foreach ($list as $file) {
        $fp_plan = fopen($dir . $file, "r");
        $data_plan = fread($fp_plan, filesize($dir . $file));
        fclose($fp_plan);
        $date = date_to_string(substr($file, 11, 8));
        fputs($fp, "-----------------------------------------\n" . $conf->fullname . "'s .plan for {$date}\n-----------------------------------------\n\n");
        fwrite($fp, $data_plan, strlen($data_plan));
        fputs($fp, "\n\n\n");
    }
    fclose($fp);
    chmod($output_file, 0777);
}
exec("zip -9 ../files/" . $conf->user . "_plan_by_year.zip " . $conf->user . "_plan_????.txt");
exec("zip -9 -j ../files/" . $conf->user . "_plan_by_day.zip " . $dir . $conf->user . "_plan_????????.txt");
chmod("../files/" . $conf->user . "_plan_by_year.zip", 0777);
chmod("../files/" . $conf->user . "_plan_by_day.zip", 0777);
exec("rm " . $conf->user . "_plan_????.txt");
コード例 #12
0
ファイル: datetime.php プロジェクト: rpodgorny/attendance
function is_holiday($year, $month, $day)
{
    $date = date_to_string($year, $month, $day);
    $res = db_query("SELECT id FROM vacancies WHERE date='" . $date . "'");
    $row = pg_fetch_array($res);
    pg_free_result($res);
    if ($row) {
        return true;
    }
    return false;
}
コード例 #13
0
ファイル: page_compile.php プロジェクト: enascimento/carmack
add_to_timeline("20110807", "Audio", "John Carmack at QuakeCon 2011", "http://www.archive.org/details/JohnCarmackAtQuakecon2011");
write_template("audio.html", ", audio, mp3, speech, keynote", " - Audio files");
write_template("plan.html", ", blog, log, plan", " - plan Archive");
write_template("pdfs.html", ", pdf", " - .pdf Archive");
// build latest postings for index
krsort($timeline);
$text = "<h2>Recent Items</h2>\n<ul>";
$items = 0;
foreach ($timeline as $timestamp => $link_array) {
    $cnt = count($link_array);
    for ($i = $cnt - 1; $i >= 0; $i--) {
        if ($items++ > 20) {
            break;
        }
        $link_info = $link_array[$i];
        $text .= "<li><span class=\"strong\">" . date_to_string($timestamp) . "</span> - ({$link_info['type']}) <a href=\"{$link_info['url']}\">{$link_info['title']}</a></li>\n";
    }
}
write_timeline();
// copy static in
if ($dh = opendir($static_dir)) {
    while (($file = readdir($dh)) !== false) {
        if (strlen($file) > 2) {
            copy($static_dir . $file, $root_dir . $file);
            chmod($root_dir . $file, 0777);
            // :|
        }
    }
    closedir($dh);
}
include "page_compress.php";
コード例 #14
0
ファイル: equipments.php プロジェクト: joran98/laclef-webapp
			    <tr>
			      <td><?php 
    echo $equipment['uid'];
    ?>
</td>
			      <td><?php 
    echo $equipment['name'];
    ?>
</td>
						<td class="hide-small hide-medium"><?php 
    echo $equipment['description'];
    ?>
</td>
						<td><?php 
    if ($equipment['hirer']) {
        echo '<span class="ink-label error invert">' . _("Loué par") . ' ' . $equipment['hirer'] . ' ' . _("jusqu'au") . ' ' . date_to_string($equipment['end']) . '</span>';
    } else {
        echo '<span class="ink-label success invert">' . _("Disponible") . '</span>';
    }
    ?>
</td>
						<td>
					    <a href="equipment?id=<?php 
    echo $equipment['id'];
    ?>
"><button class="ink-button"><i class="icon-pencil"></i></button></a>
					    <a href="equipment/delete?id=<?php 
    echo $equipment['id'];
    ?>
"><button class="ink-button red"><i class="icon-remove"></i></button></a>
					    <?php