コード例 #1
0
ファイル: showStudentSuccess.php プロジェクト: taryono/school
                    </td>
                </tr>

				<tr><td colspan="6"><div class="subtitle">Latar Belakang Siswa</div></td></tr>
                <tr>    
                   	<td style="vertical-align:middle;"><label  ><?php 
echo __('School of origin');
?>
</label></td>
                    <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
					<td style="vertical-align:middle;">
					<p class="detail">
					<?php 
$school_name = '';
if ($student_detail->getSchoolOfOrigin() != null) {
    $school = SchoolPeer::retrieveByPK($student_detail->getSchoolOfOrigin());
    if ($school) {
        $school_name = $school->getName();
    }
    echo $school_name;
} else {
    echo '';
}
?>
                    </p>
                    </td>
                    <td style="vertical-align:middle;"><label  ><?php 
echo __('Graduation year');
?>
</label></td>
                    <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
コード例 #2
0
ファイル: BaseMemberDetail.php プロジェクト: taryono/school
 public function getSchool($con = null)
 {
     include_once 'lib/model/om/BaseSchoolPeer.php';
     if ($this->aSchool === null && $this->school_of_origin !== null) {
         $this->aSchool = SchoolPeer::retrieveByPK($this->school_of_origin, $con);
     }
     return $this->aSchool;
 }
コード例 #3
0
ファイル: SchoolPeer.php プロジェクト: taryono/school
 public static function doSelectOrdered()
 {
     $criteria = new Criteria();
     $criteria->addAscendingOrderByColumn(SchoolPeer::NAME);
     return SchoolPeer::doSelect($criteria);
 }
