function rec($item, $menuMapper, $obj) { $subItems = $menuMapper->getMenuItemsByParent($obj->get('menu')->getId(), $item->getId()); $class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded'; if (empty($subItems)) { $class = 'mjs-nestedSortable-leaf'; } if ($item->getType() == 4) { $class .= ' mjs-nestedSortable-no-nesting'; } if ($item->getBoxId() > 0) { $boxKey = $item->getBoxId(); } else { $boxKey = $item->getBoxKey(); } echo '<li id="list_' . $item->getId() . '" class="' . $class . '">'; echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i> <input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" /> <input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" /> <input type="hidden" name="items[' . $item->getId() . '][href]" class="hidden_href" value="' . $item->getHref() . '" /> <input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" /> <input type="hidden" name="items[' . $item->getId() . '][siteid]" class="hidden_siteid" value="' . $item->getSiteId() . '" /> <input type="hidden" name="items[' . $item->getId() . '][boxkey]" class="hidden_boxkey" value="' . $boxKey . '" /> <input type="hidden" name="items[' . $item->getId() . '][modulekey]" class="hidden_modulekey" value="' . $item->getModuleKey() . '" /> <span></span> </span><span class="title">' . $item->getTitle() . '</span><span class="item_delete"><i class="fa fa-times-circle"></i></span><span class="item_edit"><i class="fa fa-edit"></i></span></div>'; if (!empty($subItems)) { echo '<ol>'; foreach ($subItems as $subItem) { rec($subItem, $menuMapper, $obj); } echo '</ol>'; } echo '</li>'; }
function rec($item, $forumMapper, $obj) { $subItems = $forumMapper->getforumItemsByParent('1', $item->getId()); $class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded'; if (empty($subItems)) { $class = 'mjs-nestedSortable-leaf'; } echo '<li id="list_' . $item->getId() . '" class="' . $class . '">'; echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i> <input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" /> <input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" /> <input type="hidden" name="items[' . $item->getId() . '][desc]" class="hidden_desc" value="' . $item->getDesc() . '" /> <input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" /> <input type="hidden" name="items[' . $item->getId() . '][readAccess]" class="hidden_read_access" value="' . $item->getReadAccess() . '" /> <input type="hidden" name="items[' . $item->getId() . '][replayAccess]" class="hidden_replay_access" value="' . $item->getReplayAccess() . '" /> <input type="hidden" name="items[' . $item->getId() . '][createAccess]" class="hidden_create_access" value="' . $item->getCreateAccess() . '" /> <span></span> </span> <span class="title">' . $item->getTitle() . '</span> <span class="item_delete"> <i class="fa fa-times-circle"></i> </span><span class="item_edit"> <i class="fa fa-edit"></i> </span> </div>'; if (!empty($subItems)) { echo '<ol>'; foreach ($subItems as $subItem) { rec($subItem, $forumMapper, $obj); } echo '</ol>'; } echo '</li>'; }
function rec($x, $y) { global $a, $N, $M; if (0 <= $x && $x < $N && 0 <= $y && $y < $M && $a[$y][$x]) { $a[$y][$x] = 0; rec($x - 1, $y); rec($x + 1, $y); rec($x, $y - 1); rec($x, $y + 1); } }
function rec($site, $oConfig) { $o = "<ul>"; foreach ($site as $ele) { $o .= "<li>"; $o .= "<a href='?path=" . $oConfig->docroot . $oConfig->baseName . "/" . $ele->path . "' >" . $ele->attributes['name'] . "</a>"; if ($ele->hasChildPage == 1) { $o .= rec($ele->subs); } $o .= "</li>"; } $o .= "</ul>"; return $o; }
function rec($parent_id = 0) { $items = Page::where('parent_id', $parent_id)->where('status', 1)->get(); $menu = []; if ($items) { foreach ($items as $item) { $menu[$item->id] = ['title' => $item->title, 'path' => rtrim($item->path, '/'), 'slug' => $item->slug, 'order' => $item->order]; if ($item->hasSubs()) { $menu[$item->id]['subs'] = rec($item->id); } } } return $menu; }
function rec($id) { global $_GET, $type, $_POST; $q = select("select AnswerID from ut_messages where MessageID='{$id}'"); $row = runsql("select * from ut_messages where MessageID='{$q['0']}'"); if (mysql_num_rows($row)) { while ($r1 = mysql_fetch_array($row)) { print "<img src=/images/hr.gif height=10px width=473px style=\"margin-top:5px;margin-bottom:5px\">"; $_GET['id'] = $r1[MessageID]; $f = new cls_form($type, "message"); $f->Draw(); } rec($q[0]); } }
function rec($item, $downloadsMapper, $obj, $fileMapper) { $subItems = $downloadsMapper->getDownloadsItemsByParent('1', $item->getId()); $fileCount = $fileMapper->getCountFileById($item->getId()); if ($item->getType() === 0) { echo '<div class="page-header"> <h4>' . $obj->getTrans('cat') . ': ' . $item->getTitle() . ' <small>' . $item->getDesc() . '</small> </h4><hr>'; } if ($item->getType() != 0) { $lastFile = $fileMapper->getLastFileByDownloadsId($item->getId()); $image = ''; if ($lastFile->getFileImage() != '') { $image = $obj->getBaseUrl($lastFile->getFileImage()); } else { $image = $obj->getBaseUrl('application/modules/media/static/img/nomedia.png'); } echo '<div class="col-md-12 no-padding lib-item" data-category="view"> <div class="lib-panel"> <div class="row box-shadow"> <div class="col-md-4"> <a href="' . $obj->getUrl(array('controller' => 'index', 'action' => 'show', 'id' => $item->getId())) . '" > <img class="lib-img-show" src="' . $image . '"> </a> </div> <div class="col-md-8"> <div class="lib-row lib-header"> <a href="' . $obj->getUrl(array('controller' => 'index', 'action' => 'show', 'id' => $item->getId())) . '" > ' . $item->getTitle() . ' </a> <p class="text-left">' . $obj->getTrans('files') . ': ' . count($fileCount) . '</p> <div class="lib-header-seperator"></div> </div> <div class="lib-row lib-desc"> ' . $item->getDesc() . ' </div> </div> </div> </div> </div>'; } if (!empty($subItems)) { foreach ($subItems as $subItem) { rec($subItem, $downloadsMapper, $obj, $fileMapper); } } }
function rec($item, $downloadsMapper, $obj, $fileMapper) { $subItems = $downloadsMapper->getDownloadsItemsByParent('1', $item->getId()); $file = $fileMapper->getCountFileById($item->getId()); $class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded'; if (empty($subItems)) { $class = 'mjs-nestedSortable-leaf'; } echo '<li id="list_' . $item->getId() . '" class="' . $class . '">'; echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i> <input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" /> <input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" /> <input type="hidden" name="items[' . $item->getId() . '][desc]" class="hidden_desc" value="' . $item->getDesc() . '" /> <input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" /> <span></span> </span> <span class="title">' . $item->getTitle() . '</span> <span class="item_delete"> <i class="fa fa-times-circle"></i> </span><span class="item_edit"> <i class="fa fa-edit"></i> </span> <span class="upload" style="float:right; margin-right: 6px;"> <a href="javascript:media(' . $item->getId() . ')"> <i class="fa fa-cloud-upload"></i> </a> </span> <span class="view" style="float:right; margin-right: 6px;"> <a href="' . $obj->getUrl(array('controller' => 'downloads', 'action' => 'treatdownloads', 'id' => $item->getId())) . '"> <i class="fa fa-eye"></i> </a> </span> <span class="count" style="float:right; margin-right: 6px;">' . count($file) . '</span> </div>'; if (!empty($subItems)) { echo '<ol>'; foreach ($subItems as $subItem) { rec($subItem, $downloadsMapper, $obj, $fileMapper); } echo '</ol>'; } echo '</li>'; }
} krsort($ccnt0); reset($ccnt0); $v = each($ccnt0); $cmc = $v[0]; $cities = $v[1]; $mstar /= $fcnt; $mrev /= $fcnt; $mmp /= $fcnt; if ($alt_output) { print 'User #' . $id . "\n"; print 'Visited: ' . implode(', ', array_unique($dat)) . "\n"; print 'Favoured cities: ' . implode(', ', $cities) . ' (' . $cmc . ')' . "\n"; print $mstar * 5 . ' / ' . ($mrev * 5 + 5) . ' / ' . $mmp * 100 . "\n"; } $rec = rec(3, $dat, $ccnt0, $mstar, $mrev, $mmp); if ($alt_output) { print 'Recommended: ' . implode(', ', $rec) . "\n"; print "\n"; } else { print $id . ',' . implode(',', array_map(function ($x) { return substr($x, 1); }, $rec)) . "\n"; } } function rec($num, $exc, $cit, $mstar, $mrev, $mmp) { $res = array(); foreach ($cit as $clst) { $mres = recc($num - count($res), array_merge($exc, $res), $clst, $mstar, $mrev, $mmp); $res = array_merge($res, $mres);
function rec($sourceIndex, $node, $list) { echo $node . "fc"; $result = new stdClass(); if (count($list) == 0) { $result->ar = array(); $result->needToCheck = array(); } else { $otherNode = array_pop($list); echo $otherNode . "ffcc"; $startNode = $sourceIndex->queryOne("sid:{$node}"); $endNode = $sourceIndex->queryOne("sid:{$otherNode}"); $paths = getAllPathsBetweenTwoNodes($startNode, $endNode); if (count($paths->paths) == 0) { $res = rec($sourceIndex, $node, $list); $result->ar = $res->ar; $result->needToCheck = array_merge($res->needToCheck, array($otherNode)); } else { $res = rec($sourceIndex, $otherNode, $list); $res2 = array(); if (count($res->ar) == 0) { $res2 = $paths->paths; } else { for ($j = 0; $j < count($paths->paths); $j++) { for ($i = 0; $i < count($res->ar); $i++) { $res2[] = array_merge($paths->paths[$j], $res->ar[$i]); } } } $result->ar = $res2; $result->needToCheck = $res->needToCheck; } } return $result; }
echo $hot['group_price']; ?> </span>市场价 <del>¥<?php echo $hot['original_price']; ?> </del> </div> </li> <?php } ?> </ul> <?php } ?> </div> <div class="cp_ad mb10"><?php echo rec(14); ?> </div> </div> </div> </div> </div> <script type='text/javascript'> $(function(){ var time = parseInt("<?php echo TIMESTAMP; ?> "); $('.process').each(function(){ var lag = parseInt($(this).attr('endtime')) - time; if(lag>0){
function rec($id, $uid, $req, $obj) { $CommentMappers = new \Modules\Comment\Mappers\Comment(); $userMapper = new \Modules\User\Mappers\User(); $fk_comments = $CommentMappers->getCommentsByFKId($id); $user_rep = $userMapper->getUserById($uid); $config = \Ilch\Registry::get('config'); foreach ($fk_comments as $fk_comment) { $commentDate = new \Ilch\Date($fk_comment->getDateCreated()); $user = $userMapper->getUserById($fk_comment->getUserId()); if ($req > $config->get('comment_interleaving')) { $req = $config->get('comment_interleaving'); } $col = 9 - $req; $req = $req + 1; echo '<article class="row" id="' . $fk_comment->getId() . '">'; if ($config->get('comment_avatar') == 1) { echo '<div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo '<figure class="thumbnail" title="' . $user->getName() . '">'; echo '<a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo '</figure>'; echo '</div>'; echo '<div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo '<div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo '<div class="panel panel-default">'; echo '<div class="panel-bodylist">'; echo '<div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo '<header class="text-left">'; echo '<div class="comment-user">'; echo '<i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo '</div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('dateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo '</header>'; echo '<div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="' . $obj->getUrl(array('module' => 'comment', 'controller' => 'index', 'action' => 'index', 'id' => $fk_comment->getId(), 'id_a' => $obj->getRequest()->getParam('id'))) . '" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo '</div>'; echo '</div>'; echo '</div>'; echo '</article>'; $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }
function rec($id, $uid, $req, $obj) { $CommentMappers = new \Modules\Comment\Mappers\Comment(); $userMapper = new \Modules\User\Mappers\User(); $fk_comments = $CommentMappers->getCommentsByFKId($id); $user_rep = $userMapper->getUserById($uid); $config = \Ilch\Registry::get('config'); $nowDate = new \Ilch\Date(); foreach ($fk_comments as $fk_comment) { $commentDate = new \Ilch\Date($fk_comment->getDateCreated()); $user = $userMapper->getUserById($fk_comment->getUserId()); if ($req > $config->get('comment_interleaving')) { $req = $config->get('comment_interleaving'); } $col = 10 - $req; echo ' <article class="row" id="comment_' . $fk_comment->getId() . '">'; if ($config->get('comment_avatar') == 1) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $user->getName() . '">'; echo ' <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; } else { $col = $col + 2; echo ' <div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">'; } echo ' <div class="panel panel-default">'; echo ' <div class="panel-bodylist">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>'; if ($obj->getUser() and $config->get('comment_reply') == 1) { echo '<p class="text-right"><a href="javascript:slideReply(\'reply_' . $fk_comment->getId() . '\');" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>'; } echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; if ($obj->getUser()) { echo ' <div class="replyHidden" id="reply_' . $fk_comment->getId() . '">'; echo ' <form action="" class="form-horizontal" method="POST">'; echo $obj->getTokenField(); echo ' <section class="comment-list">'; echo ' <article class="row">'; $col = $col - 1; $req = $req + 1; if ($config->get('comment_avatar') == 1) { echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">'; echo ' <figure class="thumbnail" title="' . $obj->getUser()->getName() . '">'; echo ' <a href="' . $obj->getUrl('user/profil/index/user/' . $obj->getUser()->getId()) . '"><img class="img-responsive" src="' . $obj->getUrl() . '/' . $obj->getUser()->getAvatar() . '" alt="' . $obj->getUser()->getName() . '"></a>'; echo ' </figure>'; echo ' </div>'; } echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">'; echo ' <div class="panel panel-default">'; echo ' <div class="panel-body">'; echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user->getName() . '</div>'; echo ' <header class="text-left">'; echo ' <div class="comment-user">'; echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $obj->getUser()->getId())) . '">' . $obj->getUser()->getName() . '</a>'; echo ' </div>'; if ($config->get('comment_date') == 1) { echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $nowDate->format("d.m.Y - H:i", true) . '</time>'; } echo ' </header>'; echo ' <div class="comment-post">'; echo ' <p>'; echo ' <textarea class="form-control" accesskey="" name="article_comment_text" style="resize: vertical" required></textarea>'; echo ' </p>'; echo ' </div>'; echo ' <input type="hidden" name="fkId" value="' . $fk_comment->getId() . '" />'; echo ' <p class="text-right submit">'; echo $obj->getSaveBar('submit', 'Comment'); echo ' </p>'; echo ' </div>'; echo ' </div>'; echo ' </div>'; echo ' </article>'; echo ' </section>'; echo ' </form>'; echo ' </div>'; } $fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId()); $req = $req - 1; if (count($fkk_comments) > 0) { $req++; } $i = 1; foreach ($fkk_comments as $fkk_comment) { if ($i == 1) { rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj); $i++; } } if (count($fkk_comments) > 0) { $req--; } } }
echo $hot['group_price']; ?> </span> <del class="o-price">¥<?php echo $hot['original_price']; ?> </del> </a> </li> <?php } ?> </ul> <?php } ?> </div> <div class="cp_ad mb10"><?php echo rec(15); ?> </div> </div> </div> </div> <script type='text/javascript'> $(function(){ var time = parseInt("<?php echo TIMESTAMP; ?> "); var lag = parseInt($('.process').attr('endtime')) - time; if(lag>0){ var second = Math.floor(lag % 60); var minite = Math.floor((lag / 60) % 60);
?> "><?php echo $lang['nc_coupon_detail_havealook']; ?> </a> </div> </dd> </dl> <?php } ?> <?php } ?> </div> <div class="cp_ad mb10"><?php echo rec(11); ?> </div> </div> </div> </div> </div> </div> </div> <div id='short_message' style="display: none;"> </div> <script type="text/javascript"> var RESOURCE_SITE_URL = '<?php echo RESOURCE_SITE_URL; ?> '; </script>
<?php $ar = array(1 => 0, 2 => 0, 3 => 1); function rec($arr) { foreach ($arr as &$el) { if ($el != 0) { echo $el; $arr[$el]['children'] = $el; } } return $arr; } ?> <pre> <?php print_r(rec($ar)); ?> </pre>
<img src="<?php echo UPLOAD_SITE_URL . DS . ATTACH_COMMON . DS . $GLOBALS['setting_config']['site_logowx']; ?> " class="f-l jImg img-error"> <p class="f-l"> <span>扫一扫</span> <span>关注我们</span> </p> </div> <div class="weibo f-l"> <div class="ic qq" style="padding-left: 0px;"><?php echo rec(8); ?> </div> <div class="ic sina" style="padding-left: 0px;"><?php echo rec(7); ?> </div> </div> </div> </div> </div> </div> </div> <?php } ?> </div> </div> <div id="footer" class="wrapper"> <p><a href="<?php
</dd> </dl> <?php $membernum++; ?> <?php } ?> <?php } ?> </div> </div> </div> <div class="ad10"><?php echo rec(9); ?> </div> <div id="faq"> <?php if (is_array($output['article_list']) && !empty($output['article_list'])) { ?> <?php foreach ($output['article_list'] as $k => $article_class) { ?> <?php if (!empty($article_class)) { ?> <ul class="s<?php echo '' . $k + 1; ?>
function rec($id) { global $type, $HTTP_POST_VARS; $q = select("select AnswerID from ut_messages where MessageID='{$id}'"); $row = runsql("select * from ut_messages where MessageID='{$q['0']}'"); if (mysql_num_rows($row)) { while ($r1 = mysql_fetch_array($row)) { print "<hr>"; $HTTP_GET_VARS['id'] = $r1[MessageID]; $HTTP_POST_VARS['id'] = $r1[MessageID]; $f = new cls_form($type, "message"); $f->Draw(); } rec($q[0]); } }
public function rec_viewOp() { @header("Content-type: text/html; charset=" . CHARSET); echo rec(intval($_GET['rec_id'])); }
function rec($X, $i, $prod, &$res) { // $i is the number of vector from where we currently choose // $prod is current product // $res is the list of all found products /* echo'<br>$X'; print_r($X); echo'<br>count($X[$i])'; print_r(count($X[$i])); echo'<br>count($X)'; print_r(count($X)); echo'<br>sizeof($X)'; print_r(sizeof($X)); echo'<br>$i'; print_r($i); */ if ($i > count($X) - 1) { echo '<br>count($X)'; print_r(count($X)); echo '<br>close$i'; print_r($i); array_push($res, $prod); echo '<br>close $res'; print_r($res); return; } echo '<br>count($X[$i])'; print_r(count($X[$i])); for ($j = 0; $j < count($X[$i]); $j++) { // choose element $j from vector $i echo '<br>$i'; print_r($i); echo '<br>$j'; print_r($j); echo '<br>$X[$i][$j]'; print_r($X[$i][$j]); echo '<br>$prod'; print_r($prod); rec($X, $i + 1, $prod * $X[$i][$j], $res); } }
<?php /** * Created by PhpStorm. * User: Александр * Date: 26.09.2015 * Time: 22:38 */ require __DIR__ . '/../function.php'; //news_upload($name,$text); require __DIR__ . '/../modules/sql.php'; $name = $_POST['title_news']; $text = $_POST['text_news']; $date = date("F j, Y, g:i a"); rec($name, $text); header('location: ../views/index.php');
<p class="txt"> <a href="index.php?act=coupon&op=detail&coupon_id=<?php echo $download['coupon_id']; ?> " target="_blank"> <?php echo $lang['nc_coupon_draw_coupon']; echo $download['coupon_name']; ?> </a> </p> </div> </a> </li> <?php } ?> </ul> <?php } ?> </div> </div> <div class="cp_ad mb10"><?php echo rec(10); ?> </div> </div> </div> </div> </div>
?> </em></p> </div> <div class="price"><!--<?php echo $lang['nc_store_coupon_valid'] . $lang['nc_colon']; echo date("Y-m-d", $ev['coupon_start_time']); ?> ~<?php echo date("Y-m-d", $ev['coupon_end_time']); ?> --></div> </li> <?php } ?> </ul> <?php } ?> </div> <div class="cp_ad mb10"><?php echo rec(13); ?> </div> </div> </div> </div> </div> </div> </div>
function rec($item, $forumMapper, $obj, $readAccess) { $subItems = $forumMapper->getForumItemsByParent('1', $item->getId()); $topics = $forumMapper->getCountTopicsById($item->getId()); $lastPost = $forumMapper->getLastPostByTopicId($item->getId()); $posts = $forumMapper->getCountPostsById($item->getId()); $adminAccess = null; if ($obj->getUser()) { $adminAccess = $obj->getUser()->isAdmin(); } ?> <?php if ($item->getType() === 0) { ?> <ul class="topiclist"> <li class="header"> <dl class="icon"> <dt><a href="<?php echo $obj->getUrl(array('controller' => 'showcat', 'action' => 'index', 'id' => $item->getId())); ?> "><?php echo $item->getTitle(); ?> </a></dt> <dd class="topics"><?php echo $obj->getTrans('topics'); ?> </dd> <dd class="posts"><?php echo $obj->getTrans('posts'); ?> </dd> <dd class="lastpost"><span><?php echo $obj->getTrans('lastPost'); ?> </span></dd> </dl> </li> </ul> <?php } ?> <?php if (is_in_array($readAccess, explode(',', $item->getReadAccess())) || $adminAccess == true) { ?> <?php if ($item->getType() != 0) { ?> <ul class="topiclist forums"> <li class="row"> <dl class="icon" style=" <?php if ($obj->getUser() && $lastPost) { ?> <?php if (in_array($obj->getUser()->getId(), explode(',', $lastPost->getRead()))) { ?> background-image: url(<?php echo $obj->getModuleUrl('static/img/forum_read.png'); ?> ); <?php } else { ?> background-image: url(<?php echo $obj->getModuleUrl('static/img/topic_unread.png'); ?> ); <?php } ?> <?php } else { ?> background-image: url(<?php echo $obj->getModuleUrl('static/img/forum_read.png'); ?> ); <?php } ?> background-repeat: no-repeat;"> <dt> <a href="<?php echo $obj->getUrl(array('controller' => 'showtopics', 'action' => 'index', 'forumid' => $item->getId())); ?> " class="forumtitle"><?php echo $item->getTitle(); ?> </a><br> <?php echo $item->getDesc(); ?> </dt> <dd class="topics"><?php echo $topics; ?> <dfn><?php echo $obj->getTrans('topics'); ?> </dfn></dd> <dd class="posts"><?php echo $posts; ?> <dfn><?php echo $obj->getTrans('posts'); ?> </dfn></dd> <dd class="lastpost"> <?php if ($lastPost) { ?> <span> <img style="width:30px; padding-right: 5px;" src="<?php echo $obj->getBaseUrl($lastPost->getAutor()->getAvatar()); ?> "> <?php echo $obj->getTrans('by'); ?> <a href="<?php echo $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $lastPost->getAutor()->getId())); ?> "><?php echo $lastPost->getAutor()->getName(); ?> </a> <a href="<?php echo $obj->getUrl(array('controller' => 'showposts', 'action' => 'index', 'topicid' => $lastPost->getTopicId(), 'page' => $lastPost->getPage())); ?> #<?php echo $lastPost->getId(); ?> "> <img src="<?php echo $obj->getModuleUrl('static/img/icon_topic_latest.png'); ?> " alt="<?php echo $obj->getTrans('viewLastPost'); ?> " title="<?php echo $obj->getTrans('viewLastPost'); ?> " height="10" width="12"> </a> <br><?php echo $lastPost->getDateCreated(); ?> </span> <?php } ?> </dd> </dl> </li> </ul> <?php } ?> <?php } ?> <?php if (!empty($subItems)) { foreach ($subItems as $subItem) { rec($subItem, $forumMapper, $obj, $readAccess); } } }
<?php echo rec(2); ?> <strong>数据互通</strong><span>网站,商家,消费者</span> </li> <li class="mod_agree_item mod_agree_item3"> <?php echo rec(3); ?> <strong>统一价格</strong><span>拒绝被宰,安心购物</span> </li> <li class="mod_agree_item mod_agree_item4"> <?php echo rec(4); ?> <strong>担保交易</strong><span>支付宝担保,交易更安全</span> </li> <li class="mod_agree_item mod_agree_item5"> <?php echo rec(5); ?> <strong>无忧退货</strong><span>7+15无理由退换货</span> </li> <li class="mod_agree_item mod_agree_item6"> <?php echo rec(6); ?> <strong>惊喜购</strong><span>帮你发现身边的好货</span> </li> </ul> </div></div></div>
function makepr($parent) { global $ar, $i, $topparent; $topparent = $parent; print "<table border=1>"; print "<tr><td></td>"; print rec2($parent); print "</tr>"; rec($parent); print "</table>"; unset($m); $i = 0; print "<table border=1>"; print "<tr><td></td>"; rec2($parent); foreach ($ar as $k => $v) { $i++; $q = select("select Name_rus from en_menu where MenuID='{$k}'"); print "<tr><td><b>{$q['0']}</b></td>"; $sum = 0; foreach ($v as $k1 => $v1) { $sum += $v1; } reset($v); $j = 0; foreach ($v as $k1 => $v1) { $j++; $v1 = round($v1 / $sum, 2); print "<td><center>{$v1}</td>"; $ar[$k][$k1] = $v1; $m[$i][$j] = $v1; } } print "</table>"; $c = count($ar); for ($i = 1; $i <= $c; $i++) { $pr[$i] = 1 / $c; } $sum = 0; foreach ($pr as $k => $v) { $sum += $v; } for ($i = 1; $i < 100; $i++) { $pr = mult($pr, $m); } $sum = 0; foreach ($pr as $k => $v) { $sum += round($v, 3); } reset($pr); foreach ($pr as $k => $v) { $pr[$k] = round($v / $sum, 3); } reset($pr); //расчет PR $i = 1; unset($menu); foreach ($ar as $k => $v) { $menu[$i] = $k; $i++; } $i = 1; //print count($pr)."<hr>"; foreach ($pr as $k => $v) { print "{$k}=>{$v}<br>"; $v = round($v * count($pr) * 0.85 + 0.15, 1); $m = $menu[$i]; runsql("update en_menu set PR='{$v}' where MenuID='{$m}'"); $i++; } }
function send_mail($nom, $from, $to, $subject, $body) { $headers = array('From' => $nom . '<' . $from . '>', 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array('host' => 'ssl://smtp.gmail.com', 'port' => '465', 'auth' => true, 'username' => '*****@*****.**', 'password' => 'campusfrance')); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { return false; } else { return true; } } // formulaire envoyé, on récupère tous les champs. $nom = isset($_POST['nom']) ? rec($_POST['nom']) : ''; $email = isset($_POST['email']) ? rec($_POST['email']) : ''; $objet = isset($_POST['objet']) ? rec($_POST['objet']) : ''; $message = isset($_POST['message']) ? rec($_POST['message']) : ''; // On va vérifier les variables et l'email ... $email = isEmail($email) ? $email : ''; // soit l'email est vide si erroné, soit il vaut l'email entré $err_formulaire = false; // sert pour remplir le formulaire en cas d'erreur si besoin if (isset($_POST['choix_personne'])) { switch ($_POST['choix_personne']) { case 'fortier': $destination = "*****@*****.**"; break; case 'damien': $destination = '*****@*****.**'; break; case 'quentin': $destination = '*****@*****.**';
function rec($array) { $c = count($array); foreach ($array as $key => $value) { if (is_array($value)) { $GLOBALS['rec'] .= '{"text": "' . $key . '"'; $GLOBALS['rec'] .= ', "children": ['; rec($value); $GLOBALS['rec'] .= ']}'; } else { $GLOBALS['rec'] .= '"' . $key . '"'; $c--; if ($c) { $GLOBALS['rec'] .= ","; } } } }