function displayData()
 {
     $cityTemp = CityManager::getSingleCity('id', $this->church->getIdCity());
     if ($cityTemp === NULL) {
         $cityTemp = new City();
     }
     $stateTemp = CityManager::getSingleState('id', $cityTemp->getIdState());
     $cityString = "*************************";
     if ($stateTemp === NULL) {
         $stateTemp = new State();
     } else {
         $cityString = $cityTemp->getName() . ", " . $stateTemp->getShortName();
     }
     $this->SetFont('Arial', 'B', 10);
     $cellSizeY = 5;
     for ($i = 0; $i < 3; $i++) {
         //Get the data necesary of create the document
         $this->SetXY($x + 100, $i * 60 + $y + 40 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getName()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 47 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getAddress()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 54 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', 'CP. ' . $this->church->getPostalCode()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 61 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $cityString), 0, 0, 'C');
     }
 }
Ejemplo n.º 2
0
 function insert(City $city)
 {
     //Se pasa un objeto city y se inserta, se devuelve el id del elemento con el que se ha insertado
     $parametrosSet = array();
     $parametrosSet['Name'] = $city->getName();
     $parametrosSet['CountryCode'] = $city->getCountryCode();
     $parametrosSet['District'] = $city->getDistrict();
     $parametrosSet['Population'] = $city->getPopulation();
     return $this->bd->insert($this->tabla, $parametrosSet);
 }
Ejemplo n.º 3
0
          <a href="/id<?php 
        echo $data->id;
        ?>
"><h4 class="cat-item-user"><?php 
        echo $data->name;
        ?>
</h4></a>
          <div class="cat-item-accaunt <?php 
        echo $data->member_type;
        ?>
"> <?php 
        echo $data->member_type;
        ?>
</div>
          <div class="cat__city_user">г. <?php 
        echo City::getName($data->city_id);
        ?>
</div>
          <!--div class="cat-item-rating">9,5</div-->
        </div>
        <div class="cat-item-price-top">
          <div class="cat-item-price-big"></div> 
          
          </div>
        <div class="clfx"></div>
        <?php 
        //print_r($data->flo);
        $i = 0;
        foreach ($data->flo as $item) {
            if ($i <= 4) {
                ?>
Ejemplo n.º 4
0
                                                        <?php 
}
?>
                                                    </select>


                                                </div>

                                            </td>
                                        </tr>
                                        <?php 
$id = Request::get("id");
if (is_numeric($id) && $id > 0) {
    $cityObj = new City();
    $cityObj->set("city_id", $id);
    $result = $cityObj->getName();
    if (count($result)) {
        $row = $result[0];
        $city_id = $row['id'];
        $state_id = $row['state_id'];
        $city_name = $row['name'];
        $city_status = $row['active'];
    }
}
?>
                                        <tr>
                                            <td><label class="control-label" for="selectError">City</label></td>
                                            <td><div class="input-group" style="width: 50%">
                                                    <span class="input-group-addon"></span>
                                                    <input type="text" name="city_name" value="<?php 
echo $city_name;
Ejemplo n.º 5
0
                      <span class="cabinet__people__item-img-container">
                        <?php 
        if (is_file('./users/' . $item->user->id . '/' . $item->user->photo)) {
            echo CHtml::image('/users/' . $item->user->id . '/' . $item->user->photo, 'My photo');
        } else {
            echo CHtml::image('/img/zaglushka.png', 'My photo');
        }
        ?>
                      </span>
                      <!--div class="cabinet__people__item__rating"><i class="star__icon"></i>9,5</div-->
                      <div class="cabinet__people__item__user-name"><?php 
        echo $item->user->name;
        ?>
</div>
                      <div class="cabinet__people__item__user-city"><?php 
        echo City::getName($item->user->city_id);
        ?>
, <?php 
        echo Occupation::getName($item->user->occupation_id);
        ?>
</div>
                      </a>
                    </figure>
                </div>
                <script>
                $('.delete__hidden-yes').click(function(){
                    $('.delete__hidden').hide();
                    $.ajax({
                        url: '/my/favorites/delete/id/<?php 
        echo $item->id;
        ?>
 public function actionSearch()
 {
     if (Yii::app()->request->isAjaxRequest && isset($_GET['q'])) {
         $name = $_GET['q'];
         $limit = 50;
         $criteria = new CDbCriteria();
         $criteria->condition = "name LIKE :sterm and activate=1";
         $criteria->params = array(":sterm" => "%{$name}%");
         $criteria->limit = $limit;
         $userArray = Users::model()->findAll($criteria);
         $returnVal = '';
         foreach ($userArray as $userAccount) {
             $returnVal .= '<li class="search-results__item"><a href="/id' . $userAccount->id . '" class="search-results__link">' . $userAccount->name . '<span class="small_search">' . Occupation::getName($userAccount->occupation_id) . ', ' . City::getName($userAccount->city_id) . '</span></a></li>';
         }
         echo $returnVal;
     }
 }
Ejemplo n.º 7
0
/users/<?php 
        echo $model->user->id;
        ?>
/568_<?php 
        echo $action->picture;
        ?>
" alt="<?php 
        echo $model->user->name;
        ?>
">
                <div class="mini__action__thumbnail-discount">- <?php 
        echo $action->sale;
        ?>
%</div>
                <div class="mini__action__thumbnail-city">г. <?php 
        echo City::getName($action->user->city_id);
        ?>
</div>
                <figcaption class="mini__action__thumbnail-overlay"><?php 
        echo $action->title;
        ?>
</figcaption>
              </figure>
            </a>
            <div class="mini__action__short-info clfx">
              <a href="<?php 
        echo Yii::app()->request->hostInfo;
        ?>
/id<?php 
        echo $action->user->id;
        ?>
Ejemplo n.º 8
0
 /**
  * Generador aleatorio de direcciones postales.
  *
  * @param  City $city Objeto de la ciudad para la que se genera una dirección postal.
  * @return string         Dirección postal aleatoria generada para la tienda.
  */
 private function getAddress($city)
 {
     $prefixes = array('Calle', 'Avenida', 'Plaza');
     $names = array('Lorem', 'Ipsum', 'Sitamet', 'Consectetur', 'Adipiscing', 'Necsapien', 'Tincidunt', 'Facilisis', 'Nulla', 'Scelerisque', 'Blandit', 'Ligula', 'Eget', 'Hendrerit', 'Malesuada', 'Enimsit');
     return $prefixes[array_rand($prefixes)] . ' ' . $names[array_rand($names)] . ', ' . rand(1, 100) . "\n" . $this->getPostalCode() . ' ' . $city->getName();
 }
Ejemplo n.º 9
0
        ?>
      <a class="popular-block" href="/id<?php 
        echo $u['id'];
        ?>
">
        <img class="popular-block-img" src="/users/<?php 
        echo $u['id'];
        ?>
/<?php 
        echo $img;
        ?>
" alt="" style="top: 0px; right: 0px; width: 100%; height: 100%;">
        <div class="popular-block-city">
          <div class="popular-block-city-bg"></div>
          <div class="popular-block-city-content">г.<?php 
        echo City::getName($u['city_id']);
        ?>
</div>
        </div>
        <div class="popular-block-account" style="display: none;">
          <div class="popular-block-account-border"></div>
          <?php 
        echo $u['member_type'];
        ?>
        </div>
        <div class="popular-block-info">
          <div class="popular-block-info-bg"></div>
          <div class="popular-block-name-prof">
            <div class="popular-block-name">
            <?php 
        if (strlen($u['name']) > 45) {
Ejemplo n.º 10
0
 /**
  * update one city in the database
  * 
  * @author Jonathan Sandoval <*****@*****.**>
  * @param  City $city  The city to update
  * @return boolean     if was possible to update
  */
 static function updateCity($city = null)
 {
     if ($city === null) {
         return false;
     }
     $tableCity = DatabaseManager::getNameTable('TABLE_CITY');
     $id = $city->getId();
     $idState = $city->getIdState();
     $name = $city->getName();
     $query = "UPDATE {$tableCity}\n                          SET name = '{$name}', idState = {$idState}\n                          WHERE {$tableCity}.id = {$id}";
     return DatabaseManager::singleAffectedRow($query);
 }