public function search()
 {
     $criteria = new CDbCriteria();
     if ($this->startDate) {
         $criteria->compare('cli_created', '>=' . Date::formatDate('Y-m-d', $this->startDate));
     }
     if ($this->endDate) {
         $criteria->compare('cli_created', '<=' . Date::formatDate('Y-m-d', $this->endDate));
     }
     $data = Yii::app()->db->createCommand()->from('client');
     switch ($this->granulation) {
         case self::GRANULARITY_WEEK:
             $data = $data->select('YEAR(cli_created) year, WEEK(cli_created) period, COUNT(*) count');
             $data = $data->group('YEAR(cli_created), WEEK(cli_created)');
             break;
         case self::GRANULARITY_MONTH:
             $data = $data->select('YEAR(cli_created) year, MONTH(cli_created) period, COUNT(*) count');
             $data = $data->group('YEAR(cli_created), MONTH(cli_created)');
             break;
         case self::GRANULARITY_DAY:
             $data = $data->select('YEAR(cli_created) year, DAYOFYEAR(cli_created) period, COUNT(*) count');
             $data = $data->group('YEAR(cli_created), DAYOFYEAR(cli_created)');
             break;
         default:
             $data = $data->select('YEAR(cli_created) year, WEEK(cli_created) period, COUNT(*) count');
             $data = $data->group('YEAR(cli_created), WEEK(cli_created)');
             break;
     }
     if ($criteria->toArray()['condition']) {
         $data->where($criteria->toArray()['condition']);
         $data->params = $criteria->params;
     }
     $data = $data->queryAll();
     return $data;
 }
 public function actionSelectClient()
 {
     AppointmentBuilder::start();
     AppointmentBuilder::getCurrent()->setUser(Yii::app()->user->id);
     $availableTypes = ['viewing', 'valuation'];
     $appointmentType = isset($_GET['for']) && in_array($_GET['for'], $availableTypes) ? $_GET['for'] : reset($availableTypes);
     $appointmentDate = isset($_GET['date']) && $_GET['date'] ? Date::formatDate("Y/m/d", $_GET['date']) : date("Y/m/d");
     $model = new Client('search');
     $model->cli_created = '';
     $model->cli_saleemail = '';
     $model->telephones = [new Telephone('search')];
     AppointmentBuilder::getCurrent()->setDate($appointmentDate);
     AppointmentBuilder::getCurrent()->setType($appointmentType);
     AppointmentBuilder::getCurrent()->setInstructionId(isset($_GET['instructionId']) ? $_GET['instructionId'] : null);
     $this->render('selectClient', compact('model', 'appointmentDate', 'appointmentType'));
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param $id
  * @throws CHttpException
  * @internal param \the $integer ID of the model to be loaded
  * @return Deal
  */
 public function loadModel($id)
 {
     $model = Deal::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, "Instruction [id : {$id}] was not found");
     }
     $model->followUpDue = $model->followUpDue ? Date::formatDate('d/m/Y', $model->followUpDue) : null;
     // follow up due is a very logical field. it must be either null or a real date.
     $model->valuationDate = $model->valuationDate ? Date::formatDate('d/m/Y', $model->valuationDate) : null;
     $model->dea_compdate = $model->dea_compdate ? Date::formatDate('d/m/Y', $model->dea_compdate) : null;
     $model->dea_exchdate = $model->dea_exchdate ? Date::formatDate('d/m/Y', $model->dea_exchdate) : null;
     $model->dea_marketprice = $model->dea_marketprice;
     $model->dea_valueprice = $model->dea_valueprice;
     $model->dea_valuepricemax = $model->dea_valuepricemax;
     return $model;
 }
 private function getDataById($id)
 {
     $data = [];
     $client = Client::model()->findByPk($id);
     if ($client) {
         $data[] = ['label' => 'Client: ' . $client->getFullName(), 'value' => $client->getFullName(), 'url' => $this->createUrl('client/update', ['id' => $client->cli_id])];
     }
     $instruction = Deal::model()->findByPk($id);
     if ($instruction) {
         $data[] = ['label' => 'Instruction: ' . $instruction->title, 'value' => $instruction->title, 'url' => $this->createUrl('instruction/summary', ['id' => $instruction->dea_id])];
     }
     /** @var Appointment $appointment */
     $appointment = Appointment::model()->with('user')->findByPk($id);
     if ($appointment) {
         $data[] = ['label' => $appointment->app_type . ': ' . Date::formatDate('d/m H:i', $appointment->app_start) . ' ' . $appointment->user->getFullName(), 'value' => $instruction->title, 'url' => $this->createUrl('instruction/update', ['id' => $instruction->dea_id])];
     }
     return $data;
 }
