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


PHP progress_bar函数代码示例

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


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

示例1: showratings

function showratings($rating_type, $rating_item_id, $rating_link)
{
    global $locale, $userdata;
    $settings = \fusion_get_settings();
    if ($settings['ratings_enabled'] == "1") {
        if (iMEMBER) {
            $d_rating = dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM " . DB_RATINGS . " WHERE rating_item_id='" . $rating_item_id . "' AND rating_type='" . $rating_type . "' AND rating_user='" . $userdata['user_id'] . "'"));
            if (isset($_POST['post_rating'])) {
                // Rate
                if (isnum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6 && !isset($d_rating['rating_vote'])) {
                    $result = dbquery("INSERT INTO " . DB_RATINGS . " (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip, rating_ip_type) VALUES ('{$rating_item_id}', '{$rating_type}', '" . $userdata['user_id'] . "', '" . $_POST['rating'] . "', '" . time() . "', '" . USER_IP . "', '" . USER_IP_TYPE . "')");
                    if ($result) {
                        defender::unset_field_session();
                    }
                }
                redirect($rating_link);
            } elseif (isset($_POST['remove_rating'])) {
                // Unrate
                $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='{$rating_item_id}' AND rating_type='{$rating_type}' AND rating_user='" . $userdata['user_id'] . "'");
                if ($result) {
                    defender::unset_field_session();
                }
                redirect($rating_link);
            }
        }
        $ratings = array(5 => $locale['r120'], 4 => $locale['r121'], 3 => $locale['r122'], 2 => $locale['r123'], 1 => $locale['r124']);
        if (!iMEMBER) {
            $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a>", $locale['r104']);
            if (fusion_get_settings("enable_registration") == TRUE) {
                $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a> " . $locale['or'] . " <a href='" . BASEDIR . "register.php'>" . $locale['register'] . "</a>", $locale['r104']);
            }
            echo "<div class='text-center'>" . $message . "</div>\n";
        } elseif (isset($d_rating['rating_vote'])) {
            echo "<div class='display-block'>\n";
            echo openform('removerating', 'post', $rating_link, array('class' => 'display-block text-center'));
            echo sprintf($locale['r105'], $ratings[$d_rating['rating_vote']], showdate("longdate", $d_rating['rating_datestamp'])) . "<br /><br />\n";
            echo form_button('remove_rating', $locale['r102'], $locale['r102'], array('class' => 'btn-default', 'icon' => 'fa fa-times m-r-10'));
            echo closeform();
            echo "</div>\n";
        } else {
            echo "<div class='display-block'>\n";
            echo openform('postrating', 'post', $rating_link, array('max_tokens' => 1, 'notice' => 0, 'class' => 'm-b-20 text-center'));
            echo form_select('rating', $locale['r106'], '', array('options' => $ratings, 'class' => 'display-block text-center'));
            echo form_button('post_rating', $locale['r103'], $locale['r103'], array('class' => 'btn-primary btn-sm', 'icon' => 'fa fa-thumbs-up m-r-10'));
            echo closeform();
            echo "</div>\n";
        }
        $rating_votes = dbarray(dbquery("\n\t\tSELECT\n\t\tSUM(IF(rating_vote='5', 1, 0)) as r120,\n\t\tSUM(IF(rating_vote='4', 1, 0)) as r121,\n\t\tSUM(IF(rating_vote='3', 1, 0)) as r122,\n\t\tSUM(IF(rating_vote='2', 1, 0)) as r123,\n\t\tSUM(IF(rating_vote='1', 1, 0)) as r124\n\t\tFROM " . DB_RATINGS . " WHERE rating_type='" . $rating_type . "' and rating_item_id='" . intval($rating_item_id) . "'\n\t\t"));
        if (!empty($rating_votes)) {
            echo "<div id='ratings' class='rating_container'>\n";
            foreach ($rating_votes as $key => $num) {
                echo progress_bar($num, $locale[$key], FALSE, '10px', TRUE, FALSE);
            }
            echo "</div>\n";
        } else {
            echo "<div class='text-center'>" . $locale['r101'] . "</div>\n";
        }
    }
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:59,代码来源:ratings_include.php

示例2: Shift_view

function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin, $admin_rooms, $admin_shifttypes, $user_shifts, $signed_up)
{
    $parsedown = new Parsedown();
    $angeltypes = [];
    foreach ($angeltypes_source as $angeltype) {
        $angeltypes[$angeltype['id']] = $angeltype;
    }
    $needed_angels = '';
    foreach ($shift['NeedAngels'] as $needed_angeltype) {
        $class = 'progress-bar-warning';
        if ($needed_angeltype['taken'] == 0) {
            $class = 'progress-bar-danger';
        }
        if ($needed_angeltype['taken'] >= $needed_angeltype['count']) {
            $class = 'progress-bar-success';
        }
        $needed_angels .= '<div class="list-group-item">';
        $needed_angels .= '<div class="pull-right">' . Shift_signup_button_render($shift, $angeltypes[$needed_angeltype['TID']]) . '</div>';
        $needed_angels .= '<h3>' . AngelType_name_render($angeltypes[$needed_angeltype['TID']]) . '</h3>';
        $needed_angels .= progress_bar(0, $needed_angeltype['count'], min($needed_angeltype['taken'], $needed_angeltype['count']), $class, $needed_angeltype['taken'] . ' / ' . $needed_angeltype['count']);
        $angels = [];
        foreach ($shift['ShiftEntry'] as $shift_entry) {
            if ($shift_entry['TID'] == $needed_angeltype['TID']) {
                $entry = User_Nick_render(User($shift_entry['UID']));
                if ($shift_entry['freeloaded']) {
                    $entry = '<strike>' . $entry . '</strike>';
                }
                if ($user_shift_admin) {
                    $entry .= ' <div class="btn-group">';
                    $entry .= button_glyph(page_link_to('user_myshifts') . '&edit=' . $shift_entry['id'] . '&id=' . $shift_entry['UID'], 'pencil', 'btn-xs');
                    $entry .= button_glyph(page_link_to('user_shifts') . '&entry_id=' . $shift_entry['id'], 'trash', 'btn-xs');
                    $entry .= '</div>';
                }
                $angels[] = $entry;
            }
        }
        $needed_angels .= join(', ', $angels);
        $needed_angels .= '</div>';
    }
    $shiftManagers = getShiftManagers($shift['SID']);
    return page_with_title($shift['name'] . ' <small class="moment-countdown" data-timestamp="' . $shift['start'] . '">%c</small>', [msg(), Shift_collides($shift, $user_shifts) ? info(_('This shift collides with one of your shifts.'), true) : '', $signed_up ? info(_('You are signed up for this shift.'), true) : '', $shift_admin || $admin_shifttypes || $admin_rooms ? buttons([$shift_admin ? button(shift_edit_link($shift), glyph('pencil') . _('edit')) : '', $shift_admin ? button(shift_delete_link($shift), glyph('trash') . _('delete')) : '', $admin_shifttypes ? button(shifttype_link($shifttype), $shifttype['name']) : '', $admin_rooms ? button(room_link($room), glyph('map-marker') . $room['Name']) : '']) : '', div('row', [div('col-sm-3 col-xs-6', ['<h4>' . _('Title') . '</h4>', '<p class="lead">' . ($shift['URL'] != '' ? '<a href="' . $shift['URL'] . '">' . $shift['title'] . '</a>' : $shift['title']) . '</p>']), div('col-sm-3 col-xs-6', ['<h4>' . _('Start') . '</h4>', '<p class="lead' . (time() >= $shift['start'] ? ' text-success' : '') . '">', glyph('calendar') . date('Y-m-d', $shift['start']), '<br />', glyph('time') . date('H:i', $shift['start']), '</p>']), div('col-sm-3 col-xs-6', ['<h4>' . _('End') . '</h4>', '<p class="lead' . (time() >= $shift['end'] ? ' text-success' : '') . '">', glyph('calendar') . date('Y-m-d', $shift['end']), '<br />', glyph('time') . date('H:i', $shift['end']), '</p>']), div('col-sm-3 col-xs-6', ['<h4>' . _('Location') . '</h4>', '<p class="lead">' . glyph('map-marker') . $room['Name'] . '</p>'])]), div('row', [div('col-sm-6', ['<h2>' . _('Needed angels') . '</h2>', '<div class="list-group">' . $needed_angels . '</div>']), div('col-sm-6', [!empty($shiftManagers) ? '<h2>' . _('Shift Manager') . '</h2>' : '', !empty($shiftManagers) ? implode('<br>', array_map(function ($manager) {
        return $manager['Vorname'] . ' ' . $manager['Name'];
    }, $shiftManagers)) : '', '<h2>' . _('Description') . '</h2>', $parsedown->parse($shifttype['description'])])]), $shift_admin ? Shift_editor_info_render($shift) : '']);
}
开发者ID:Grreg,项目名称:engelsystem,代码行数:44,代码来源:Shifts_view.php

