本文整理汇总了PHP中School类的典型用法代码示例。如果您正苦于以下问题:PHP School类的具体用法?PHP School怎么用?PHP School使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了School类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _edit
function _edit($OID = 0, $CID = 0)
{
loginRequireMgmt();
if (!loginCheckPermission(USER::MGMT_SCHOOL)) {
redirect("errors/401");
}
$item = "School";
$urlPrefix = "mgmt_school";
$object = new School();
$object->retrieve($OID, $CID);
if (!$object->exists()) {
$data['body'][] = "<p>{$item} Not Found!</p>";
} else {
$fdata['form_heading'] = "Edit {$item}";
$fdata['object'] = $object;
$fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update");
$fdata['actionLabel'] = "Submit";
$fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
$fdata['cancelLabel'] = "Cancel";
$form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form.php", $fdata);
$data['head'][] = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form_js.php");
$data['body'][] = "<h2>Edit {$item}</h2>";
$data['body'][] = $form;
}
View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
示例2: getAvailableSchoolsAttribute
public function getAvailableSchoolsAttribute()
{
$filters = array_filter(Input::only('specialty', 'district', 'municipality', 'city', 'type', 'search'));
$filters['financing'][] = $this->id;
$schools_data = new School();
return $schools_data->filterSchools($filters)->get()->count();
}
示例3: _ops_delete
function _ops_delete($OID = 0, $CID = 0)
{
$OID = max(0, intval($OID));
$CID = max(0, intval($CID));
$msg = '';
loginRequireMgmt();
if (!loginCheckPermission(USER::MGMT_SCHOOL)) {
redirect("errors/401");
}
$itemName = "School";
$urlPrefix = "mgmt_school";
$object = new School($OID, $CID);
if (!$object->exists()) {
$msg = "{$itemName} not found!";
} else {
transactionBegin();
if ($object->delete()) {
transactionCommit();
$msg = "{$itemName} deleted!";
} else {
TransactionRollback();
$msg = "{$itemName} delete failed!";
}
}
redirect("{$urlPrefix}/manage", $msg);
}
示例4: isexist
function isexist($zipcode)
{
$Model_B = new School();
$valid = $Model_B->find('count', array('conditions' => array('School.school_code' => $zipcode)));
if ($valid == 1) {
return true;
} else {
return false;
}
}
示例5: getAllAsHTMLOptions
static function getAllAsHTMLOptions($itemId = -1)
{
$school = new School();
$aray = $school->retrieve_many();
$options = "";
foreach ($aray as $item) {
$itemOID = $item->get('OID');
$selected = $item->rs['OID'] == $itemId ? "selected" : "";
$options .= '<option value=' . $itemOID . ' ' . $selected . '>' . $item->get("name");
}
return $options;
}
示例6: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$trashIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/trash.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
// <img src=\"{$editIcon}\">
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTopic", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Kategorie einfügen <img src=\"{$blankIcon}\">", "command" => "CreateCategory", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "Order", "namespace" => "Portal", "params" => "{'portletId':'{$this->id}','order':'last'}", "type" => "popup"))), array("name" => "SEPARATOR"), array("name" => "Kopieren <img src=\"{$copyIcon}\">", "command" => "PortletCopy", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Ausschneiden <img src=\"{$cutIcon}\">", "command" => "PortletCut", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Referenzieren <img src=\"{$referIcon}\">", "command" => "PortletReference", "namespace" => "Portal", "params" => "{'id':'{$this->id}','user':'{$this->user}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$trashIcon}\">", "command" => "Delete", "namespace" => "PortletTopic", "params" => "{'portletId':'{$this->id}'}", "type" => "popup"), array("name" => "SEPARATOR"), array("name" => "Rechte <img src=\"{$rightsIcon}\">", "command" => "Sanctions", "namespace" => "Explorer", "params" => "{'id':'{$this->id}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例7: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteTerm", "namespace" => "PortletAppointment", "params" => "{'portletId':'{$this->id}','termIndex':'{$this->termIndex}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例8: actionEditmoreinfo
public function actionEditmoreinfo($user_id)
{
$user_more_info = UserInfoAR::model()->findByPk($user_id);
$this->assign('user_more', $user_more_info);
$maritalStatus = MaritalStatus::model()->findAll();
// 'MaritalStatus', 'marital_status_id'),
$hometown = Hometown::model()->findAll();
// 'Province', 'hometown_id'),
$nation = Nation::model()->findAll();
// 'Nation', 'nation_id'),
$bodyType = BodyType::model()->findAll();
// 'BodyType', 'body_type_id'),
$education = Education::model()->findAll();
// 'Education', 'education_id'),
$school = School::model()->findAll();
// 'School', 'school_id'),
$province = Province::model()->findAll();
// 'Province', 'province_id'),
$job = Job::model()->findAll();
// '$maritalSta,
$this->assign('maritalStatus', $maritalStatus);
$this->assign('hometown', $hometown);
$this->assign('nation', $nation);
$this->assign('bodyType', $bodyType);
$this->assign('education', $education);
$this->assign('school', $school);
$this->assign('province', $province);
$this->assign('job', $job);
}
示例9: 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);
}
示例10: ajaxResponse
public function ajaxResponse(\AjaxResponseObject $ajaxResponseObject)
{
//icons
$copyIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/copy.png";
$cutIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/cut.png";
$referIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/refer.png";
$deleteIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/delete.png";
$hideIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/hide.png";
$bookmarkIcon = \Bookmarks::getInstance()->getAssetUrl() . "icons/bookmark.png";
$schoolBookmarkIcon = \School::getInstance()->getAssetUrl() . "icons/schoolbookmark.png";
$upIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/up.png";
$downIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/down.png";
$topIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/top.png";
$bottomIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/bottom.png";
$renameIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rename.png";
$editIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/edit.png";
$propertiesIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/properties.png";
$rightsIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/rights.png";
$blankIcon = \Explorer::getInstance()->getAssetUrl() . "icons/menu/blank.png";
$popupMenu = new \Widgets\PopupMenu();
$items = array(array("name" => "Bearbeiten <img src=\"{$editIcon}\">", "command" => "EditMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Bild bearbeiten <img src=\"{$blankIcon}\">", "command" => "EditMessageImage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"), array("name" => "Umsortieren <img src=\"{$blankIcon}\">", "direction" => "left", "menu" => array(array("name" => "Eins nach oben <img src=\"{$upIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'up'}", "type" => "popup"), array("name" => "Eins nach unten <img src=\"{$downIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'down'}", "type" => "popup"), array("name" => "Ganz nach oben <img src=\"{$topIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'first'}", "type" => "popup"), array("name" => "Ganz nach unten <img src=\"{$bottomIcon}\">", "command" => "OrderMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}','order':'last'}", "type" => "popup"))), array("name" => "Löschen <img src=\"{$deleteIcon}\">", "command" => "DeleteMessage", "namespace" => "PortletMsg", "params" => "{'portletObjectId':'{$this->portletObjectId}','messageObjectId':'{$this->messageObjectId}'}", "type" => "popup"));
$popupMenu->setItems($items);
$popupMenu->setPosition(round($this->x + $this->width - 155) . "px", round($this->y + $this->height + 4) . "px");
$popupMenu->setWidth("150px");
$ajaxResponseObject->setStatus("ok");
$ajaxResponseObject->addWidget($popupMenu);
return $ajaxResponseObject;
}
示例11: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
School::create([]);
}
}
示例12: _make_html_table
function _make_html_table($table, $item, $urlPrefix, $n, &$data)
{
$dbh = getdbh();
//pagination
$stmt = $dbh->query("SELECT count(OID) total FROM {$table}");
$total = $stmt->fetchColumn();
$limit = $GLOBALS['pagination']['per_page'];
$data['body'][] = '<p>Showing records ' . ($n + 1) . ' to ' . min($total, $n + $limit) . ' of ' . $total . '</p>';
$data['body'][] = pagination::makePagination($n, $total, myUrl("{$urlPrefix}/manage"), $GLOBALS['pagination']);
//table
$stmt = $dbh->query("SELECT OID,CID,name,pin,schoolId FROM {$table} LIMIT {$n},{$limit}");
if ($stmt === false) {
var_dump($dbh->errorInfo());
return;
}
$tablearr[] = explode(',', "name,pin,school");
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$OID = $rs['OID'];
$CID = $rs['CID'];
$row = null;
foreach ($tablearr[0] as $f) {
if ($f == 'school') {
$row[] = htmlspecialchars(School::getNameFromId($rs['schoolId']));
} else {
$row[] = htmlspecialchars($rs[$f]);
}
}
$row[] = '<a href="' . myUrl("{$urlPrefix}/edit_score/{$OID}/{$CID}") . '">Edit Score</a> | ' . '<a href="' . myUrl("{$urlPrefix}/edit/{$OID}/{$CID}") . '">Edit</a> | ' . '<a href="javascript:jsconfirm(\'Really Delete ' . $item . '?\',\'' . myUrl("{$urlPrefix}/ops_delete/{$OID}/{$CID}") . '\')">Delete</a>';
$tablearr[] = $row;
}
$data['body'][] = table::makeTable($tablearr);
$data['head'][] = '<script type="text/javascript" src="' . myUrl('js/jsconfirm.js') . '"></script>';
}
示例13: 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');
}
示例14: run
public function run()
{
$faker = Faker\Factory::create();
for ($id = 1; $id < 19; $id++) {
School::create(['user_id' => $id, 'primary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'primary_address' => $faker->streetAddress, 'primary_years' => '', 'secondary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'secondary_address' => $faker->streetAddress, 'secondary_years' => '', 'tertiary_name' => $faker->randomElement(['Jose Rizal University', 'Rizal Techonological University', 'La Salle', 'Ateneo de Manila', 'San Sebastian College', 'University of the Philippines', 'University of Santo Tomas']), 'tertiary_address' => $faker->streetAddress, 'tertiary_years' => '']);
}
}
示例15: 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);
}