Exemplo n.º 5
0
ob_start();
foreach ($dealNotes as $note) {
    ?>
<div class="note <?php 
    echo $note->not_status;
    ?>
">
	<div class="header">
		<div class="author">
			<?php 
    echo $note->creator->getFullUsername();
    ?>
		</div>
		<div class="date">
			<?php 
    echo Date::formatDate('d/m/y', $note->not_edited);
    ?>
		</div>
		<div class="icon">
			<?php 
    echo CHtml::image(Icon::EDIT_ICON, "Edit", ["onClick" => "popupWindow('" . $this->createUrl("note/edit/", ["id" => $note->not_id, 'callback' => "showNotesBlocksById", "popup" => true]) . "');"]);
    ?>
		</div>
		<div class="icon">
			<?php 
    echo CHtml::image(Icon::CROSS_ICON, "Delete", ["onClick" => "deleteNote('" . $note->not_id . "')"]);
    ?>
		</div>
	</div>
	<div class="content">
		<?php 
Exemplo n.º 6
0
    echo $form->textField($model, 'off_price', ['placeholder' => '£']);
    ?>
							</div>
						</div>
					<?php 
} else {
    ?>
						<div class="control-group">
							<label class="control-label"><?php 
    echo $form->controlLabel($model, 'off_timestamp');
    ?>
</label>

							<div class="controls">
								<span class="text"><?php 
    echo Date::formatDate('d F Y', $model->off_timestamp);
    ?>
</span>
								<?php 
    echo $form->hiddenField($model, 'off_timestamp', ['value' => date('Y-m-d H:i:s')]);
    ?>
							</div>
						</div>
						<div class="control-group">
							<label class="control-label"><?php 
    echo $form->controlLabel($model, 'off_price');
    ?>
</label>

							<div class="controls">
								<span class="text"><?php 
Exemplo n.º 7
0
    if ($data['vendorsNames']) {
        $vendors = explode(',', $data['vendorsNames']);
        $vendorsId = explode(',', $data['vendorsIds']);
        for ($i = 0; $i < count($vendorsId); $i++) {
            echo CHtml::link($vendors[$i], ['client/update', 'id' => $vendorsId[$i]], ['class' => 'table-link']);
            echo $i + 1 == count($vendorsId) ? '' : ',';
        }
    } else {
        echo 'No vendor found';
    }
}), array('name' => 'vendorLastContacted', 'header' => "Last Contacted", 'value' => function ($data) {
    if ($data['vendorsIds']) {
        $date = "";
        $dateLink = "-- -- ----";
        if ($data['vendorLastContacted'] && $data['vendorLastContacted'] != '0000-00-00 00:00:00') {
            $date = $dateLink = Date::formatDate('d/m/Y', $data['vendorLastContacted']);
        }
        echo CHtml::textField("Vendor[lastContacted][" . str_replace(',', '_', $data['vendorsIds']) . "]", $date, ['class' => 'datepicker', 'placeholder' => 'dd/mm/yyyy', 'style' => 'width:66px;', 'data-id' => $data['vendorsIds']]);
        echo CHtml::label($dateLink, '#', ['class' => 'saveLastContacted', 'data-id' => $data['vendorsIds'], 'onclick' => 'saveContactedDt(this.id)', 'id' => str_replace(',', '_', $data['vendorsIds'])]);
    }
}), array('name' => 'totalOffers', 'header' => "Offers", 'value' => function ($data) {
    echo CHtml::link($data['totalOffers'], ['instruction/summary/id/' . $data['dea_id'] . '##offers'], ['class' => 'table-link']);
}), array('name' => 'dea_board', 'header' => "Board", 'value' => function ($data) {
    $boardText = $data['dea_board'] . ' - ' . ($data['dea_boardtype'] ? $data['dea_boardtype'] : "Not specified");
    echo CHtml::link($boardText, ['instruction/summary/id/' . $data['dea_id'] . '##marketingDetails'], ['class' => 'table-link']);
}), array('name' => 'latestViewing', 'header' => "Last Viewing", 'type' => 'raw', 'value' => function ($data) {
    if ($data['latestViewing']) {
        return CHtml::link(date("d/m/Y", strtotime($data['latestViewing'])), ['instruction/latestApp', 'id' => $data['dea_id']], ['class' => 'table-link']);
    } else {
        return 'No viewing found';
    }
Exemplo n.º 8
0
				<th>Type</th>
				<th>Total</th>
				<th>Queued</th>
				<th>Sent</th>
				<th>Opened</th>
				<th>Property Hits</th>
				<th>Unique Hits</th>
				<th>User</th>
				<th>Details</th>
			</tr>
			<?php 
foreach ($model->mandrillMailshots as $key => $mailshot) {
    ?>
				<tr>
					<td><?php 
    echo Date::formatDate('d/m/Y H:i', $mailshot->created);
    ?>
</td>
					<td><?php 
    echo $mailshot->type;
    ?>
</td>
<!--					<td>--><?php 
    //echo $mailshot->emailCount
    ?>
<!--</td>-->
<!--					<td>--><?php 
    //echo $mailshot->queuedEmailCount
    ?>
<!--</td>-->
<!--					<td>--><?php 
Exemplo n.º 9
0
	<div class="info">

		<div class="block titles">
			<div class="inner-block">
				<h3 class="title">
					<?php 
echo CHtml::link($data->title, ['blog/view', 'id' => $data->id]);
?>
				</h3>
			</div>
		</div>

		<div class="block strapline">
			<div class="inner-block">
				<?php 
echo Util::strapString(CHtml::encode($data->strapline), 0, 300);
?>
			</div>
		</div>

		<div class="block">
			<div class="inner-block blog-date">
				<?php 
echo Date::formatDate('F jS', $data->created);
?>
			</div>
		</div>

	</div>
</div>
Exemplo n.º 10
0
    echo $data->timeFrom ? " " . CHtml::encode($data->timeFrom) : "";
    ?>
						<br/>
					<?php 
}
?>

					<?php 
if ($data->dateTo) {
    ?>
						<b><?php 
    echo "Finishes";
    ?>
:</b>
						<?php 
    echo CHtml::encode(Date::formatDate("d/m/Y", $data->dateTo));
    ?>
						<?php 
    echo $data->timeTo ? " " . CHtml::encode($data->timeTo) : "";
    ?>
						<br/>
					<?php 
}
?>
					<b>Status: </b><?php 
echo $data->statusValue ? $data->statusValue->ListItem : "";
?>
					<br>
					<?php 
echo CHtml::link('Delete', $this->createUrl('delete', ['id' => $data->id]), array('onclick' => ' {' . CHtml::ajax(array('type' => 'POST', 'beforeSend' => 'js:function(){if(confirm("Are you sure you want to delete?"))return true;else return false;}', 'url' => $this->createUrl('delete', array('id' => $data->id, 'ajax' => 'delete')), 'complete' => "js:function(jqXHR, textStatus){ location.reload(); }")) . 'return false;}'));
?>
Exemplo n.º 11
0
$activeViewing = false;
foreach ($model->viewings as $viewing) {
    if ($viewing->app_start <= date('Y-m-d H:i:s') && $viewing->app_status == Appointment::STATUS_ACTIVE) {
        $activeViewing = true;
    }
    ?>
			<tr class="<?php 
    echo strtotime($viewing->app_start) > time() ? "highlight green" : "";
    ?>
">
				<td><?php 
    echo Date::formatDate("d/m/Y", $viewing->app_start);
    ?>
</td>
				<td><?php 
    echo Date::formatDate("H:i", $viewing->app_start);
    ?>
</td>
				<td>
					<?php 
    if ($viewing->user) {
        ?>
					<span class="negotiator-color"
						  style="background-color:#<?php 
        echo $viewing->user->use_colour;
        ?>
 "></span><?php 
        echo $viewing->user->fullName;
        ?>
					<?php 
    }
Exemplo n.º 12
0
    ?>
		<table class="small-table">
			<tr>
				<th>Date</th>
				<th>Client</th>
				<th>Email</th>
				<th>Text</th>
				<th>Registered</th>
			</tr>

			<?php 
    foreach ($model->interest as $interest) {
        ?>
				<tr>
					<td><?php 
        echo Date::formatDate('d/m/Y H:i', $interest->created);
        ?>
</td>
					<td><?php 
        echo CHtml::link($interest->client->getFullName(), ['client/update', 'id' => $interest->client->cli_id]);
        ?>
</td>
					<td><?php 
        echo $interest->email ? CHtml::image(Icon::GREEN_TICK_ICON) : CHtml::image(Icon::CROSS_ICON);
        ?>
</td>
					<td><?php 
        echo $interest->text ? CHtml::image(Icon::GREEN_TICK_ICON) : CHtml::image(Icon::CROSS_ICON);
        ?>
</td>
					<td></td>
Exemplo n.º 13
0
		<div class="controls">
			<?php 
echo $form->checkBoxListWithSelectOnLabel($model, 'app_notetype', Appointment::getNoteTypes(), ['separator' => ' ']);
?>
		</div>
		<?php 
echo $form->endControlGroup();
?>
	</div>
</fieldset>
<?php 
$this->endWidget();
$this->widget('AdminGridView', array('dataProvider' => $dataProvider, 'title' => 'SEARCH APPOINTMENT', 'id' => 'appointment-list', 'columns' => array(array('class' => 'CButtonColumn', 'header' => 'Actions', 'template' => '{edit}', 'buttons' => array('edit' => array('label' => 'Edit', 'url' => function (Appointment $data) {
    return AppointmentController::createEditLink($data->app_id);
}, 'imageUrl' => Icon::EDIT_ICON))), array('name' => 'app_status', 'htmlOptions' => ['style' => 'width: 80px;']), 'app_start' => array('name' => 'app_start', 'header' => 'start', 'htmlOptions' => ['style' => 'width: 130px;'], 'value' => function (Appointment $data) {
    return Date::formatDate('d/m/Y H:i', $data->app_start);
}), 'app_type', 'app_notetype', 'app_subject', array('name' => 'user.fullName', 'header' => 'User', 'value' => function ($data) {
    return $data->user ? $data->user->fullName : 'unassigned';
}), array('name' => 'client', 'header' => 'Clients', 'type' => 'raw', 'value' => function (Appointment $data) {
    $t = [];
    foreach ($data->clients as $key => $client) {
        $t[] = CHtml::link($client->getFullName(), Yii::app()->createUrl('admin4/client/update', ['id' => $client->cli_id]));
    }
    return implode(', ', $t);
}), array('header' => 'Address', 'name' => 'address', 'type' => 'raw', 'value' => function (Appointment $data) {
    $str = [];
    foreach ($data->addresses as $key => $value) {
        $str[] = $value->getFullAddressString(', ');
    }
    return implode('<br>', $str);
}))));
Exemplo n.º 14
0
			<?php 
    echo $form->endControlGroup();
    ?>

			<?php 
    echo $form->beginControlGroup($model, 'app_end');
    ?>
			<?php 
    echo $form->controlLabel($model, 'app_end');
    ?>
			<div class="controls nofloat">
				<?php 
    echo CHtml::textField('endDay', Date::formatDate('d/m/Y', $model->app_end), array('class' => 'datepicker'));
    ?>
				<?php 
    echo CHtml::textField('endTime', Date::formatDate('H:i', $model->app_end), array('class' => 'timepicker input-xxsmall', 'placeholder' => 'hh:mm'));
    ?>
			</div>
			<?php 
    echo $form->endControlGroup();
    ?>
		<?php 
} else {
    ?>
			<div class="control-group">
				<label class="control-label">Date</label>

				<div class="controls">
					This is a <em>follow up</em> appointment to change its date please do it on <?php 
    echo CHtml::link('instruction screen', ['instruction/summary', 'id' => $model->instructions[0]->dea_id, '#' => '#valuation']);
    ?>
Exemplo n.º 15
0
		<label for="Property[pro_postcode]">Postcode</label>
		<?php 
echo $form->textField($model, 'pro_postcode', array('size' => 10));
?>
		<label for="Deal[dea_status]">Postcode</label>
		<?php 
echo $form->textField($model, 'pro_postcode', array('size' => 10));
?>
	</div>
</fieldset>
<?php 
$this->endWidget();
?>
</div>

<?php 
$this->widget('AdminGridView', array('id' => 'property-list', 'dataProvider' => $model->search(), 'columns' => array('pro_id', array('header' => 'Instructions', 'type' => 'raw', 'value' => function (Property $data) {
    $instructionsHtml = array();
    foreach ($data->instructions as $instruction) {
        $instructionsHtml[] = '<td><a href="/admin4/instruction/summary/' . $instruction->dea_id . '">' . $instruction->dea_id . '</a></td>' . '<td style="width:100px">' . $instruction->dea_status . '</td>' . '<td>' . Date::formatDate('d/m/Y', $instruction->dea_created) . "</td>" . '</td><td>' . $instruction->dea_type . "</td>";
    }
    return '<table class="sublist"><tr>' . implode('</tr><tr>', $instructionsHtml) . '</tr></table>';
}, 'htmlOptions' => array('style' => 'width:400px;')), array('name' => 'fullAddressString', 'header' => 'Address'), array('name' => 'pro_postcode', 'header' => 'Postcode'))));
?>

<script type="text/javascript">
	var goToInstruction = function (id)
	{
		document.location.href = "/admin4/instruction/summary/" + id + "";
	}
</script>
Exemplo n.º 16
0
<?php

/**
 * @var                          $this CareerController
 * @var CActiveDataProvider      $dataProvider
 */
$self = $this;
$buttonColumn = array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => '{view}', 'buttons' => array('view' => array('label' => 'View', 'url' => function ($data) use($self) {
    return $self->createUrl('update', array('id' => $data->id));
}, 'imageUrl' => "/images/sys/admin/icons/edit-icon.png")));
$this->widget('AdminGridView', array('dataProvider' => $dataProvider, 'title' => 'Careers', 'actions' => array('add' => array($this->createUrl("Create"), 'Add New Career', array('rel' => 'career-add-button'))), 'columns' => array($buttonColumn, 'id', 'listOrder', 'name', 'email', array('name' => 'created', 'header' => 'Created', 'value' => function ($data) {
    return Date::formatDate("d/m/Y", $data->created);
}), array('header' => 'Created by', 'value' => function ($data) {
    return $data->creator->use_fname . " " . $data->creator->use_sname;
}), array('name' => 'isActive', 'header' => 'Active', 'value' => function ($data) {
    return $data->isActive ? 'Yes' : 'No';
}), $buttonColumn)));
?>


Exemplo n.º 17
0
		<a href="<?php 
echo $this->createUrl('instruction/detailSearch');
?>
" class="btn btn-small">Show All</a>
	</div>
	</div>
</fieldset>
<?php 
$this->endWidget();
$editColumn = array('type' => 'raw', 'htmlOptions' => ['class' => 'centered-text'], 'value' => function (Deal $data) {
    $html = CHtml::link(CHtml::image('/images/sys/admin/icons/edit-icon.png', 'Edit instruction'), InstructionController::generateLinkToInstruction($data->dea_id));
    $html .= CHtml::link(CHtml::image('/images/sys/admin/icons/print-icon.png', 'Print instruction'), ['/property/pdf', 'id' => $data->dea_id], ['target' => '_blank']);
    return $html;
});
$this->widget('AdminGridView', array('id' => 'instruction-list', 'dataProvider' => $model->search(), 'selectableRows' => 1000, 'selectionChanged' => 'instructionListSelectionChanged', 'title' => 'INSTRUCTIONS', 'columns' => array($editColumn, 'dea_id::ID', array('name' => 'dea_created', 'header' => 'created', 'value' => function (Deal $data) {
    return Date::formatDate('d/m/Y', $data->dea_created);
}), array('name' => 'dea_marketprice', 'header' => 'Price', 'type' => 'raw', 'value' => function (Deal $data) {
    return Locale::formatPrice($data->dea_marketprice, $data->dea_type == Deal::TYPE_LETTINGS);
}), array('name' => 'negotiator.use_fname', 'header' => "Neg'", 'type' => 'raw', 'value' => function (Deal $data) {
    if (!$data->negotiator) {
        return '<span class="negotiator-color empty"></span>N/A';
    }
    return '<span class="negotiator-color" style="background: #' . $data->negotiator->use_colour . '"></span><span title="' . $data->negotiator->getFullName() . '">' . $data->negotiator->getInitials() . '</span>';
}), array('name' => 'address.fullAddressString', 'value' => function (Deal $data) {
    return $data->address ? $data->address->getFullAddressString(", ") : '';
}, 'header' => 'Address'), array('name' => 'address.postcode', 'header' => 'Postcode'), array('name' => 'owners', 'header' => 'Vendors', 'type' => 'raw', 'value' => function (Deal $data) {
    $owners = [];
    foreach ($data->owner as $key => $owner) {
        $owners[] = CHtml::link($owner->getFullName(), Yii::app()->createUrl('admin4/client/update', ['id' => $owner->cli_id]), ['class' => 'table-link']);
    }
    return implode(', ', $owners);
Exemplo n.º 18
0
<?php

/**
 * @var $this         PropertyCategoryController
 * @var $dataProvider CActiveDataProvider
 */
$buttonColumn = array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => '{edit}', 'buttons' => array('edit' => array('label' => 'Edit', 'url' => function ($data) {
    return $this->createUrl('update', ['id' => $data->id]);
}, 'imageUrl' => Icon::EDIT_ICON)));
$this->widget('AdminGridView', array('id' => 'property-category', 'dataProvider' => $model->search(), 'title' => 'Property Categories', 'actions' => array('add' => array($this->createUrl("create"), 'Add New Property Category', array('rel' => 'category-add-button'))), 'columns' => array($buttonColumn, 'id', 'title::Name', array('name' => 'created', 'header' => 'Created', 'value' => function ($data) {
    return Date::formatDate("d/m/Y", $data->created);
}), array('name' => 'modified', 'header' => 'Modified', 'value' => function ($data) {
    return Date::formatDate("d/m/Y", $data->modified);
}), 'statusValue.ListItem::Status', $buttonColumn)));
?>


Exemplo n.º 19
0
						<?php 
echo $form->checkBox($model, 'app_allday', ['value' => Appointment::ALLDAY_YES, 'uncheckValue' => Appointment::ALLDAY_NO, 'id' => 'allday-check']);
?>
					</div>
				</div>
				<div id="start-time-container">
					<div class="control-group">
						<label class="control-label">Start time</label>

						<div class="controls">
							<span><?php 
echo CHtml::textField('startDate', date('d/m/Y', strtotime($model->app_start)), ['class' => 'datepicker input-small']);
?>
</span>
							<span><?php 
echo CHtml::textField('startTime', Date::formatDate('H:i', $model->app_start), ['class' => 'timepicker input-xxsmall', 'placeholder' => 'hh:mm']);
?>
</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">Duration</label>

						<div class="controls">
							<?php 
echo CHtml::dropDownList('duration', '', $this->getTimeIntervals(), ['class' => 'input-xsmall']);
?>
						</div>
					</div>
				</div>
			</div>
Exemplo n.º 20
0
    foreach ($model->appointment->clients as $v) {
        $t[] = CHtml::link($v->getFullName(), Yii::app()->createUrl('admin4/client/update', ['id' => $v->cli_id]));
    }
    echo implode(', ', $t);
    ?>
						</div>
					</div>
				<?php 
}
?>
				<div class="control-group">
					<label class="control-label">Date</label>

					<div class="controls text">
						<?php 
echo Date::formatDate('d/m/Y H:i', $model->appointment->app_start);
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">Outcome</label>

					<div class="controls">
						<?php 
echo $form->radioButtonList($model, 'd2a_feedback', LinkDealToAppointment::getPossibleOutcomes(), ['separator' => ' ']);
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">Add Note</label>
 public function actionView($id)
 {
     /** @var $model Appointment */
     $model = Appointment::model()->findByPk($id);
     if (!$model) {
         throw new CHttpException(404, 'Appointment [id = ' . $id . '] is not found.');
     }
     if (isset($_POST['delete'])) {
         $model->deactivate();
         $this->redirect(['View', 'id' => $model->app_id]);
     }
     if (isset($_POST['restore'])) {
         $model->activate();
         $this->redirect(['View', 'id' => $model->app_id]);
     }
     if (isset($_POST['Appointment']) && $_POST['Appointment']) {
         $model->attributes = $_POST['Appointment'];
         if ($_POST['startDay']) {
             $model->app_start = Date::formatDate("Y-m-d", $_POST['startDay']);
         }
         if ($_POST['startTime']) {
             $model->app_start = date("Y-m-d H:i:s", strtotime($model->app_start . " " . $_POST['startTime']));
         }
         if ($_POST['endDay']) {
             $model->app_end = Date::formatDate("Y-m-d", $_POST['endDay']);
         }
         if ($_POST['endTime']) {
             $model->app_end = date("Y-m-d H:i:s", strtotime($model->app_end . " " . $_POST['endTime']));
         }
         if ($model->save()) {
             Yii::app()->user->setFlash('appointment-success', 'Updated!');
             $this->redirect(['View', 'id' => $model->app_id]);
         }
     }
     $this->render('view', compact('model'));
 }
Exemplo n.º 22
0
 public function actionSaveLastContacted()
 {
     $clientIds = isset($_GET['clientIds']) && $_GET['clientIds'] ? $_GET['clientIds'] : '';
     if (isset($_GET['contactDate']) && $clientIds) {
         $contactDate = $_GET['contactDate'] ? Date::formatDate('Y-m-d H:i:s', $_GET['contactDate']) : "null";
         $clientUpdate = Client::model()->updateAll(['lastContacted' => $contactDate], "cli_id in (" . $clientIds . ")");
         if ($clientUpdate) {
             echo Date::formatDate('d/m/Y', $contactDate);
         }
     }
 }
Exemplo n.º 23
0
?>
	<fieldset>

		<div class="block-header">Search</div>
		<div class="content">
			<?php 
$form = $this->beginWidget('AdminFilterForm', array('id' => isset($id) && $id ? $id : 'incoming-message-filter-form', 'enableAjaxValidation' => false, 'model' => $model, 'ajaxFilterGrid' => 'incoming-messages', 'storeInSession' => false));
?>
			<div class="control-group">
				<label class="control-label">Show</label>

				<div class="controls">
					<?php 
echo $form->checkBoxList($model, 'isRead', [Sms::READ_UNREAD => 'unread', Sms::READ_READ => 'read'], ['separator' => '', 'class' => 'show-checkbox']);
?>
</div>
			</div>
		</div>
		<?php 
$this->endWidget();
?>
		</div>
	</fieldset>
<?php 
$this->widget('AdminGridView', array('id' => 'incoming-messages', 'dataProvider' => $model->incoming(), 'title' => 'Incoming Messages', 'columns' => array(array('header' => 'Actions', 'class' => 'CButtonColumn', 'template' => '{edit}', 'buttons' => array('edit' => array('label' => 'Edit', 'url' => function (Sms $data) {
    return $this->createUrl('client/textConversation', ['clientId' => $data->client->cli_id, 'messageId' => $data->id]);
}, 'imageUrl' => Icon::EDIT_ICON))), 'id', 'fromNumber', array('type' => 'raw', 'header' => 'Client', 'value' => function (Sms $data) {
    return $data->client ? CHtml::link($data->client->getFullName(), ['client/update', 'id' => $data->client->cli_id]) : '';
}), array('name' => 'created', 'header' => 'Received', 'value' => function (Sms $data) {
    return Date::formatDate('d/m/Y H:i', $data->created);
}), 'isRead')));
Exemplo n.º 24
0
			</fieldset>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span12">
			<fieldset>
				<div class="block-header">History</div>
				<?php 
foreach ($model->changes as $key => $change) {
    ?>
					<div class="control-group">
						<span class="control-label"><?php 
    echo $change->creator->getFullName();
    ?>
<br><?php 
    echo Date::formatDate('d/m/Y H:i', $change->cha_datetime);
    ?>
</span>

						<div class="controls text">
							<?php 
    echo nl2br($change->cha_new);
    ?>
						</div>
					</div>
					<?php 
    echo $form->separator();
    ?>
				<?php 
}
?>
Exemplo n.º 25
0
 * @var $instruction Deal
 */
$address = array($instruction->address->line1, $instruction->address->line2, $instruction->address->line3);
$address = implode(' ', array_filter($address));
ob_start();
if ($model->app_type === Appointment::TYPE_VALUATION) {
    ?>
	A valuation has been booked in for your property <?php 
    echo $address;
    ?>
 on the <?php 
    echo Date::formatDate("d/m/y \\a\\t g:ia", $model->app_start);
    ?>
.
<?php 
} else {
    ?>
	A viewing has been booked in for your property <?php 
    echo $address;
    ?>
 on the <?php 
    echo Date::formatDate("d/m/y \\a\\t g:ia", $model->app_start);
    ?>
.
<?php 
}
echo trim(ob_get_clean());
// this is the most stupid workaround I could come up with. phpstorm adds intendation on formatting, so we need to trim output
?>

Wooster & Stock
Exemplo n.º 26
0
						<th>Price</th>
						<th>Negotiator</th>
						<th>Client</th>
						<th>Status</th>
						<th></th>
					</tr>
					<?php 
    foreach ($offers as $offer) {
        ?>

						<tr <?php 
        echo $offer->off_status == Offer::STATUS_ACCEPTED ? 'class="accepted-offer"' : '';
        ?>
>
							<td><?php 
        echo Date::formatDate('d/m/Y', $offer->off_timestamp);
        ?>
</td>
							<td><?php 
        echo Locale::formatPrice($offer->off_price);
        ?>
</td>
							<td>
								<span class="negotiator-color"
									  style="background: #<?php 
        echo $offer->negotiator->use_colour;
        ?>
"></span><?php 
        echo $offer->negotiator->getFullName();
        ?>
							</td>
Exemplo n.º 27
0
<h2 class="conversation-header fixed">Conversation with <?php 
echo CHtml::link($client->getFullName(), ['client/edit', 'id' => $client->cli_id]);
?>
</h2>
<div class="conversation">
	<?php 
foreach ($client->textMessages as $key => $sms) {
    ?>
		<?php 
    if ($date !== Date::formatDate("Y-m-d", $sms->created)) {
        ?>
			<?php 
        $date = Date::formatDate("Y-m-d", $sms->created);
        ?>
			<div class="date"><?php 
        echo Date::formatDate("d/m/y", $date);
        ?>
</div>
		<?php 
    }
    ?>
		<?php 
    $this->renderPartial('sms/message-row', ['sms' => $sms]);
    ?>
	<?php 
}
?>
</div>
<div class="message-info-container">
	<h2 style="color: #555">Message information</h2>
Exemplo n.º 28
0
	<div class="block-header">Search</div>
	<div class="content">
		<div class="control-group">
			<label class="control-label">Email</label>

			<div class="controls">
				<?php 
echo $form->textField($dataProviderModel, 'email');
?>
			</div>
		</div>

		<div class="control-group">
			<label class="control-label">Status</label>

			<div class="controls">
				<?php 
echo $form->checkBoxList($dataProviderModel, 'status', MandrillEmail::getStatuses(), ['separator' => ' ']);
?>
			</div>
		</div>

	</div>
</fieldset>
<?php 
$this->endWidget();
$this->widget('AdminGridView', array('dataProvider' => $dataProviderModel->search(), 'id' => 'email-list', 'columns' => array(array('class' => 'CButtonColumn', 'template' => '{details}', 'buttons' => array('details' => array('label' => 'Details', 'url' => function ($data) {
    return $this->createUrl('mail/details', ['id' => $data->id]);
}, 'imageUrl' => "/images/sys/admin/icons/edit-icon.png"))), 'status', array('value' => function (MandrillEmail $data) {
    return Date::formatDate('d/m/Y H:i', $data->sent);
}), 'email')));
Exemplo n.º 29
0
?>
</label>
    <div class="controls text">
		<?php 
echo $model->dea_tenure;
?>
    </div>
</div>
<div class="control-group">
    <label class="control-label"><?php 
echo $form->controlLabel($model, 'dea_leaseend');
?>
</label>
    <div class="controls text">
		<?php 
echo Date::formatDate('d/m/Y', $model->dea_leaseend);
?>
    </div>
</div>
<div class="control-group">
    <label class="control-label"><?php 
echo $form->controlLabel($model, 'dea_servicecharge');
?>
</label>
    <div class="controls text">
		<?php 
echo $model->dea_servicecharge;
?>
    </div>
</div>
<div class="control-group">
Exemplo n.º 30
0
					The property you chose (<?php 
echo $model->address->getFullAddressString(' ');
?>
) already has associated instructions:
				</p>
				<ul>
					<?php 
foreach ($model->instructions as $key => $instruction) {
    ?>
						<li>
							<a href="<?php 
    echo $this->createUrl('instructionSelected', ['instructionId' => $instruction->dea_id]);
    ?>
">
								<?php 
    echo Date::formatDate('d/m/Y', $instruction->dea_created);
    ?>
								<?php 
    echo $instruction->dea_type;
    ?>
								<?php 
    echo $instruction->dea_status;
    ?>
								<?php 
    if ($instruction->negotiator) {
        ?>
									created by <?php 
        echo $instruction->negotiator->getFullName();
        ?>
								<?php 
    }