示例3: print_solved_graph

function print_solved_graph($user_id)
{
    validate_id($user_id);
    $challenges = db_query_fetch_all('
        SELECT
           ca.title,
           (SELECT SUM(ch.points) FROM challenges AS ch JOIN submissions AS s ON s.challenge = ch.id AND s.user_id = :user_id AND s.correct = 1 WHERE ch.category = ca.id GROUP BY ch.category) AS points,
           (SELECT SUM(ch.points) FROM challenges AS ch WHERE ch.category = ca.id GROUP BY ch.category) AS category_total
        FROM categories AS ca
        WHERE
          ca.available_from < UNIX_TIMESTAMP() AND
          ca.exposed = 1
        ORDER BY ca.title ASC', array('user_id' => $user_id));
    $user_total = 0;
    $ctf_total = 0;
    foreach ($challenges as $challenge) {
        echo '<strong>', htmlspecialchars($challenge['title']), '</strong>, ', number_format($challenge['points']), ' / ', number_format($challenge['category_total']), ' (', round($challenge['points'] / max(1, $challenge['category_total']) * 100), '%)';
        progress_bar($challenge['points'] / max(1, $challenge['category_total']) * 100);
        $user_total += $challenge['points'];
        $ctf_total += $challenge['category_total'];
    }
    echo lang_get('total_solves'), ' ', number_format($user_total), ' / ', number_format($ctf_total), ' (', round($user_total / $ctf_total * 100, 1), '%)';
}
开发者ID:dirvuk,项目名称:mellivora,代码行数:23,代码来源:user.inc.php

示例4: RenderPopularity

  function RenderPopularity() {
    $pop = (int)calculate_popularity( $this->prod->views );
    echo "popularity : ".$pop."%<br/>\n";
    echo progress_bar( $pop, $pop."%" );

    $year = substr($this->prod->releaseDate,0,4);
    echo "<div class='awards'>";
    foreach($this->awards as $award)
    {
    	printf("<a href='./awards.php#%s'><img src='".POUET_CONTENT_URL."gfx/sceneorg/%s.gif' title='%s' alt='%s'/></a>",
        $award->type == "viewingtip" ? $year : $year . str_replace(" ","",$award->category),
        $award->type,
        $award->category,
        $award->category);
    }
    echo "</div>";
  }
开发者ID:neodyme60,项目名称:pouet2.0,代码行数:17,代码来源:prod.php

示例5: show_stores

function show_stores()
{
    page_head("Stores");
    table_start();
    table_header(array("Name<br><small>Click for details</small>", "Files<br><small>Click to view</small>", "Capacity", "Used", "% used", "Available"));
    $stores = store_enum();
    foreach ($stores as $store) {
        $nfiles = file_count("store_id={$store->id}");
        table_row(array("<a href=hl.php?action=store&id={$store->id}>{$store->name}</a>", "<a href=hl.php?action=file_search_action&store_id={$store->id}>{$nfiles}</a>", size_str($store->capacity), size_str($store->used), progress_bar(100 * $store->used / $store->capacity), $store->unavailable ? "No" : "Yes"));
    }
    table_end();
    echo '
        <a href="hl.php?action=edit_store_form">
        <button type="button" class="btn btn-default">
        Add store
        </button>
        </a>
    ';
    page_tail();
}
开发者ID:pkgw,项目名称:hera-librarian,代码行数:20,代码来源:hl.php

示例6: array

$table->column_style('progress', 'text-align', 'center');
$table->no_sorting('picture');
$table->no_sorting('progressbar');
$table->define_baseurl($PAGE->url);
$table->setup();
// Build table of progress bars as they are marked
for ($i = 0; $i < $numberofusers; $i++) {
    $picture = $OUTPUT->user_picture($users[$i], array('course' => $course->id));
    $name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $users[$i]->id . '&course=' . $course->id . '">' . fullname($users[$i]) . '</a>';
    if ($users[$i]->lastaccess == 0) {
        $lastonline = get_string('never');
    } else {
        $lastonline = userdate($users[$i]->lastaccess);
    }
    $attempts = get_attempts($modules, $config, $events, $users[$i]->id, $course->id);
    $progressbar = progress_bar($modules, $config, $events, $users[$i]->id, $course->id, $attempts, true);
    $progressvalue = get_progess_percentage($events, $attempts);
    $progress = $progressvalue . '%';
    $rows[] = array('firstname' => $users[$i]->firstname, 'lastname' => strtoupper($users[$i]->lastname), 'picture' => $picture, 'fullname' => $name, 'lastonlinetime' => $users[$i]->lastaccess, 'lastonline' => $lastonline, 'progressbar' => $progressbar, 'progressvalue' => $progressvalue, 'progress' => $progress);
    //Inserting the values into created table
    $result = $DB->get_records_sql('SELECT * FROM {progress_percent} WHERE uid = ? AND cid = ?', array($users[$i]->id, $course->id));
    $val = array_values($result);
    $record = new stdClass();
    $record->uid = $users[$i]->id;
    $record->cid = $course->id;
    $record->progress_percentage = $progressvalue;
    if (count($result) != 0) {
        $record->id = $val[0]->id;
    }
    count($result) == 0 ? $DB->insert_record('progress_percent', $record, false) : $DB->update_record('progress_percent', $record, false);
}
开发者ID:vinoth4891,项目名称:clinique,代码行数:31,代码来源:overview.php

示例7: foreach

</div>
<div class="col-md-6">
	<h2>Most Connected Documents</h2>
	<p>Top 100 documents with the lowest average Helsinger distance to other documents. 
		These tend to have low topic entropy.</p>
	<?php 
foreach ($connectors as $doc) {
    $doc_url = base_url('doc/item/' . $doc['doc_id']);
    $dist = round($doc['distance'], 3);
    print "<div class='data-item'>";
    print "<a href='{$doc_url}'>" . $doc['title'] . "</a>";
    print progress_bar('success', $dist, 0, 1.4, $dist);
    print "</div>";
}
?>
</div>
<div class="col-md-6">
	<h2>Most Lonely (Least Connected) Documents</h2>
	<p>Top 100 documents with the highest average Helsinger distance to other documents.
		These tend to have high topic entropy.</p>
	<?php 
foreach ($loners as $doc) {
    $doc_url = base_url('doc/item/' . $doc['doc_id']);
    $dist = round($doc['distance'], 3);
    print "<div class='data-item'>";
    print "<a href='{$doc_url}'>" . $doc['title'] . "</a>";
    print progress_bar('success', $dist, 0, 1.4, $dist);
    print "</div>";
}
?>
</div>
开发者ID:battelle-dsi-capstone-2015,项目名称:corpus_topic_browser,代码行数:31,代码来源:doc_list.php

示例8: section_head

 section_head(htmlspecialchars($user['team_name']), country_flag_link($user['country_name'], $user['country_code'], true), false);
 if (!$user['competing']) {
     message_inline_blue('This user is listed as a non-competitor.');
 }
 $challenges = db_query_fetch_all('
     SELECT
        ca.title,
        (SELECT SUM(ch.points) FROM challenges AS ch JOIN submissions AS s ON s.challenge = ch.id AND s.user_id = :user_id AND s.correct = 1 WHERE ch.category = ca.id GROUP BY ch.category) AS points,
        (SELECT SUM(ch.points) FROM challenges AS ch WHERE ch.category = ca.id GROUP BY ch.category) AS category_total
     FROM categories AS ca
     ORDER BY ca.title ASC', array('user_id' => $_GET['id']));
 $user_total = 0;
 $ctf_total = 0;
 foreach ($challenges as $challenge) {
     echo '<strong>', htmlspecialchars($challenge['title']), '</strong>, ', number_format($challenge['points']), ' / ', number_format($challenge['category_total']), ' (', round($challenge['points'] / max(1, $challenge['category_total']) * 100), '%)';
     progress_bar($challenge['points'] / max(1, $challenge['category_total']) * 100);
     $user_total += $challenge['points'];
     $ctf_total += $challenge['category_total'];
 }
 echo 'Total: ', number_format($user_total), ' / ', number_format($ctf_total), ' (', round($user_total / $ctf_total * 100, 1), '%)';
 section_head('Solved challenges');
 $submissions = db_query_fetch_all('
     SELECT
        s.added,
        ((SELECT COUNT(*) FROM submissions AS ss WHERE ss.correct = 1 AND ss.added < s.added AND ss.challenge=s.challenge)+1) AS pos,
        ch.id AS challenge_id,
        ch.available_from,
        ch.title,
        ch.points,
        ca.title AS category_title
     FROM submissions AS s
开发者ID:jpnelson,项目名称:mellivora,代码行数:31,代码来源:user.php

示例9: round

    #$w = round($topic['word_count']/$max,2) * 100;
    $vnow = $topic['word_count'];
    $topic_url = base_url('topic/item/' . $topic['topic_id']);
    print "<div class='data-item'>";
    print "<a href='{$topic_url}'>";
    print $topic['topic_words'];
    print "</a>";
    print progress_bar('success', $vnow, 0, $max_words, $vnow);
    print "</div>";
}
?>
</div>

<div class="col-md-7">
    <h2>Related Documents</h2>
    <div><p>Documents in which this word is the most frequent word.</p></div>
    <?php 
$vmin = 0;
$vmax = $max_docwords;
foreach ($docs as $doc) {
    $vnow = $doc['word_count'];
    $doc_url = base_url('doc/item/' . $doc['doc_id']);
    print "<div class='data-item'>";
    print "<a href='{$doc_url}'>" . $doc['title'] . "</a>";
    print progress_bar('success', $vnow, $vmin, $vmax, $vnow);
    print "</div>";
}
?>
  	
</div>
开发者ID:battelle-dsi-capstone-2015,项目名称:corpus_topic_browser,代码行数:30,代码来源:word_item.php

示例10: format_numeric

			$info_general .= "<tr>";
			//$info_general .= "<td class='no_border size_min'></td>";
			// Project name
			$info_general .= "<td><a href='index.php?sec=projects&sec2=operation/projects/project_detail&id_project=".$project["id"]."'>".$project["name"]."</a></td>";
		
			// Manager
			$info_general .= "<td>".$project['id_owner']."</a></td>";
			
			// Completion
			if ($project["start"] == $project["end"]) {
				$info_general .= '<td>'.__('Unlimited');
			}
			else {
				$completion = format_numeric (calculate_project_progress ($project['id']));
				$info_general .= "<td>";
				$info_general .= progress_bar($completion, 90, 20);
			}
			$info_general .= "</td>";
			
			// Last update time
			$sql = sprintf ('SELECT tworkunit.timestamp FROM ttask, tworkunit_task, tworkunit
							 WHERE ttask.id_project = %d AND ttask.id = tworkunit_task.id_task
							 AND tworkunit_task.id_workunit = tworkunit.id
							 ORDER BY tworkunit.timestamp DESC LIMIT 1', $project['id']);
			$timestamp = get_db_sql ($sql);
			$timestamp = explode(" ", $timestamp);
			if ($timestamp[0] != "")
				$info_general .= "<td><span style='font-size: 10px'>".$timestamp[0]."</span></td>";
			else
				$info_general .= "<td>".__('Never')."</td>";
			
开发者ID:articaST,项目名称:integriaims,代码行数:30,代码来源:project_overview.php

示例11: format_numeric

	echo "</ul></div>";
}
echo "</h4>";


// Project info

//Name
$project_info .= '<tr><td colspan="2"><b>'.__('Name').':</b></td></tr>';
$project_info .= '<tr><td colspan="2">'.$name.'</td></tr>';

//Only show project progress if there is a project created
if ($id_project) {
	$project_info .= '<tr><td colspan="2"><b>'.__('Current progress').':</b></td></tr>';
	$completion =  format_numeric(calculate_project_progress ($id_project));
	$project_info .= '<tr><td colspan="2">'.progress_bar($completion, 90, 20, $graph_ttl).'</td></tr>';
}

//start and end date
$project_info .= '<tr><td colspan="2"><b>'.__('Start').':</b></td></tr>';
$project_info .= '<tr><td colspan="2">'.$start_date.'</td></tr>';
$project_info .= '<tr><td colspan="2"><b>'.__('End').':</b></td></tr>';
$project_info .= '<tr><td colspan="2">'.$end_date.'</td></tr>';

//owner
$id_owner = get_db_value ( 'id_owner', 'tproject', 'id', $id_project);
$project_info .= '<tr><td colspan="2"><b>'.__('Project manager').':</b></td></tr>';
$project_info .= '<tr><td colspan="2">'.get_db_value ("nombre_real", "tusuario", "id_usuario", $owner).'</td></tr>';

//Project Group
$project_info .= '<tr><td colspan="2"><b>'.__('Project group').':</b></td></tr>';
开发者ID:articaST,项目名称:integriaims,代码行数:31,代码来源:project_report.php

示例12: foreach

?>
<div class="col-md-12">
	<h2>Documents by Title</h2>
  <table data-page-length='25' class="table data-table">
    <thead>
      <tr>
        <th>Entropy</th>
        <th>Year</th>
        <th>Title</th>				
      </tr>
    </thead>
    <tbody>
   <?php 
$vmin = 0;
$vmax = $entropy['max'];
foreach ($docs as $doc) {
    $doc_url = base_url('doc/item/' . $doc['doc_id']);
    $vnow = round($doc['topic_entropy'], 3);
    print "<tr>";
    print "<td>";
    print progress_bar('info', $vnow, $vmin, $vmax, $vnow);
    print "</td>";
    print "<td>{$doc['year']}</td>";
    print "<td style='font-size:110%;'><a href='{$doc_url}'>{$doc['title']}</a></td>";
    print "</tr>";
}
?>
	
    </tbody>
  </table>
</div>
开发者ID:battelle-dsi-capstone-2015,项目名称:corpus_topic_browser,代码行数:31,代码来源:doc_list_by_topic.php

示例13: progress_bar

<h1>Playground</h1>
<?php 
print progress_bar('info', 5, 0, 20, 30, 'Testing');
开发者ID:battelle-dsi-capstone-2015,项目名称:corpus_topic_browser,代码行数:3,代码来源:play.php

示例14: tasks_print_tree

function tasks_print_tree($id_project, $sql_search = '')
{
    global $config;
    global $pdf_output;
    if ($pdf_output) {
        $graph_ttl = 2;
    } else {
        $graph_ttl = 1;
    }
    echo "<table class='blank' style='width:98%'>";
    echo "<tr><td style='width:60%' valign='top'>";
    $sql = "SELECT t.*\n\t\t\tFROM ttask t\n\t\t\tWHERE t.id_parent_task=0\n\t\t\t\tAND t.id>0\n\t\t\t\tAND t.id_project={$id_project}\n\t\t\t\t{$sql_search}\n\t\t\tORDER BY t.name";
    //$sql_search = base64_encode($sql_search);
    $sql_count = "SELECT COUNT(*) AS num\n\t\t\tFROM ttask t\n\t\t\tWHERE t.id_parent_task=0\n\t\t\t\tAND t.id>0\n\t\t\t\tAND t.id_project={$id_project}\n\t\t\t\t{$sql_search}";
    $countRows = process_sql($sql_count);
    if ($countRows === false) {
        $countRows = 0;
    } else {
        $countRows = (int) $countRows[0]['num'];
    }
    if ($countRows == 0) {
        echo '<h3 class="error">' . __('No tasks found') . '</h3>';
        return;
    }
    $new = true;
    $count = 0;
    echo "<ul style='margin: 0; margin-top: 20px; padding: 0;'>\n";
    $first = true;
    while ($task = get_db_all_row_by_steps_sql($new, $result, $sql)) {
        $new = false;
        $count++;
        echo "<li style='margin: 0; padding: 0;'>";
        echo "<span style='display: inline-block;'>";
        $branches = array();
        if ($first) {
            if ($count != $countRows) {
                $branches[] = true;
                $img = print_image("images/tree/first_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "0"));
                $first = false;
            } else {
                $branches[] = false;
                $img = print_image("images/tree/one_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "1"));
            }
        } else {
            if ($count != $countRows) {
                $branches[] = true;
                $img = print_image("images/tree/closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "2"));
            } else {
                $branches[] = false;
                $img = print_image("images/tree/last_closed.png", true, array("style" => 'vertical-align: middle;', "id" => "tree_image" . $task['id'] . "_task_" . $task['id'], "pos_tree" => "3"));
            }
        }
        $task_access = get_project_access($config["id_user"], $id_project, $task["id"], false, true);
        if ($task_access["read"]) {
            // Background color
            if ($task["completion"] < 40) {
                $background_color = "background: #FFFFFF;";
            } else {
                if ($task["completion"] < 90) {
                    $background_color = "background: #FFE599;";
                } else {
                    if ($task["completion"] < 100) {
                        $background_color = "background: #A4BCFA;";
                    } else {
                        if ($task["completion"] == 100) {
                            $background_color = "background: #B6D7A8;";
                        } else {
                            $background_color = "";
                        }
                    }
                }
            }
            // Priority
            $priority = print_priority_flag_image($task['priority'], true);
            // Task name
            $name = safe_output($task['name']);
            if (strlen($name) > 30) {
                $name = substr($name, 0, 30) . "...";
                $name = "<a title='" . safe_output($task['name']) . "' href='index.php?sec=projects&sec2=operation/projects/task_detail\n\t\t\t\t\t&id_project=" . $task['id_project'] . "&id_task=" . $task['id'] . "&operation=view'>" . $name . "</a>";
            } else {
                $name = "<a href='index.php?sec=projects&sec2=operation/projects/task_detail\n\t\t\t\t\t&id_project=" . $task['id_project'] . "&id_task=" . $task['id'] . "&operation=view'>" . $name . "</a>";
            }
            if ($task["completion"] == 100) {
                $name = "<s>{$name}</s>";
            }
            // Completion
            $progress = progress_bar($task['completion'], 70, 20, $graph_ttl);
            // Estimation
            $imghelp = "Estimated hours = " . $task['hours'];
            $taskhours = get_task_workunit_hours($task['id']);
            $imghelp .= ", Worked hours = {$taskhours}";
            $a = round($task["hours"]);
            $b = round($taskhours);
            $mode = 2;
            if ($a > 0) {
                $estimation = histogram_2values($a, $b, __("Planned"), __("Real"), $mode, 60, 18, $imghelp, $graph_ttl);
            } else {
                $estimation = "--";
            }
            // Time used on all child tasks + this task
//.........这里部分代码省略.........
开发者ID:dsyman2,项目名称:integriaims,代码行数:101,代码来源:functions_tasks.php

示例15: getuserlevel

 echo "</div>\n";
 echo "<h4 class='m-t-10 m-b-0'><strong>" . $userdata['user_name'] . "</strong></h4>\n";
 echo "<small>" . getuserlevel($userdata['user_level']) . "</small>\n<br/>";
 echo "</div>\n";
 echo "<ul class='user-info-bar'>\n";
 echo $msg_count ? "<li><a href='" . BASEDIR . "messages.php?folder=inbox' title='" . sprintf($locale['UM085'], $msg_count) . ($msg_count == 1 ? $locale['UM086'] : $locale['UM087']) . "' ><i class='entypo icomment'></i><label style='position:absolute; margin-left:-20px;' class='pointer label label-danger'>{$msg_count}</label></a>\n</li>\n" : "";
 echo "</ul>\n";
 $inbox_cfg = user_pm_settings($userdata['user_id'], "user_inbox");
 $inbox_percent = $inbox_cfg > 1 ? number_format($inbox_count / $inbox_cfg * 99, 0) : number_format(0 * 99, 0);
 echo progress_bar($inbox_percent, $locale['UM098'], FALSE, FALSE, FALSE, TRUE, $inbox_cfg == 0 ? TRUE : FALSE);
 $outbox_cfg = user_pm_settings($userdata['user_id'], "user_outbox");
 $outbox_percent = $outbox_cfg > 1 ? number_format($outbox_count / $outbox_cfg * 99, 0) : number_format(0 * 99, 0);
 echo progress_bar($outbox_percent, $locale['UM099'], FALSE, FALSE, FALSE, TRUE, $inbox_cfg == 0 ? TRUE : FALSE);
 $archive_cfg = user_pm_settings($userdata['user_id'], "user_archive");
 $archive_percent = $archive_cfg > 1 ? number_format($archive_count / $archive_cfg * 99, 0) : number_format(0 * 99, 0);
 echo progress_bar($archive_percent, $locale['UM100'], FALSE, FALSE, FALSE, TRUE, $inbox_cfg == 0 ? TRUE : FALSE);
 echo "<div id='navigation-user'>\n";
 echo "<h5><strong>" . $locale['UM097'] . "</strong></h5>\n";
 echo "<hr class='side-hr'>\n";
 echo "<ul>\n";
 echo "<li><a class='side' href='" . BASEDIR . "edit_profile.php'>" . $locale['UM080'] . " <i class='pull-right entypo suitcase'></i></a></li>\n";
 echo "<li><a class='side' href='" . BASEDIR . "messages.php'>" . $locale['UM081'] . " <i class='pull-right entypo mail'></i></a></li>\n";
 if (db_exists(DB_FORUM_THREADS)) {
     echo "<li><a class='side' href='" . INFUSIONS . "forum_threads_list_panel/my_tracked_threads.php'>" . $locale['UM088'] . " <i class='pull-right entypo eye'></i></a></li>\n";
 }
 echo "<li><a class='side' href='" . BASEDIR . "members.php'>" . $locale['UM082'] . " <i class='pull-right entypo users'></i></a></li>\n";
 echo iADMIN ? "<li><a class='side' href='" . ADMIN . "index.php" . $aidlink . "&amp;pagenum=0'>" . $locale['UM083'] . " <i class='pull-right entypo cog'></i></a></li>\n" : '';
 if ($installedModules) {
     echo "<li><a class='side' href=\"javascript:show_hide('ShowHide001')\">" . $locale['UM089'] . " <i class='pull-right entypo upload-cloud'></i></a></li>\n";
     echo "<li>\n";
     echo "<div id='ShowHide001' style='display:none'>\n";
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:31,代码来源:user_info_panel.php


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