function getStatusInventory($data) { $endadate = strtotime($data->end_date); $startdate = strtotime($data->start_date); $now = strtotime(date('Y-m-d', time())); $Delivery = new Delivery(); $statusInventory = 'play'; $statusInventoryMsg = "Running"; $event = Tracking::getTrackingEventType($this->cost_type); if ($startdate <= $now && $endadate >= $now) { $status = $Delivery->checkInventory($this, 0, $event, json_decode($this->date)); if ((string) $status == 'inventory_limited' || (string) $status == 'ad_zone_daily_inventory_limited') { $statusInventory = 'stop'; $statusInventoryMsg = $status; } } else { if ($startdate > $now) { $statusInventory = 'stop'; $statusInventoryMsg = "Campaignnotstart"; } else { $statusInventory = 'stop'; $statusInventoryMsg = "End_Campaign"; } } $statusI['status'] = $statusInventory; $statusI['msg'] = 'text.' . $statusInventoryMsg; return $statusI; }