Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $rows = Yii::app()->db->createCommand($query . ' ' . $limit)
- ->bindParam(':username', $username, PDO::PARAM_STR)
- ->bindParam(':date', $date, PDO::PARAM_STR)
- ->queryAll();
- $type = "";
- foreach ($rows as $k => $v) {
- if ($v['last_called_days'] >= 360) {
- $type = "label-default";
- } else if ($v['last_called_days'] >= 180) {
- $type = "label-danger";
- } else if ($v['last_called_days'] >= 90) {
- $type = "label-warning";
- } else {
- $type = "label-success";
- }
- $rows[$k]['last_called_days'] = '<h5><span id="call-log" class=" label ' . $type . '" data-id="' . $v['cid'] . '" data-name="' . $v['name'] . '">' . $v['last_called_days'] . '</span></h5>';
- }
- $result['rows'] = $rows;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement