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


PHP Program::find方法代码示例

本文整理汇总了PHP中Program::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Program::find方法的具体用法?PHP Program::find怎么用?PHP Program::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Program的用法示例。


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

示例1: postDelete

 public function postDelete()
 {
     $id = Input::get('id');
     $delpro = Program::find($id);
     $delpro->delete();
     return 1;
 }
开发者ID:saifurrahman,项目名称:dev,代码行数:7,代码来源:ProgramController.php

示例2: showSpecificProgram

 public function showSpecificProgram()
 {
     $programIDInput = Input::get('program-dropdown');
     $program = Program::find($programIDInput);
     //ave students per year and ave difference
     $yearsArray = Studentterm::where('programid', $program->programid)->where('year', '>', 1999)->where('year', '<', 2014)->groupBy('year')->orderBy('year', 'asc')->lists('year');
     $yearlyStudentAverage = [];
     $yearlySemDifference = [];
     foreach ($yearsArray as $yearData) {
         $aveStudents = $program->getYearlyAveStudents($yearData);
         if ($aveStudents > 1) {
             $yearlyStudentAverage[$yearData] = $aveStudents;
         }
     }
     $aveYearsOfStay = $program->getAveYearsOfStay();
     $aveYearsBeforeDropout = $program->getAveYearsBeforeDropout();
     $aveYearsBeforeShifting = $program->getAveYearsBeforeShifting();
     $aveAttrition = $program->getAveAttrition();
     $aveShiftRate = $program->getAveShiftRate();
     $batchAttrition = $program->getBatchAttrition();
     $batchShiftRate = $program->getBatchShiftRate();
     $division = $program->getDivision();
     $numYears = $program->getNumYears();
     $gradeCount = $program->getGradeCount();
     $shiftGradeCount = $program->getShiftGradeCount();
     $stbracketCount = $program->getSTBracketCount();
     $shiftBracketCount = $program->getShiftSTBracketCount();
     return View::make('program.program-specific', ['program' => $program, 'aveYearsOfStay' => $aveYearsOfStay, 'yearlyStudentAverage' => $yearlyStudentAverage, 'aveYearsBeforeShifting' => $aveYearsBeforeShifting, 'aveYearsBeforeDropout' => $aveYearsBeforeDropout, 'aveAttrition' => $aveAttrition, 'batchAttrition' => $batchAttrition, 'aveShiftRate' => $aveShiftRate, 'batchShiftRate' => $batchShiftRate, 'division' => $division, 'numYears' => $numYears, 'gradeCount' => $gradeCount, 'shiftGradeCount' => $shiftGradeCount, 'stbracketCount' => $stbracketCount, 'shiftBracketCount' => $shiftBracketCount]);
 }
开发者ID:jpcamba,项目名称:attrition,代码行数:29,代码来源:ProgramController.php

