<?php

/* @var $this ServicecallsController */
/* @var $model Servicecalls */
$this->breadcrumbs = array('Servicecalls' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Servicecalls', 'url' => array('index')), array('label' => 'Create Servicecalls', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#servicecalls-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Manage Servicecalls</h1>

<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>

<?php 
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'servicecalls-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'service_reference_number', 'engineer_email', 'callcenter_account_id', 'customer_fullname', 'customer_address', array('name' => 'jobstatus_id', 'value' => 'Jobstatus::published_item("Jobstatus",$data->jobstatus_id)', 'filter' => Jobstatus::published_items('Jobstatus')), 'data_sent', array('class' => 'CButtonColumn'))));
		</td>
		<td style="text-align:right;">
				<a target="_blank" href="" title='Help'>		
					<span  class="fa fa-question-circle fa-3x" ></span>
				</a>
		</td>
	</tr>
</table>
<!--
<p>
    You can also search your servicealls by entering a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
    or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>
-->




<?php 
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#servicecalls-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
echo CHtml::link('Advanced Search', '#', array('class' => 'search-button'));
?>
<div class="search-form" style="display:none">
    <?php 
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'servicecalls-grid', 'dataProvider' => $model->myservicecallsearch(), 'filter' => $model, 'columns' => array(array('name' => 'service_reference_number', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->service_reference_number),array("viewmyservicecall","id"=>$data->id))'), 'customer_fullname', 'customer_address', array('name' => 'jobstatus_id', 'value' => 'Jobstatus::published_item("Jobstatus",$data->jobstatus_id)', 'filter' => Jobstatus::published_items('Jobstatus')), array('name' => 'created', 'value' => '$data->created==null ? "":date("d-M-Y",$data->created)', 'filter' => false), array('header' => 'Payment Date', 'type' => 'raw', 'value' => 'Servicecalls::model()->findpaymentdate($data->communications)'))));