示例#1
0
)</a><br />
			<div class="klear"></div>
		</div>
		<?php 
}
?>
		
		<?php 
if (isset($D->p->post_attached['image'])) {
    ?>
		<div class="attachment">
			<span class="imgtxt"><?php 
    echo $this->lang('singlepost_atch_image');
    ?>
 (<?php 
    echo show_filesize($D->p->post_attached['image']->filesize);
    ?>
,&nbsp;<?php 
    echo $D->p->post_attached['image']->size_original[0];
    ?>
x<?php 
    echo $D->p->post_attached['image']->size_original[1];
    ?>
px):</span>
			<div class="klear"></div>
			<a href="<?php 
    echo $C->SITE_URL;
    ?>
getfile/pid:<?php 
    echo $D->p->post_tmp_id;
    ?>
示例#2
0
if (db_check_larare($_SESSION['sendMe']['id'])) {
    // lärar-view
    ?>
<h2>Att rätta</h2>
<?php 
    $sql = "SELECT id, namn FROM kurs WHERE skapad_av='" . $_SESSION['sendMe']['id'] . "' ORDER BY namn";
    $q = mysql_query($sql);
    if (mysql_num_rows($q) > 0) {
        echo "<table border=1 style='width: 100%'>\n";
        while ($r = mysql_fetch_array($q)) {
            echo "<tr><th colspan='6' style='width: 100%; background-color: #ccc; text-align: left'><strong>" . $r['namn'] . "</strong></th></tr>";
            $s = "SELECT * FROM uppgifter WHERE kurs_id='" . $r['id'] . "' AND rattad='0' ORDER BY inlamnad DESC";
            $qu = mysql_query($s);
            while ($row = mysql_fetch_array($qu)) {
                $file_url = $row['inlamnad'] . "-" . $row['name_orig'];
                printf("<tr><td><img src='icons/%s.gif' style='width: 20px'/></td><td><a href='showfile.php?file=%s'>%s</a></td><td>%s</td><td>%s</td><td>%s</td><td align='right'><a href='getfile.php?file=%s'><img src='icons/download.gif' title='H�mta' alt='H�mta' style='border: 0; width: 20px' /></a></td></tr>", file_to_icon($row['file_type']), $file_url, $row['name_orig'], db_get_user_name($row['user_id']), show_filesize($row['file_size']), show_date($row['inlamnad']), $file_url);
            }
        }
        echo "</table>\n";
    } else {
        echo "<p>Du har inga kurser upplagda än.</p>";
    }
    ?>

<?php 
} else {
    // elev-view
    ?>
<h2>Dina inlämnade uppgifter</h2>

<h2>Dina rättade uppgifter</h2>	
getfile/pid:<?php 
    echo $D->p->post_tmp_id;
    ?>
/tp:image/<?php 
    echo htmlspecialchars($D->att->title);
    ?>
" target="_top">
					<?php 
    echo $D->att->size_original[0];
    ?>
x<?php 
    echo $D->att->size_original[1];
    ?>
px,
					<?php 
    echo show_filesize($D->att->filesize);
    ?>
				</a>
				<!--
				&middot;
				<a href="<?php 
    echo $C->SITE_URL;
    ?>
getfile/pid:<?php 
    echo $D->p->post_tmp_id;
    ?>
/tp:image/<?php 
    echo htmlspecialchars($D->att->title);
    ?>
" target="_top"><?php 
    echo $this->lang('post_atchimg_ftr_dwnld');
示例#4
0
function table_att_ratta($id)
{
    $ret = "";
    $id = db_clean($id);
    $sql = "SELECT id, namn FROM kurs WHERE skapad_av='" . $id . "' AND active='1' ORDER BY namn";
    $q = mysql_query($sql);
    if (mysql_num_rows($q) > 0) {
        $ret .= "<table border=0 style='width: 100%'>\n";
        while ($r = mysql_fetch_array($q)) {
            $s = "SELECT * FROM uppgifter WHERE kurs_id='" . $r['id'] . "' AND rattad='0' ORDER BY inlamnad DESC";
            $qu = mysql_query($s);
            if (mysql_num_rows($qu) > 0) {
                $ret .= "<tr><th colspan='6' style='width: 100%; background-color: #ccc; text-align: left'><strong>" . $r['namn'] . "</strong></th></tr>";
                while ($row = mysql_fetch_array($qu)) {
                    $file_url = $row['inlamnad'] . "-" . $row['name_orig'];
                    $ret .= sprintf("<tr><td><img src='icons/%s.gif' style='width: 20px'/></td><td><a href='showfile.php?file=%s'>%s</a></td><td>%s</td><td class='right'>%s</td><td class='right'>%s</td><td class='right'><a href='getfile.php?file=%s'><img src='icons/download.gif' title='Hämta' alt='Hämta' style='border: 0; width: 20px' /></a></td></tr>", file_to_icon($row['file_type']), $file_url, $row['name_orig'], db_get_user_name($row['user_id']), show_filesize($row['file_size']), show_date($row['inlamnad']), $file_url);
                }
            }
        }
        $ret .= "</table>\n";
    } else {
        $ret .= "<p>Du har inga kurser upplagda än.</p>";
    }
    return $ret;
}