本文整理汇总了PHP中cout函数的典型用法代码示例。如果您正苦于以下问题:PHP cout函数的具体用法?PHP cout怎么用?PHP cout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
YuiLib::load(array('json' => 'json-min.js', 'container' => 'container_core-min.js', 'menu' => 'menu-min.js', 'button' => 'button-min.js', 'treeview' => 'treeview-min.js'), array('assets/skins/sam' => 'skin.css'));
cout(Util::get_css('base-folder-tree.css'), 'page_head');
cout(Util::get_js('appLms/lib/category/lib.categorytree.js'), 'page_head');
Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
}
示例2: showTask
public function showTask()
{
if (!Get::cfg('enable_plugins', false)) {
cout("Plugin feature disabled");
return;
}
$model = new PluginAdm();
$plugins = $model->getInstalledPlugins();
$plugins_info = $model->getPluginsInfo($plugins);
$active_tab = $_GET['active_tab'];
$this->render('show', array('model' => $model, 'plugins' => $plugins, 'active_tab' => $active_tab, 'plugins_info' => $plugins_info));
}
示例3: play
function play($object_link, $id_param)
{
//-kb-play-// if(!checkPerm('view', true, 'organization') && !checkPerm('view', true, 'storage')) die("You can't access");
$lang =& DoceboLanguage::createInstance('link');
$idCategory = $object_link->getId();
$mode = importVar('mode', false, 'link');
$back_coded = htmlentities(urlencode($object_link->back_url));
require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
$idReference = getLOParam($id_param, 'idReference');
// NOTE: Track only if $idReference is present
if ($idReference !== FALSE) {
require_once $GLOBALS['where_lms'] . '/class.module/track.link.php';
list($exist, $idTrack) = Track_Link::getIdTrack($idReference, getLogUserId(), $idCategory, TRUE);
if ($exist) {
$ti = new Track_Link($idTrack);
$ti->setDate(date('Y-m-d H:i:s'));
$ti->status = 'completed';
$ti->update();
} else {
$ti = new Track_Link(false);
$ti->createTrack($idReference, $idTrack, getLogUserId(), date('Y-m-d H:i:s'), 'completed', 'link');
}
}
list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\tWHERE idCategory = '" . (int) $idCategory . "'"));
$link = 'index.php?modname=link&op=play&idCategory=' . $idCategory . '&id_param=' . $id_param . '&back_url=' . $back_coded;
/*$GLOBALS['page']->add('<div id="top" class="std_block">'
.'<div class="colum_container">' */
cout('<div id="top" class="yui-navset yui-navset-top tab_block">
<ul class="yui-nav">
<li class="first' . ($mode != 'keyw' ? ' selected' : '') . '">
<a href="' . $link . '&mode=list">
<em>' . Lang::t('_SWITCH_TO_LIST', 'link') . '</em>
</a>
</li>
<li' . ($mode == 'keyw' ? ' class="selected"' : '') . '>
<a href="' . $link . '&mode=keyw">
<em>' . Lang::t('_SWITCH_TO_KEYWORD', 'link') . '</em>
</a>
</li>
</ul>
<div class="yui-content">', 'content');
cout(getBackUi(Util::str_replace_once('&', '&', $object_link->back_url), $lang->def('_BACK')), 'content');
$GLOBALS['page']->add('<b>' . $lang->def('_TITLE') . ' : ' . $title . '</b><br /><br />' . $lang->def('_LINKIUNNEWWINDOW') . '<br /><br />', 'content');
if ($mode == 'keyw') {
displayAsKey($idCategory, $link . '&mode=keyw');
} else {
displayAsList($idCategory);
}
$GLOBALS['page']->add('<div class="align_center">' . '<a href="#top"><img src="' . getPathImage() . 'standard/up.png" title="' . $lang->def('_BACKTOTOP') . '" />' . $lang->def('_BACKTOTOP') . '</a>' . getBackUi(Util::str_replace_once('&', '&', $object_link->back_url), $lang->def('_BACK')) . '</div>', 'content');
cout('</div></div>', 'content');
}
示例4: reportList
function reportList()
{
checkPerm('view');
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('report', 'framework');
$_SESSION['report_tempdata'] = array();
$can_mod = checkPerm('mod', true);
$acl_man = Docebo::aclm();
$public_admin_mod = true;
$query = "SELECT t1.*, t2.userid \r\n\tFROM %lms_report_filter as t1 \r\n\t\tLEFT JOIN %adm_user as t2 ON t1.author=t2.idst\r\n\tWHERE t1.is_public = 1 OR t1.author = " . Docebo::user()->getId();
$tb = new Table();
$tb->initNavBar('ini', 'button');
$col_type = array('', 'align_center', 'align_center', 'image');
$col_content = array($lang->def('_NAME'), $lang->def('_TAB_REP_CREATOR', 'report', 'framework'), $lang->def('_CREATION_DATE'), '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS') . '" title="' . $lang->def('REPORT_SHOW_RESULTS') . '" />');
if ($public_admin_mod && $can_mod) {
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" title="' . $lang->def('_MOD') . '"/>';
$col_type[] = 'image';
$col_content[] = '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" title="' . $lang->def('_DEL') . '"/>';
}
$tb->setColsStyle($col_type);
$tb->addHead($col_content);
$res = sql_query($query);
if ($res) {
while ($row = sql_fetch_assoc($res)) {
$id = $row['id_filter'];
$opn_link = '<a href="index.php?modname=public_report_admin&op=view_report&idrep=' . $id . '" ' . ' title="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('REPORT_SHOW_RESULTS', 'report', 'framework') . '" />' . '</a>';
$tb_content = array($row['author'] == 0 ? $lang->def($row['filter_name']) : $row['filter_name'], $row['author'] == 0 ? '<div class="align_center">-</div>' : $acl_man->relativeId($row['userid']), Format::date($row['creation_date']), $opn_link);
if ($public_admin_mod && $can_mod) {
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=modify_name&modid=' . $id . '" ' . ' title="' . $lang->def('_MOD', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
if ($row['author'] == Docebo::user()->getId()) {
$tb_content[] = '<a href="index.php?modname=public_report_admin&op=del_public_report&idrep=' . $id . '" ' . ' title="' . $lang->def('_DEL', 'report', 'framework') . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL', 'report', 'framework') . '" />' . '</a>';
} else {
$tb_content[] = '';
}
}
$tb->addBody($tb_content);
}
}
require_once _base_ . '/lib/lib.dialog.php';
setupHrefDialogBox('a[href*=del_public_report]');
if ($public_admin_mod && $can_mod) {
$tb->addActionAdd('<a href="index.php?modname=public_report_admin&op=create_name">' . '<img src="' . getPathImage() . 'standard/add.png" title="' . $lang->def('_NEW') . '" /> ' . $lang->def('_NEW') . '</a>');
}
cout(getTitleArea($lang->def('_REPORT')) . '<div class="std_block">' . $tb->getTable() . '</div>', 'content');
}
示例5: mycompetences
function mycompetences(&$url)
{
checkPerm('view');
$html = "";
$html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences');
$html .= '<div class="std_block">';
$cmodel = new CompetencesAdm();
$fmodel = new FunctionalrolesAdm();
$id_user = getLogUserId();
$ucomps = $cmodel->getUserCompetences($id_user);
$rcomps = $fmodel->getUserRequiredCompetences($id_user);
$ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps));
$language = getLanguage();
$_typologies = $cmodel->getCompetenceTypologies();
$_types = $cmodel->getCompetenceTypes();
$icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>';
$icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>';
//*******************
require_once _base_ . '/lib/lib.table.php';
$table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES'));
$style_h = array('', '', 'image', 'image', 'image', 'image', 'image');
$label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences'));
$table->addHead($label_h, $style_h);
foreach ($ucomps_info as $id_competence => $cinfo) {
$line = array();
$line[] = $cinfo->langs[$language]['name'];
$line[] = $_typologies[$cinfo->typology];
$line[] = $_types[$cinfo->type];
$line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv;
$line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime');
$line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : '';
$table->addBody($line);
}
$html .= $table->getTable();
$html .= '</div>';
$html .= Form::openForm('beck_url', 'index.php');
$html .= Form::openButtonSpace();
$html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard'));
$html .= Form::closeButtonSpace();
$html .= Form::closeform();
cout($html, 'content');
}
示例6: loadSelector
/**
* Display the user/group/orgchart/fncrole selector
* @param string $url the url of the page, used for the form
* @param string $title the main title for the page (will be passed to a getTitleArea function
* @param string $text extra text to display
* @param bool $selector_mode if true the main div and page title will be drawed by the selector
* @param string $id the id for the form that will contain the selector
*/
public function loadSelector($url, $title = false, $text = '', $selector_mode = TRUE, $id = FALSE)
{
$res = '';
$id = empty($id) ? 'main_selector' : $id;
$us_util = new UserSelectorUtil();
if ($selector_mode && $title != false) {
$res .= getTitleArea($title);
$res .= '<div class="std_block">';
}
$res .= Form::openForm($id . '_form', $url);
if (is_array($this->_extra_form) && !empty($this->_extra_form)) {
$res .= implode("\n", $this->_extra_form);
}
$res .= Util::widget('userselector', array('id' => $id, 'show_user_selector' => $this->show_user_selector, 'show_group_selector' => $this->show_group_selector, 'show_orgchart_selector' => $this->show_orgchart_selector, 'show_fncrole_selector' => $this->show_fncrole_selector, 'initial_selection' => $this->selection, 'admin_filter' => true, 'learning_filter' => $this->learning_filter, 'use_suspended' => $this->use_suspended, 'nFields' => $this->nFields !== FALSE ? $this->nFields : 3), true);
$res .= Form::openButtonSpace();
$res .= Form::getButton('okselector', 'okselector', Lang::t('_SAVE', 'standard'));
$res .= Form::getButton('cancelselector', 'cancelselector', Lang::t('_UNDO', 'standard'));
$res .= Form::closeButtonSpace();
$res .= Form::closeForm();
if ($selector_mode) {
$res .= '</div>';
}
cout($res, 'content');
}
示例7: getHistoryTable
function getHistoryTable($id_user, $id_org, $idscorm_item, $idReference)
{
require_once _base_ . '/lib/lib.table.php';
$tb = new Table(Get::sett('visu_course'));
$lang = DoceboLanguage::CreateInstance('organization', 'lms');
$h_type = array('', '', '', '', '');
$h_content = array($lang->def('_ATTEMPT'), $lang->def('_STATUS'), $lang->def('_SCORE'), $lang->def('_DATE'), $lang->def('_TIME'));
$tb->setColsStyle($h_type);
$tb->addHead($h_content);
$qry = "SELECT t1.* FROM " . $GLOBALS['prefix_lms'] . "_scorm_tracking_history as t1 JOIN " . $GLOBALS['prefix_lms'] . "_scorm_tracking as t2 ON (t1.idscorm_tracking=t2.idscorm_tracking) " . " WHERE t2.idscorm_item={$idscorm_item} AND t2.idUser={$id_user} " . " ORDER BY t1.date_action ASC ";
$res = sql_query($qry);
$i = 1;
while ($row = mysql_fetch_assoc($res)) {
$line = array();
$line[] = $lang->def('_ATTEMPT') . ' ' . $i;
$line[] = $row['lesson_status'];
$line[] = $row['score_raw'];
$line[] = Format::date($row['date_action']);
$line[] = decodeSessionTime($row['session_time']);
$tb->addBody($line);
$i++;
}
//title
cout($tb->getTable(), 'content');
}
示例8: handleCreateStore
function handleCreateStore()
{
$useremail = $_SESSION['email'];
$storelocation = $_POST['storelocation'];
$storename = $_POST['storename'];
cout("<br> username :" . $useremail);
cout("storeloaction :" . $storelocation);
cout("storename\t:" . $storename);
dbConnect("endurance");
$sql = "INSERT INTO storeslist (storeid, storelocation, storename, username) VALUES ('','" . $storelocation . "' , '" . $storename . "' , '" . $useremail . "' )";
$result = mysql_query($sql);
if (!$result) {
echo "<b>Error </b>" . mysql_error();
//cout("database error") ; //echo "<br> database error";
} else {
cout("Last generated row id" + mysql_insert_id());
$storeID = mysql_insert_id();
//Create a new table with this name
//All the devices should point to this table
dbConnect("endurance");
$storeID = (string) $storeID;
$storeIDinValidFormat = "Z" . $storeID . "Z";
//$sql = "CREATE TABLE IF NOT EXISTS '".$storeID."' () ";
//$sql = "CREATE TABLE ". $storeIDinValidFormat. " ( first_name VARCHAR(25), last_name VARCHAR(25), phone_number VARCHAR(15)) ENGINE=InnoDB DEFAULT CHARSET=latin1";
$sql = "CREATE TABLE IF NOT EXISTS " . $storeIDinValidFormat . " (\r\n\t\tslno int(11) NOT NULL,\r\n\t\tbarcode varchar(255) NOT NULL,\r\n\t\tproductcategory varchar(100) NOT NULL,\r\n\t\tproductname varchar(100) NOT NULL,\r\n\t\tbuyprice int(11) NOT NULL,\r\n\t\tsellprice int(11) NOT NULL,\r\n\t\ttaxcategory int(11) NOT NULL,\r\n\t\tquantityadded int(11) NOT NULL,\r\n\t\tquantityremaining int(11) NOT NULL,\r\n\t\treferencecode int(11) NOT NULL ,\r\n\t\tPRIMARY KEY (slno) \r\n\t\t) ENGINE=InnoDB DEFAULT CHARSET=latin1";
$result = mysql_query($sql);
if (!$result) {
echo "<b>Error </b>" . mysql_error();
} else {
echo "<br>Success Creating new Store table";
}
}
}
示例9: get
public function get($noPrint = true)
{
$js_code = '';
if ($this->jsClassName != '') {
$jsOptions = $this->_getJsOptions();
$treeName = 'tree_' . $this->id;
if ($this->isGlobalVariable) {
$js_code = 'var ' . $treeName . ';';
} else {
$js_code = '';
}
$js_code .= ($this->useDOMReady ? 'YAHOO.util.Event.onDOMReady(function(e){' : '') . '
' . ($this->isGlobalVariable ? '' : 'var ') . $treeName . ' = new ' . $this->jsClassName . '("' . $this->id . '"' . ($jsOptions != '' ? ', ' . $jsOptions : '') . ');
' . ($this->useDOMReady ? '});' : '');
}
$output = array('js' => '<script type="text/javascript">' . $js_code . '</script>', 'html' => '<div class="folder_tree" id="' . $this->id . '">' . $this->_getHtml() . '</div>', 'options' => $jsOptions);
if ($noPrint) {
return $output;
} else {
cout($output['js'], 'page_head');
cout($output['html'], 'content');
}
}
示例10: showLog
function showLog()
{
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.table.php';
$lang =& DoceboLanguage::createInstance('conference', 'lms');
$id = Get::req('id', DOTY_INT, 0);
$conference = new Conference_Manager();
$room_info = $conference->roomInfo($id);
$acl_man =& Docebo::user()->getAclManager();
cout(getTitleArea('') . '<div class="std_block">', 'content');
$room_log = array();
switch ($room_info['room_type']) {
case 'teleskill':
require_once $GLOBALS['where_scs'] . '/lib/lib.teleskill.php';
$teleskill = new Teleskill_Management();
$roomid = $teleskill->getRoomId($id);
if (isset($_POST['update_log'])) {
$teleskill->updateRoomLog($roomid);
}
$room_log = $teleskill->getRoomLog($roomid);
break;
}
$tb = new Table(0, $lang->def('_ROOM_LOG'), $lang->def('_ROOM_LOG'));
$cont_h = array($lang->def('_FULLNAME'), $lang->def('_ROLE'), $lang->def('_DATE'), $lang->def('_TOTAL_TIME'), $lang->def('_NUMBER_OF_ACCESS'));
$type_h = array('', '', '', '', '');
$tb->setColsStyle($type_h);
$tb->addHead($cont_h);
foreach ($room_log as $log_row) {
$user_info = $acl_man->getUser($log_row['idUser'], false);
$cont = array();
if ($user_info[ACL_INFO_FIRSTNAME] !== '' && $user_info[ACL_INFO_LASTNAME]) {
$cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' ' . $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
} elseif ($user_info[ACL_INFO_FIRSTNAME] !== '') {
$cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
} elseif ($user_info[ACL_INFO_LASTNAME] !== '') {
$cont[] = $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
} else {
$cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]);
}
$cont[] = $log_row['role'] == 1 ? $lang->def('_USER_ROLE') : $lang->def('_TUTOR_ROLE');
$cont[] = Format::date($log_row['date'], 'datetime');
$duration_s = 0;
$duration_m = 0;
$duration_h = 0;
$duration = $log_row['duration'];
$duration_s = $duration % 60;
$duration -= $duration_s;
if ($duration) {
$duration_m = $duration % 3600 / 60;
$duration -= $duration_m * 60;
if ($duration) {
$duration_h = $duration / 3600;
}
}
$cont[] = $duration_h . ' ' . $lang->def('_HOURS') . ' ' . $duration_m . ' ' . $lang->def('_MINUTS') . ' ' . $duration_s . ' ' . $lang->def('_SECONDS');
$cont[] = $log_row['access'];
$tb->addBody($cont);
}
$tb->addActionAdd(Form::getButton('update_log', 'update_log', $lang->def('_UPDATE_LOG')));
cout(Form::openForm('log_table', 'index.php?modname=conference&op=log&id=' . $id) . $tb->getTable() . Form::closeForm() . '<br/>' . getBackUi('index.php?modname=conference&op=history', $lang->def('_BACK')), 'content');
cout('</div>', 'content');
}
示例11: cout
// They're either tweeting to me for shits and giggles or playing.
// In either scenario, just play the game.
// Clean their post and submit their guess.
$tweetman->guess(substr($message, 0, 1));
// Check if they found the word or failed.
$game = $tweetman->isGameOver();
if (!$game['status']) {
// debug:
cout("{$user}: {$game['remaining']} left\r\n");
//$lettersRemaining = insertSpaces($tweetman->getRemainingLetters());
$strReplyText = "@{$user} {$game['remaining']} attempts left. \r\n";
// Remaining characters: {$lettersRemaining}";
$strReplyText .= $game['message'] != 'You lose.' ? insertSpaces($game['message']) : $game['message'];
$twitter->postStatus($strReplyText, $tweet->id_str);
} else {
//debug:
cout("{$user} won!\r\n\t{$game['message']}\r\n--------------------\r\n");
$twitter->postStatus("@{$user} {$game['message']}", $tweet->id_str);
}
break;
}
}
endMain:
// debug:
cout("sleeping...\r\n\r\n");
// Twitter REST API has maximum of 150 requests/IP per hour.
// This must run at 25 second intervals or longer.
sleep(25);
// Don't run this forever!
}
fclose($fp);
示例12: schedule_set
function schedule_set($idrep)
{
checkPerm('mod');
$lang =& DoceboLanguage::createInstance('report', 'framework');
//initialize session data for schedulation, if not updating
if (!isset($_SESSION['schedule_tempdata'])) {
$_SESSION['schedule_tempdata'] = array('name' => '', 'period' => 'day', 'period_info' => '', 'time' => '', 'recipients' => array());
}
$ref =& $_SESSION['schedule_tempdata'];
require_once _base_ . '/lib/lib.form.php';
$jump_url = 'index.php?modname=report&op=report_schedule&idrep=' . $idrep;
$back_url = 'index.php?modname=report&op=schedulelist&idrep=' . $idrep;
$body = Form::openForm('report_schedule_time', $jump_url);
$body .= Form::getTextfield($lang->def('_SAVE_SCHED_NAME'), 'sched_name', 'sched_name', '200', $ref['name']) . Form::getHidden('next_step', 'next_step', 'sched_setrecipients');
//create selections for crontab specification
$month_days = array();
for ($i = 1; $i <= 31; $i++) {
$month_days[$i] = $i;
//TO DO : format with 2 digits filling with 0
}
$year_months = array();
for ($i = 1; $i <= 12; $i++) {
$year_months[$i] = $i;
//TO DO : format with 2 digits filling with 0
}
$lang_days =& DoceboLanguage::createInstance('calendar', 'lms');
$week_days = array('0' => $lang_days->def('_MONDAY'), '1' => $lang_days->def('_TUESDAY'), '2' => $lang_days->def('_WEDNESDAY'), '3' => $lang_days->def('_THURSDAY'), '4' => $lang_days->def('_FRIDAY'), '5' => $lang_days->def('_SATURDAY'), '6' => $lang_days->def('_SUNDAY'));
$body .= Form::getRadio($lang->def('_REPORT_DAILY'), 'cron_radio_1', 'cron_radio', 'day', $ref['period'] == 'day' ? true : false) . '<div class="form_line_l">' . Form::getInputRadio('cron_radio_2', 'cron_radio', 'week', $ref['period'] == 'week' ? true : false, '') . ' <label class="label_normal" for="cron_radio_2">' . $lang->def('_REPORT_WEEKLY') . '</label> ' . Form::getInputDropdown('', 'cron_weekly', 'cron_weekly', $week_days, $ref['period'] == 'week' ? $ref['period_info'] : '', '') . '</div>' . '<div class="form_line_l">' . Form::getInputRadio('cron_radio_3', 'cron_radio', 'month', $ref['period'] == 'month' ? true : false, '') . ' <label class="label_normal" for="cron_radio_3">' . $lang->def('_REPORT_MONTHLY') . '</label> ' . Form::getInputDropdown('', 'cron_monthly', 'cron_monthly', $month_days, $ref['period'] == 'month' ? $ref['period_info'] : '', '') . '</div>' . Form::getHidden('idrep', 'idrep', $idrep);
$body .= Form::openButtonSpace() . Form::getButton('', 'schedule_confirm', $lang->def('_NEXT')) . Form::getButton('', 'schedule_undo', $lang->def('_UNDO')) . form::closeButtonSpace();
$body .= Form::closeForm();
//output content
cout(getTitleArea($lang->def('_SCHEDULE')));
cout('<div class="std_block">');
cout($body);
cout('</div>');
//close std_block div
}
示例13: modTransaction
function modTransaction()
{
require_once _base_ . '/lib/lib.table.php';
require_once _base_ . '/lib/lib.form.php';
require_once _base_ . '/lib/lib.dialog.php';
require_once _lms_ . '/lib/lib.course.php';
require_once _lms_ . '/lib/lib.date.php';
$lang =& DoceboLanguage::createInstance('transaction');
$acl_man = Docebo::user()->getAclManager();
$man_transaction = new Man_Transaction();
$course_man = new Man_Course();
$date_man = new DateManager();
$id_transaction = Get::req('id', DOTY_INT, 0);
$transaction_info = $man_transaction->getTransactionInfo($id_transaction);
if (isset($_POST['update'])) {
$payment_status = Get::req('payment_status', DOTY_INT, 0);
$course_status = Get::req('course_status', DOTY_INT, 0);
$note = Get::req('note', DOTY_MIXED, '');
if ($man_transaction->updateTransaction($id_transaction, $payment_status, $course_status, $note)) {
if (isset($_POST['confirm'])) {
$activations = array();
foreach ($_POST['confirm'] as $id => $n) {
list($id_course, $id_date) = explode('_', $id);
if ($id_date != 0) {
$activations[$id_course]['dates'][$id_date] = $id_date;
} else {
$activations[$id_course] = $id_course;
}
}
if ($man_transaction->activateCourses($id_transaction, $transaction_info['id_user'], $activations)) {
Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
}
} else {
Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
}
}
Util::jump_to('index.php?modname=transaction&op=transaction&res=err_up');
}
$array_title = array('index.php?modname=transaction&op=transaction' => $lang->def('_TRANSACTION'), $lang->def('_MOD_TRANSACTION'));
//Status info & note
$array_payment_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
$array_course_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
cout(getTitleArea($array_title) . '<div class="std_block">' . Form::openForm('transaction_info', 'index.php?modname=transaction&op=mod&id=' . $id_transaction) . Form::openElementSpace() . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $transaction_info['payment_status']) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $transaction_info['course_status']) . Form::getSimpleTextarea($lang->def('_NOTES'), 'note', 'note', $transaction_info['note']) . Form::closeElementSpace());
//User info
$user_info = $acl_man->getUser($transaction_info['id_user'], false);
$tb_user = new Table(0, $lang->def('_USER_INFO'), $lang->def('_USER_INFO'));
$cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'));
$type_h = array('', '', '', '');
$tb_user->setColsStyle($type_h);
$tb_user->addHead($cont_h);
$tb_user->addBody(array($acl_man->relativeId($user_info[ACL_INFO_USERID]), $user_info[ACL_INFO_FIRSTNAME], $user_info[ACL_INFO_LASTNAME], $user_info[ACL_INFO_EMAIL]));
cout('<br />' . $tb_user->getTable());
//Payment info if we need it
//Product info
$tb_product = new Table(0, $lang->def('_PRODUCT_INFO'), $lang->def('_PRODUCT_INFO'));
$cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DATE_BEGIN'), $lang->def('_DATE_END'), $lang->def('_COURSE_PRIZE'), $lang->def('_CONFIRM_COURSE'));
$type_h = array('', '', '', '', '', '');
$tb_product->setColsStyle($type_h);
$tb_product->addHead($cont_h);
$transaction_course = $man_transaction->getTransactionCourses($id_transaction);
foreach ($transaction_course as $id_course => $details) {
if (is_array($details)) {
foreach ($details['dates'] as $id_date) {
$date_info = $date_man->getDateInfo($id_date);
$checked = false;
$other = '';
if ($man_transaction->controlActivation($id_transaction, $id_course, $id_date)) {
$checked = true;
$other = 'disabled="disabled"';
}
$tb_product->addBody(array($date_info['code'], $date_info['name'], Format::date($date_info['date_begin']), Format::date($date_info['date_end']), $date_info['price'], Form::getInputCheckbox($id_course . '_' . $id_date, 'confirm[' . $id_course . '_' . $id_date . ']', 1, $checked, $other)));
}
} else {
$course_info = $course_man->getCourseInfo($id_course);
$checked = false;
$other = '';
if ($man_transaction->controlActivation($id_transaction, $id_course)) {
$checked = true;
$other = 'disabled="disabled"';
}
$tb_product->addBody(array($course_info['code'], $course_info['name'], $course_info['date_begin'] !== '0000-00-00' ? Format::date($course_info['date_begin'], 'date') . ($course_info['hour_begin'] !== '-1' ? $course_info['hour_begin'] : '') : '', $course_info['date_end'] !== '0000-00-00' ? Format::date($course_info['date_end'], 'date') . ($course_info['hour_end'] !== '-1' ? $course_info['hour_end'] : '') : '', $course_info['prize'] == '' ? '0' : $course_info['prize'], Form::getInputCheckbox($id_course . '_0', 'confirm[' . $id_course . '_0]', 1, $checked, $other)));
}
}
cout('<br />' . $tb_product->getTable() . Form::openButtonSpace() . Form::getButton('update', 'update', $lang->def('_UPDATE')) . Form::getButton('back_mod', 'back_mod', $lang->def('_BACK')) . Form::closeButtonSpace() . Form::closeForm());
cout('</div>');
}
示例14: getButton
/**
* public static function getButton( $id, $name, $value, $css_class )
*
* @param string $id the id of the submit button
* @param string $name the name of the submit button
* @param string $value the value of the submit button
* @param string $css_button optional css class for the button
* @param string $other_param other element for the tag
*
* @return string contains the close tag for button element
*/
public static function getButton($id, $name, $value, $css_button = FALSE, $other_param = '', $use_js = true, $is_submit = true)
{
if ($use_js && ($css_button == false || $css_button == 'yui-button')) {
if (!defined("IS_AJAX")) {
cout('<script type="text/javascript">
(function() {
YAHOO.util.Event.onDOMReady(function() {
var o = YAHOO.namespace("buttonObjects.' . $id . '");
YAHOO.buttonObjects.' . $id . ' = new YAHOO.widget.Button("' . $id . '", { value: "' . addslashes($value) . '" });
});
})();
</script>', 'scripts');
}
return '<input type="' . ($is_submit ? 'submit' : 'button') . '" id="' . $id . '" ' . ($name ? 'name="' . $name . '" ' : '') . 'value="' . $value . '"' . ($other_param != '' ? ' ' . $other_param : '') . ' />';
}
if ($css_button == 'yui-button') {
return '<span id="' . $id . '_span" class="yui-button yui-submit-button">' . '<span class="first-child">' . '<input type="' . ($is_submit ? 'submit' : 'button') . '" id="' . $id . '" ' . ($name ? 'name="' . $name . '" ' : '') . 'value="' . $value . '"' . ($other_param != '' ? ' ' . $other_param : '') . ' />' . '</span>' . '</span>';
}
$css_button = $css_button === FALSE ? 'button' : $css_button;
return '<input type="' . ($is_submit ? 'submit' : 'button') . '" ' . "\n\t" . 'class="' . $css_button . '" ' . "\n\t" . 'id="' . $id . '" ' . "\n\t" . 'name="' . $name . '" ' . "\n\t" . 'value="' . $value . '"' . ($other_param != '' ? ' ' . $other_param : '') . ' />';
}
示例15: showchart
function showchart()
{
require_once _lms_ . '/modules/test/charts.test.php';
$idTest = Get::req('id_test', DOTY_INT, -1);
$idUser = Get::req('id_user', DOTY_INT, -1);
$chartType = Get::req('chart_type', DOTY_STRING, 'column');
$lang =& DoceboLanguage::createInstance('coursereport', 'lms');
$acl_man = Docebo::user()->getAclManager();
$user_info = $acl_man->getUser($idUser, false);
list($title) = sql_fetch_row(sql_query("SELECT title FROM " . $GLOBALS['prefix_lms'] . "_test WHERE idTest=" . (int) $idTest));
$backUrl = 'index.php?modname=coursereport&op=testvote&id_test=' . (int) $idTest;
$backUi = getBackUi($backUrl, $lang->def('_BACK'));
$page_title = array('index.php?modname=coursereport&op=coursereport' => $lang->def('_COURSEREPORT', 'menu_course'), $backUrl => strip_tags($title), $acl_man->relativeId($user_info[ACL_INFO_USERID]));
cout(getTitleArea($page_title, 'coursereport', $lang->def('_TH_ALT')));
cout('<div class="stdblock">');
cout($backUi);
cout('<div><h2>' . $lang->def('_USER_DETAILS') . '</h2>');
cout('<div class="form_line_l"><p><label class="floating">' . $lang->def('_USERNAME') . ': </label></p>' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . '</div>');
cout('<div class="form_line_l"><p><label class="floating">' . $lang->def('_LASTNAME') . ': </label></p>' . $user_info[ACL_INFO_LASTNAME] . '</div>');
cout('<div class="form_line_l"><p><label class="floating">' . $lang->def('_FIRSTNAME') . ': </label></p>' . $user_info[ACL_INFO_FIRSTNAME] . '</div>');
cout('<div class="no_float"></div>');
$charts = new Test_Charts($idTest, $idUser);
$charts->render($chartType, true);
cout($backUi);
cout('</div>');
}