/lms_debug/protected/views/dashboard/dashboard_09_june_2014.php
PHP | 457 lines | 404 code | 38 blank | 15 comment | 43 complexity | b7c4dab9d8cab086125f577469241016 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, LGPL-2.0
- <script>
- $(function(){
- $("#loader").show();
- $("#myteamworkload").load('index.php?r=dashboard/myteamworkload',function (responseText, textStatus, XMLHttpRequest) {
- if (textStatus == "success") {
- $("#loader").hide();
- // all good!
- }
- if (textStatus == "error") {
- // oh noes!
- }
- });
-
- });
- </script><?php if(Yii::app()->session['isRenewalUser']=='yes'){
- @$this->redirect(array('dashboard/renewal'));
- }
- ?>
- <style>
- #fancybox-wrap{
- z-index:9999999 !important;
- }
- </style>
-
- <div class="rightSection">
- <div class="toolbarheaderContainer"> Dashboard
-
- <table border="0" cellspacing="0" cellpadding="0" class="toolbarheaderContainer_date">
- <?php $form=$this->beginWidget('CActiveForm',array(
- 'id'=>'dashboard_update',
- 'action'=> Yii::app()->createUrl('dashboard/dashboard'),
- ));
- ?>
-
- <tr>
- <td>Select Date :</td>
- <td>
- <?php
- $this->widget('zii.widgets.jui.CJuiDatePicker', array(
- 'name' => 'searchDashboard',
- 'id' => 'textfield2',
- 'value'=>''.@$_POST['searchDashboard']?stripslashes($_POST['searchDashboard']):'Select Date'.'',
- 'options' => array(
- // how to change the input format? see http://docs.jquery.com/UI/Datepicker/formatDate
- 'dateFormat'=>'dd-M-yy',
- // user will be able to change month and year
- 'changeMonth' => 'true',
- 'changeYear' => 'true',
- // speed at which the datepicker appears, time in ms or "slow", "normal" or "fast"
- 'duration'=>'fast',
- // animation effect, see http://docs.jquery.com/UI/Effects
- 'showAnim' =>'slide',
- ),
- 'htmlOptions' => array(
- 'maxlength' => '10', // textField maxlength
- 'class'=>'txtfield_calendericon_select',
- 'onclick'=>'javascript:this.value=""',
- 'onblur'=> 'this.value = ( this.value == "" ) ? "Select Date" : this.value;',
-
- ),
- ));
- ?>
- </td>
- <td><input name="image" type="image" img src="<?php echo Yii::app()->request->baseUrl;?>/images/go.png" border="none" class="go"/></td>
- </tr>
- <?php $this->endWidget(); ?>
- </table>
- <div class="cl"></div>
- </div>
- <script src="js/excanvas.js"></script>
- <?php
- $relationManager = $_SESSION['relationalManager'];
- $managerMemberId = implode(",",array_unique(@$relationManager));
- Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/js/fullcalendar.js');
- $todayTime = strtotime(date('d M Y'));
- /* $models = Yii::app()->db->createCommand("SELECT startDate, count(*) AS total,leadFollowupId FROM leadFollowup WHERE
- userId = '".@$_SESSION['id']."' AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') AND startDate = '".@$todayTime."' GROUP BY startDate DESC")->queryAll();*/
-
- /* $models = Yii::app()->db->createCommand("SELECT startDate, count(*) AS total,leadFollowupId FROM leadFollowup WHERE
- userId IN (".@$managerMemberId.") AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') AND startDate = '".@$todayTime."' GROUP BY startDate DESC")->queryAll();
- */
-
- $timbefore3days = strtotime('-3 days', time());
- $timafter3days = strtotime('+3 days', time());
- $models = Yii::app()->db->createCommand("SELECT startDate, count(*) AS total,leadFollowupId FROM leadFollowup WHERE
- userId IN (".@$managerMemberId.") AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') AND (startDate >= $timbefore3days and startDate <= $timafter3days ) GROUP BY startDate DESC")->queryAll();
- $meetingArray = array();
- for($i=0;$i<count($models);$i++){
- $meetingDate = @$models[$i]['startDate'];
- $totalCount = @$models[$i]['total'];
- $monthValue = date('m',@$models[$i]['startDate']);
-
- $meetingArray[$i]['totalCount'] = @$totalCount;
- $meetingArray[$i]['day'] = date('d',@$models[$i]['startDate']);
- $meetingArray[$i]['month'] = $monthValue-1;
- $meetingArray[$i]['year'] = date('Y',@$models[$i]['startDate']);
- $meetingArray[$i]['leadFollowupId'] = @$models[$i]['leadFollowupId'];
-
- //$meetingModels = LeadFollowup::model()->findAll(array("condition"=>"startDate = '".@$meetingDate."' AND userId = '".@$_SESSION['id']."' AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') ORDER BY hour DESC"));
- $meetingModels = LeadFollowup::model()->findAll(array("condition"=>"startDate = '".@$meetingDate."' AND userId IN(".@$managerMemberId.") AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') ORDER BY hour DESC"));
-
- $meetingArray[$i]['finalDescription'] = '';
-
- for($j=0;$j<count($meetingModels);$j++) {
- $srno = $j+1;
- $meetingArray[$i]['finalDescription'] = @$meetingDate;
- }
- }
-
- ?>
- <link href="<?php echo Yii::app()->request->baseUrl;?>/css/fullcalendar.css" rel="stylesheet" type="text/css" />
- <link href="<?php echo Yii::app()->request->baseUrl;?>/css/fullcalendar.print.css" rel="stylesheet" type="text/css" />
- <script>
- $(document).ready(function() {
- var date = new Date();
- var d = date.getDate();
- var m = date.getMonth();
- var y = date.getFullYear();
- //alert(y+'-'+m+'-'+d);
- $('#calendar').fullCalendar({
- theme: true,
- header: {
- left: 'prev today',
- center: 'title',
- right: 'next'
- },
- editable: true,
-
- events: [
- <?php
- $g=1;
- for($i=0;$i<count($meetingArray);$i++) { ?>
- {
- title: '<?php echo @$meetingArray[$i]['totalCount']?>',
- start: new Date(<?php echo @$meetingArray[$i]['year']?>, <?php echo @$meetingArray[$i]['month']?>, <?php echo @$meetingArray[$i]['day']?>, 0),
- allDay: false,
- rel: "myrel",
- 'class': 'class-link',
- url: '<?php echo Yii::app()->request->baseUrl;?>/index.php?r=leads/ViewCalenderActs&id=<?php echo $meetingArray[$i]['finalDescription']; ?>',
- }
- <?php if(count($meetingArray) > $g){
- echo ",";
- }
- $g++;
- } ?>
- ],
-
- eventClick : function(event) {
- //parent.$.fancybox.close();
- $.fancybox(
- {
- 'autoDimensions' : false,
- 'type' : 'iframe',
- 'href' : event.url,
- 'width' : 700,
- 'height' : 316,
- 'transitionIn' : 'none',
- 'transitionOut' : 'none',
- 'onClosed' : function(){
- $.fn.yiiGridView.update("acc-payment-recei-grid2");
- $.fn.yiiGridView.update("acc-payment-recei-grid4");
- }
- }
- );
- return false;
- }
- });
-
- });
- </script>
- <div class="opentaskside fl">
- <div class="fullcontainer">
- <p> Leads for Today</p>
- <?php if(isset($dataProviderc) && !empty($dataProviderc)) {
-
- $alert="Are you sure you want to Change Status? ";
- $this->widget('zii.widgets.grid.CGridView', array(
- 'id'=>'acc-payment-recei-grid11',
- 'htmlOptions' => array('class' => 'items'),
- 'ajaxUpdate'=>false,
- 'pager' => array(
- 'header' => ' ',
- 'prevPageLabel' => 'Prev',
- 'nextPageLabel' => 'Next',
- ),
- 'dataProvider'=>@$dataProviderc,
- 'columns'=>array(
- array( // display 'create_time' using an expression
- 'header'=>'',
- 'name'=>'getparent',
- 'value'=>function($data){
- $primary = LeadStatus::model()->findByPk($data['me_id']);
- if(@$primary['parentId'] > 0){
- $parentName = LeadStatus::model()->findByPk(@$primary['parentId']);
- @$pname=@$parentName['leadStatus'];
- } else {
- @$pname="Primary";
- }
-
- echo @$pname;
-
- },
- ), array( // display 'create_time' using an expression
- 'header'=>'',
- 'name'=>'child',
- 'value'=>'@$data[me_leadStatus]',
- ), array( // display 'create_time' using an expression
- 'header'=>'',
- 'name'=>'total',
- 'value'=>function($data){
- if(strlen(@$data['total'])==1){ $resd = "00".@$data['total']; } else if(strlen(@$data['total'])==2){ $resd= "0".@$data['total']; } else { $resd= @$data['total']; }
- echo '<span class="followBox"><a href="'.Yii::app()->createUrl('dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['me_id'])).'" class=" class-link" style="color:#FFFFFF; text-decoration:none;cursor:pointer;">'.@$resd.'</a></span>';
- },
- ),
-
- ),
-
- ));
- }
- ?>
- </div>
-
- <div id="myteamworkload">
- <p>My Team (Workload)</p>
- <div id="loaderteam"><img src="images/loading.gif" height="30" width="30" /></div>
- </div>
- <div class="fullcontainer">
- <p>Speedometer</p>
- <?php $form=$this->beginWidget('CActiveForm',array(
- 'id'=>'speedometer',
- 'action'=>Yii::app()->createUrl('dashboard/dashboard'),
- 'htmlOptions'=>array(
- 'name'=>'speedometer_form'
- )
- ));
- ?>
- <div class="dropdownBoxdash fr mrgnDropbox">
- <select class="styled" name="speedmeterUser" onchange="this.form.submit();">
- <option value="">Select User</option>
- <?php if(count($managerDetailsArr) > 0 && isset($managerDetailsArr) && !empty($managerDetailsArr)){
- foreach($managerDetailsArr as $key=>$value){
- ?>
- <option value="<?php echo @$value['id']; ?>" <?php if(@$_REQUEST['speedmeterUser']==@$value['id']) { echo "selected"; } ?>><?php echo @$value['firstName']." ".@$value['lastName']; ?></option>
- <?php }
- } ?>
-
- </select>
- </div>
- <?php $this->endWidget();
- $totalClosedAmount=intval(@$totalAmountOfSpeedometer[0]['totalAmount']);
- if($totalClosedAmount > 1000000){
- $totalClosedAmount=1000000;
- }
- $totalclosedAmount=1000000;
- if($totalClosedAmount > 0){
- $totalClosedAmount = $totalClosedAmount;
- } else {
- $totalClosedAmount = 1;
- }
- $chartAmount=intval($totalclosedAmount-$totalClosedAmount);
- ?>
- <div class="barnotation">
-
- <div class="barnotationheading"><span class="followBoxDashboard" style="background-color:#FFFF01;"> </span> Close Lead Amount (<?php if($totalClosedAmount=='1') { echo 0; } else { echo @$totalClosedAmount; } ?>) </div>
- <div class="barnotationheading"><span class="followBoxDashboard" style="background-color:#4D4D4D;"> </span> Target 10 Lakh </div>
-
- </div>
- <?php
- $graphbg = Yii::app()->image->createUrl('images',YiiBase::getPathOfAlias('webroot.images').'/graphBg.png');
-
- ?>
- <div class="dashboardBox" style="background:url(<?php echo $graphbg;?>) center center no-repeat;">
-
-
- <?php
- $this->widget(
- 'chartjs.widgets.ChPie',
-
- array(
- 'width' => 400,
- 'height' => 189,
- 'datasets' => array(
- array(
- 'value'=>$totalClosedAmount,
- 'color'=>'#FFFF01',
- ),
- array(
- 'value'=>$chartAmount,
- 'color'=>'#4d4d4d',
- ),
-
- ),
-
- 'options' => array('centerTop'=>830, // Distance from widget's left side to the center of pie chart
- 'centerLeft'=>130, // Distance from widget's top side to the center of pie chart
- 'radius'=>100)
- )
- );
- ?>
- <span class="fr">
- </span>
- </div>
- </div>
- </div>
- <?php $form=$this->beginWidget('CActiveForm',array(
- 'id'=>'add_plan_type',
- 'action'=>'',
- 'htmlOptions'=>array(
- 'name'=>'plan_type_form'
- )
- ));
- ?>
-
- <div class="opentaskside fr">
- <div class="formHeadContainerrght">
- <h1>Meetings/Followups</h1>
- </div>
- <div class="formBox">
- <div class="formBoxScrollrght">
- <div id='calendar'></div>
- <div>
- <?php echo CHtml::link('View All Calenders Follow-Up/Call-later',array('dashboard/fullcalender'),array('style'=>'color:#545454;font:13px Calibri,Helvetica Neue,Tahoma,sans-serif;','target'=>'_blank'));?>
- </div>
-
- </div>
- </div>
-
- <div class="fullcontainer">
- <p>Performance</p>
- <table cellspacing="0" cellpadding="0" class="items">
- <tr>
- <th>Team Member</th>
- <th>Closures</th>
- <th>Amount</th>
- <th>Detalis</th>
- </tr>
- <?php
- if(count($managerDetailsArr) > 0 && isset($managerDetailsArr) && !empty($managerDetailsArr)){
- $start = 1;
- foreach($managerDetailsArr as $key=>$value){
-
- if($start <= 10){
- $closeLeads=Lead::model()->closeLeads($value['id']);
- $totalAmount=Lead::model()->closedLeadsAmount($value['id']);
-
- ?>
- <tr>
- <td><?php echo @$value['firstName']." ".@$value['lastName']; ?></td>
- <td><?php echo $closeLeads; ?></td>
- <td><?php echo $totalAmount[0]['totalAmount']?$totalAmount[0]['totalAmount']:0; ?></td>
- <td><?php echo CHtml::link('View', Yii::app()->createUrl('dashboard/ViewFancyboxData',array('id'=>$value['id'])), array('class' => 'viewNav class-link')); ?></td>
- </tr>
- <?php }
- $start++;
- }
- } else { ?>
- <tr><td colspan="4">No Records Found</td></tr>
- <?php } if(count($managerDetailsArr) > 10){ ?>
- <tr>
- <td colspan="4" align="right" style="text-align:right;"><a style="color:#545454; text-decoration:none;cursor:pointer;" href="<?php echo Yii::app()->createUrl('dashboard/ViewAllPerformanceData'); ?>" rel="myrel" class="class-link">View All</a></td>
- </tr>
- <?php } ?>
-
- </table>
- </div>
- <div class="fullcontainer">
- <p>Announcements</p>
- <table cellspacing="0" cellpadding="0" class="items">
- <?php
- if(count(@$notifications)>0 && isset($notifications) && !empty($notifications)){
- foreach(@$notifications as $key2=>$value2){
- if($notifications[$key2]['type']=='TEXT'){
- if($notifications[$key2]['description']!=''){
- $data=str_replace("<p>","",$notifications[$key2]['description']);
- $data=str_replace("</p>","",$data);
- ?>
- <tr>
- <td><?php echo stripslashes(@$data); ?></td>
- </tr>
- <?php } }
- }
- } else {
- ?>
- <tr>
- <td>No Data Available</td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- <div class="fullcontainer" style="display:none;">
- <p>Activity</p>
- <div class="formBox">
- <div class="formBoxScroll">
- <?php
- $activationrelationManager = $_SESSION['relationalManager'];
- $activationmanagerMemberId = implode(",",array_unique(@$activationrelationManager));
-
- $dataProvider=new CActiveDataProvider('LeadFollowup', array('criteria'=>array(
- 'condition'=>"userId = '".@$_SESSION['id']."' AND STATUS = 'Pending'",
- 'order'=>'leadFollowupId DESC',
- )));
- $alert="Are you sure you want to Change Status? ";
- $this->widget('zii.widgets.grid.CGridView', array(
- 'id'=>'acc-payment-recei-grid2',
- 'htmlOptions' => array('class' => 'items'),
- 'ajaxUpdate'=>true,
- 'enableSorting'=>true,
- 'enablePagination' => true,
- 'pager' => array(
- 'header' => ' ',
- 'prevPageLabel' => 'Prev',
- 'nextPageLabel' => 'Next',
- ),
- 'dataProvider'=>$dataProvider,
- 'columns'=>array(
- array( // display 'create_time' using an expression
- 'name'=>'Date',
- 'value'=>'Yii::app()->dateFormatter->format("d MMM y",$data->createdOn)',
- ),
- array( // display 'create_time' using an expression
- 'name'=>'Mobile',
- 'value'=>'@$data->leadDetails->mobile',
- ),
- array( // display 'create_time' using an expression
- 'name'=>'Description',
- 'type'=>'raw',
- 'value'=>'CHtml::link(substr($data->description,0,15),Yii::app()->createUrl("leads/ViewLeadActivity",array("id"=>$data->leadFollowupId)),array("title"=>"","class"=>"class-link","rel"=>"myrel"))',
- ),
- array( // display 'create_time' using an expression
- 'header'=>'Edit',
- 'type'=>'raw',
- 'visible'=>'0',
- 'value'=>'CHtml::link(substr("Edit",0,15),Yii::app()->createUrl("leads/leads_details",array("actionId"=>$data->leadFollowupId,"leadId"=>$data->leadId)),array("title"=>"Edit Details"))',
- ),
- ),
- ));
- ?>
- </div>
- </div>
- </div>
- </div>
-
- <?php
- if(count($notifications)>0 && isset($notifications) && !empty($notifications)){
- foreach($notifications as $key2=>$value2){
- if($notifications[$key2]['type']=='BANNER'){
- if(@$notifications[$key2]['banner']!=''){
- ?>
- <div class="footerBanner fl" style="text-align:left !important;"><img src="<?php echo Yii::app()->request->baseUrl;?>/siteupload/<?php echo @$notifications[$key2]['banner']; ?>" width="529" height="63" /></div>
- <?php }
- }
- } } else { ?> <?php } ?>
- <?php $this->endWidget(); ?>
- <div class="cl"></div>
- </div>