当前位置: 首页>>代码示例>>PHP>>正文


PHP nice_format函数代码示例

本文整理汇总了PHP中nice_format函数的典型用法代码示例。如果您正苦于以下问题:PHP nice_format函数的具体用法?PHP nice_format怎么用?PHP nice_format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了nice_format函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list_videos

function list_videos()
{
    global $id, $tool_content, $themeimg, $course_id, $langTitle, $langDescr, $langDate, $langChoice, $langCatVideoDirectory, $langAddModulesButton, $langNoVideo, $course_code;
    $count = 0;
    $video_found = FALSE;
    $cnt1 = Database::get()->querySingle("SELECT COUNT(*) AS cnt FROM video WHERE course_id = ?d", $course_id)->cnt;
    $cnt2 = Database::get()->querySingle("SELECT COUNT(*) AS cnt FROM videolink WHERE course_id = ?d", $course_id)->cnt;
    $count = $cnt1 + $cnt2;
    if ($count > 0) {
        $video_found = TRUE;
        $tool_content .= "<form action='insert.php?course={$course_code}' method='post'><input type='hidden' name='id' value='{$id}' />";
        $tool_content .= "<table class='table-default'>";
        $tool_content .= "<tr>" . "<th width='200' class='text-left'>&nbsp;{$langTitle}</th>" . "<th class='text-left'>{$langDescr}</th>" . "<th width='100'>{$langDate}</th>" . "<th width='80'>{$langChoice}</th>" . "</tr>";
        foreach (array('video', 'videolink') as $table) {
            $result = Database::get()->queryArray("SELECT * FROM {$table} WHERE (category IS NULL OR category = 0) AND course_id = ?d", $course_id);
            foreach ($result as $row) {
                $row->course_id = $course_id;
                if ($table == 'video') {
                    $vObj = MediaResourceFactory::initFromVideo($row);
                    $videolink = MultimediaHelper::chooseMediaAhref($vObj);
                } else {
                    $vObj = MediaResourceFactory::initFromVideoLink($row);
                    $videolink = MultimediaHelper::chooseMedialinkAhref($vObj);
                }
                $tool_content .= "<td>&nbsp;" . icon('fa-film') . "&nbsp;&nbsp;" . $videolink . "</td>" . "<td>" . q($row->description) . "</td>" . "<td class='text-center'>" . nice_format($row->date, true, true) . "</td>" . "<td class='text-center'><input type='checkbox' name='video[]' value='{$table}:{$row->id}' /></td>" . "</tr>";
            }
        }
        $sql = Database::get()->queryArray("SELECT * FROM video_category WHERE course_id = ?d ORDER BY name", $course_id);
        if ($sql) {
            $tool_content .= "<tr><td colspan='3' class='bold'>&nbsp;{$langCatVideoDirectory}</td></tr>";
            foreach ($sql as $videocat) {
                $tool_content .= "<tr>";
                $tool_content .= "<td>" . icon('fa-folder-o') . "&nbsp;&nbsp;" . q($videocat->name) . "</td>";
                $tool_content .= "<td colspan='2'>" . standard_text_escape($videocat->description) . "</td>";
                $tool_content .= "<td align='center'><input type='checkbox' name='videocatlink[]' value='{$videocat->id}' /></td>";
                $tool_content .= "</tr>";
                foreach (array('video', 'videolink') as $table) {
                    $sql2 = Database::get()->queryArray("SELECT * FROM {$table} WHERE category = ?d", $videocat->id);
                    foreach ($sql2 as $linkvideocat) {
                        $tool_content .= "<tr>";
                        $tool_content .= "<td>&nbsp;&nbsp;&nbsp;&nbsp;<img src='{$themeimg}/links_on.png' />&nbsp;&nbsp;<a href='" . q($linkvideocat->url) . "' target='_blank'>" . q($linkvideocat->title == '' ? $linkvideocat->url : $linkvideocat->title) . "</a></td>";
                        $tool_content .= "<td>" . standard_text_escape($linkvideocat->description) . "</td>";
                        $tool_content .= "<td class='text-center'>" . nice_format($linkvideocat->date, true, true) . "</td>";
                        $tool_content .= "<td class='text-center'><input type='checkbox' name='video[]' value='{$table}:{$linkvideocat->id}' /></td>";
                        $tool_content .= "</tr>";
                    }
                }
            }
        }
        $tool_content .= "<tr><th colspan='4'><div align='right'><input class='btn btn-primary' type='submit' name='submit_video' value='" . q($langAddModulesButton) . "' />&nbsp;&nbsp;</div></th></tr></table></form>";
    }
    if (!$video_found) {
        $tool_content .= "<div class='alert alert-warning'>{$langNoVideo}</div>";
    }
}
开发者ID:kostastzo,项目名称:openeclass,代码行数:55,代码来源:insert_video.php

示例2: show_assignments