コード例 #4
0
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = SchoolPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setShallowSpideredAt($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setEnabled($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setName($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setShortName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setSlug($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setState($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setZip($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setLocalTax($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setAmazonTag($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setSubdomain($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setDeptsToIgnore($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setNbCampuses($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setSpideredAt($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setTouched($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setBId($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setBookstoreType($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setId($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setCreatedAt($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setUpdatedAt($arr[$keys[18]]);
     }
 }
コード例 #5
0
 /**
  * Selects a collection of Campus objects pre-filled with all related objects.
  *
  * @param      Criteria  $criteria
  * @param      PropelPDO $con
  * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  * @return     array Array of Campus objects.
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 {
     $criteria = clone $criteria;
     // Set the correct dbName if it has not been overridden
     if ($criteria->getDbName() == Propel::getDefaultDB()) {
         $criteria->setDbName(self::DATABASE_NAME);
     }
     CampusPeer::addSelectColumns($criteria);
     $startcol2 = CampusPeer::NUM_HYDRATE_COLUMNS;
     SchoolPeer::addSelectColumns($criteria);
     $startcol3 = $startcol2 + SchoolPeer::NUM_HYDRATE_COLUMNS;
     $criteria->addJoin(CampusPeer::SCHOOL_ID, SchoolPeer::ID, $join_behavior);
     $stmt = BasePeer::doSelect($criteria, $con);
     $results = array();
     while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $key1 = CampusPeer::getPrimaryKeyHashFromRow($row, 0);
         if (null !== ($obj1 = CampusPeer::getInstanceFromPool($key1))) {
             // We no longer rehydrate the object, since this can cause data loss.
             // See http://www.propelorm.org/ticket/509
             // $obj1->hydrate($row, 0, true); // rehydrate
         } else {
             $cls = CampusPeer::getOMClass();
             $obj1 = new $cls();
             $obj1->hydrate($row);
             CampusPeer::addInstanceToPool($obj1, $key1);
         }
         // if obj1 already loaded
         // Add objects for joined School rows
         $key2 = SchoolPeer::getPrimaryKeyHashFromRow($row, $startcol2);
         if ($key2 !== null) {
             $obj2 = SchoolPeer::getInstanceFromPool($key2);
             if (!$obj2) {
                 $cls = SchoolPeer::getOMClass();
                 $obj2 = new $cls();
                 $obj2->hydrate($row, $startcol2);
                 SchoolPeer::addInstanceToPool($obj2, $key2);
             }
             // if obj2 loaded
             // Add the $obj1 (Campus) to the collection in $obj2 (School)
             $obj2->addCampus($obj1);
         }
         // if joined row not null
         $results[] = $obj1;
     }
     $stmt->closeCursor();
     return $results;
 }
コード例 #6
0
ファイル: BaseSchool.php プロジェクト: taryono/school
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = SchoolPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setSchoolType($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setStatus($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setName($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setAddress($arr[$keys[4]]);
     }
 }
コード例 #7
0
 public static function doSelectJoinAllExceptCountry(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     MemberDetailPeer::addSelectColumns($c);
     $startcol2 = MemberDetailPeer::NUM_COLUMNS - MemberDetailPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegionPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     SchoolPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + SchoolPeer::NUM_COLUMNS;
     $c->addJoin(MemberDetailPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(MemberDetailPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(MemberDetailPeer::SCHOOL_OF_ORIGIN, SchoolPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = MemberDetailPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getRegion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addMemberDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initMemberDetails();
             $obj2->addMemberDetail($obj1);
         }
         $omClass = ReligionPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addMemberDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initMemberDetails();
             $obj3->addMemberDetail($obj1);
         }
         $omClass = SchoolPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getSchool();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addMemberDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initMemberDetails();
             $obj4->addMemberDetail($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
コード例 #8
0
 public static function doSelectJoinAllExceptDegree(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     StudentEducationHistoryPeer::addSelectColumns($c);
     $startcol2 = StudentEducationHistoryPeer::NUM_COLUMNS - StudentEducationHistoryPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS;
     SchoolPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + SchoolPeer::NUM_COLUMNS;
     $c->addJoin(StudentEducationHistoryPeer::STUDENT_ID, StudentPeer::ID);
     $c->addJoin(StudentEducationHistoryPeer::SCHOOL_ID, SchoolPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = StudentEducationHistoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = StudentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getStudent();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addStudentEducationHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initStudentEducationHistorys();
             $obj2->addStudentEducationHistory($obj1);
         }
         $omClass = SchoolPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getSchool();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addStudentEducationHistory($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initStudentEducationHistorys();
             $obj3->addStudentEducationHistory($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
コード例 #9
0
 /**
  * Find object by primary key using raw SQL to go fast.
  * Bypass doSelect() and the object formatter by using generated code.
  *
  * @param     mixed $key Primary key to use for the query
  * @param     PropelPDO $con A connection object
  *
  * @return    School A model object, or null if the key is not found
  */
 protected function findPkSimple($key, $con)
 {
     $sql = 'SELECT `SHALLOW_SPIDERED_AT`, `ENABLED`, `NAME`, `SHORT_NAME`, `SLUG`, `STATE`, `ZIP`, `LOCAL_TAX`, `AMAZON_TAG`, `SUBDOMAIN`, `DEPTS_TO_IGNORE`, `NB_CAMPUSES`, `SPIDERED_AT`, `TOUCHED`, `B_ID`, `BOOKSTORE_TYPE`, `ID`, `CREATED_AT`, `UPDATED_AT` FROM `school` WHERE `ID` = :p0';
     try {
         $stmt = $con->prepare($sql);
         $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
         $stmt->execute();
     } catch (Exception $e) {
         Propel::log($e->getMessage(), Propel::LOG_ERR);
         throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
     }
     $obj = null;
     if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
         $obj = new School();
         $obj->hydrate($row);
         SchoolPeer::addInstanceToPool($obj, (string) $key);
     }
     $stmt->closeCursor();
     return $obj;
 }
コード例 #10
0
ファイル: actions.class.php プロジェクト: taryono/school
 public function filter($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'SCHOOL_NAME') {
             $c->addJoin(SchoolPeer::ID, StudentEducationHistoryPeer::SCHOOL_ID);
             $column = SchoolPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = StudentEducationHistoryPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             $c2 = null;
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
                 $c2 = $c->getCriterion($name);
             }
             if ($from != '' && $from != null && $to != '' && $to != null) {
                 $c3 = new Criterion($c, $name, $to, Criteria::LESS_EQUAL);
                 $c2->addAnd($c3);
             }
             if (($from == '' || $from == null) && $to != '' && $to != null) {
                 $c->add($name, $to, Criteria::LESS_EQUAL);
             }
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
コード例 #11
0
ファイル: editSuccess.php プロジェクト: taryono/school
echo object_input_hidden_tag($student_education_history, 'getId');
echo input_hidden_tag('action_type', '');
echo input_hidden_tag('student_id', $student_id);
?>
<table class="form">
<tr><td class="form">
	<table class="form_content">
	<tbody>
		<tr><td class='first'>
         <label  ><?php 
echo __('School of origin');
?>
</label><br/>
         <?php 
echo input_hidden_tag('school_id', $school_id);
echo input_auto_complete_tag('school_name', $student_education_history->getSchoolId() ? SchoolPeer::retrieveByPK($student_education_history->getSchoolId())->toString() : '', '/school/getList', array('size' => 64), array('after_update_element' => 'function(f, s) {$("school_id").updateFromInformalAutocomplete(f, s);}', 'min_chars' => 2));
?>
         <?php 
echo form_error('school_id');
?>
		</td><td>
		<tr><td >
			<label><?php 
echo __('In date');
?>
</label><br/>
			<?php 
echo object_input_date_tag($student_education_history, 'getInDate', array('rich' => true, 'calendar_button_img' => '/images/calendar.gif'));
?>
			<?php 
echo form_error('in_date');
コード例 #12
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(SchoolPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(SchoolPeer::DATABASE_NAME);
         $criteria->add(SchoolPeer::ID, $pks, Criteria::IN);
         $objs = SchoolPeer::doSelect($criteria, $con);
     }
     return $objs;
 }