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


PHP School::all方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // create new sitemap object
     $sitemap = App::make("sitemap");
     // set cache (key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean))
     // by default cache is disabled
     $sitemap->setCache('laravel.sitemap', 3600);
     // check if there is cached sitemap and build new only if is not
     if (!$sitemap->isCached()) {
         // add item to the sitemap (url, date, priority, freq)
         $sitemap->add(URL::route('index'), '2015-04-18T12:24:11+00:00', '1.0', 'daily');
         // get all posts from db
         $schools = School::all();
         // add every post to the sitemap
         foreach ($schools as $school) {
             $images = array(array('url' => $school->cover_photo_url, 'title' => $school->name, 'caption' => $school->name));
             foreach ($school->photos_data as $image) {
                 $images[] = array('url' => $image->photo_url, 'title' => $school->name, 'caption' => $image->name);
             }
             $sitemap->add($school->school_url, $school->updated_at, '0.9', 'daily', $images);
         }
     }
     // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
     return $sitemap->render('xml');
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:30,代码来源:SitemapController.php

示例2: getMyprofile

 public function getMyprofile()
 {
     $id = Auth::user()->id;
     $alumni_id = null;
     $sql = "SELECT * FROM alumni WHERE account_id = ?";
     $prof = DB::select($sql, array($id));
     if ($prof != null) {
         $alumni_id = $prof[0]->id;
     }
     $sql2 = "SELECT * FROM degree WHERE alumni_id = ?";
     $deg = DB::select($sql2, array($alumni_id));
     $sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?";
     $wrk_exp = DB::select($sql3, array($alumni_id));
     $sql4 = "SELECT * FROM certificate WHERE alumni_id = ?";
     $certificate = DB::select($sql4, array($alumni_id));
     // $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?";
     $sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id";
     $a_tracer = DB::select($sql5, array($alumni_id));
     $dept = Department::all();
     $region = Region::all();
     $province = Province::all();
     $occupation = Occupation::all();
     $company = Company::all();
     $deg_title = DegreeTitle::all();
     $school = School::all();
     $jobs = Job::all();
     $field = Field::all();
     $questions = DB::select("SELECT * FROM survey_questions");
     $civil_status = DB::select("SELECT * FROM civil_status");
     return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs);
 }
开发者ID:patocjurel,项目名称:capstone-project,代码行数:31,代码来源:UserController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $statistics = (object) array('schools_count' => School::all()->count(), 'municipalities_count' => Municipality::all()->count(), 'visitor_likes_count' => VisitorLikes::all()->count(), 'visitor_comments_count' => VisitorComments::all()->count());
     $home_schools = School::orderBy('created_at', 'desc')->take(5)->get();
     $home_comments = VisitorComments::orderBy('created_at', 'desc')->take(5)->get();
     return View::make('admin.home')->with('home_schools', $home_schools)->with('home_comments', $home_comments)->with('statistics', $statistics);
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:12,代码来源:AdminHomeController.php

示例4: index

 public function index()
 {
     $schools = School::all();
     $states = State::all();
     $cities = City::where('state_id', '=', 25)->get();
     $menu = 'data';
     return View::make('schools.index', compact('schools', 'states', 'cities', 'menu'));
 }
开发者ID:emanmks,项目名称:oneschool,代码行数:8,代码来源:SchoolsController.php

示例5: index

 public function index()
 {
     $schools = School::all();
     $schoolNames = array();
     foreach ($schools as $school) {
         array_push($schoolNames, $school->name);
     }
     sort($schoolNames);
     return View::make('content.schoolIndex')->with('schoolNames', $schoolNames);
 }
开发者ID:AlexLeung,项目名称:ibsurvey,代码行数:10,代码来源:SchoolsController.php

