public $date;
public $time;
public $datetime;
public $order_type;
public function attributeLabels()
{
return array(
'datetime' =>'Delivery/Collection Date & Time',
'order_type' =>'Order Type',
etc...
); }
protected function afterFind() {
parent::afterFind();
//$delivery_date_new = strstr($this->delivery_date, '+', true);
if(strpos($this->delivery_date,'+') !== false){
$pieces = explode(" ", $this->delivery_date);
$timenew=explode(":", $pieces[1]);
$this->time=$timenew[0].":".$timenew[1];
$this->date = $pieces[0];
$this->datetime=$this->date." ".$this->time;
}else{
$this->time = $this->dilivery_time;
$this->date = $this->delivery_date;
$this->datetime=$this->delivery_date." ".$this->dilivery_time;
}
if ($this->delivery_type == 0)
{
$this->order_type = "Takeaway";
} elseif ($this->delivery_type == 1) {
$this->order_type = "Delivery";
} else {
$this->order_type = "Table";
}
return $this;
}
public $time;
public $datetime;
public $order_type;
public function attributeLabels()
{
return array(
'datetime' =>'Delivery/Collection Date & Time',
'order_type' =>'Order Type',
etc...
); }
protected function afterFind() {
parent::afterFind();
//$delivery_date_new = strstr($this->delivery_date, '+', true);
if(strpos($this->delivery_date,'+') !== false){
$pieces = explode(" ", $this->delivery_date);
$timenew=explode(":", $pieces[1]);
$this->time=$timenew[0].":".$timenew[1];
$this->date = $pieces[0];
$this->datetime=$this->date." ".$this->time;
}else{
$this->time = $this->dilivery_time;
$this->date = $this->delivery_date;
$this->datetime=$this->delivery_date." ".$this->dilivery_time;
}
if ($this->delivery_type == 0)
{
$this->order_type = "Takeaway";
} elseif ($this->delivery_type == 1) {
$this->order_type = "Delivery";
} else {
$this->order_type = "Table";
}
return $this;
}