PageRenderTime 28ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 1ms

/lms_debug/protected/views/leads/searchLeads_old.php

https://gitlab.com/badelal143/lms_debug
PHP | 2194 lines | 1947 code | 197 blank | 50 comment | 35 complexity | 6a0525c75466b2e8dfb3c24de999ce7e MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, LGPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl;?>/js/customInput.jquery.js"></script>
  2. <script type="text/javascript">
  3. // Run the script on DOM ready:
  4. $(function(){
  5. $("#check_all").click(function () {
  6. var thisCheck = $(this);
  7. if (thisCheck.is(':checked')){
  8. $(".cbox").prop("checked",true);
  9. $(".sel").each(function(){
  10. $(this).addClass("checked");
  11. });
  12. } else {
  13. $(".cbox").prop("checked",false);
  14. $(".sel").each(function(){
  15. $(this).removeClass("checked");
  16. });
  17. }
  18. });
  19. $('.cbox').customInput();
  20. });
  21. </script>
  22. <?php
  23. $relationManager = $_SESSION['relationalManager'];
  24. $managerMemberId = implode(",",array_unique(@$relationManager));
  25. $moduleAccessArray=$this->init();
  26. if(@$moduleAccessArray['read']=='no' or empty($moduleAccessArray['read'])){
  27. $this->redirect(array('dashboard/dashboard'));
  28. }
  29. if(Yii::app()->session->get('type')=='superadmin'){
  30. $agentcodedisplay = 1;
  31. $agentnamedisplay = 1;
  32. } else {
  33. $displayrolewisecolumnlist =Yii::app()->db->createCommand("select `displayagentname`,`displayagentcode` from rolewiseleadspermission where roleId=".Yii::app()->session->get('roleId')."")->queryAll();
  34. if(count(@$displayrolewisecolumnlist) > 0){
  35. $agentcodedisplay = (@$displayrolewisecolumnlist[0]['displayagentname']=='YES')?1:0;
  36. $agentnamedisplay = (@$displayrolewisecolumnlist[0]['displayagentcode']=='YES')?1:0;
  37. } else {
  38. $agentcodedisplay = 0;
  39. $agentnamedisplay = 0;
  40. }
  41. }
  42. Yii::import('zii.widgets.grid.CGridColumn');
  43. class CounterColumn extends CGridColumn
  44. {
  45. private $i = 1;
  46. public function init()
  47. {
  48. $pager=$this->grid->dataProvider->pagination;
  49. $this->i=0;
  50. }
  51. public function renderDataCellContent($row, $data) // $row number is ignored
  52. {
  53. $this->i++;
  54. echo "<label class='sel' for='check_".$this->i."'>&nbsp;</label>";
  55. }
  56. }
  57. $cond='';
  58. if(isset($_REQUEST['id'])){
  59. $cond =" leadId ='".@$_REQUEST['id']."' ";
  60. }
  61. $type=@$_REQUEST['type'];
  62. if($type=="fresh" && isset($_REQUEST['id'])){
  63. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  64. 'condition'=>@$cond,
  65. 'order'=>'leadId desc',
  66. )));
  67. $alert="Are you sure you want to Change Status? ";
  68. $this->widget('zii.widgets.grid.CGridView', array(
  69. 'id'=>'acc-payment-recei-grid',
  70. 'htmlOptions' => array('class' => 'items'),
  71. 'ajaxUpdate'=>true,
  72. 'enableSorting'=>true,
  73. 'enablePagination' => true,
  74. 'pager' => array(
  75. 'header' => '&nbsp;',
  76. 'prevPageLabel' => 'Prev',
  77. 'nextPageLabel' => 'Next',
  78. ),
  79. 'dataProvider'=>$dataProvider->search(),
  80. 'columns'=>array(
  81. array(
  82. 'header'=>'',
  83. 'class'=>'CounterColumn',
  84. 'htmlOptions'=>array('class'=>'hideheader'),
  85. ),
  86. array(
  87. 'class' => 'CCheckBoxColumn',
  88. 'id'=>'check',
  89. 'selectableRows' => 2,
  90. 'checkBoxHtmlOptions' => array(
  91. 'id'=>'check',
  92. 'name' => 'userids[]',
  93. 'class'=>'cbox',
  94. 'rel'=>'cbox',
  95. ),
  96. 'value'=>'@$data->leadId',
  97. 'htmlOptions'=>array('width'=>'10px'),
  98. ),
  99. array( // display 'create_time' using an expression
  100. 'header'=>'Mobile',
  101. 'name'=>'mobile',
  102. 'type'=>'raw',
  103. 'value'=>'CHtml::link($data->mobile,Yii::app()->createUrl("leads/create_lead",array("leadId"=>$data->leadId)))',
  104. 'sortable'=>TRUE,
  105. ),
  106. array( // display 'create_time' using an expression
  107. 'header'=>'Name',
  108. 'name'=>'name',
  109. 'value'=>'@$data->name',
  110. 'sortable'=>TRUE,
  111. ),
  112. array( // display 'create_time' using an expression
  113. 'header'=>'Email',
  114. 'name'=>'email',
  115. 'value'=>'@$data->email',
  116. 'sortable'=>TRUE,
  117. ),
  118. array( // display 'create_time' using an expression
  119. 'header'=>'Date &amp; Time',
  120. 'name'=>'createdOn',
  121. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  122. 'sortable'=>TRUE,
  123. ),
  124. array( // display 'create_time' using an expression
  125. 'header'=>'Source',
  126. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  127. 'name'=>'leadSourceDetails_search',
  128. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  129. 'sortable'=>TRUE,
  130. ),
  131. array( // display 'create_time' using an expression
  132. 'header'=>'AgentId',
  133. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  134. 'name'=>'ws_agentid',
  135. 'value'=>'@$data->ws_agentid',
  136. 'sortable'=>TRUE,
  137. ),
  138. array( // display 'create_time' using an expression
  139. 'header'=>'Lead Stage',
  140. 'name'=>'leadStageDetails',
  141. 'value'=>'@$data->leadStageDetails->leadStage',
  142. 'sortable'=>TRUE,
  143. ),
  144. array( // display a column with "view", "update" and "delete" buttons
  145. 'header'=>'Action',
  146. 'htmlOptions'=>array('style'=>'width: 80px',),
  147. 'class'=>'CButtonColumn',
  148. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  149. <tr>
  150. <td>'.($moduleAccessArray['write']=="yes"?"{edit}":"NA").'</td>
  151. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  152. </tr>
  153. </table>',
  154. 'buttons' => array(
  155. 'Active' =>array(
  156. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("leadId"=>$data->leadId,"status"=>$data->status))',
  157. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  158. 'label' => @$model->status,
  159. 'visible'=>'($data->status=="Active")?1:0',
  160. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  161. 'confirm' => $alert,
  162. 'class' => 'grid_action_set1',
  163. 'click'=>"function(){
  164. $.ajax({
  165. type:'POST',
  166. url:'',
  167. success:function(data) {
  168. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  169. $.fn.yiiGridView.update('user-grid');
  170. }
  171. })
  172. return false;
  173. }
  174. ",
  175. ),
  176. ),
  177. 'Deactive' =>array(
  178. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  179. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  180. 'label' => @$model->status,
  181. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  182. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  183. 'confirm' => $alert,
  184. 'class' => 'grid_action_set1',
  185. 'click'=>"function(){
  186. $.ajax({
  187. type:'POST',
  188. url:'',
  189. success:function(data) {
  190. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  191. $.fn.yiiGridView.update('user-grid');
  192. }
  193. })
  194. return false;
  195. }
  196. ",
  197. ),
  198. ),
  199. 'edit' => array(
  200. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  201. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  202. ),
  203. 'view' => array(
  204. 'url' => 'Yii::app()->controller->createUrl("leads/create_lead",array("leadId"=>$data->leadId))',
  205. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  206. ),
  207. ),
  208. ),
  209. ),
  210. ));
  211. ?>
  212. <label class="sel" for="check_all"></label>
  213. <label class="sel" for="check_0"></label>
  214. <?php exit;
  215. } if($type=="new" && isset($_REQUEST['id'])){
  216. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  217. 'condition'=>@$cond,
  218. 'order'=>'leadId desc',
  219. )));
  220. $alert="Are you sure you want to Change Status? ";
  221. $this->widget('zii.widgets.grid.CGridView', array(
  222. 'id'=>'acc-payment-recei-grid',
  223. 'htmlOptions' => array('class' => 'items'),
  224. 'ajaxUpdate'=>false,
  225. 'enableSorting'=>true,
  226. 'enablePagination' => true,
  227. 'pager' => array(
  228. 'header' => '&nbsp;',
  229. 'prevPageLabel' => 'Prev',
  230. 'nextPageLabel' => 'Next',
  231. ),
  232. 'dataProvider'=>$dataProvider,
  233. 'columns'=>array(
  234. array(
  235. 'header'=>'',
  236. 'class'=>'CounterColumn',
  237. 'htmlOptions'=>array('class'=>'hideheader'),
  238. ),
  239. array(
  240. 'class' => 'CCheckBoxColumn',
  241. 'id'=>'check',
  242. 'selectableRows' => 2,
  243. 'checkBoxHtmlOptions' => array(
  244. 'id'=>'check',
  245. 'name' => 'userids[]',
  246. 'class'=>'cbox',
  247. 'rel'=>'cbox',
  248. ),
  249. 'value'=>'@$data->leadId',
  250. 'htmlOptions'=>array('width'=>'10px'),
  251. ),
  252. array( // display 'create_time' using an expression
  253. 'header'=>'Mobile',
  254. 'name'=>'mobile',
  255. 'type'=>'raw',
  256. 'value'=>'CHtml::link($data->mobile,Yii::app()->createUrl("leads/create_lead",array("leadId"=>$data->leadId)))',
  257. 'sortable'=>TRUE,
  258. ),
  259. array( // display 'create_time' using an expression
  260. 'header'=>'Name',
  261. 'name'=>'name',
  262. 'value'=>'@$data->name',
  263. 'sortable'=>TRUE,
  264. ),
  265. array( // display 'create_time' using an expression
  266. 'header'=>'Email',
  267. 'name'=>'email',
  268. 'value'=>'@$data->email',
  269. 'sortable'=>TRUE,
  270. ),
  271. array( // display 'create_time' using an expression
  272. 'header'=>'Date &amp; Time',
  273. 'name'=>'createdOn',
  274. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  275. 'sortable'=>TRUE,
  276. ),
  277. array( // display 'create_time' using an expression
  278. 'header'=>'Source',
  279. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  280. 'name'=>'leadSourceDetails_search',
  281. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  282. 'sortable'=>TRUE,
  283. ),
  284. array( // display 'create_time' using an expression
  285. 'header'=>'AgentId',
  286. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  287. 'name'=>'ws_agentid',
  288. 'value'=>'@$data->ws_agentid',
  289. 'sortable'=>TRUE,
  290. ),
  291. array( // display 'create_time' using an expression
  292. 'header'=>'Lead Stage',
  293. 'name'=>'leadStageDetails',
  294. 'value'=>'@$data->leadStageDetails->leadStage',
  295. 'sortable'=>TRUE,
  296. ),
  297. array( // display 'create_time' using an expression
  298. 'name'=>'Owner',
  299. 'value'=>'@$data->ownerDetails->firstName." ".$data->ownerDetails->lastName',
  300. 'sortable'=>TRUE,
  301. ),
  302. array( // display a column with "view", "update" and "delete" buttons
  303. 'header'=>'Action',
  304. 'htmlOptions'=>array('style'=>'width: 80px',),
  305. 'class'=>'CButtonColumn',
  306. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  307. <tr>
  308. <td>'.($moduleAccessArray['write']=="yes"?"{edit}":"NA").'</td>
  309. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  310. </tr>
  311. </table>',
  312. 'buttons' => array(
  313. 'Active' =>array(
  314. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("leadId"=>$data->leadId,"status"=>$data->status))',
  315. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  316. 'label' => @$model->status,
  317. 'visible'=>'($data->status=="Active")?1:0',
  318. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  319. 'confirm' => $alert,
  320. 'class' => 'grid_action_set1',
  321. 'click'=>"function(){
  322. $.ajax({
  323. type:'POST',
  324. url:'',
  325. success:function(data) {
  326. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  327. $.fn.yiiGridView.update('user-grid');
  328. }
  329. })
  330. return false;
  331. }
  332. ",
  333. ),
  334. ),
  335. 'Deactive' =>array(
  336. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  337. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  338. 'label' => @$model->status,
  339. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  340. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  341. 'confirm' => $alert,
  342. 'class' => 'grid_action_set1',
  343. 'click'=>"function(){
  344. $.ajax({
  345. type:'POST',
  346. url:'',
  347. success:function(data) {
  348. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  349. $.fn.yiiGridView.update('user-grid');
  350. }
  351. })
  352. return false;
  353. }
  354. ",
  355. ),
  356. ),
  357. 'edit' => array(
  358. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  359. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  360. ),
  361. 'view' => array(
  362. 'url' => 'Yii::app()->controller->createUrl("leads/create_lead",array("leadId"=>$data->leadId))',
  363. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  364. ),
  365. ),
  366. ),
  367. ),
  368. ));
  369. ?>
  370. <label class="sel" for="check_all"></label>
  371. <label class="sel" for="check_0"></label>
  372. <?php exit;
  373. } if($type=="duplicate" && isset($_REQUEST['id'])){
  374. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  375. 'condition'=>@$cond,
  376. 'order'=>'leadId DESC',
  377. )));
  378. $alert="Are you sure you want to Change Status? ";
  379. $this->widget('zii.widgets.grid.CGridView', array(
  380. 'id'=>'acc-payment-recei-grid',
  381. 'htmlOptions' => array('class' => 'items'),
  382. 'ajaxUpdate'=>false,
  383. 'enableSorting'=>true,
  384. 'enablePagination' => true,
  385. 'pager' => array(
  386. 'header' => '&nbsp;',
  387. 'prevPageLabel' => 'Prev',
  388. 'nextPageLabel' => 'Next',
  389. ),
  390. 'dataProvider'=>$dataProvider,
  391. 'columns'=>array(
  392. array(
  393. 'header'=>'',
  394. 'class'=>'CounterColumn',
  395. 'htmlOptions'=>array('class'=>'hideheader'),
  396. ),
  397. array(
  398. 'class' => 'CCheckBoxColumn',
  399. 'id'=>'check',
  400. 'selectableRows' => 2,
  401. 'checkBoxHtmlOptions' => array(
  402. 'id'=>'check',
  403. 'name' => 'userids[]',
  404. 'class'=>'cbox',
  405. 'rel'=>'cbox',
  406. ),
  407. 'value'=>'@$data->leadId',
  408. 'htmlOptions'=>array('width'=>'10px'),
  409. ),
  410. array( // display 'create_time' using an expression
  411. 'name'=>'Mobile',
  412. 'value'=>'@$data->mobile',
  413. 'sortable'=>TRUE,
  414. ),
  415. array( // display 'create_time' using an expression
  416. 'name'=>'Name',
  417. 'value'=>'@$data->name',
  418. 'sortable'=>TRUE,
  419. ),
  420. array( // display 'create_time' using an expression
  421. 'name'=>'Email',
  422. 'value'=>'@$data->email',
  423. 'sortable'=>TRUE,
  424. ),
  425. array( // display 'create_time' using an expression
  426. 'name'=>'Date &amp; Time',
  427. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  428. 'sortable'=>TRUE,
  429. ),
  430. array( // display 'create_time' using an expression
  431. 'name'=>'Source',
  432. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  433. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  434. 'sortable'=>TRUE,
  435. ),
  436. array( // display 'create_time' using an expression
  437. 'header'=>'AgentId',
  438. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  439. 'name'=>'ws_agentid',
  440. 'value' => function($data){
  441. leadsController::getAgentIds($data->ws_agentid,$data->mobile);
  442. },
  443. 'type'=>'html',
  444. 'sortable'=>TRUE,
  445. ),
  446. /* array( // display 'create_time' using an expression
  447. 'header'=>'AgentId',
  448. 'name'=>'ws_agentid',
  449. 'value'=>'@$data->ws_agentid',
  450. 'sortable'=>TRUE,
  451. ),*/
  452. array( // display 'create_time' using an expression
  453. 'header'=>'Lead Stage',
  454. 'name'=>'leadStageDetails',
  455. 'value'=>'@$data->leadStageDetails->leadStage',
  456. 'sortable'=>TRUE,
  457. ),
  458. array( // display 'create_time' using an expression
  459. 'name'=>'History',
  460. 'type'=>'raw',
  461. 'value'=>'CHtml::link("Details",array("leads/leads_details","leadId"=>$data->duplicateLeadId))',
  462. 'sortable'=>TRUE,
  463. ),
  464. array( // display a column with "view", "update" and "delete" buttons<td class="nobg">'.($moduleAccessArray['delete']=="yes"?"{Active}{Deactive}":"NA").'</td>
  465. 'header'=>'Action',
  466. 'htmlOptions'=>array('style'=>'width: 80px',),
  467. 'class'=>'CButtonColumn',
  468. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  469. <tr>
  470. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  471. </tr>
  472. </table>',
  473. 'buttons' => array(
  474. 'Active' =>array(
  475. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status))',
  476. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  477. 'visible'=>'($data->status=="Active")?1:0',
  478. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  479. 'confirm' => $alert,
  480. 'class' => 'grid_action_set1',
  481. 'click'=>"function(){
  482. $.ajax({
  483. type:'POST',
  484. url:'',
  485. success:function(data) {
  486. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  487. $.fn.yiiGridView.update('user-grid');
  488. }
  489. })
  490. return false;
  491. }
  492. ",
  493. ),
  494. ),
  495. 'Deactive' =>array(
  496. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  497. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  498. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  499. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  500. 'confirm' => $alert,
  501. 'class' => 'grid_action_set1',
  502. 'click'=>"function(){
  503. $.ajax({
  504. type:'POST',
  505. url:'',
  506. success:function(data) {
  507. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  508. $.fn.yiiGridView.update('user-grid');
  509. }
  510. })
  511. return false;
  512. }
  513. ",
  514. ),
  515. ),
  516. 'edit' => array(
  517. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  518. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  519. ),
  520. 'view' => array(
  521. 'url' => 'Yii::app()->controller->createUrl("leads/create_lead",array("leadId"=>$data->leadId))',
  522. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  523. ),
  524. ),
  525. ),
  526. ),
  527. ));
  528. ?>
  529. <label class="sel" for="check_all"></label>
  530. <label class="sel" for="check_0"></label>
  531. <?php exit;
  532. } if($type=="dupforday" && isset($_REQUEST['id'])){
  533. $today12PMs = mktime(0,0,0,date("m"),date("d"),date("Y"));
  534. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  535. 'condition'=>"`createdOn` > '".@$today12PMs."' AND ".@$cond,
  536. 'order'=>'leadId DESC',
  537. )));
  538. $alert="Are you sure you want to Change Status? ";
  539. $this->widget('zii.widgets.grid.CGridView', array(
  540. 'id'=>'acc-payment-recei-grid',
  541. 'htmlOptions' => array('class' => 'items'),
  542. 'ajaxUpdate'=>false,
  543. 'enableSorting'=>true,
  544. 'enablePagination' => true,
  545. 'pager' => array(
  546. 'header' => '&nbsp;',
  547. 'prevPageLabel' => 'Prev',
  548. 'nextPageLabel' => 'Next',
  549. ),
  550. 'dataProvider'=>$dataProvider,
  551. 'columns'=>array(
  552. array(
  553. 'header'=>'',
  554. 'class'=>'CounterColumn',
  555. 'htmlOptions'=>array('class'=>'hideheader'),
  556. ),
  557. array(
  558. 'class' => 'CCheckBoxColumn',
  559. 'id'=>'check',
  560. 'selectableRows' => 2,
  561. 'checkBoxHtmlOptions' => array(
  562. 'id'=>'check',
  563. 'name' => 'userids[]',
  564. 'class'=>'cbox',
  565. 'rel'=>'cbox',
  566. ),
  567. 'value'=>'@$data->leadId',
  568. 'htmlOptions'=>array('width'=>'10px'),
  569. ),
  570. array( // display 'create_time' using an expression
  571. 'name'=>'Mobile',
  572. 'value'=>'@$data->mobile',
  573. 'sortable'=>TRUE,
  574. ),
  575. array( // display 'create_time' using an expression
  576. 'name'=>'Name',
  577. 'value'=>'@$data->name',
  578. 'sortable'=>TRUE,
  579. ),
  580. array( // display 'create_time' using an expression
  581. 'name'=>'Email',
  582. 'value'=>'@$data->email',
  583. 'sortable'=>TRUE,
  584. ),
  585. array( // display 'create_time' using an expression
  586. 'name'=>'Date &amp; Time',
  587. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  588. 'sortable'=>TRUE,
  589. ),
  590. array( // display 'create_time' using an expression
  591. 'name'=>'Source',
  592. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  593. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  594. 'sortable'=>TRUE,
  595. ),
  596. array( // display 'create_time' using an expression
  597. 'header'=>'AgentId',
  598. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  599. 'name'=>'ws_agentid',
  600. 'value' => function($data){
  601. leadsController::getAgentIds($data->ws_agentid,$data->mobile);
  602. },
  603. 'type'=>'html',
  604. 'sortable'=>TRUE,
  605. ),
  606. /* array( // display 'create_time' using an expression
  607. 'header'=>'AgentId',
  608. 'name'=>'ws_agentid',
  609. 'value'=>'@$data->ws_agentid',
  610. 'sortable'=>TRUE,
  611. ), */
  612. array( // display 'create_time' using an expression
  613. 'header'=>'Lead Stage',
  614. 'name'=>'leadStageDetails',
  615. 'value'=>'@$data->leadStageDetails->leadStage',
  616. 'sortable'=>TRUE,
  617. ),
  618. array( // display 'create_time' using an expression
  619. 'header'=>'Status',
  620. 'name'=>'Status',
  621. 'value'=>'@$data->status',
  622. 'sortable'=>TRUE,
  623. ),
  624. array( // display 'create_time' using an expression
  625. 'name'=>'Owner',
  626. 'type'=>'html',
  627. 'value'=>'(@$data->currentAllocatedId==@$data->createdBy)?@$data->ownerDetails->firstName." ".$data->ownerDetails->lastName."(C)":(@$data->ownerDetails->firstName?@$data->ownerDetails->firstName." ".$data->ownerDetails->lastName:"NA")',
  628. 'sortable'=>TRUE,
  629. ),
  630. array( // display 'create_time' using an expression
  631. 'name'=>'History',
  632. 'type'=>'raw',
  633. 'value'=>'CHtml::link("Details",array("leads/leads_details","leadId"=>$data->duplicateLeadId))',
  634. 'sortable'=>TRUE,
  635. ),
  636. array( // display a column with "view", "update" and "delete" buttons<td class="nobg">'.($moduleAccessArray['delete']=="yes"?"{Active}{Deactive}":"NA").'</td>
  637. 'header'=>'Action',
  638. 'htmlOptions'=>array('style'=>'width: 80px',),
  639. 'class'=>'CButtonColumn',
  640. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  641. <tr>
  642. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  643. </tr>
  644. </table>',
  645. 'buttons' => array(
  646. 'Active' =>array(
  647. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status))',
  648. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  649. 'visible'=>'($data->status=="Active")?1:0',
  650. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  651. 'confirm' => $alert,
  652. 'class' => 'grid_action_set1',
  653. 'click'=>"function(){
  654. $.ajax({
  655. type:'POST',
  656. url:'',
  657. success:function(data) {
  658. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  659. $.fn.yiiGridView.update('user-grid');
  660. }
  661. })
  662. return false;
  663. }
  664. ",
  665. ),
  666. ),
  667. 'Deactive' =>array(
  668. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  669. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  670. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  671. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  672. 'confirm' => $alert,
  673. 'class' => 'grid_action_set1',
  674. 'click'=>"function(){
  675. $.ajax({
  676. type:'POST',
  677. url:'',
  678. success:function(data) {
  679. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  680. $.fn.yiiGridView.update('user-grid');
  681. }
  682. })
  683. return false;
  684. }
  685. ",
  686. ),
  687. ),
  688. 'edit' => array(
  689. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  690. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  691. ),
  692. 'view' => array(
  693. 'url' => 'Yii::app()->controller->createUrl("leads/create_lead",array("leadId"=>$data->leadId))',
  694. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  695. ),
  696. ),
  697. ),
  698. ),
  699. ));
  700. ?>
  701. <label class="sel" for="check_all"></label>
  702. <label class="sel" for="check_0"></label>
  703. <?php exit;
  704. } if($type=="junk" && isset($_REQUEST['id'])){
  705. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  706. 'condition'=>@$cond,
  707. 'order'=>'leadId DESC',
  708. )));
  709. $alert="Are you sure you want to Change Status? ";
  710. $this->widget('zii.widgets.grid.CGridView', array(
  711. 'id'=>'acc-payment-recei-grid',
  712. 'htmlOptions' => array('class' => 'items'),
  713. 'ajaxUpdate'=>false,
  714. 'enableSorting'=>true,
  715. 'enablePagination' => true,
  716. 'pager' => array(
  717. 'header' => '&nbsp;',
  718. 'prevPageLabel' => 'Prev',
  719. 'nextPageLabel' => 'Next',
  720. ),
  721. 'dataProvider'=>$dataProvider,
  722. 'columns'=>array(
  723. array(
  724. 'header'=>'',
  725. 'class'=>'CounterColumn',
  726. 'htmlOptions'=>array('class'=>'hideheader'),
  727. ),
  728. array(
  729. 'class' => 'CCheckBoxColumn',
  730. 'id'=>'check',
  731. 'selectableRows' => 2,
  732. 'checkBoxHtmlOptions' => array(
  733. 'id'=>'check',
  734. 'name' => 'userids[]',
  735. 'class'=>'cbox',
  736. 'rel'=>'cbox',
  737. ),
  738. 'value'=>'@$data->leadId',
  739. 'htmlOptions'=>array('width'=>'10px'),
  740. ),
  741. array( // display 'create_time' using an expression
  742. 'name'=>'Mobile',
  743. 'value'=>'@$data->mobile',
  744. 'sortable'=>TRUE,
  745. ),
  746. array( // display 'create_time' using an expression
  747. 'name'=>'Name',
  748. 'value'=>'@$data->name',
  749. 'sortable'=>TRUE,
  750. ),
  751. array( // display 'create_time' using an expression
  752. 'name'=>'Email',
  753. 'value'=>'@$data->email',
  754. 'sortable'=>TRUE,
  755. ),
  756. array( // display 'create_time' using an expression
  757. 'name'=>'Date &amp; Time',
  758. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  759. 'sortable'=>TRUE,
  760. ),
  761. array( // display 'create_time' using an expression
  762. 'name'=>'Source',
  763. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  764. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  765. 'sortable'=>TRUE,
  766. ),
  767. array( // display 'create_time' using an expression
  768. 'header'=>'AgentId',
  769. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  770. 'name'=>'ws_agentid',
  771. 'value' => function($data){
  772. leadsController::getAgentIds($data->ws_agentid,$data->mobile);
  773. },
  774. 'type'=>'html',
  775. 'sortable'=>TRUE,
  776. ),
  777. /* array( // display 'create_time' using an expression
  778. 'header'=>'AgentId',
  779. 'name'=>'ws_agentid',
  780. 'value'=>'@$data->ws_agentid',
  781. 'sortable'=>TRUE,
  782. ), */
  783. array( // display 'create_time' using an expression
  784. 'header'=>'Lead Stage',
  785. 'name'=>'leadStageDetails',
  786. 'value'=>'@$data->leadStageDetails->leadStage',
  787. 'sortable'=>TRUE,
  788. ),
  789. array( // display a column with "view", "update" and "delete" buttons<td class="nobg">'.($moduleAccessArray['delete']=="yes"?"{Active}{Deactive}":"NA").'</td>
  790. 'header'=>'Action',
  791. 'htmlOptions'=>array('style'=>'width: 80px',),
  792. 'class'=>'CButtonColumn',
  793. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  794. <tr>
  795. <td>'.($moduleAccessArray['write']=="yes"?"{edit}":"NA").'</td>
  796. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  797. </tr>
  798. </table>',
  799. 'buttons' => array(
  800. 'Active' =>array(
  801. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status))',
  802. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  803. 'visible'=>'($data->status=="Active")?1:0',
  804. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  805. 'confirm' => $alert,
  806. 'class' => 'grid_action_set1',
  807. 'click'=>"function(){
  808. $.ajax({
  809. type:'POST',
  810. url:'',
  811. success:function(data) {
  812. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  813. $.fn.yiiGridView.update('user-grid');
  814. }
  815. })
  816. return false;
  817. }
  818. ",
  819. ),
  820. ),
  821. 'Deactive' =>array(
  822. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  823. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  824. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  825. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  826. 'confirm' => $alert,
  827. 'class' => 'grid_action_set1',
  828. 'click'=>"function(){
  829. $.ajax({
  830. type:'POST',
  831. url:'',
  832. success:function(data) {
  833. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  834. $.fn.yiiGridView.update('user-grid');
  835. }
  836. })
  837. return false;
  838. }
  839. ",
  840. ),
  841. ),
  842. 'edit' => array(
  843. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  844. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  845. ),
  846. 'view' => array(
  847. 'url' => 'Yii::app()->controller->createUrl("leads/create_lead",array("leadId"=>$data->leadId))',
  848. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  849. ),
  850. ),
  851. ),
  852. ),
  853. ));
  854. ?>
  855. <label class="sel" for="check_all"></label>
  856. <label class="sel" for="check_0"></label>
  857. <?php exit;
  858. } if($type=="allocated" && isset($_REQUEST['id'])){
  859. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  860. 'condition'=>@$cond,
  861. 'order'=>'leadId DESC',
  862. )));
  863. $alert="Are you sure you want to Change Status? ";
  864. $this->widget('zii.widgets.grid.CGridView', array(
  865. 'id'=>'acc-payment-recei-grid',
  866. 'htmlOptions' => array('class' => 'items'),
  867. 'ajaxUpdate'=>false,
  868. 'enableSorting'=>true,
  869. 'enablePagination' => true,
  870. 'pager' => array(
  871. 'header' => '&nbsp;',
  872. 'prevPageLabel' => 'Prev',
  873. 'nextPageLabel' => 'Next',
  874. ),
  875. 'dataProvider'=>$dataProvider,
  876. 'columns'=>array(
  877. array(
  878. 'header'=>'',
  879. 'class'=>'CounterColumn',
  880. 'htmlOptions'=>array('class'=>'hideheader'),
  881. ),
  882. array(
  883. 'class' => 'CCheckBoxColumn',
  884. 'id'=>'check',
  885. 'selectableRows' => 2,
  886. 'checkBoxHtmlOptions' => array(
  887. 'id'=>'check',
  888. 'name' => 'userids[]',
  889. 'class'=>'cbox',
  890. 'rel'=>'cbox',
  891. ),
  892. 'value'=>'@$data->leadId',
  893. 'htmlOptions'=>array('width'=>'10px'),
  894. ),
  895. array( // display 'create_time' using an expression
  896. 'header'=>'Mobile',
  897. 'name'=>'mobile',
  898. 'value'=>'@$data->mobile',
  899. 'sortable'=>TRUE,
  900. ),
  901. array( // display 'create_time' using an expression
  902. 'header'=>'Name',
  903. 'name'=>'name',
  904. 'value'=>'@$data->name',
  905. 'sortable'=>TRUE,
  906. ),
  907. array( // display 'create_time' using an expression
  908. 'header'=>'Email',
  909. 'name'=>'email',
  910. 'value'=>'@$data->email',
  911. 'sortable'=>TRUE,
  912. ),
  913. array( // display 'create_time' using an expression
  914. 'header'=>'Date &amp; Time',
  915. 'name'=>'createdOn',
  916. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  917. 'sortable'=>TRUE,
  918. ),
  919. array( // display 'create_time' using an expression
  920. 'header'=>'Source',
  921. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  922. 'name'=>'leadSourceDetails_search',
  923. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  924. 'sortable'=>TRUE,
  925. ),
  926. array( // display 'create_time' using an expression
  927. 'header'=>'AgentId',
  928. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  929. 'name'=>'ws_agentid',
  930. 'value' => function($data){
  931. leadsController::getAgentIds($data->ws_agentid,$data->mobile);
  932. },
  933. 'type'=>'html',
  934. 'sortable'=>TRUE,
  935. ),
  936. /* array( // display 'create_time' using an expression
  937. 'header'=>'AgentId',
  938. 'name'=>'ws_agentid',
  939. 'value'=>'@$data->ws_agentid',
  940. 'sortable'=>TRUE,
  941. ), */
  942. array( // display 'create_time' using an expression
  943. 'header'=>'Lead Stage',
  944. 'name'=>'leadStageDetails',
  945. 'value'=>'@$data->leadStageDetails->leadStage',
  946. 'sortable'=>TRUE,
  947. ),
  948. array( // display 'create_time' using an expression
  949. 'name'=>'Status',
  950. 'value'=>'@$data->leadStatusDetails->leadStatus',
  951. 'sortable'=>TRUE,
  952. ),
  953. array( // display 'create_time' using an expression
  954. 'name'=>'Owner',
  955. 'value'=>'@$data->ownerDetails->firstName." ".$data->ownerDetails->lastName',
  956. 'sortable'=>TRUE,
  957. ),
  958. array( // display a column with "view", "update" and "delete" buttons <td>'.($moduleAccessArray['delete']=="yes"?"{Active}{Deactive}":"NA").'</td>
  959. 'header'=>'Action',
  960. 'htmlOptions'=>array('style'=>'width: 80px',),
  961. 'class'=>'CButtonColumn',
  962. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  963. <tr>
  964. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  965. </tr>
  966. </table>',
  967. 'buttons' => array(
  968. 'Active' =>array(
  969. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status))',
  970. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  971. 'visible'=>'($data->status=="Active")?1:0',
  972. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  973. 'confirm' => $alert,
  974. 'class' => 'grid_action_set1',
  975. 'click'=>"function(){
  976. $.ajax({
  977. type:'POST',
  978. url:'',
  979. success:function(data) {
  980. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  981. $.fn.yiiGridView.update('user-grid');
  982. }
  983. })
  984. return false;
  985. }
  986. ",
  987. ),
  988. ),
  989. 'Deactive' =>array(
  990. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  991. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  992. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  993. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  994. 'confirm' => $alert,
  995. 'class' => 'grid_action_set1',
  996. 'click'=>"function(){
  997. $.ajax({
  998. type:'POST',
  999. url:'',
  1000. success:function(data) {
  1001. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  1002. $.fn.yiiGridView.update('user-grid');
  1003. }
  1004. })
  1005. return false;
  1006. }
  1007. ",
  1008. ),
  1009. ),
  1010. 'edit' => array(
  1011. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  1012. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/edit_icon.png',
  1013. ),
  1014. 'view' => array(
  1015. 'url' => 'Yii::app()->controller->createUrl("leads/leads_details",array("leadId"=>$data->leadId))',
  1016. 'imageUrl'=>Yii::app()->request->baseUrl.'/images/view_icon.png',
  1017. ),
  1018. ),
  1019. ),
  1020. ),
  1021. ));
  1022. ?>
  1023. <label class="sel" for="check_all"></label>
  1024. <label class="sel" for="check_0"></label>
  1025. <?php exit;
  1026. } if($type=="cip" && isset($_REQUEST['id'])){
  1027. $dataProvider=new CActiveDataProvider('Lead', array('criteria'=>array(
  1028. 'condition'=>@$cond,
  1029. 'order'=>'leadId DESC',
  1030. )));
  1031. $alert="Are you sure you want to Change Status? ";
  1032. $this->widget('zii.widgets.grid.CGridView', array(
  1033. 'id'=>'acc-payment-recei-grid',
  1034. 'htmlOptions' => array('class' => 'items'),
  1035. 'ajaxUpdate'=>false,
  1036. 'enableSorting'=>true,
  1037. 'enablePagination' => true,
  1038. 'pager' => array(
  1039. 'header' => '&nbsp;',
  1040. 'prevPageLabel' => 'Prev',
  1041. 'nextPageLabel' => 'Next',
  1042. ),
  1043. 'dataProvider'=>$dataProvider,
  1044. 'columns'=>array(
  1045. array(
  1046. 'header'=>'',
  1047. 'class'=>'CounterColumn',
  1048. 'htmlOptions'=>array('class'=>'hideheader'),
  1049. ),
  1050. array(
  1051. 'class' => 'CCheckBoxColumn',
  1052. 'id'=>'check',
  1053. 'selectableRows' => 2,
  1054. 'checkBoxHtmlOptions' => array(
  1055. 'id'=>'check',
  1056. 'name' => 'userids[]',
  1057. 'class'=>'cbox',
  1058. 'rel'=>'cbox',
  1059. ),
  1060. 'value'=>'@$data->leadId',
  1061. 'htmlOptions'=>array('width'=>'10px'),
  1062. ),
  1063. array( // display 'create_time' using an expression
  1064. 'name'=>'Mobile',
  1065. 'value'=>'@$data->mobile',
  1066. 'sortable'=>TRUE,
  1067. ),
  1068. array( // display 'create_time' using an expression
  1069. 'name'=>'Name',
  1070. 'value'=>'@$data->name',
  1071. 'sortable'=>TRUE,
  1072. ),
  1073. array( // display 'create_time' using an expression
  1074. 'name'=>'Email',
  1075. 'value'=>'@$data->email',
  1076. 'sortable'=>TRUE,
  1077. ),
  1078. array( // display 'create_time' using an expression
  1079. 'name'=>'Date &amp; Time',
  1080. 'value'=>'date("d/m/y h:i A",@$data->createdOn)',
  1081. 'sortable'=>TRUE,
  1082. ),
  1083. array( // display 'create_time' using an expression
  1084. 'name'=>'Source',
  1085. 'visible'=>$agentcodedisplay?$agentcodedisplay:0,
  1086. 'value'=>'@$data->leadSourceDetails->leadSourceTitle',
  1087. 'sortable'=>TRUE,
  1088. ),
  1089. array( // display 'create_time' using an expression
  1090. 'header'=>'AgentId',
  1091. 'visible'=>$agentnamedisplay?$agentnamedisplay:0,
  1092. 'name'=>'ws_agentid',
  1093. 'value' => function($data){
  1094. leadsController::getAgentIds($data->ws_agentid,$data->mobile);
  1095. },
  1096. 'type'=>'html',
  1097. 'sortable'=>TRUE,
  1098. ),
  1099. /* array( // display 'create_time' using an expression
  1100. 'header'=>'AgentId',
  1101. 'name'=>'ws_agentid',
  1102. 'value'=>'@$data->ws_agentid',
  1103. 'sortable'=>TRUE,
  1104. ),*/
  1105. array( // display 'create_time' using an expression
  1106. 'header'=>'Lead Stage',
  1107. 'name'=>'leadStageDetails',
  1108. 'value'=>'@$data->leadStageDetails->leadStage',
  1109. 'sortable'=>TRUE,
  1110. ),
  1111. array( // display 'create_time' using an expression
  1112. 'header'=>'Status',
  1113. 'name'=>'Status',
  1114. 'value'=>'@$data->status',
  1115. 'sortable'=>TRUE,
  1116. ),
  1117. array( // display 'create_time' using an expression
  1118. 'header'=>'Owner',
  1119. 'name'=>'leadSourceDetails_search',
  1120. 'value'=>'@$data->ownerDetails->firstName?@$data->ownerDetails->firstName." ".$data->ownerDetails->lastName:"NA"',
  1121. 'sortable'=>TRUE,
  1122. ),
  1123. array( // display a column with "view", "update" and "delete" buttons<td class="nobg">'.($moduleAccessArray['delete']=="yes"?"{Active}{Deactive}":"NA").'</td>
  1124. 'header'=>'Action',
  1125. 'htmlOptions'=>array('style'=>'width: 80px',),
  1126. 'class'=>'CButtonColumn',
  1127. 'template' => '<table border="0" cellspacing="0" cellpadding="0" class="iconitem">
  1128. <tr>
  1129. <td class="nobg">'.($moduleAccessArray['write']=="yes"?"{view}":"NA").'</td>
  1130. </tr>
  1131. </table>',
  1132. 'buttons' => array(
  1133. 'Active' =>array(
  1134. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status))',
  1135. 'imageUrl'=>Yii::app()->baseUrl.'/images/active.png',
  1136. 'visible'=>'($data->status=="Active")?1:0',
  1137. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  1138. 'confirm' => $alert,
  1139. 'class' => 'grid_action_set1',
  1140. 'click'=>"function(){
  1141. $.ajax({
  1142. type:'POST',
  1143. url:'',
  1144. success:function(data) {
  1145. $('#AjFlash').html(data.status).fadeIn().animate({opacity: 1.0}, 3000).fadeOut('slow');
  1146. $.fn.yiiGridView.update('user-grid');
  1147. }
  1148. })
  1149. return false;
  1150. }
  1151. ",
  1152. ),
  1153. ),
  1154. 'Deactive' =>array(
  1155. 'url' => 'Yii::app()->controller->createUrl("ChangeRoleStatus",array("id"=>$data->leadId,"status"=>$data->status?$data->status:"Inactive"))',
  1156. 'imageUrl'=>Yii::app()->baseUrl.'/images/dactivate_icon.png',
  1157. 'visible'=>'($data->status=="Inactive" or $data->status=="")?1:0',
  1158. 'options' => array(// this is the 'html' array but we specify the 'ajax' element
  1159. 'confirm' => $alert,
  1160. 'class' => 'grid_action_set1',
  1161. 'click'=>"function(){
  1162. $.ajax({
  1163. type:'POST',
  1164. url:'',
  1165. success:function(data) {

Large files files are truncated, but you can click here to view the full file