示例6: home

 public function home()
 {
     $address = Address::findByIdentityId(1);
     $schools = School::all(0, 50);
     $teachers = Teacher::findBySchoolId(1);
     $studentContacts = StudentContact::findByStudentId(1);
     $classes = Sclass::findByTeacherId(1);
     $student = Student::findById(1);
     require_once 'views/identity/home.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:10,代码来源:identity_controller.php

示例7: listRecords

 public function listRecords()
 {
     $start = 0;
     $number = 50;
     if (isset($_POST['rStart'])) {
         $start = $_POST['rStart'];
     }
     if (isset($_POST['rNumber'])) {
         $number = $_POST['rNumber'];
     } else {
         $number = School::rowCount();
     }
     $schools = School::all($start, $number);
     require_once 'views/school/list.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:15,代码来源:school_controller.php

示例8: listClasses

 public function listClasses()
 {
     $start = 0;
     if (isset($_POST['rStart'])) {
         $start = $_POST['rStart'];
     }
     $number = 0;
     if (isset($_POST['rNumber'])) {
         $number = $_POST['rNumber'];
     } else {
         $number = Sclass::rowCount();
     }
     $schoolList = School::all($start, $number);
     $classesAtSchool = '';
     $schoolName = '';
     if (isset($_POST['schoolID'])) {
         $classesAtSchool = Sclass::getAllClassesAtSchool($_POST['schoolID'], $start, $number);
         $schoolName = School::findById($_POST['schoolID']);
         $schoolName = $schoolName->getValues();
         $schoolName = $schoolName['name'];
     }
     require_once 'views/class/listClasses.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:23,代码来源:sclass_controller.php

示例9: header

    $application->id_pelajar = (int) $_POST['id_pelajar'];
    $application->id_sekolah = (int) $_POST['sekolah'];
    $application->id_subjek = (int) $_POST['subjek'];
    $application->status = (int) $_POST['status'];
    if ($application->update()) {
        // $_SESSION['success'] = 'Application updated!';
        header('Location: index.php?module=admin');
        exit;
    } else {
        // $_SESSION['error'] = 'Failed to update application!';
    }
}
ob_start();
$app = Application::findById($id);
$pelajar = Student::findById($app->id_pelajar);
$sekolahs = School::all();
$subjeks = Subject::ofSchool($app->id_sekolah);
$statuses = Application::statuses();
?>
<div>
	<div>
		<h1>Kemaskini Permohonan <span class="text-muted">#<?php 
echo $id;
?>
</span></h1>
		<hr />
	</div>
	
	<form action="" class="form-horizontal" method="post" id="application-form">
		<input type="hidden" name="id_pelajar" value="<?php 
echo $pelajar->id;
开发者ID:sanusi87,项目名称:project_one,代码行数:31,代码来源:admin_edit_application.php

示例10: function

$app->get('/talent/:name', function ($name) use($app) {
    $app->response()->header('Content-Type', 'application/json');
    try {
        $talent = Talent::with('questions')->where('name', '=', $name)->firstOrFail();
    } catch (ModelNotFoundException $e) {
        $app->halt(404, 'Talent niet gevonden');
    }
    echo $talent->toJson();
});
$app->get('/schooladvice', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo EducationLevel::SchoolAdvice()->get()->toJson();
});
$app->get('/schools', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo School::all()->toJson();
});
$app->get('/skills', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->get('/occupation', function () use($app) {
    $app->response()->header('Content-Type', 'application/json');
    echo Skill::all()->toJson();
});
$app->group('/user', function () use($app) {
    $app->options('/:name', function ($name) use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
    });
    $app->options('/', function () use($app) {
        $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
开发者ID:Robinwist,项目名称:UXDTalentenTest,代码行数:31,代码来源:api.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $schools = School::all();
     //return $schools->toJson();
     return view('layouts.schools', ['schools' => $teachers]);
 }
开发者ID:purplenimbus,项目名称:Nimbus-SMS,代码行数:11,代码来源:SchoolController.php

示例12: create

 public function create()
 {
     // Get grades
     $grades = [];
     foreach (Grade::all() as $i) {
         $grades[] = $i->getValues();
     }
     // Get Schools
     $schools = [];
     foreach (School::all() as $i) {
         $schools[] = $i->getValues();
     }
     include_once 'views/student/create.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:14,代码来源:student_controller.php

示例13: daftarsekolah

 public function daftarsekolah()
 {
     $schools = School::all();
     return View::make('schools.daftarsekolah', compact('schools'))->withTitle('Sekolah');
 }
开发者ID:inseo201,项目名称:atletik4,代码行数:5,代码来源:SchoolsController.php

示例14: ob_start

<?php

$id = $_GET['id'];
ob_start();
$app = Application::findById($id);
$pelajar = Student::findById($app->id_pelajar);
$bangsa = Student::bangsa();
$sekolahs = array();
array_map(function ($sekolah) {
    global $sekolahs;
    $sekolahs[$sekolah['id']] = $sekolah['nama'];
}, School::all());
$subjeks = array();
array_map(function ($subjek) {
    global $subjeks;
    $subjeks[$subjek['id']] = $subjek['nama'];
}, Subject::ofSchool($app->id_sekolah));
$statuses = array();
array_map(function ($status) {
    global $statuses;
    $statuses[$status['id']] = $status['nama'];
}, Application::statuses());
$programmes = array();
array_map(function ($programme) {
    global $programmes;
    return $programmes[$programme['id']] = $programme['nama_panjang'];
}, Programme::all());
?>
<div>
	<table class="table">
		<tbody>
开发者ID:sanusi87,项目名称:project_one,代码行数:31,代码来源:print_application.php


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