示例3: suggestIssue

 public function suggestIssue($course_id)
 {
     $course = Course::find($course_id);
     $program = Program::find($course->program->id);
     $year = date('y');
     $month = date('m');
     $counter = Issue::where('project_id', '=', Auth::user()->curr_project_id)->count();
     $counter += 1;
     $issue = substr($program->name, 0, 1) . $year . $month . str_pad($counter, 5, "0", STR_PAD_LEFT);
     return Response::json(array('issue' => $issue));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:11,代码来源:AjaxesController.php

示例4: detail

 /**
  * 详情
  *
  * @param int $date
  * @return void
  */
 public function detail($date)
 {
     // query the specified dates program and audio list
     $program = Program::dated($date)->enabled()->first();
     $audios = $this->getAudios($program);
     // get contributions info
     $contributers = $this->getProgramContributers($program->date);
     // get around pages
     $pages = (object) ['prev' => Program::find($program->id - 1), 'next' => Program::find($program->id + 1)];
     // TDK
     $title = $program->topic . ' (' . $program->date . ') ';
     $description = sprintf('%s 期飞鱼秀 %s 回放在线收听,下载', $program->date, $program->topic);
     // render page
     return View::make('program.detail')->with('appdate', $this->getAppProgramDate())->with('program', $program)->with('audios', $audios)->with('pages', $pages)->with('contributers', $contributers)->with('title', $title)->with('description', $description);
 }
开发者ID:popfeng,项目名称:zao,代码行数:21,代码来源:ProgramController.php

示例5: array

/**
 * loads all program data for the specified time range.
 * Set $single_program to true if you only want information about programs that
 * start exactly at $start_time (used by program_detail.php)
/**/
function &load_all_program_data($start_time, $end_time, $chanid = false, $single_program = false, $extra_query = '', $distinctTitle = false)
{
    global $db;
    // Don't allow negative timestamps; it confuses MySQL
    if ($start_time < 0) {
        $start_time = 0;
    }
    if ($end_time < 0) {
        $end_time = 0;
    }
    // Make a local hash of channel chanid's with references to the actual
    // channel data (Channels are not indexed by anything in particular, so
    // that the user can sort by chanid or channum).
    $channel_hash = array();
    // An array (that later gets converted to a string) containing the id's of channels we want to load
    if ($chanid) {
        $these_channels[] = $chanid;
    } else {
        $these_channels = Channel::getChannelList();
    }
    // convert $these_channels into a string so it'll go straight into the query
    if (!count($these_channels)) {
        trigger_error("load_all_program_data() attempted with out any channels", FATAL);
    }
    $these_channels = implode(',', $these_channels);
    // Build the sql query, and execute it
    $query = 'SELECT program.*,
                         UNIX_TIMESTAMP(program.starttime) AS starttime_unix,
                         UNIX_TIMESTAMP(program.endtime) AS endtime_unix,
                         IFNULL(programrating.system, "") AS rater,
                         IFNULL(programrating.rating, "") AS rating,
                         channel.callsign,
                         channel.channum
                  FROM program USE INDEX (id_start_end)
                       LEFT JOIN programrating USING (chanid, starttime)
                       LEFT JOIN channel ON program.chanid = channel.chanid
                       LEFT JOIN credits ON (program.chanid = credits.chanid AND program.starttime = credits.starttime)
                       LEFT JOIN people ON (credits.person = people.person)
                 WHERE';
    // Only loading a single channel worth of information
    if ($chanid > 0) {
        $query .= ' program.chanid=' . $db->escape($chanid);
    } else {
        $query .= ' program.chanid IN (' . $these_channels . ')';
    }
    // Requested start time is the same as the end time - don't bother with fancy calculations
    if ($start_time == $end_time) {
        $query .= ' AND program.starttime = FROM_UNIXTIME(' . $db->escape($start_time) . ')';
    } else {
        $query .= ' AND (program.endtime > FROM_UNIXTIME(' . $db->escape($start_time) . ')' . ' AND program.starttime < FROM_UNIXTIME(' . $db->escape($end_time) . ')' . ' AND program.starttime != program.endtime)';
    }
    // The extra query, if there is one
    if ($extra_query) {
        $query .= ' AND ' . $extra_query;
    }
    // Group and sort
    if (!$distinctTitle) {
        $query .= "\nGROUP BY channel.callsign, program.chanid, program.starttime";
    } else {
        $query .= "\nGROUP BY program.title";
    }
    $query .= " ORDER BY program.starttime";
    // Limit
    if ($single_program) {
        $query .= "\n LIMIT 1";
    }
    // Query
    $sh = $db->query($query);
    // No results
    if ($sh->num_rows() < 1) {
        $sh->finish();
        return array();
    }
    // Build two separate queries for optimized selecting of recstatus
    $sh2 = $db->prepare('SELECT recstatus
                               FROM oldrecorded
                              WHERE recstatus IN (-3, 11)
                                    AND programid = ?
                                    AND seriesid  = ?
                                    AND future = 0
                             LIMIT 1');
    $sh3 = $db->prepare('SELECT recstatus
                               FROM oldrecorded
                              WHERE recstatus IN (-3, 11)
                                    AND title       = ?
                                    AND subtitle    = ?
                                    AND description = ?
                                    AND future = 0 
                             LIMIT 1');
    // Load in all of the programs (if any?)
    $these_programs = array();
    $scheduledRecordings = Schedule::findScheduled();
    while ($data = $sh->fetch_assoc()) {
        if (!$data['chanid']) {
            continue;
//.........这里部分代码省略.........
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:101,代码来源:programs.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /program/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $program = Program::find($id);
     $program->delete();
     return Redirect::action('ProgramController@index');
 }
开发者ID:illuminate3,项目名称:league-production,代码行数:13,代码来源:ProgramController.php


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