?> <h3>There were some problems with your invitations: </h3> <div class="error-message"> <?php echo Yii::app()->user->getFlash('invitation-error'); ?> </div> <?php } ?> <?php $user = User::model()->findByAttributes(array("username" => Yii::app()->user->getId())); $vcs = VideoConference::model()->findAllByPk($meetingsId, array("order" => "scheduled_for DESC")); $past = array(); $todays = array(); $futures = array(); $today = new DateTime(); foreach ($vcs as $vc) { if ($vc->status != 'cancelled') { $dt = new DateTime($vc->scheduled_for); if ($dt->format('Y-m-d') == $today->format('Y-m-d')) { array_push($todays, $vc); } else { if ($dt > $today) { array_push($futures, $vc); } else { array_push($past, $vc); }
public function getDateToString() { $date = new DateTime($this->scheduled_for); $nowc = VideoConference::model()->findBySql("Select NOW() as id"); $now = new DateTime($nowc->id); if ($date->format('Y-m-d') == $now->format('Y-m-d')) { $diff = date_diff($now, $date); $total = $diff->h * 60 + $diff->i; $striDate = "Today, " . date(" g:i A", strtotime($this->scheduled_for)); } else { $striDate = date("M d, g:i A", strtotime($this->scheduled_for)); } if ($now->format('Y-m-d-H-i') > $date->format('Y-m-d-H-i')) { $diff = date_diff($now, $date); $total = $diff->h * 60 + $diff->i; $striDate = $striDate . " " . $total . " minutes Late "; } return $striDate; }
?> <br/> <?php if (User::isCurrentUserDomMentor()) { ?> <h3>Assigned Questions</h3> <br/> <?php $model3 = Ticket::model(); $AssignedTabs = array('tab4' => array('title' => "Open", 'content' => $this->widget('zii.widgets.grid.CGridView', array('id' => 'Assigned_tickets', 'dataProvider' => $model3->searchAssigned(User::getCurrentUserId()), 'columns' => array(array('name' => 'created_date', 'value' => '$data->getCreatedDateToString()'), 'subject', array('name' => 'Last Activity', 'value' => '$data->getLatestActivityDate()'), array('name' => 'Priority', 'value' => '$data->getPriorityString()'), array('class' => 'CButtonColumn', 'template' => '{view}', 'buttons' => array('view' => array('url' => 'Yii::app()->createUrl("ticket/view", array("id"=>$data->id))'))))), true)), 'tab3' => array('title' => "Closed", 'content' => $this->widget('zii.widgets.grid.CGridView', array('id' => 'Assigned_Closed_tickets', 'dataProvider' => $model3->searchAssignedClosed(User::getCurrentUserId()), 'columns' => array(array('name' => 'created_date', 'value' => '$data->getCreatedDateToString()'), 'subject', array('name' => 'Last Activity', 'value' => '$data->getLatestActivityDate()'), array('name' => 'Priority', 'value' => '$data->getPriorityString()'), array('class' => 'CButtonColumn', 'template' => '{view}', 'buttons' => array('view' => array('url' => 'Yii::app()->createUrl("ticket/view", array("id"=>$data->id))'))))), true))); $this->widget('CTabView', array('tabs' => $AssignedTabs)); } ?> <br/> <h3>Upcoming Meetings</h3> <?php $model2 = VideoConference::model(); $this->widget('zii.widgets.grid.CGridView', array('id' => 'upcomingVc', 'dataProvider' => $model2->searchUpcoming(User::getCurrentUserId()), 'columns' => array('subject', array('name' => 'scheduled_for', 'value' => '$data->getDateToString()'), array('class' => 'CButtonColumn', 'template' => '{view}', 'buttons' => array('view' => array('url' => 'Yii::app()->createAbsoluteUrl("videoConference/join/".$data->id, array(), "https")')))))); ?> <div class="span2" style="margin-left: 30px"> <!-- Cancel Button --> <table> <tr> </tr> <tr> <td> <br> </td> </tr> </table>
/** * 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 integer $id the ID of the model to be loaded * @return VideoConference the loaded model * @throws CHttpException */ public function loadModel($id) { $model = VideoConference::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }