PageRenderTime 58ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lms_debug/protected/views/dashboard/dashboard_4dec2014.php

https://gitlab.com/badelal143/lms_debug
PHP | 717 lines | 596 code | 75 blank | 46 comment | 37 complexity | 56301842f6010ce10c9ad0aaa98208bc MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, LGPL-2.0
  1. <?php if(Yii::app()->session['isRenewalUser']=='yes'){
  2. @$this->redirect(array('dashboard/renewal'));
  3. }
  4. ?>
  5. <style>
  6. #fancybox-wrap{
  7. z-index:9999999 !important;
  8. }
  9. </style>
  10. <div class="rightSection">
  11. <div class="toolbarheaderContainer"> Dashboard
  12. <table border="0" cellspacing="0" cellpadding="0" class="toolbarheaderContainer_date">
  13. <?php $form=$this->beginWidget('CActiveForm',array(
  14. 'id'=>'dashboard_update',
  15. 'action'=> Yii::app()->createUrl('dashboard/dashboard'),
  16. ));
  17. ?>
  18. <tr>
  19. <td>Select Date :</td>
  20. <td>
  21. <?php
  22. $this->widget('zii.widgets.jui.CJuiDatePicker', array(
  23. 'name' => 'searchDashboard',
  24. 'id' => 'textfield2',
  25. 'value'=>''.@$_POST['searchDashboard']?stripslashes($_POST['searchDashboard']):'Select Date'.'',
  26. 'options' => array(
  27. // how to change the input format? see http://docs.jquery.com/UI/Datepicker/formatDate
  28. 'dateFormat'=>'dd-M-yy',
  29. // user will be able to change month and year
  30. 'changeMonth' => 'true',
  31. 'changeYear' => 'true',
  32. // speed at which the datepicker appears, time in ms or "slow", "normal" or "fast"
  33. 'duration'=>'fast',
  34. // animation effect, see http://docs.jquery.com/UI/Effects
  35. 'showAnim' =>'slide',
  36. ),
  37. 'htmlOptions' => array(
  38. 'maxlength' => '10', // textField maxlength
  39. 'class'=>'txtfield_calendericon_select',
  40. 'onclick'=>'javascript:this.value=""',
  41. 'onblur'=> 'this.value = ( this.value == "" ) ? "Select Date" : this.value;',
  42. ),
  43. ));
  44. ?>
  45. </td>
  46. <td><input name="image" type="image" img src="<?php echo Yii::app()->request->baseUrl;?>/images/go.png" border="none" class="go"/></td>
  47. </tr>
  48. <?php $this->endWidget(); ?>
  49. </table>
  50. <div class="cl"></div>
  51. </div>
  52. <script src="js/excanvas.js"></script>
  53. <?php
  54. $relationManager = $_SESSION['relationalManager'];
  55. $managerMemberId = implode(",",array_unique(@$relationManager));
  56. Yii::app()->getClientScript()->registerScriptFile(Yii::app()->baseUrl.'/js/fullcalendar.js');
  57. $todayTime = strtotime(date('d M Y'));
  58. $timbefore3days = strtotime('-3 days', time());
  59. $timafter3days = strtotime('+3 days', time());
  60. $models = Yii::app()->db->createCommand("SELECT startDate, count(*) AS total,leadFollowupId FROM leadFollowup WHERE
  61. userId IN (".@$managerMemberId.") AND STATUS = 'Pending' AND (actionType = 'Meeting' OR actionType = 'Follow Up') AND (startDate >= $timbefore3days and startDate <= $timafter3days ) GROUP BY startDate DESC")->queryAll();
  62. $meetingArray = array();
  63. for($i=0;$i<count($models);$i++){
  64. $meetingDate = @$models[$i]['startDate'];
  65. $totalCount = @$models[$i]['total'];
  66. $monthValue = date('m',@$models[$i]['startDate']);
  67. $meetingArray[$i]['totalCount'] = @$totalCount;
  68. $meetingArray[$i]['day'] = date('d',@$models[$i]['startDate']);
  69. $meetingArray[$i]['month'] = $monthValue-1;
  70. $meetingArray[$i]['year'] = date('Y',@$models[$i]['startDate']);
  71. $meetingArray[$i]['leadFollowupId'] = @$models[$i]['leadFollowupId'];
  72. //$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"));
  73. $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"));
  74. $meetingArray[$i]['finalDescription'] = '';
  75. for($j=0;$j<count($meetingModels);$j++) {
  76. $srno = $j+1;
  77. $meetingArray[$i]['finalDescription'] = @$meetingDate;
  78. }
  79. }
  80. ?>
  81. <link href="<?php echo Yii::app()->request->baseUrl;?>/css/fullcalendar.css" rel="stylesheet" type="text/css" />
  82. <link href="<?php echo Yii::app()->request->baseUrl;?>/css/fullcalendar.print.css" rel="stylesheet" type="text/css" />
  83. <script>
  84. $(document).ready(function() {
  85. var date = new Date();
  86. var d = date.getDate();
  87. var m = date.getMonth();
  88. var y = date.getFullYear();
  89. //alert(y+'-'+m+'-'+d);
  90. $('#calendar').fullCalendar({
  91. theme: true,
  92. header: {
  93. left: 'prev today',
  94. center: 'title',
  95. right: 'next'
  96. },
  97. editable: true,
  98. events: [
  99. <?php
  100. $g=1;
  101. for($i=0;$i<count($meetingArray);$i++) { ?>
  102. {
  103. title: '<?php echo @$meetingArray[$i]['totalCount']?>',
  104. start: new Date(<?php echo @$meetingArray[$i]['year']?>, <?php echo @$meetingArray[$i]['month']?>, <?php echo @$meetingArray[$i]['day']?>, 0),
  105. allDay: false,
  106. rel: "myrel",
  107. 'class': 'class-link',
  108. url: '<?php echo Yii::app()->request->baseUrl;?>/index.php?r=leads/ViewCalenderActs&id=<?php echo $meetingArray[$i]['finalDescription']; ?>',
  109. }
  110. <?php if(count($meetingArray) > $g){
  111. echo ",";
  112. }
  113. $g++;
  114. } ?>
  115. ],
  116. eventClick : function(event) {
  117. //parent.$.fancybox.close();
  118. $.fancybox(
  119. {
  120. 'autoDimensions' : false,
  121. 'type' : 'iframe',
  122. 'href' : event.url,
  123. 'width' : 700,
  124. 'height' : 316,
  125. 'transitionIn' : 'none',
  126. 'transitionOut' : 'none',
  127. 'onClosed' : function(){
  128. $.fn.yiiGridView.update("acc-payment-recei-grid2");
  129. $.fn.yiiGridView.update("acc-payment-recei-grid4");
  130. }
  131. }
  132. );
  133. return false;
  134. }
  135. });
  136. $('a.tstf').fancybox({
  137. type: "iframe",
  138. width:700,
  139. height:500,
  140. });
  141. });
  142. </script>
  143. <?php $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('jquery');
  144. $cs = Yii::app()->clientScript;
  145. $cs->coreScriptPosition = CClientScript::POS_HEAD;
  146. $baseUrl = Yii::app()->getModule('gii')->assetsUrl; //the assets of existing module
  147. //$cs->registerCoreScript('jquery');
  148. //$cs->registerCoreScript('jquery.ui');
  149. $cs->registerScriptFile($baseUrl . '/js/fancybox/jquery.fancybox-1.3.1.pack.js');
  150. $cs->registerCssFile($baseUrl . '/js/fancybox/jquery.fancybox-1.3.1.css');
  151. $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/popup.js');
  152. ?>
  153. <div class="opentaskside fl">
  154. <div class="fullcontainer items">
  155. <p> Leads for Today</p>
  156. <?php
  157. $form=$this->beginWidget('CActiveForm',array(
  158. 'id'=>'leadfortoday_filter',
  159. 'action'=> Yii::app()->createUrl('dashboard/dashboard'),
  160. ));
  161. ?>
  162. <table class="items" style="width:55%;border:none;">
  163. <tr><td>Financial year &nbsp;<div class="dropdownBox">
  164. <select name="financialyear" class="styled">
  165. <?php
  166. $u=0;
  167. for($i=date('Y')-5; $i<=date('Y'); $i++){
  168. $res = date('Y')-$u++;
  169. ?>
  170. <option value="<?php echo $res; ?>" <?php if(@$_POST['financialyear']==$res){ echo "selected='true'"; } ?> ><?php echo $res;?></option>;
  171. <?php
  172. }
  173. ?>
  174. </select>
  175. </div></td><td>&nbsp;<input name="image" type="image" src="images/go.png" /></td></tr>
  176. </table>
  177. <?php $this->endWidget();
  178. if(isset($dataProviderc) && !empty($dataProviderc)) {
  179. $alert="Are you sure you want to Change Status? ";
  180. $this->widget('zii.widgets.grid.CGridView', array(
  181. 'id'=>'acc-payment-recei-grid11',
  182. 'htmlOptions' => array('class' => ''),
  183. 'ajaxUpdate'=>false,
  184. 'enablePagination' => true,
  185. 'pager' => array(
  186. 'header' => '&nbsp;',
  187. 'prevPageLabel' => 'Prev',
  188. 'nextPageLabel' => 'Next',
  189. ),
  190. 'dataProvider'=>@$dataProviderc,
  191. 'columns'=>array(
  192. array( // display 'create_time' using an expression
  193. 'header'=>'Disposition',
  194. 'name'=>'leadStatus',
  195. 'value'=>'@$data[leadstatus]',
  196. ),
  197. array( // display 'create_time' using an expression
  198. 'header'=>'Count(MTD)',
  199. 'name'=>'getparent',
  200. //'value'=>array($this,'getMTD'),
  201. 'value'=>function($data){
  202. $res = DashboardController::getMTD($data['leadstatusId']);
  203. if($res > 0){
  204. $financialyear = @$_POST['financialyear']?@$_POST['financialyear']:date('Y',time());
  205. echo CHtml::ajaxLink(DashboardController::getMTD($data['leadstatusId']), Yii::app()->createUrl( 'dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear,'type'=>'M') ),
  206. array( // ajaxOptions
  207. 'type' => 'POST',
  208. ),
  209. array( //htmlOptions
  210. 'href' => Yii::app()->createUrl( 'dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear,'type'=>'M') ),
  211. 'class'=>'tstf',
  212. )
  213. );
  214. } else {
  215. echo DashboardController::getMTD($data['leadstatusId']);
  216. }
  217. },
  218. ),
  219. array( // display 'create_time' using an expression
  220. 'header'=>'Count(YTD)',
  221. 'name'=>'getparent',
  222. 'type'=>'html',
  223. // 'value'=>array($this,'getYTD'),
  224. 'value'=>function($data){
  225. $res = DashboardController::getYTD($data['leadstatusId']);
  226. if($res > 0){
  227. $financialyear = @$_POST['financialyear']?@$_POST['financialyear']:date('Y',time());
  228. echo CHtml::ajaxLink(DashboardController::getYTD($data['leadstatusId']), Yii::app()->createUrl( 'dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear) ),
  229. array( // ajaxOptions
  230. 'type' => 'POST',
  231. ),
  232. array( //htmlOptions
  233. 'href' => Yii::app()->createUrl( 'dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'],'Y'=>@$financialyear) ),
  234. 'class'=>'tstf',
  235. )
  236. );
  237. } else {
  238. echo DashboardController::getYTD($data['leadstatusId']);
  239. }
  240. },
  241. ),
  242. array( // display 'create_time' using an expression
  243. 'header'=>'Priority',
  244. 'name'=>'sortOrder',
  245. 'value'=>'@$data[sortOrder]',
  246. ),
  247. array( // display 'create_time' using an expression
  248. 'header'=>'View',
  249. 'name'=>'total',
  250. 'visible'=>0,
  251. 'value'=>function($data){
  252. echo '<a href="'.Yii::app()->createUrl('dashboard/ViewLeadSummaryData',array('leadStatusId'=>$data['leadstatusId'])).'" class=" class-link" style="color:#134BDB; text-decoration:none;cursor:pointer;">Details</a>';
  253. },
  254. ),
  255. ),
  256. ));
  257. }
  258. ?>
  259. </div>
  260. <div id="myteamworkload">
  261. <p>Workload</p>
  262. <?php
  263. if(Yii::app()->session->get('type')=='superadmin' or Yii::app()->session->get('roleId')==2){
  264. $form=$this->beginWidget('CActiveForm',array(
  265. 'id'=>'team_filter',
  266. 'action'=> Yii::app()->createUrl('dashboard/dashboard'),
  267. ));
  268. ?>
  269. <table class="items">
  270. <tr><td>Caller &nbsp;<div class="dropdownBox"><?php
  271. $models = User::model()->fetchCallersList();
  272. $caller_list = CHtml::listData($models,'id', 'userName');
  273. $modelUser=new User();
  274. $modelLead=new Lead();
  275. echo $form->dropDownList($modelUser,'userName',@$caller_list, array('id'=>'userName','class'=>'styled','empty' => 'Select Caller','options'=>array(@$_REQUEST['User']['userName']=>array('selected'=>'selected'))));
  276. ?></div></td><td><div class="dropdownBox010"><?php
  277. $modelnew = new leadSourceMaster();
  278. $modelstatus = leadSourceMaster::model()->findAll();
  279. // format models as $key=>$value with listData
  280. //echo $model->set_status;
  281. $status_list = CHtml::listData($modelstatus,'leadSourceId', 'leadSourceTitle');
  282. echo $form->dropDownList($modelnew,'leadSourceId',@$status_list, array('id'=>'status','class'=>'styled','empty' => 'Select Source','options'=>array(@$_REQUEST['LeadSourceMaster']['leadSourceId']=>array('selected'=>'selected'))));?></div></td><td>&nbsp;<input name="image" type="image" src="images/go.png" /></td></tr>
  283. <tr style="display:none;">
  284. <td style="display:none;">From : &nbsp;<?php
  285. $this->widget('zii.widgets.jui.CJuiDatePicker', array(
  286. 'model' =>@$modelLead,
  287. 'attribute' => 'createdOn',
  288. 'id'=>'period1',
  289. 'language'=>Yii::app()->language=='et' ? 'et' : null,
  290. // optional: jquery Datepicker options
  291. 'options' => array(
  292. // how to change the input format? see http://docs.jquery.com/UI/Datepicker/formatDate
  293. 'dateFormat'=>'dd-mm-yy',
  294. 'onSelect'=>'js:function(selected) {
  295. $("#period2").datepicker("option","minDate", selected)
  296. }',
  297. // user will be able to change month and year
  298. 'changeMonth' => 'true',
  299. 'changeYear' => 'true',
  300. // speed at which the datepicker appears, time in ms or "slow", "normal" or "fast"
  301. 'duration'=>'fast',
  302. // animation effect, see http://docs.jquery.com/UI/Effects
  303. 'showAnim' =>'slide',
  304. ),
  305. 'htmlOptions'=>array(
  306. 'style'=>'width:60%',
  307. 'class'=>'txtfield_calendericon','autocomplete'=>'off','value'=>@$_REQUEST['Lead']['createdOn']
  308. ),
  309. ));
  310. ?></td>
  311. <td style="display:none;">To&nbsp;&nbsp;<?php
  312. $this->widget('zii.widgets.jui.CJuiDatePicker', array(
  313. 'model' =>@$modelLead,
  314. 'attribute' => 'createdOn2',
  315. 'id'=>'period2',
  316. 'name'=>'period2',
  317. 'language'=>Yii::app()->language=='et' ? 'et' : null,
  318. // optional: jquery Datepicker options
  319. 'options' => array(
  320. // how to change the input format? see http://docs.jquery.com/UI/Datepicker/formatDate
  321. 'dateFormat'=>'dd-mm-yy',
  322. // user will be able to change month and year
  323. 'changeMonth' => 'true',
  324. 'changeYear' => 'true',
  325. // speed at which the datepicker appears, time in ms or "slow", "normal" or "fast"
  326. 'duration'=>'fast',
  327. // animation effect, see http://docs.jquery.com/UI/Effects
  328. 'showAnim' =>'slide',
  329. ),
  330. 'htmlOptions'=>array(
  331. 'style'=>'width:60%',
  332. 'class'=>'txtfield_calendericon','autocomplete'=>'off','value'=>@$_REQUEST['Lead']['createdOn2']
  333. ),
  334. ));
  335. ?> <td>&nbsp;<input name="image" type="image" src="images/go.png" /></td></td>
  336. </tr>
  337. </table>
  338. <?php $this->endWidget();
  339. }
  340. ?>
  341. <?php
  342. if(Yii::app()->session->get('isAllocator')=='yes' or Yii::app()->session->get('type')=='superadmin' or Yii::app()->session->get('roleId')==1 or Yii::app()->session->get('roleId')==4 ){
  343. if(isset($dataProviderWorkload) && !empty($dataProviderWorkload)) {
  344. $alert="Are you sure you want to Change Status? ";
  345. $this->widget('zii.widgets.grid.CGridView', array(
  346. 'id'=>'acc-payment-recei-grid11',
  347. 'htmlOptions' => array('class' => ''),
  348. 'ajaxUpdate'=>false,
  349. 'pager' => array(
  350. 'header' => '&nbsp;',
  351. 'prevPageLabel' => 'Prev',
  352. 'nextPageLabel' => 'Next',
  353. ),
  354. 'dataProvider'=>@$dataProviderWorkload,
  355. 'columns'=>array(
  356. array( // display 'create_time' using an expression
  357. 'header'=>'Team Members',
  358. 'name'=>'leadStatus',
  359. 'value'=>function($data){
  360. echo '<a href="'.Yii::app()->createUrl('dashboard/ViewWorkLoadData',array('id'=>$data['Id'])).'" class=" class-link" style="color:#545454; text-decoration:none;cursor:pointer;">'.CHtml::encode($data["firstName"]." ".$data["lastName"]).'</a>';
  361. },
  362. //'value'=>'CHtml::encode($data["firstName"]." ".$data["lastName"])',
  363. ),
  364. array( // display 'create_time' using an expression
  365. 'header'=>'T',
  366. 'name'=>'getparent',
  367. 'value'=>'@$data[T]',
  368. ),
  369. array( // display 'create_time' using an expression
  370. 'header'=>'Y',
  371. 'name'=>'getparent',
  372. 'value'=>'@$data[Y]',
  373. ),
  374. array( // display 'create_time' using an expression
  375. 'header'=>'M',
  376. 'name'=>'sortOrder',
  377. 'value'=>'@$data[M]',
  378. ),
  379. array( // display 'create_time' using an expression
  380. 'header'=>'LM',
  381. 'name'=>'total',
  382. 'value'=>'@$data[LM]',
  383. ),
  384. ),
  385. ));
  386. }
  387. }
  388. if(isset($dataProvidercaller) && !empty($dataProvidercaller)) {
  389. //for caller display records
  390. if(Yii::app()->session->get('roleId')==3 ){
  391. $this->widget('zii.widgets.CListView', array(
  392. 'dataProvider'=>$dataProvidercaller,
  393. 'itemView'=>'_view',
  394. 'template'=>'{items}<br/>{pager}'
  395. ));
  396. }
  397. }
  398. if(Yii::app()->session->get('roleId')==2 ){
  399. $today12PM = mktime(0,0,0,date("m"),date("d"),date("Y"));
  400. $tomorrow12PM = mktime(0,0,0,date("m"),date("d"),date("Y"))+86400;
  401. $yesterday12PM = mktime(0,0,0,date("m"),date("d"),date("Y"))-86400;
  402. $CurrentMonth_first_minute = mktime(0, 0, 0, date("n"), 1);
  403. $CurrentMonth_last_minute = mktime(23, 59, 0, date("n"), date("t"));
  404. $LastMonth_first_minute = mktime(0, 0, 0, date("n")-1, 1);
  405. $adminUniqueT=Yii::app()->db->createCommand("Select Count(*) as TotalUnique from (SELECT count(*) from lead where lead.updatedOn >= '".@$today12PM."' and lead.updatedOn <= '".@$tomorrow12PM."' and lead.currentAllocatedId IN (".$impresuser.") group by mobile) as lm ")->queryAll();
  406. $adminUniqueY=Yii::app()->db->createCommand("Select Count(*) as TotalUnique from (SELECT count(*) from lead where lead.updatedOn >= '".@$yesterday12PM."' and lead.updatedOn <= '".@$today12PM."' and lead.currentAllocatedId IN (".$impresuser.") group by mobile) as lm ")->queryAll();
  407. $adminUniqueL=Yii::app()->db->createCommand("Select Count(*) as TotalUnique from (SELECT count(*) from lead where lead.updatedOn >= '".@$CurrentMonth_first_minute."' and lead.updatedOn <= '".@$CurrentMonth_last_minute."' and lead.currentAllocatedId IN (".$impresuser.") group by mobile) as lm ")->queryAll();
  408. $adminUniqueLM=Yii::app()->db->createCommand("Select Count(*) as TotalUnique from (SELECT count(*) from lead where lead.updatedOn >= '".@$LastMonth_first_minute."' and lead.updatedOn <= '".@$CurrentMonth_first_minute."' and lead.currentAllocatedId IN (".$impresuser.") group by mobile) as lm ")->queryAll();
  409. $adminTotalT=Yii::app()->db->createCommand("SELECT count(*) as TotalUnique from lead where lead.updatedOn >= '".@$today12PM."' and lead.updatedOn <= '".@$tomorrow12PM."' and lead.currentAllocatedId IN (".$impresuser.")")->queryAll();
  410. $adminTotalY=Yii::app()->db->createCommand("SELECT count(*) as TotalUnique from lead where lead.updatedOn >= '".@$yesterday12PM."' and lead.updatedOn <= '".@$today12PM."' and lead.currentAllocatedId IN (".$impresuser.")")->queryAll();
  411. $adminTotalL=Yii::app()->db->createCommand("SELECT count(*) as TotalUnique from lead where lead.updatedOn >= '".@$CurrentMonth_first_minute."' and lead.updatedOn <= '".@$CurrentMonth_last_minute."' and lead.currentAllocatedId IN (".$impresuser.")")->queryAll();
  412. $adminTotalLM=Yii::app()->db->createCommand("SELECT count(*) as TotalUnique from lead where lead.updatedOn >= '".@$LastMonth_first_minute."' and lead.updatedOn <= '".@$CurrentMonth_first_minute."' and lead.currentAllocatedId IN (".$impresuser.")")->queryAll();
  413. ?>
  414. <table class="items">
  415. <thead>
  416. <tr>
  417. <th>&nbsp;</th><th>Total</th><th>Unique</th>
  418. </tr>
  419. </thead>
  420. <tbody>
  421. <tr><td>T</td><td><?php echo @$adminTotalT[0]['TotalUnique']?@$adminTotalT[0]['TotalUnique']:0; ?></td><td><?php echo @$adminUniqueT[0]['TotalUnique']?@$adminUniqueT[0]['TotalUnique']:0; ?></td></tr>
  422. <tr><td>Y</td><td><?php echo @$adminTotalY[0]['TotalUnique']?@$adminTotalY[0]['TotalUnique']:0; ?></td><td><?php echo @$adminUniqueY[0]['TotalUnique']?@$adminUniqueY[0]['TotalUnique']:0; ?></td></tr>
  423. <tr><td>M</td><td><?php echo @$adminTotalL[0]['TotalUnique']?@$adminTotalL[0]['TotalUnique']:0; ?></td><td><?php echo @$adminUniqueL[0]['TotalUnique']?@$adminUniqueL[0]['TotalUnique']:0; ?></td></tr>
  424. <tr><td>LM</td><td><?php echo @$adminTotalLM[0]['TotalUnique']?@$adminTotalLM[0]['TotalUnique']:0; ?></td><td><?php echo @$adminUniqueLM[0]['TotalUnique']?@$adminUniqueLM[0]['TotalUnique']:0; ?></td></tr>
  425. </tbody>
  426. </table>
  427. <?php
  428. }
  429. ?>
  430. </div>
  431. <div class="fullcontainer">
  432. <p>Speedometer</p>
  433. <?php $form=$this->beginWidget('CActiveForm',array(
  434. 'id'=>'speedometer',
  435. 'action'=>Yii::app()->createUrl('dashboard/dashboard'),
  436. 'htmlOptions'=>array(
  437. 'name'=>'speedometer_form'
  438. )
  439. ));
  440. ?>
  441. <div class="dropdownBoxdash fr mrgnDropbox">
  442. <select class="styled" name="speedmeterUser" onchange="this.form.submit();">
  443. <option value="">Select User</option>
  444. <?php if(count($managerDetailsArr) > 0 && isset($managerDetailsArr) && !empty($managerDetailsArr)){
  445. foreach($managerDetailsArr as $key=>$value){
  446. ?>
  447. <option value="<?php echo @$value['id']; ?>" <?php if(@$_REQUEST['speedmeterUser']==@$value['id']) { echo "selected"; } ?>><?php echo @$value['firstName']."&nbsp;".@$value['lastName']; ?></option>
  448. <?php }
  449. } ?>
  450. </select>
  451. </div>
  452. <?php $this->endWidget();
  453. $totalClosedAmount=intval(@$totalAmountOfSpeedometer[0]['totalAmount']);
  454. if($totalClosedAmount > 1000000){
  455. $totalClosedAmount=1000000;
  456. }
  457. $totalclosedAmount=1000000;
  458. if($totalClosedAmount > 0){
  459. $totalClosedAmount = $totalClosedAmount;
  460. } else {
  461. $totalClosedAmount = 1;
  462. }
  463. $chartAmount=intval($totalclosedAmount-$totalClosedAmount);
  464. ?>
  465. <div class="barnotation">
  466. <div class="barnotationheading"><span class="followBoxDashboard" style="background-color:#FFFF01;">&nbsp;</span>&nbsp;Close Lead Amount (<?php if($totalClosedAmount=='1') { echo 0; } else { echo @$totalClosedAmount; } ?>) </div>
  467. <div class="barnotationheading"><span class="followBoxDashboard" style="background-color:#4D4D4D;">&nbsp;</span>&nbsp;Target 10 Lakh </div>
  468. </div>
  469. <?php
  470. $graphbg = Yii::app()->image->createUrl('images',YiiBase::getPathOfAlias('webroot.images').'/graphBg.png');
  471. ?>
  472. <div class="dashboardBox" style="background:url(<?php echo $graphbg;?>) center center no-repeat;">
  473. <?php
  474. $this->widget(
  475. 'chartjs.widgets.ChPie',
  476. array(
  477. 'width' => 400,
  478. 'height' => 189,
  479. 'datasets' => array(
  480. array(
  481. 'value'=>$totalClosedAmount,
  482. 'color'=>'#FFFF01',
  483. ),
  484. array(
  485. 'value'=>$chartAmount,
  486. 'color'=>'#4d4d4d',
  487. ),
  488. ),
  489. 'options' => array('centerTop'=>830, // Distance from widget's left side to the center of pie chart
  490. 'centerLeft'=>130, // Distance from widget's top side to the center of pie chart
  491. 'radius'=>100)
  492. )
  493. );
  494. ?>
  495. <span class="fr">
  496. </span>
  497. </div>
  498. </div>
  499. </div>
  500. <?php $form=$this->beginWidget('CActiveForm',array(
  501. 'id'=>'add_plan_type',
  502. 'action'=>'',
  503. 'htmlOptions'=>array(
  504. 'name'=>'plan_type_form'
  505. )
  506. ));
  507. ?>
  508. <div class="opentaskside fr">
  509. <div class="formHeadContainerrght">
  510. <h1>Meetings/Followups</h1>
  511. </div>
  512. <div class="formBox">
  513. <div class="formBoxScrollrght">
  514. <div id='calendar'></div>
  515. <div>
  516. <?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'));?>
  517. </div>
  518. </div>
  519. </div>
  520. <div class="fullcontainer">
  521. <p>Performance</p>
  522. <?php
  523. if(isset($dataProviderPerf) && !empty($dataProviderPerf)) {
  524. $alert="Are you sure you want to Change Status? ";
  525. $this->widget('zii.widgets.grid.CGridView', array(
  526. 'id'=>'acc-payment-recei-grid11',
  527. 'htmlOptions' => array('class' => ''),
  528. 'ajaxUpdate'=>false,
  529. 'pager' => array(
  530. 'header' => '&nbsp;',
  531. 'prevPageLabel' => 'Prev',
  532. 'nextPageLabel' => 'Next',
  533. ),
  534. 'dataProvider'=>@$dataProviderPerf,
  535. 'columns'=>array(
  536. array( // display 'create_time' using an expression
  537. 'header'=>'Team Member',
  538. 'name'=>'leadStatus',
  539. 'value'=>'CHtml::encode($data["firstName"]." ".$data["lastName"])',
  540. ),
  541. array( // display 'create_time' using an expression
  542. 'header'=>'MTD',
  543. 'name'=>'getparent',
  544. 'value'=>'@$data[MTD]',
  545. ),
  546. array( // display 'create_time' using an expression( add by me)
  547. 'header'=>'Amount',
  548. 'name'=>'getparent',
  549. 'value'=>'@$data[mtdpremium]',
  550. ),
  551. /*
  552. array( // display 'create_time' using an expression
  553. 'header'=>'Closures',
  554. 'name'=>'getparent',
  555. 'value'=>'@$data[closeLeads]',
  556. ),
  557. array( // display 'create_time' using an expression(add comment by me)
  558. 'header'=>'Amount',
  559. 'name'=>'getparent',
  560. 'value'=>'@$data[premium]',
  561. ), */
  562. array( // display 'create_time' using an expression
  563. 'header'=>'YTD',
  564. 'name'=>'getparent',
  565. 'value'=>'@$data[YTD]',
  566. ),
  567. array( // display 'create_time' using an expression(add new collom by me)
  568. 'header'=>'Amount',
  569. 'name'=>'getparent',
  570. 'value'=>'@$data[premium]',
  571. ),
  572. /*array( // display 'create_time' using an expression
  573. 'header'=>'Detalis',
  574. 'name'=>'total',
  575. 'value'=>function($data){
  576. echo '<a href="'.Yii::app()->createUrl('dashboard/ViewFancyboxData',array('id'=>$data['Id'])).'" class="viewNav class-link" style="color:#134BDB; text-decoration:none;cursor:pointer;">View</a>';
  577. },
  578. ),*/
  579. ),
  580. ));
  581. }
  582. ?>
  583. </div>
  584. <div class="fullcontainer">
  585. <p>Announcements</p>
  586. <table cellspacing="0" cellpadding="0" class="items">
  587. <?php
  588. if(count(@$notifications)>0 && isset($notifications) && !empty($notifications)){
  589. foreach(@$notifications as $key2=>$value2){
  590. if($notifications[$key2]['type']=='TEXT'){
  591. if($notifications[$key2]['description']!=''){
  592. $data=str_replace("<p>","",$notifications[$key2]['description']);
  593. $data=str_replace("</p>","",$data);
  594. ?>
  595. <tr>
  596. <td><?php echo stripslashes(@$data); ?></td>
  597. </tr>
  598. <?php } }
  599. }
  600. } else {
  601. ?>
  602. <tr>
  603. <td>No Data Available</td>
  604. </tr>
  605. <?php
  606. }
  607. ?>
  608. </table>
  609. </div>
  610. <div class="fullcontainer">
  611. <p>leads count</p>
  612. <table cellspacing="0" cellpadding="0" class="items">
  613. <tr>
  614. <td><?php echo CHtml::ajaxLink('Source Wise', Yii::app()->createUrl( 'dashboard/showLeadCount' ),
  615. array( // ajaxOptions
  616. 'type' => 'POST',
  617. ),
  618. array( //htmlOptions
  619. 'href' => Yii::app()->createUrl( 'dashboard/showLeadCount' ),
  620. 'class'=>'tstf',
  621. )
  622. ); ?>
  623. </td>
  624. <td><?php echo CHtml::ajaxLink('Disposition Wise', Yii::app()->createUrl( 'dashboard/showleadcountdisp' ),
  625. array( // ajaxOptions
  626. 'type' => 'POST',
  627. ),
  628. array( //htmlOptions
  629. 'href' => Yii::app()->createUrl( 'dashboard/showleadcountdisp' ),
  630. 'class'=>'tstf',
  631. )
  632. ); ?></td>
  633. </tr>
  634. </table>
  635. </div>
  636. </div>
  637. <?php $this->endWidget(); ?>
  638. <div class="cl"></div>
  639. </div>