public function getMenuTitle() { if (!is_null($this->title)) { return $this->title; } return parent::getMenuTitle(); }
public function actionEditProcess() { try { $post = StringHelper::filterArrayString($_POST); $result = Guide::model()->edit($_POST); if ($result == 1) { Yii::app()->user->setFlash('success', 'Cập nhật dữ liệu thành công !'); $this->redirect(Yii::app()->createUrl('guide/edit', array('id' => $post['id']))); } else { if ($result == 2) { Yii::app()->user->setFlash('error', 'Cập nhật dữ liệu thất bại !'); $this->redirect(Yii::app()->createUrl('guide/edit', array('id' => $post['id']))); } else { Yii::app()->user->setFlash('error', 'Không tồn tại tài liệu !'); $this->redirect(Yii::app()->createUrl('guide/edit', array('id' => $post['id']))); } } } catch (Exception $ex) { var_dump($ex->getMessage()); } }
public function actionPrintArea() { $documentary = Documentary::model()->searchByCondition($_GET, null, 2); $wanted_abroad = WantedAbroad::model()->searchByCondition($_GET, null, 2); $letters = Letters::model()->searchByCondition($_GET, null, 2); $cases = Cases::model()->searchByCondition($_GET, null, 2); $cases_abroad = CasesAbroadOther::model()->searchByCondition($_GET, null, 2); $opinion = Opinion::model()->searchByCondition($_GET, null, 2); $documentary_recieve = DocumentaryRecieve::model()->searchByCondition($_GET, null, 2); $documentary_abroad = DocumentaryAbroad::model()->searchByCondition($_GET, null, 2); $guide = Guide::model()->searchByCondition($_GET, null, 2); $result = array('documentary' => $documentary, 'wanted_abroad' => $wanted_abroad, 'letters' => $letters, 'cases' => $cases, 'cases_abroad' => $cases_abroad, 'opinion' => $opinion, 'documentary_recieve' => $documentary_recieve, 'documentary_abroad' => $documentary_abroad, 'guide' => $guide); $this->render('printArea', $result); }
$conditions = array('conditions'=>"program.manualid=0 AND $intervalQry"); switch ( $select ) { case 'Series': $conditions['conditions'].= " AND program.category_type='series' AND( (program.programid like '%001' AND program.previouslyshown=FALSE AND program.first=TRUE) OR (program.subtitle = 'Pilot' and program.first=TRUE) )"; break; case 'Specials': $conditions['conditions'].= " AND program.category='Special' AND program.originalairdate> adddate(now(), interval -1 month) AND program.previouslyshown=FALSE AND( program.first=true OR program.last=true )"; break; case 'Movies': $conditions['conditions'].= " AND program.category_type='movie' AND program.airdate>=year(now())-2 AND( program.first=true OR program.last=true )"; break; case 'Sports': $conditions['conditions'].= " AND program.category LIKE '$NewSportsQueryType' AND program.PreviouslyShown=false AND( program.first=true OR program.last=true ) AND( program.originalairdate is null OR program.originalairdate> adddate(now(), interval -1 day) )"; break; default: break; } $conditions['conditions'].= " AND program.chanid in (select chanid from channel where visible=TRUE)"; $conditions['conditions'].= " ORDER BY program.starttime"; $conditions['conditions'].= " LIMIT $NewShowsQueryLimit"; $joins = array('joins'=>'LEFT JOIN oldrecorded o on(program.programid=o.programid AND program.starttime=o.starttime)'); $query = array('select'=>'program.*, o.recstatus, o.station '); $guide = Guide::all( array_merge($query, $joins, $conditions) ); error_log("COUNT of GUIDE: ".count($guide), 0); $items = array(); $shows = array_values(array_merge($guide)); foreach($shows as $item => $show ){ if($show->recstatus != 8 && $show->recstatus != 4 ) { //later or earlier showings removed from list //error_log(">>> chanid: $show->chanid time: $show->starttime recstatus: $show->recstatus", 0); $items[] = new item($show); } } $items = array_unique($items); usort($items, 'items_date_compare'); if(count($items)){ $feed = new feed(
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Guide the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Guide::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function render() { $intro = get_field(Guide::field_intro); $toc = ''; $toc_list = ''; $content = ''; while (have_rows(Guide::field_section)) { the_row(); $section_name = esc_html(get_sub_field(Guide::field_section_name)); $toc_name = str_replace(' ', '', $section_name); $toc_list .= '<li><a href="#' . $toc_name . '">' . $section_name . '</a></li>'; $content .= '<h3 id="' . $toc_name . '">' . $section_name . '</h3>'; $content .= get_sub_field(Guide::field_section_intro); // 6-1-15: Allow lightboxes in guide pages $guide_post_id = get_the_ID(); //$content = preg_replace("/<a href=\"(.*(jpg|png|gif))\"(.*)>(.*)<\/a>/", "<a href=\"$1\" rel=\"lightbox[$guide_post_id]\" $3>$4</a>", $content); //$content = preg_replace("/<a href=\"(.*(jpg|png|gif))\">(.*)<\/a>/", "<a href=\"$1\" rel=\"lightbox[$guide_post_id]\" $2>$3</a>", $content); $content .= '<table class="guide_articles" border="0">'; $i = 0; while (have_rows(Guide::field_section_articles)) { the_row(); if ($i != 0) { $content .= '<tr><td colspan="2" style="border: 0; padding: 0;"><hr class="guide_article_seperator" /></td></tr>'; } $post_url = get_sub_field(Guide::field_section_article_url); $post_id = url_to_postid($post_url); // If post_id == 0 then we coudln't resolve the URL, just move on. if ($post_id == 0) { continue; } $post_title = get_sub_field(Guide::field_section_article_title); if ($post_title == '') { $post_title = get_the_title($post_id); } $post_description = get_sub_field(Guide::field_section_article_description); if ($post_description == '') { $post = get_post($post_id); $post_description = $post->post_excerpt; } $size = get_sub_field(Guide::field_section_article_size); $extra_size_class = ''; switch ($size) { case Guide::size_small: $extra_size_class = 'guide_article_small'; $image_size = 'guide_small'; break; case Guide::size_featured: $image_size = 'guide_featured'; break; case Guide::size_normal: default: $image_size = 'guide_normal'; break; } $image_source = Guide::otf_get_attachment_image_src($post_id, $image_size, true); $image_source = $image_source[0]; if ($size == Guide::size_featured) { $content .= '<tr class="guide_article">'; $content .= '<td colspan="2" class="guide_article_left guide_article_featured"><a href="' . $post_url . '"><img src="' . $image_source . '" /></a></td>'; $content .= '</tr>'; $content .= '<tr class="guide_article">'; $content .= '<td colspan="2" class="guide_article_featured guide_article_right">'; $content .= '<h3><a href="' . $post_url . '">' . $post_title . '</a></h3>'; $content .= $post_description; $content .= '<p class="guide_read_more"><a href="' . $post_url . '">Read more...</a></p>'; $content .= '</td>'; $content .= '</tr>'; } else { $content .= '<tr class="guide_article">'; $content .= '<td class="guide_article_left ' . $extra_size_class . '">'; $content .= '<a href="' . $post_url . '"><img src="' . $image_source . '" /></a>'; $content .= '</td>'; $content .= '<td class="guide_article_right ' . $extra_size_class . '">'; $content .= '<h3><a href="' . $post_url . '">' . $post_title . '</a></h3>'; if ($size != Guide::size_small) { $content .= $post_description; $content .= '<p class="guide_read_more"><a href="' . $post_url . '">Read more...</a></p>'; } $content .= '</td>'; $content .= '</tr>'; } $i++; } $content .= '</table>'; } $toc = '<h3>Table of Contents</h3><ul>' . $toc_list . '</ul>'; echo $intro . $toc . $content; }
<?php /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ require_once "__inc__.php"; validate_num($_GET['guide_id']); validate_num($_GET['chapter_id']); ?> <?php if (isset($_GET['guide_id']) && isset($_GET['chapter_id'])) { // Creo un istanza di Guide e vedo se la guida è presente nel DB $guide = new Guide($_GET['guide_id']); if ($guide->exists()) { $chapter = $guide->getChapter($_GET['chapter_id']); if ($chapter->exists()) { $backUrl = $guide->getLink(); $pagTitle = "{$guide['name']} - {$chapter['name']}"; require_once ROOT_PATH . "header.php"; echo "<div id='chapters-navigator' class='center'>"; $back_next_button = "<div style='overflow: auto;'>"; $prev_chapter = $chapter->getPrevious(); $next_chapter = $chapter->getNext(); if ($prev_chapter != NULL) { $back_next_button .= '<div style="float:left;"> <button class="btn" onclick="location.href=\'' . $prev_chapter->getLink() . '\';">«<span class="hide-phone"> Precedente</span></button> </div>'; } if ($next_chapter != NULL) { $back_next_button .= '<div style="float:right;">
margin-left:200px; margin-top:-350px; } </style> </head> <style type="text/css"> body { background-color:#cfcfcf; } </style> <body bgcolor = "green"> <script language="php"> require_once("../classes/database.class.php"); $con=new Database; if (!isset($_SESSION['uname']) || $_SESSION['uname']!=$_SESSION['projectName']) header("location:/views/loginwrong.html"); $con->messageDump(); $con->close(); require_once("../classes/guide.class.php"); require_once("../classes/common.class.php"); $page=new page("Weclome $_SESSION[projectName] Guide"); echo "<h3> Project Contributers </h3>"; $guide = new Guide($_SESSION["projectName"]); $guide->show_members(); $guide->show_commit_button(); $guide->show_panel_button() </script> </html>
$team_leader->team_leader = $leader['team_leader'][$j]; $team_leader->leader_phone = $leader['leader_phone'][$j]; $team_leader->deleted = $leader['deleted'][$deleted_count]; $team_leader->groupprogram_id = $return_id; if ($team_leader->deleted == 1) { $team_leader->mark_deleted($team_leader->id); } else { $team_leader->save(); } $deleted_count++; } // save to module Guide $guide = array('id' => $_POST['guide_record'], 'guide_id' => $_POST['guide_id'], 'guide_name' => $_POST['guide_name'], 'guide_phone' => $_POST['guide_phone'], 'deleted' => $_POST['deleted']); $guide_count = count($guide['id']); for ($j = 0; $j < $guide_count; $j++) { $guides = new Guide(); $guides->id = $guide['id'][$j]; $guides->guide_id = $guide['guide_id'][$j]; $guides->guide_name = $guide['guide_name'][$j]; $guides->guide_phone = $guide['guide_phone'][$j]; $guides->deleted = $guide['deleted'][$deleted_count]; $guides->groupprogram_id = $return_id; if ($guides->deleted == 1) { $guides->mark_deleted($guides->id); } else { $guides->save(); } $deleted_count++; } // save to module pick up car $pick_up_car = array('id' => $_POST['pick_id'], 'pick_up_car_id' => $_POST['pick_up_car_id'], 'number_plates' => $_POST['number_plates'], 'driver' => $_POST['driver'], 'driver_phone' => $_POST['driver_phone'], 'deleted' => $_POST['deleted']);
/** * Returns the static model of the specified AR class. * Please note that you should have this exact method in all your CActiveRecord descendants! * @param string $className active record class name. * @return WGuide the static model class */ public static function model($className = __CLASS__) { return parent::model($className); }
function appendGuides() { global $INTERNAL, $VISITOR; $guides = array(); $visitors = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_GUIDES . "_va"]); $asks = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_GUIDES . "_vb"]); $urls = explode(POST_ACTION_VALUE_SPLITTER, slashesStrip($_POST[POST_INTERN_PROCESS_GUIDES . "_vc"])); $browids = explode(POST_ACTION_VALUE_SPLITTER, $_POST[POST_INTERN_PROCESS_GUIDES . "_vd"]); $texts = explode(POST_ACTION_VALUE_SPLITTER, slashesStrip($_POST[POST_INTERN_PROCESS_GUIDES . "_ve"])); foreach ($visitors as $key => $visitor) { if (isset($VISITOR[$visitors[$key]])) { $guide = new Guide($INTERNAL[CALLER_SYSTEM_ID]->SessId, $visitors[$key], $browids[$key], $asks[$key]); $guide->SenderFullname = $INTERNAL[CALLER_SYSTEM_ID]->Fullname; $guide->Text = $texts[$key]; $guide->TargetURL = $urls[$key]; $guides[$visitors[$key] . $browids[$key]] = $guide; } } foreach ($guides as $guide) { $guide->Save(); } }
public function searchByCondition($attr, $cnt = NULL, $pagination = 1) { $criteria = new CDbCriteria(); if (!empty($attr['date_start']) && !empty($attr['date_end'])) { // $date_start = strtotime($attr['date_start']); // $date_end = strtotime($attr['date_end']); // $criteria->addBetweenCondition('date_prosecution', $date_start, $date_end); } if (!empty($attr['obj_name'])) { $obj_name = $attr['obj_name']; $criteria->addSearchCondition('obj_name', $obj_name); } if (!empty($attr['nation'])) { $nation = $attr['nation']; $criteria->addSearchCondition('country', $nation); } if (!empty($attr['assignee'])) { $assignee = $attr['assignee']; $criteria->addSearchCondition('did_by', $assignee); } if (!empty($attr['keyword'])) { $keyword = $attr['keyword']; $criteria->addSearchCondition('shortcut', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('number', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('abstract', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('country', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('did_by', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('obj_name', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('number_doc_finish', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('number_doc_send', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('signed_user', $keyword, true, "OR", "LIKE"); $criteria->addSearchCondition('reciever', $keyword, true, "OR", "LIKE"); } $count = Guide::model()->count($criteria); $pages = new CPagination($count); if (!empty($cnt)) { return $count; } if ($pagination != 1) { $result = Guide::model()->findAll($criteria); return $result; } // results per page $pages->pageSize = Yii::app()->params['limit']; $pages->applyLimit($criteria); $result = Guide::model()->findAll($criteria); return array('models' => $result, 'pages' => $pages); }
<div class="container-fluid"> <div class="row blizzardwatch-row blizzardwatch-row-single main-content-area"> <div class="row blizzardwatch-row article-content-area"> <div class="col-md-8 col-sm-7"> <article class="guide"> <div class="image-container"> <?php the_post_thumbnail('bw-main-featured', $thumbnail_attrs); ?> </div> <h1 class="article-title"><?php the_title(); ?> </a></h1> <div class="content"><?php Guide::render(); ?> </div> <p><?php echo get_field('above_comments_content', 'option'); ?> </p> <?php comments_template('', true); ?> </article> </div> <div class="col-md-4 col-sm-5 sidebar"> <?php get_template_part('sidebar');