function show_assignments()
{
    global $m, $uid, $group_id, $langSubmit, $langDays, $langNoAssign, $tool_content, $langWorks, $course_id, $course_code, $themeimg;
    $res = Database::get()->queryArray("SELECT *, (TO_DAYS(deadline) - TO_DAYS(NOW())) AS days\n\t\t FROM assignment WHERE course_id = ?d", $course_id);
    if (count($res) == 0) {
        $tool_content .= $langNoAssign;
        return;
    }
    $tool_content .= "<form action='{$_SERVER['SCRIPT_NAME']}?course={$course_code}' method='post'>\n                <input type='hidden' name='file' value='" . q($_GET['submit']) . "'>\n                <input type='hidden' name='group_id' value='{$group_id}'>\n                <table class='tbl' width='99%'>\n                <tr>\n                <th class='left' width='170'>&nbsp;</th>\n                <td>&nbsp;</td>\n                </tr>\n                <tr>\n                <th class='left'>{$langWorks} ({$m['select']}):</th>\n                <td>\n                <table width='99%' align='left'>\n                <tr>\n\t\t<th class='left' colspan='2'>{$m['title']}</th>\n\t\t<th align='center' width='30%'>{$m['deadline']}</th>\n\t\t<th align='center' width='10%'>{$m['submitted']}</th>\n\t\t<th align='center' width='10%'>{$m['select']}</th>\n\t\t</tr>";
    foreach ($res as $row) {
        if (!$row->active) {
            continue;
        }
        $tool_content .= "<tr><td width=\"1%\">\n\t\t\t<img style='padding-top:2px;' src='{$themeimg}/arrow.png' alt=''></td>\n\t\t\t<td><div align='left'><a href='index.php?course={$course_code}&amp;id={$row->id}'>" . q($row->title) . "</a></td>\n\t\t\t<td align='center'>" . nice_format($row->deadline);
        if ($row->days > 1) {
            $tool_content .= " ({$m['in']}&nbsp;{$row->days}&nbsp;{$langDays}";
        } elseif ($row->days < 0) {
            $tool_content .= " ({$m['expired']})";
        } elseif ($row->days == 1) {
            $tool_content .= " ({$m['tomorrow']})";
        } else {
            $tool_content .= " ({$m['today']})";
        }
        $tool_content .= "</div></td>\n      <td align=\"center\">";
        $subm = was_submitted($uid, $group_id, $row->id);
        if ($subm == 'user') {
            $tool_content .= $m['yes'];
        } elseif ($subm == 'group') {
            $tool_content .= $m['by_groupmate'];
        } else {
            $tool_content .= $m['no'];
        }
        $tool_content .= "</td><td align=\"center\">";
        if ($row->days >= 0 and !was_graded($uid, $row->id) and is_group_assignment($row->id)) {
            $tool_content .= "<input type='radio' name='assign' value='{$row->id}'>";
        } else {
            $tool_content .= '-';
        }
        $tool_content .= "</td>\n    </tr>";
    }
    $tool_content .= "\n    </table>";
    $tool_content .= "</td></tr>\n\t<tr>\n\t  <th class='left'>" . $m['comments'] . ":</th>\n\t  <td><textarea name='comments' rows='4' cols='60'>" . "</textarea></td>\n\t</tr>\n\t<tr>\n\t  <th>&nbsp;</th>\n\t  <td><input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'></td>\n\t</tr>\n\t</table>\n\t</form>";
}
开发者ID:kostastzo,项目名称:openeclass,代码行数:43,代码来源:group_work.php

示例3: list_assignments

/**
 * @brief display list of available assignments (if any)
 * @global type $id
 * @global type $tool_content
 * @global type $langTitle
 * @global type $langChoice
 * @global type $langGroupWorkDeadline_of_Submission
 * @global type $langAddModulesButton
 * @global type $langNoAssign
 * @global type $langActive
 * @global type $langInactive
 * @global type $langVisible
 * @global type $course_id
 * @global type $course_code
 */
function list_assignments() {
    global $id, $tool_content, $langTitle, $langChoice, $langGroupWorkDeadline_of_Submission,
    $langAddModulesButton, $langNoAssign, $langActive, $langInactive,
    $langVisible, $course_id, $course_code;

    $result = Database::get()->queryArray("SELECT * FROM assignment WHERE course_id = ?d ORDER BY active, title", $course_id);
    if (count($result) == 0) {
        $tool_content .= "<div class='alert alert-warning'>$langNoAssign</div>";
    } else {
        $tool_content .= "<form action='insert.php?course=$course_code' method='post'>" .
                "<input type='hidden' name='id' value='$id'>" .
                "<table class='table-default'>" .
                "<tr class='list-header'>" .
                "<th class='text-left'>&nbsp;$langTitle</th>" .
                "<th width='120'>$langGroupWorkDeadline_of_Submission</th>" .
                "<th style='width:20px;' class='text-center'>$langChoice</th>" .
                "</tr>";        
        foreach ($result as $row) {
            
            if ($row->active) {
                $visible = icon('fa-eye', $langActive);
            } else {
                $visible = icon('fa-eye-slash', $langInactive);
            }            
            $description = empty($row->description) ? '' :
                    "<div>$row->description</div>";            
            $tool_content .= "<tr>" .
                    "<td> " . q($row->title) . "<br><br><div class='text-muted'>$description</div></td>" .
                    "<td class='text-center'>".nice_format($row->submission_date, true)."</td>" .
                    "<td class='text-center'><input name='work[]' value='$row->id' type='checkbox' /></td>" .
                    "</tr>";            
        }
        $tool_content .= 
                "</table>" .
                "<div align='right'><input class='btn btn-primary' type='submit' name='submit_work' value='$langAddModulesButton' /></div></th></form>";
    }
}
开发者ID:nikosv,项目名称:openeclass,代码行数:52,代码来源:insert_work.php

示例4: foreach

 $count_index = 0;
 foreach ($sql as $cu) {
     if ($cu->visible == 1) {
        $count_index++;
     }
     // access status
     $access = $cu->public;
     // Visibility icon
     $vis = $cu->visible;
     $icon_vis = ($vis == 1) ? 'visible.png' : 'invisible.png';
     $class_vis = ($vis == 0) ? 'not_visible' : '';
     if ($course_info->view_type == 'weekly') {
         if (!empty($cu->title)) {
             $cwtitle = "" . q($cu->title) . " ($langFrom2 ".nice_format($cu->start_week)." $langTill ".nice_format($cu->finish_week).")";                    
         } else {
             $cwtitle = "$count_index$langOr $langsWeek ($langFrom2 ".nice_format($cu->start_week)." $langTill ".nice_format($cu->finish_week).")"; 
         }                
         $href = "<a class = '$class_vis' href='${urlServer}modules/weeks/?course=$course_code&amp;id=$cu->id&amp;cnt=$count_index'>$cwtitle</a>";
     } else {
         $href = "<a class='$class_vis' href='${urlServer}modules/units/?course=$course_code&amp;id=$cu->id'>" . q($cu->title) . "</a>";
     }
     $cunits_content .= "<div class='col-xs-12'><div class='panel clearfix'><div class='col-xs-12'>
                             <div class='item-content'>
                                 <div class='item-header clearfix'>
                                     <h4 class='item-title'>$href</h4>";
                         if ($is_editor) {
         if ($course_info->view_type == 'weekly') { // actions for course weekly format
             $cunits_content .= "<div class='item-side'>" .
             action_button(array(
                 array('title' => $langEditChange,
                       'url' => $urlAppend . "modules/weeks/info.php?course=$course_code&amp;edit=$cu->id&amp;cnt=$count_index",
开发者ID:nikosv,项目名称:openeclass,代码行数:31,代码来源:course_home.php

示例5: foreach

 $tool_content .= "\n    <th width='50'>&nbsp;</th>";
 $tool_content .= "\n    <th width='10%'><div align='center'><b>{$langType}</b></div></th>";
 $tool_content .= "\n    <th><div align='left'><b>{$langName}</b></div></th>";
 $tool_content .= "\n    <th width='15%'><div align='center'><b>{$langSize}</b></div></th>";
 $tool_content .= "\n    <th width='15%'><div align='center'><b>{$langDate}</b></div></th>";
 $tool_content .= "\n  </tr>";
 foreach ($fileinfo as $entry) {
     if ($entry['is_dir']) {
         // do not handle directories
         continue;
     }
     $cmdDirName = $entry['path'];
     $copyright_icon = '';
     $image = choose_image('.' . $entry['format']);
     $size = format_file_size($entry['size']);
     $date = nice_format($entry['date'], true, true);
     if ($entry['visible']) {
         $style = '';
     } else {
         $style = ' class="invisible"';
     }
     if (empty($entry['title'])) {
         $link_text = $entry['filename'];
     } else {
         $link_text = $entry['title'];
     }
     if ($entry['copyrighted']) {
         $link_text .= " <img src='../document/img/copyrighted.png' />";
     }
     $tool_content .= "\n  <tr{$style}>";
     $tool_content .= "\n    <td><input type='radio' name='selectedDocument' value='" . $entry['path'] . "'/></td>";
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:importLearningPath.php

示例6: show_assignments

function show_assignments() {
    global $m, $uid, $group_id, $langSubmit, $langDays, $langNoAssign, $tool_content,
    $langWorks, $course_id, $course_code, $themeimg, $langCancel, $urlServer;
    
    $gids = user_group_info($uid, $course_id);
    if (!empty($gids)) {
        $gids_sql_ready = implode(',',array_keys($gids));
    } else {
        $gids_sql_ready = "''";
    }
    
    $res = Database::get()->queryArray("SELECT *, CAST(UNIX_TIMESTAMP(deadline)-UNIX_TIMESTAMP(NOW()) AS SIGNED) AS time
                                 FROM assignment WHERE course_id = ?d AND active = '1' AND
                                 (assign_to_specific = '0' OR assign_to_specific = '1' AND id IN
                                    (SELECT assignment_id FROM assignment_to_specific WHERE user_id = ?d UNION SELECT assignment_id FROM assignment_to_specific WHERE group_id IN ($gids_sql_ready))
                                 )
                                 ORDER BY CASE WHEN CAST(deadline AS UNSIGNED) = '0' THEN 1 ELSE 0 END, deadline", $course_id, $uid);

    if (count($res) == 0) {
        $tool_content .= $langNoAssign;
        return;
    }
    $table_content = '';
    foreach ($res as $row) {
        if (!$row->active) {
            continue;
        }

        $table_content .= "<tr><td width=\"1%\">
			<img style='padding-top:2px;' src='$themeimg/arrow.png' alt=''></td>
			<td><div align='left'><a href='index.php?course=$course_code&amp;id=$row->id'>" . q($row->title) . "</a></td>
			<td align='center'>" . nice_format($row->deadline);
                        if ($row->time > 0) {
                            $table_content .= "<br>(<small>$langDaysLeft" . format_time_duration($row->time) . "</small>)";
                        } else if($row->deadline){
                            $table_content .= "<br> (<small><span class='expired'>$m[expired]</span></small>)";
                        }

        $table_content .= "</div></td>\n      <td align=\"center\">";
        $subm = was_submitted($uid, $group_id, $row->id);
        if ($subm == 'user') {
            $table_content .= $m['yes'];
        } elseif ($subm == 'group') {
            $table_content .= $m['by_groupmate'];
        } else {
            $table_content .= $m['no'];
        }
        $table_content .= "</td><td align=\"center\">";
        if ($row->time >= 0 and !was_graded($uid, $row->id) and is_group_assignment($row->id)) {
            $table_content .= "<input type='radio' name='assign' value='$row->id'>";
        } else {
            $table_content .= '-';
        }
        $table_content .= "</td>\n    </tr>";
    }
    $tool_content .= "
            <div class='form-wrapper'>
                <form class='form-horizontal' action='$_SERVER[SCRIPT_NAME]?course=$course_code' method='post'>
                <fieldset>
                    <input type='hidden' name='file' value='" . q($_GET['submit']) . "'>
                    <input type='hidden' name='group_id' value='$group_id'>
                    <div class='form-group'>
                        <label for='title' class='col-sm-2 control-label'>$langWorks ($m[select]):</label>
                        <div class='col-sm-10'>
                            <table class='table-default'>
                                <tr>
                                    <th class='left' colspan='2'>$m[title]</th>
                                    <th align='center' width='30%'>$m[deadline]</th>
                                    <th align='center' width='10%'>$m[submitted]</th>
                                    <th align='center' width='10%'>$m[select]</th>
                                </tr>
                                $table_content
                            </table>
                        </div>
                    </div>
                    <div class='form-group'>
                        <label for='title' class='col-sm-2 control-label'>$m[comments]:</label>
                        <div class='col-sm-10'>
                            <textarea name='comments' rows='4' cols='60' class='form-control'></textarea>
                        </div>
                    </div>
                    <div class='form-group'>
                        <div class='col-sm-10 col-sm-offset-2'>
                            <input class='btn btn-primary' type='submit' name='submit' value='$langSubmit'>
                            <a class='btn btn-default' href='$urlServer/modules/group/document.php?course=$course_code&group_id=$group_id'>$langCancel</a>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>";
}
开发者ID:nikosv,项目名称:openeclass,代码行数:91,代码来源:group_work.php

示例7: nice_format

        echo $_LANG[$l]["g_deposit"];
        ?>
</a> | <a href="?c=balance/withdraw_slc<?php 
        echo $___l;
        ?>
" <?php 
        if ($content == "balance/withdraw_slc") {
            echo " class=\"active\"";
        }
        ?>
><?php 
        echo $_LANG[$l]["g_withdraw"];
        ?>
</a></li>
            <li style="font-size: 0.9em"><?php 
        echo nice_format(get_balance($_SESSION["user_id"], "BTC"), false, 0, 8);
        ?>
 <?php 
        echo $_LANG[$l]["g_bitcoins"];
        ?>
<br /><a href="?c=balance/deposit_btc<?php 
        echo $___l;
        ?>
" <?php 
        if ($content == "balance/deposit_btc") {
            echo " class=\"active\"";
        }
        ?>
><?php 
        echo $_LANG[$l]["g_deposit"];
        ?>
开发者ID:rhartness,项目名称:slc24,代码行数:31,代码来源:index.php

示例8: display

 /**
  * display users logging        
  * Note: $module_id = $course_id = 0 means other logging (e.g. modify user profile, course creation etc.)
  * @param int $course_id (-1 means all courses)
  * @param type $user_id (-1 means all users)
  * @param int $module_id (-1 means all modules)
  * @param type $logtype (-1 means logtypes)
  * @param type $date_from
  * @param type $date_now
  * @param type script_page     
  * @return none        
  */
 public function display($course_id, $user_id, $module_id, $logtype, $date_from, $date_now, $script_page)
 {
     global $tool_content, $modules;
     global $langNoUsersLog, $langDate, $langUser, $langAction, $langDetail, $langCourse, $langModule, $langAdminUsers, $langExternalLinks, $langCourseInfo;
     $q1 = $q2 = $q3 = $q4 = '';
     if ($user_id != -1) {
         $q1 = "AND user_id = {$user_id}";
         // display specific user
     }
     if ($logtype > 0) {
         $q3 = "AND action_type = {$logtype}";
         // specific course logging
         if ($logtype > 3) {
             // specific system logging
             $module_id = $course_id = 0;
         }
     } elseif ($logtype == -2) {
         // display all system logging
         $q2 = "AND module_id = 0";
         $q4 = "AND course_id = 0";
     }
     if ($module_id > 0) {
         $q2 = "AND module_id = {$module_id}";
         // display specific module
     } elseif ($module_id == -1) {
         // display all course module logging
         $q2 = "AND module_id > 0";
         // but exclude system logging
     }
     if ($course_id > 0) {
         $q4 = "AND course_id = {$course_id}";
         // display specific course
     } elseif ($course_id == -1) {
         // display all course logging
         $q4 = "AND course_id > 0";
         // but exclude system logging
     }
     // count logs
     $num_of_logs = Database::get()->querySingle("SELECT COUNT(*) AS count FROM log WHERE ts BETWEEN '{$date_from}' AND '{$date_now}' {$q1} {$q2} {$q3} {$q4}")->count;
     // fetch logs
     $sql = Database::get()->queryArray("SELECT user_id, course_id, module_id, details, action_type, ts FROM log\n                                WHERE ts BETWEEN '{$date_from}' AND '{$date_now}'\n                                {$q1} {$q2} {$q3} {$q4}\n                                ORDER BY ts DESC");
     if ($num_of_logs > 0) {
         if ($course_id > 0) {
             $tool_content .= "<div class='alert alert-info'>{$langCourse}: " . q(course_id_to_title($course_id)) . "</div>";
         }
         if ($module_id > 0) {
             if ($module_id == MODULE_ID_USERS) {
                 $tool_content .= "<div class='alert alert-info'>{$langModule}: " . $langAdminUsers . "</div>";
             } elseif ($module_id == MODULE_ID_TOOLADMIN) {
                 $tool_content .= "<div class='alert alert-info'>{$langModule}: " . $langExternalLinks . "</div>";
             } else {
                 $tool_content .= "<div class='alert alert-info'>{$langModule}: " . $modules[$module_id]['title'] . "</div>";
             }
         }
         $tool_content .= "<table id = 'log_results_table' class='tbl'>";
         $tool_content .= "<thead>";
         // log header
         $tool_content .= "<tr><th>{$langDate}</th><th>{$langUser}</th>";
         if ($course_id == -1) {
             $tool_content .= "<th>{$langCourse}</th>";
         }
         if ($module_id == -1) {
             $tool_content .= "<th>{$langModule}</th>";
         }
         $tool_content .= "<th>{$langAction}</th><th>{$langDetail}</th>";
         $tool_content .= "</tr>";
         $tool_content .= "</thead>";
         $tool_content .= "<tbody>";
         // display logs
         foreach ($sql as $r) {
             $tool_content .= "<tr>";
             $tool_content .= "<td>" . nice_format($r->ts, true) . "</td>";
             if ($r->user_id == 0 or $logtype == LOG_DELETE_USER) {
                 // login failures or delete user
                 $tool_content .= "<td>&nbsp;&nbsp;&mdash;&mdash;&mdash;</td>";
             } else {
                 $tool_content .= "<td>" . display_user($r->user_id, false, false) . "</td>";
             }
             if ($course_id == -1) {
                 // all courses
                 $tool_content .= "<td>" . q(course_id_to_title($r->course_id)) . "</td>";
             }
             if ($module_id == -1) {
                 // all modules
                 $mid = $r->module_id;
                 if ($mid == MODULE_ID_USERS) {
                     $tool_content .= "<td>" . $langAdminUsers . "</td>";
                 } elseif ($mid == MODULE_ID_TOOLADMIN) {
//.........这里部分代码省略.........
开发者ID:kostastzo,项目名称:openeclass,代码行数:101,代码来源:log.php

示例9: show_resourcesWeeks

$tool_content .= "<div class='row'>
  <div class='col-md-12'>
    <div class='panel padding'>";
show_resourcesWeeks($id);
$tool_content .= "
    </div>
  </div>
</div>";

$q = Database::get()->queryArray("SELECT id, start_week, finish_week, title FROM course_weekly_view
               WHERE course_id = ?d $visibility_check", $course_id);
$course_weeks_options = "";
foreach ($q as $info) {
    $selected = ($info->id == $id) ? ' selected ' : '';
    $course_weeks_options .= "<option value='$info->id'$selected>" .
            nice_format($info->start_week)." ... " . nice_format($info->finish_week) ."</option>";
}
$tool_content .= "
            <div class='panel panel-default'>
                <div class='panel-body'>
                    <form class='form-horizontal' name='unitselect' action='" . $urlServer . "modules/weeks/' method='get'>
                        <div class='form-group'>
                            <label class='col-sm-8 control-label'>$langWeeks</label>
                            <div class='col-sm-4'>
                                <select name='id' class='form-control' onChange='document.unitselect.submit();'>
                                    $course_weeks_options
                                </select>
                            </div>
                        </div>
                    </form>
                </div>
开发者ID:nikosv,项目名称:openeclass,代码行数:31,代码来源:index.php

示例10: array

    $data['aaData'] = array();
    foreach ($result as $myrow) {
        $full_name = $myrow->givenname . " " . $myrow->surname;
        $am_message = empty($myrow->am) ? '' : ("<div class='right'>($langAm: " . q($myrow->am) . ")</div>");
        /* $link_parent_email = "";
          if (get_config('enable_secondary_email')) {
          if ($myrow->editor == 1 or $myrow->tutor == 1 or $myrow->status == 1 or empty($myrow['parent_email'])) {
          $link_parent_email = "";
          } else {
          $link_parent_email = "<a href='emailparent.php?course=$course_code&amp;id=$myrow->id'>
          <img src='$themeimg/email.png' title='".q($langEmailToParent)."' alt='".q($langEmailToParent)."' />
          </a>";
          }
          } */
        //create date field with unregister button
        $date_field = ($myrow->reg_date == '0000-00-00') ? $langUnknownDate : nice_format($myrow->reg_date);

        // Create appropriate role control buttons
        // Admin right
        $user_role_controls = '';
        if ($myrow->id != $_SESSION["uid"] && $myrow->reviewer == '1') {
            $user_role_controls .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;removeReviewer=$myrow->id'><img src='$themeimg/reviewer_remove.png' alt='$langRemoveRightReviewer' title='$langRemoveRightReviewer'></a>";
        } else {
            $user_role_controls .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;giveReviewer=$myrow->id'><img src='$themeimg/reviewer_add.png' alt='$langGiveRightReviewer' title='$langGiveRightReviewer'></a>";
        }
        // opencourses reviewer right
        if (get_config('opencourses_enable')) {
                if ($myrow->reviewer == '1') {
                    $user_role_controls .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;removeReviewer=$myrow->id'><img src='$themeimg/reviewer_remove.png' alt='$langRemoveRightReviewer' title='$langRemoveRightReviewer'></a>";
                } else {
                    $user_role_controls .= "<a href='$_SERVER[SCRIPT_NAME]?course=$course_code&amp;giveReviewer=$myrow->id'><img src='$themeimg/reviewer_add.png' alt='$langGiveRightReviewer' title='$langGiveRightReviewer'></a>";
开发者ID:nikosv,项目名称:openeclass,代码行数:31,代码来源:index.php

示例11: redirect_to_home_page

             Session::Messages($langAttendanceEdit, "alert-success");
             redirect_to_home_page("modules/attendance/index.php");
         }
     }
     //display the form and the list
     $result = Database::get()->querySingle("SELECT * FROM attendance_activities  WHERE id = ?d", $actID);
     $tool_content .= "<div class='alert alert-info'>" . $result->title . "</div>";
     //show all the students
     $resultUsers = Database::get()->queryArray("SELECT attendance_users.id as recID, attendance_users.uid as userID, user.surname as surname, user.givenname as name, user.am as am, course_user.reg_date as reg_date   FROM attendance_users, user, course_user  WHERE attendance_id = ?d AND attendance_users.uid = user.id AND `user`.id = `course_user`.`user_id` AND `course_user`.`course_id` = ?d ", $attendance_id, $course_id);
     if ($resultUsers) {
         //table to display the users
         $tool_content .= "\n            <form method='post' action='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&ins=" . $actID . "'>\n            <table id='users_table{$course_id}' class='table-default custom_list_order'>\n                <thead>\n                    <tr>\n                      <th width='1'>{$langID}</th>\n                      <th><div align='left' width='100'>{$langName} {$langSurname}</div></th>\n                      <th class='center' width='80'>{$langRegistrationDateShort}</th>\n                      <th class='center'>{$langAttendanceAbsences}</th>\n                      <th class='center'>{$langActions}</th>\n                    </tr>\n                </thead>\n                <tbody>";
         $cnt = 0;
         foreach ($resultUsers as $resultUser) {
             $cnt++;
             $tool_content .= "\n                    <tr>\n                        <td>{$cnt}</td>\n                        <td> " . display_user($resultUser->userID) . " ({$langAm}: {$resultUser->am})</td>\n                        <td>" . nice_format($resultUser->reg_date) . "</td>\n                        <td>" . userAttendTotal($attendance_id, $resultUser->userID) . "/" . $attendance_limit . "</td>\n                        <td class='center'>\n                            <input class='form-control' type='checkbox' value='1' name='" . $resultUser->userID . "'";
             //check if the user has attendace for this activity already OR if it should be automatically inserted here
             $q = Database::get()->querySingle("SELECT attend FROM attendance_book WHERE attendance_activity_id = ?d AND uid = ?d", $actID, $resultUser->userID);
             if (isset($q->attend) && $q->attend == 1) {
                 $tool_content .= " checked";
             }
             $tool_content .= ">\n                            <input type='hidden' value='" . $actID . "' name='actID'>\n                        </td>";
             $tool_content .= "\n                    </tr>";
         }
         $tool_content .= "</tbody></table> <input type='submit' class='btn btn-default' name='bookUsersToAct' value='{$langAttendanceBooking}' /></form>";
     }
     $showAttendanceActivities = 0;
 }
 //DISPLAY: list of attendance activities
 if ($showAttendanceActivities == 1) {
     //get all the available activities
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:index.php

示例12: foreach

        foreach ($posts as $post) {
            $sharing_content = '';
            $rating_content = '';
            if ($sharing_allowed) {
                $sharing_content = $sharing_enabled ? print_sharing_links($urlServer . "modules/blog/index.php?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId(), $post->getTitle()) : '';
            }
            if ($ratings_enabled) {
                $rating = new Rating('up_down', 'blogpost', $post->getId());
                $rating_content = $rating->put($is_editor, $uid, $course_id);
            }
            if ($comments_enabled) {
                $comm = new Commenting('blogpost', $post->getId());
                $comment_content = "<a class='btn btn-primary btn-xs pull-right' href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "#comments_title'>{$langComments} (" . $comm->getCommentsNum() . ")</a>";
            } else {
                $comment_content = "<div class=\"blog_post_empty_space\"></div>";
            }
            $tool_content .= "<div class='panel panel-action-btn-default'>\r\n                                <div class='panel-heading'>\r\n                                    <div class='pull-right'>\r\n                                        " . action_button(array(array('title' => $langModify, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=editPost&amp;pId=" . $post->getId(), 'icon' => 'fa-edit', 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)), array('title' => $langDelete, 'url' => "{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=delPost&amp;pId=" . $post->getId(), 'icon' => 'fa-times', 'class' => 'delete', 'confirm' => $langSureToDelBlogPost, 'show' => $post->permEdit($is_editor, $stud_allow_create, $uid)))) . "\r\n                                    </div>\r\n                                    <h3 class='panel-title'>\r\n                                        <a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'>" . q($post->getTitle()) . "</a>\r\n                                    </h3>                                    \r\n                                </div>\r\n                                <div class='panel-body'>\r\n                                    <div class='label label-success'>" . nice_format($post->getTime(), true) . "</div><small>" . $langBlogPostUser . display_user($post->getAuthor(), false, false) . "</small><br><br>" . standard_text_escape(ellipsize_html($post->getContent(), $num_chars_teaser_break, "<strong>&nbsp;...<a href='{$_SERVER['SCRIPT_NAME']}?course={$course_code}&amp;action=showPost&amp;pId=" . $post->getId() . "'> <span class='smaller'>[{$langMore}]</span></a></strong>")) . "\r\n                                    {$comment_content}\r\n                                </div>\r\n                                <div class='panel-footer'>\r\n                                    <div class='row'>\r\n                                        <div class='col-sm-6'>{$rating_content}</div>\r\n                                        <div class='col-sm-6 text-right'>{$sharing_content}</div>\r\n                                    </div>                                    \r\n                                </div>\r\n                             </div>";
        }
        //display navigation links
        $tool_content .= $blog->navLinksHTML($page, $posts_per_page);
        $tool_content .= "</div>";
        /***end of blog posts area***/
        /***sidebar area***/
        $tool_content .= "<div class='col-sm-3'>";
        $tool_content .= $blog->popularBlogPostsHTML($num_popular);
        $tool_content .= $blog->chronologicalTreeHTML(date('n', strtotime($posts[0]->getTime())), date('Y', strtotime($posts[0]->getTime())));
        $tool_content .= "</div></div>";
        /***end of sidebar area***/
    }
}
draw($tool_content, 2, null, $head_content);
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:index.php

示例13: display_user

                $td[$i++] = "";
            }
        }
        
        if ($mbox_type == 'inbox') {
            $td[$i++] = display_user($msg->author_id, false, false, "outtabs");
        } else {
            $recipients = '';
            foreach ($msg->recipients as $r) {
                if ($r != $msg->author_id) {
                    $recipients .= display_user($r, false, false, "outtabs").'<br/>';
                }
            }
            $td[$i++] = $recipients;
        }
        $td[$i++] = nice_format(date('Y-m-d H:i:s',$msg->timestamp), true);
            
//            $td[$i++] = action_button(array(
//                array(
//                    'icon' => 'fa-times',
//                    'url' => 'javascript:void(0);',
//                    'level' => 'primary',
//                    'title' => $langDelete,
//                    'btn_class' => $mbox_type == 'inbox'? 'delete_in btn-default' : 'delete_out btn-default',
//                    'link-attrs' => "data-id='$msg->id'"
//                    )
//                )
//            );
        $btn_class = ($mbox_type == 'inbox')? 'delete_in' : 'delete_out';
        $td[$i++] = "<a href='javascript:void(0)' class='$btn_class'><span class='fa fa-times text-danger' style='padding-top:8px; font-size:1.2em;'></span></a>";
        
开发者ID:nikosv,项目名称:openeclass,代码行数:30,代码来源:ajax_handler.php

示例14: Indexer

 // ResourceIndexers require course_id inside the input data array (POST, but we do not want to pass it through the form)
 $_POST['course_id'] = $course_id;
 // Search Terms might come from GET, but we want to pass it alltogether with POST in ResourceIndexers
 $_POST['search_terms'] = $search_terms;
 $idx = new Indexer();
 $tool_content .= "\n        <div id=\"operations_container\">\n      <ul id='opslist'>\n        <li><a href='" . $_SERVER['SCRIPT_NAME'] . "'>{$langNewSearch}</a></li>\n      </ul>\n    </div>\n        <p class='sub_title1'>{$langResults}</p>";
 // search in announcements
 if ($announcements) {
     $announceHits = $idx->searchRaw(AnnouncementIndexer::buildQuery($_POST));
     if (count($announceHits) > 0) {
         $tool_content .= "<script type='text/javascript' src='../auth/sorttable.js'></script>\n              <table width='99%' class='sortable' id='t1' align='left'>\n              <tr>\n                <th colspan='2'>{$langAnnouncements}:</th>\n              </tr>";
         $numLine = 0;
         foreach ($announceHits as $annHit) {
             $announce = Database::get()->querySingle("SELECT title, content, date FROM announcement WHERE id = ?d", $annHit->pkid);
             $class = $numLine % 2 ? 'odd' : 'even';
             $tool_content .= "<tr class='{$class}'>\n                                  <td width='1' valign='top'><img style='padding-top:3px;' src='{$themeimg}/arrow.png' title='bullet' /></td>\n                                  <td><b><a href='" . $annHit->url . "'>" . q($announce->title) . "</a></b>&nbsp;&nbsp;\n                                  <small>(" . nice_format(claro_format_locale_date($dateFormatLong, strtotime($announce->date))) . ")\n                                  </small><br />" . $announce->content . "</td></tr>";
             $numLine++;
         }
         $tool_content .= "</table>";
         $found = true;
     }
 }
 // search in agenda
 if ($agenda) {
     $agendaHits = $idx->searchRaw(AgendaIndexer::buildQuery($_POST));
     if (count($agendaHits) > 0) {
         $tool_content .= "<script type='text/javascript' src='../auth/sorttable.js'></script>\n                  <table width='99%' class='sortable' id='t2' align='left'>\n          <tr>\n            <th colspan='2' class='left'>{$langAgenda}:</th>\n                  </tr>";
         $numLine = 0;
         foreach ($agendaHits as $agHit) {
             $agenda = Database::get()->querySingle("SELECT title, content, start, duration FROM agenda WHERE id = ?d", $agHit->pkid);
             $class = $numLine % 2 ? 'odd' : 'even';
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:search_incourse.php

示例15: user_get_data

                        . '<input type="radio" name="new" value="' . $version->id . '"' . $checked . ' />' . "\n"
                        . '</td>'
                        . "\n"
                ;

                $userInfo = user_get_data($version->editor_id);                

                $userStr = q($userInfo->givenname) . "&nbsp;" . q($userInfo->surname);

                $userUrl = $userStr;

                $versionUrl = '<a href="' . $_SERVER['SCRIPT_NAME'] . '?course=' . $course_code . '&amp;wikiId='
                        . $wikiId . '&amp;title=' . rawurlencode($wiki_title)
                        . '&amp;action=show&amp;versionId=' . $version->id
                        . '">'
                        . nice_format($version->mtime,TRUE)
                        . '</a>'
                ;

                $tool_content .= '<td>'
                        . sprintf($langWikiVersionPattern, $versionUrl, $userUrl)
                        . '</td><td>'.$makecurrent.'</td><td colspan="3"></td>'
                        . "\n"
                ;
                
                if ($version->changelog != '') {
                	$tool_content .='<td colspan="4">(<i>'.$version->changelog
                	. '</i>)</td>'
                	. "\n";
                }
                
开发者ID:nikosv,项目名称:openeclass,代码行数:30,代码来源:page.php


注:本文中的nice_format函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。