Пример #1
0
 public function actionDelete($id)
 {
     $service = Service::model()->findAll('contractor_id=' . $id);
     if ($service) {
         foreach ($service as $serv) {
             WrapServTransport::Del($serv->id);
             ServCulture::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             $food = ServFood::model()->findAll('service_id=' . $serv->id);
             if ($food) {
                 foreach ($food as $mFood) {
                     LinkFoodServ::model()->deleteAllByAttributes(array('serv_food_id' => $mFood->id));
                 }
             }
             ServFood::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             ServIntensiv::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             ServOther::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             $personal = ServPersonal::model()->findAll('service_id=' . $serv->id);
             if ($personal) {
                 foreach ($personal as $mPers) {
                     LinkPersonalLanguage::model()->deleteAllByAttributes(array('serv_personal_id' => $mPers->id));
                 }
             }
             ServPersonal::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             ServPlatform::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             ServProgram::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             ServTicket::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             $live = ServLive::model()->findAll('service_id=' . $serv->id);
             if ($live) {
                 foreach ($live as $mLive) {
                     ServLiveRoom::model()->deleteAllByAttributes(array('serv_live_id' => $mLive->id));
                 }
             }
             ServLive::model()->deleteAllByAttributes(array('service_id' => $serv->id));
             Photo::model()->deleteAllByAttributes(array('service_id' => $serv->id));
         }
     }
     Service::model()->deleteAllByAttributes(array('contractor_id' => $id));
     Comment::model()->deleteAllByAttributes(array('contractor_id' => $id));
     LinkCityContractor::model()->deleteAllByAttributes(array('contractor_id' => $id));
     Contractor::model()->deleteByPk($id);
     echo "ok";
 }
Пример #2
0
/<?php 
echo $cont->logo;
?>
" width="100px" >
		</div>


	</div>


	<label class="control-label" for="contractor-city">Город обслуживания</label>

	<div class="row">

		<div class="col-md-36 tagContainer pull-left">

<?php 
$city = LinkCityContractor::model()->findAllByAttributes(array('contractor_id' => $contractor));
foreach ($city as $c) {
    echo '<span class="tm-tag"><span>' . $c->city->name . '</span><a href="#" class="tm-tag-remove">&nbsp;</a></span>';
}
?>


		</div>


	</div>

</div>