/lms_debug/protected/views/dashboard/renewaldashboard.php
PHP | 553 lines | 487 code | 51 blank | 15 comment | 33 complexity | e14e65a9ec5e8ee2622521b9350e38aa MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, LGPL-2.0
- <style>
- #fancybox-wrap{
- z-index:9999999 !important;
- }
- </style>
-
- <div class="rightSection">
- <div class="toolbarheaderContainer">Renewal 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/renewal'),
- ));
- ?>
-
- <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();
- */
-
- $models = Yii::app()->db->createCommand("SELECT startDate, count(*) AS total,leadFollowupId FROM renewalleadFollowup WHERE
- userId IN (".@$managerMemberId.") AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') 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 = renewalleadFollowup::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=renewalleads/renViewCalenderActs&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;
- }
- });
- $('a.tstf').fancybox({
- type: "iframe",
- width:700,
- height:500,
- });
- });
- </script>
- <!--Dashboard start here-->
- <div class="opentaskside fl">
- <div class="fullcontainer items">
- <p> Leads for Today</p>
- <?php
-
- $form=$this->beginWidget('CActiveForm',array(
- 'id'=>'leadfortoday_filter',
- 'action'=> Yii::app()->createUrl('dashboard/renewal'),
- ));
- ?>
-
- <table class="items" style="width:55%;border:none;">
- <tr><td>Financial year <div class="dropdownBox">
- <select name="financialyear" class="styled">
- <?php
- $u=0;
- for($i=date('Y')-5; $i<=date('Y'); $i++){
- $res = date('Y')-$u++;
- ?>
- <option value="<?php echo $res; ?>" <?php if(@$_POST['financialyear']==$res){ echo "selected='true'"; } ?> ><?php echo $res;?></option>;
-
- <?php
- }
- ?>
- </select>
- </div></td><td> <input name="image" type="image" src="images/go.png" /></td></tr>
- </table>
- <?php $this->endWidget();
-
- 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' => ''),
- 'ajaxUpdate'=>false,
- 'enablePagination' => true,
- 'pager' => array(
- 'header' => ' ',
- 'prevPageLabel' => 'Prev',
- 'nextPageLabel' => 'Next',
- ),
- 'dataProvider'=>@$dataProviderc,
- 'columns'=>array(
- array( // display 'create_time' using an expression
- 'header'=>'Disposition',
- 'name'=>'leadStatus',
- 'value'=>'@$data[leadstatus]',
- ),
- array( // display 'create_time' using an expression
- 'header'=>'Count(MTD)',
- 'name'=>'getparent',
- //'value'=>array($this,'getMTD'),
- 'value'=>function($data){
- $res = DashboardController::rengetMTD($data['leadstatusId']);
- if($res > 0){
- $financialyear = @$_POST['financialyear']?@$_POST['financialyear']:date('Y',time());
- echo CHtml::ajaxLink(DashboardController::rengetMTD($data['leadstatusId']), Yii::app()->createUrl( 'dashboard/RenewalViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear,'type'=>'M') ),
- array( // ajaxOptions
- 'type' => 'POST',
- ),
- array( //htmlOptions
- 'href' => Yii::app()->createUrl( 'dashboard/RenewalViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear,'type'=>'M') ),
- 'class'=>'tstf',
- )
- );
- } else {
- echo DashboardController::rengetMTD($data['leadstatusId']);
- }
- },
- ),
- array( // display 'create_time' using an expression
- 'header'=>'Count(YTD)',
- 'name'=>'getparent',
- 'type'=>'html',
- // 'value'=>array($this,'getYTD'),
- 'value'=>function($data){
- $res = DashboardController::rengetYTD($data['leadstatusId']);
- if($res > 0){
- $financialyear = @$_POST['financialyear']?@$_POST['financialyear']:date('Y',time());
- echo CHtml::ajaxLink(DashboardController::rengetYTD($data['leadstatusId']), Yii::app()->createUrl( 'dashboard/RenewalViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear) ),
- array( // ajaxOptions
- 'type' => 'POST',
- ),
- array( //htmlOptions
- 'href' => Yii::app()->createUrl( 'dashboard/RenewalViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear) ),
- 'class'=>'tstf',
- )
- );
- } else {
- echo DashboardController::rengetYTD($data['leadstatusId']);
- }
- },
- ),
- array( // display 'create_time' using an expression
- 'header'=>'Priority',
- 'name'=>'sortOrder',
- 'value'=>'@$data[sortOrder]',
-
- ),
- array( // display 'create_time' using an expression
- 'header'=>'View',
- 'name'=>'total',
- 'visible'=>0,
- 'value'=>function($data){
- echo '<a href="'.Yii::app()->createUrl('dashboard/RenewalViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'])).'" class=" class-link" style="color:#134BDB; text-decoration:none;cursor:pointer;">Details</a>';
- },
- ),
-
- ),
-
- ));
- }
-
- ?>
- </div>
- <div class="fullcontainer">
- <p>My Team (Workload)</p>
- <table cellspacing="0" cellpadding="0" class="items">
- <?php if(count($managerDetailsArr) > 0){
- $start = 1;
- foreach($managerDetailsArr as $key=>$value){
- if($start <= 10){
- $NewLeads=Renewallead::model()->NewLeads($value['id']);
- $overallLeads=Renewallead::model()->overallLeads($value['id']);
- $allocatedLead12Pm=Renewallead::model()->allocatedLead12Pm($value['id']);
- $closeLeads=Renewallead::model()->closeLeads($value['id']);
- $followUpLeads=Renewallead::model()->followUpLeads($value['id']);
- ?>
- <tr>
- <td width="50%"><a style="color:#545454; text-decoration:none;cursor:pointer;" href="<?php echo Yii::app()->createUrl('dashboard/renViewWorkLoadData',array('id'=>$value['id'])); ?>" class="class-link"><?php echo @$value['firstName']." ".@$value['lastName']; ?></a></td>
- <td width="50%" class="txtalign">(<?php echo $NewLeads; ?> -N / <?php echo $overallLeads; ?>-O / <?php echo $allocatedLead12Pm; ?>-A /<?php echo $closeLeads; ?>-C / <?php echo $followUpLeads; ?>-F )</td>
- </tr>
- <?php
- $start++;
- }
- }
- } if(count($managerDetailsArr) > 10){ ?>
- <tr>
- <td colspan="2" align="right" style="text-align:right;"><a style="color:#545454; text-decoration:none;cursor:pointer;" href="<?php echo Yii::app()->createUrl('dashboard/renViewAllWorkLoadData'); ?>" class="class-link">View All</a></td>
- </tr>
- <?php } ?>
-
- <tr>
- <td colspan="2">N = New, O = overall, A = Allocated today Past 12 , C = Clead call out, F = Follow-ups</td>
- </tr>
- </table>
- </div>
- <div class="fullcontainer">
- <p>Speedometer</p>
- <?php $form=$this->beginWidget('CActiveForm',array(
- 'id'=>'speedometer',
- 'action'=>Yii::app()->createUrl('dashboard/renewal'),
- '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){
- 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>
- <!-- <input name="input" type="image" img="img" src="images/setting.jpg" class="setting112 fr"/>-->
- </div>
- <div class="formBox">
- <div class="formBoxScrollrght">
- <div id='calendar'></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
- $cs = Yii::app()->clientScript;
- $cs->coreScriptPosition = CClientScript::POS_HEAD;
- $baseUrl = Yii::app()->getModule('gii')->assetsUrl; //the assets of existing module
- $cs->registerCoreScript('jquery');
- $cs->registerCoreScript('jquery.ui');
- $cs->registerScriptFile($baseUrl . '/js/fancybox/jquery.fancybox-1.3.1.pack.js');
- $cs->registerCssFile($baseUrl . '/js/fancybox/jquery.fancybox-1.3.1.css');
- $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/popup.js');
- if(count($managerDetailsArr) > 0){
- $start = 1;
- foreach($managerDetailsArr as $key=>$value){
-
- if($start <= 10){
- $closeLeads=Renewallead::model()->closeLeads($value['id']);
- $totalAmount=Renewallead::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/renViewFancyboxData',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/renViewAllPerformanceData'); ?>" 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){
- 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('RenewalleadFollowup', 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("renewalleads/renViewLeadActivity",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("renewalleads/renleads_details",array("actionId"=>$data->leadFollowupId,"leadId"=>$data->leadId)),array("title"=>"Edit Details"))',
- ),
- ),
- ));
- ?>
- </div>
- </div>
- </div>
- </div>
-
- <?php
- if(count($notifications)>0){
- 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="footerBanner fl" style="text-align:left;"><img src="<?php echo Yii::app()->request->baseUrl;?>/images/footerBanner.jpg" width="49%" /></div>-->
- <!--Dashboard end here-->
- <div class="cl"></div>
- </div>