public static function createAppointmentLinkUsingDeal($instructionId, $appStartDate, $appType = Appointment::TYPE_VIEWING)
 {
     if (!$instructionId || !$appStartDate) {
         return false;
     }
     $appointmentsByDeal = LinkDealToAppointment::model()->findAllByAttributes(['d2a_dea' => $instructionId]);
     $appIdsByDeal = [];
     foreach ($appointmentsByDeal as $value) {
         /** @var $value LinkDealToAppointment[ ] */
         if ($value->appointment->app_start == $appStartDate && $value->appointment->app_type == $appType) {
             $appIdsByDeal[] = $value->appointment->app_id;
         }
     }
     return AppointmentController::createAppointmentUpdateLink(reset($appIdsByDeal));
 }
?>
">
		<?php 
echo $sms->text;
?>
		<div class="beak"></div>
	</div>
	<?php 
if ($sms->type === Sms::TYPE_OUTGOING && isset($sms->appointment[0])) {
    ?>
		<?php 
    $app = $sms->appointment[0];
    ?>
		<div class="app-info">
			<div><?php 
    echo CHtml::link($app->app_type == Appointment::TYPE_VIEWING ? "Viewing" : "Valuation", AppointmentController::createAppointmentUpdateLink($app->app_id));
    ?>
</div>
			<?php 
    foreach ($app->instructions as $key => $instruction) {
        ?>
				<div><?php 
        echo $instruction->address->toString();
        ?>
</div>
			<?php 
    }
    ?>
		</div>
	<?php 
}
Beispiel #3
0
                    case LinkDealToAppointment::FEEDBACK_NEGATIVE:
                        $negativeFeedback++;
                        break;
                    default:
                        $noFeedback++;
                }
            }
            echo '<div style="padding: 4px 0">';
            echo CHtml::link($feedback ? $feedback : "(not entered)", $this->createUrl('appointment/feedback', ['id' => $id]));
            echo '</div>';
        }
    }
    ?>
				</td>
				<td><?php 
    echo CHtml::link(CHtml::image(Icon::EDIT_ICON), AppointmentController::createAppointmentUpdateLink($viewing->app_id));
    ?>
</td>
			</tr>
		<?php 
}
?>
		<tr>
			<td colspan="5">
				(
				Total Properties Viewed:<b><?php 
echo $totalViewed;
?>
</b>&nbsp;
				Positive:<b><?php 
echo $positiveFeedback;