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


PHP Institution::Updateinstitute方法代码示例

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


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

示例1: institutioneditAction

 public function institutioneditAction()
 {
     require_once 'models/table/Tutoredit.php';
     $this->viewAssignEscaped('locations', Location::getAll());
     if (isset($_POST['update'])) {
         $instituteupdate = new Institution();
         $details = $instituteupdate->Updateinstitute($_POST);
     }
     # GETTING ID IF NOT ALREADY SET
     $request = $this->getRequest();
     if (!isset($instituteid)) {
         $instituteid = $request->getParam('id');
     }
     # CREATING INSTITUTION OBJECT
     $ins = new Institution();
     # PULLING STAFF LISTING FOR THIS INSTITUTION
     $staff = $ins->listStaff($instituteid);
     $this->view->assign('fetchins', $staff);
     # CREATING HELPER
     $helper = new Helper();
     # DISPLAYING
     $institutedit = new Institution();
     $details = $institutedit->Editinstitute($instituteid);
     $this->view->assign('insid', $institudeid);
     # PRESENTING MULTI-SELECT OPTIONS
     $this->view->assign('instypes', $helper->getInstitutionTypes());
     $this->view->assign('cadres', $helper->getCadres());
     $cadselect = $helper->getInstitutionCadres($request->getParam('id'));
     $_cs = array();
     foreach ($cadselect as $cad) {
         $_cs[] = $cad['id_cadre'];
     }
     $this->view->assign('cadresselected', $_cs);
     $this->view->assign('id', $instituteid);
     $this->view->assign('name', $details['institutionname']);
     $this->view->assign('address1', $details['address1']);
     $this->view->assign('address2', $details['address2']);
     $this->view->assign('city', $details['city']);
     $this->view->assign('geo1', $details['geography1']);
     $this->view->assign('geo2', $details['geography2']);
     $this->view->assign('geo3', $details['geography3']);
     $this->view->assign('zip', $details['postalcode']);
     $this->view->assign('phone', $details['phone']);
     $this->view->assign('fax', $details['fax']);
     $this->view->assign('degree', $details['degrees']);
     $this->view->assign('type', $details['type']);
     $this->view->assign('hasdormitories', $details['hasdormitories']);
     $this->view->assign('dormcount', $details['dormcount']);
     $this->view->assign('tutorhousing', $details['tutorhousing']);
     $this->view->assign('tutorhouses', $details['tutorhouses']);
     $this->view->assign('sponsor', $details['sponsor']);
     $this->view->assign('computers', $details['computercount']);
     $this->view->assign('tutorhouses', $details['tutorhouses']);
     $this->view->assign('studbeds', $details['bedcount']);
     $this->view->assign('comments', $details['comments']);
     $this->view->assign('year', $details['yearfounded']);
     $degreeselect = $helper->getInstitutionDegrees($request->getParam('id'));
     $_ds = array();
     foreach ($degreeselect as $deg) {
         $_ds[] = $deg['id'];
     }
     $this->view->assign('degree', $_ds);
     $sponsors = $helper->getSponsors();
     $this->view->assign('lookupsponsors', $sponsors);
     if ($details['tutorcount'] != 0 && is_numeric($details['tutorcount']) && $details['studentcount'] != 0 && is_numeric($details['studentcount'])) {
         $this->view->assign('tutorratio', "1 : " . round($details['studentcount'] / $details['tutorcount'], 2));
     } else {
         $this->view->assign('tutorratio', "N/A");
     }
     # GETTING LOOKUPS
     $this->view->assign('lookupdegrees', $helper->getDegrees());
     #		$degrees = $helper->getInstitutionDegrees($instituteid);
     #		$_deg = array();
     #		foreach ($degrees as $degree){
     #			$_deg[] = $degree['id'];
     #		}
     #		$this->view->assign('degreesselected',$_deg);
     $studentcount = $institutedit->getStudentCount($instituteid);
     $tutorcount = $institutedit->getTutorCount($instituteid);
     $this->view->assign('tutor', $tutorcount);
     $this->view->assign('students', $studentcount);
 }
开发者ID:falafflepotatoe,项目名称:trainsmart-code,代码行数:82,代码来源:InstitutionController.php


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