public function actiongenerateExcel() { header("Content-Type: application/vnd.ms-excel;"); header("Content-Disposition: attachment; filename=export.xls"); header("Pragma: no-cache"); header("Expires: 0"); $countModel = Lead::Model()->findAllByAttributes(array(), array('order' => 'id desc', 'limit' => Yii::app()->Session['datepick'])); ?> <table> <tr> <th>S.NO</th> <th>Lead Title</th> <th>Use</th> <th>Retailer Website</th> <th>Tenant Rep</th> <th>First Name</th> <th>Last Name</th> <th>Phone No</th> <th>Email Id</th> <th>Title</th> <th>High End</th> <th>Min Size</th> <th>Max Size</th> <th>State</th> <th>Message</th> <th>Broker</th> <th>Broker First Name</th> <th>Broker Last Name</th> <th>Broker Phone Number</th> <th>Broker Cell Number</th> <th>Broker email</th> <th>Broker Company</th> <th>Broker territory</th> </tr> <?php $k = 1; foreach ($countModel as $data) { ?> <tr> <td><?php echo $k++; ?> </td> <td><?php echo $data['retail']; ?> </td> <td><?php echo $data['uses']; ?> </td> <td><?php echo $data['retailer_webiste']; ?> </td> <td><?php echo $data['tenant _rep']; ?> </td> <td><?php echo $data['first_name']; ?> </td> <td><?php echo $data['last_name']; ?> </td> <td><?php echo $data['phone_1']; ?> </td> <td><?php echo $data['email_id']; ?> </td> <td><?php echo $data['title']; ?> </td> <td><?php echo $data['high_end']; ?> </td> <td><?php echo $data['min_size']; ?> </td> <td><?php echo $data['max_size']; ?> </td> <td><?php echo $data['state']; ?> </td> <td><?php echo $data['message']; ?> </td> <td><?php echo $data['repersented_by_broker']; ?> </td> <td><?php echo $data['broker_firstname']; ?> </td> <td><?php echo $data['broker_lastname']; ?> </td> <td><?php echo $data['broker_phone_no']; ?> </td> <td><?php echo $data['broker_cell_no']; ?> </td> <td><?php echo $data['broker_email']; ?> </td> <td><?php echo $data['broker_company']; ?> </td> <td><?php echo $data['broker_territory']; ?> </td> </tr> <?php } ?> </table> <?php exit; }
<option value="100">100</option> <option value="200">200</option> <option value="300">300</option> <option value="400">400</option> <option value="500">500</option> <option value="1000">1000</option> </select> <input type="submit" class="main-but" name="Filter" value="filter"> </form> <?php if (isset($_POST['Filter']) == 'filter') { Yii::app()->Session['datepick'] = $_POST['limit']; $lead = Lead::Model()->findAllByAttributes(array(), array('order' => 'id desc', 'limit' => Yii::app()->Session['datepick'])); } else { $lead = Lead::Model()->findAll(); } ?> <span class="excel"> <a href="<?php echo Yii::app()->baseurl; ?> /lead/generateExcel"><span style="color: #333333;font-size:17px;font-weight:bold;font: bold 11px Arial;background-color: #EEEEEE;padding: 2px 6px 2px 6px;border-top: 1px solid #CCCCCC;border-right: 1px solid #333333;border-bottom: 1px solid #333333;border-left: 1px solid #CCCCCC;">Save as Excel</span></a></span> <table class="tab"> <tr> <th>S.NO</th> <th>Name</th> <th>First Name</th>
"> <input type="text" readonly="true" maxlength="255" size="22" value="<?php echo $sas['email_id']; ?> "></li> </div> <?php } ?> <?php $_Lead = Lead::Model()->findAllByAttributes(array('status' => 4)); ?> <?php foreach ($_Lead as $_da) { ?> <li title=<?php echo $_da['id']; ?> > <div class="min-hd"><?php echo strtoupper($_da['retail']); ?> </a></div> <input type="text" readonly="true" maxlength="255" size="22" value="<?php