public function redis() { $this->cache = new Redis(); $this->cache->connect(DOO::conf()->redis[0], DOO::conf()->redis[1]); if ($this->cache) { return $this->cache; } else { return false; } }
public function __construct() { parent::__construct(); Doo::loadClass('UserSession'); $this->usession = new UserSession(); $username = $this->usession->uget('username'); if (!$username) { header('Location:' . DOO::conf()->SUBFOLDER . 'login'); } $this->init(); }
<form class="navbar-search pull-right" action="<?php echo DOO::conf()->SUBFOLDER . $data['filter_action']; ?> " method="POST" > <select name="table_row" onchange="this.form.submit();" style="width:80px;margin-left:10px;"> <?php foreach ($data['table_row_option'] as $dr) { ?> <option value="<?php echo $dr; ?> " <?php echo $data['limit'] == $dr ? "selected" : ""; ?> ><?php echo $dr; ?> </option> <?php } ?> </select> </form>
function redirectit() { header('Location:' . DOO::conf()->SUBFOLDER); }
</td> </tr> <tr> <td>Voucher Code</td> <td><?php $voucher_list = $data['dbapi']->get_voucher_code($cv['user_id']); foreach ($voucher_list as $rs) { /* $orderInfo = array(); if($rs['validate']=='1'){ $orderInfo = $data['dbapi']->get_user_order_by_transaction_id($rs['transaction_id'],$rs['order_type']); } */ $vUsed = $data['dbapi']->get_used_voucher_code($cv['user_id'], $rs['code']); $usedTime = date("d-m-Y", strtotime($rs['expire_time'])); if ($vUsed['created_time']) { $usedTime = date("d-m-Y", strtotime($vUsed['created_time'])); } echo $rs['code'] . ' - Puchased at ' . date("d-m-Y", strtotime($rs['create_time'])) . ' ' . ($rs['validate'] == '1' || $vUsed['created_time'] ? 'Used at ' . $usedTime : 'Not used') . '<br/>'; } ?> </td> </tr> </table> </content> <div class="clear"></div> <div style="text-align:right"> <a href="<?php echo DOO::conf()->SUBFOLDER; ?> ">Back to list</a> </div> </div>
/** * 实例化redis * @return void */ public function getObjRedis() { if (!self::$_redis) { self::$_redis = new Redis(); self::$_redis->connect(DOO::conf()->redis[0], DOO::conf()->redis[1]); //'127.0.0.1','6379' } }
protected function init() { /* $this->regional = false; */ if ($this->username == 'dcs_timur') { /* $this->regional = "14','15','16','17"; */ $_REQUEST['userProvider'] = 1; } if ($this->username == 'dcs_barat') { /* $this->regional = "11','12','13"; */ $_REQUEST['userProvider'] = 1; } if (isset($_POST['table_row'])) { $this->usession->uset('table_row_option', $_POST['table_row']); } $rows_data = $this->usession->uget('table_row_option'); if (!$this->username) { header('Location:' . DOO::conf()->SUBFOLDER . 'login'); } $dbapi = $this->dbapi; $data['limit'] = 20; if ($rows_data) { $data['limit'] = $rows_data; } $gpage = $_GET['page'] - 1; if ($_REQUEST['print'] == 'excel') { set_time_limit(0); ini_set('memory_limit', '512M'); $data['limit'] = 99999999; unset($gpage); } $gord = $_GET['ord']; $gsearch = trim(addslashes($_REQUEST['search'])); $gdtform = addslashes($_GET['dtform']); $gdtto = addslashes($_GET['dtto']); if (!$gdtform) { $gdtform = date("m/d/Y", strtotime("-1 month")); } if (!$gdtto) { $gdtto = date("m/d/Y"); } $data['gdtto'] = $gdtto; $data['gdtform'] = $gdtform; if (isset($gpage) && $gpage >= 0) { $start = $gpage * $data['limit']; } $start_date = date("Y-m-d", strtotime($gdtform)) . ' 00:00:00'; $end_date = date("Y-m-d", strtotime($gdtto)) . ' 23:59:59'; /* if(!$start_date) $start_date = date("Y-m-d",strtotime("-1 month")); if(!$end_date) $end_date = date("Y-m-d"); */ if ($_GET['ascd'] == '0') { $ordby = "DESC"; } switch ($gord) { case 'user': $ord = 'user_id'; break; case 'movie': $ord = 'content_name '; break; case 'bill': $ord = 'pay_business_account '; break; case 'created': $ord = 'create_time '; break; default: $ord = 'create_time '; $ordby = "DESC"; break; } if ($ord) { $ord .= $ordby; } $this->ord = $ord; $this->start_date = $start_date; $this->end_date = $end_date; $this->start = $start; $this->limit = $data['limit']; $this->gdtto = $data['gdtto']; $this->gdtform = $data['gdtform']; $this->gsearch = $gsearch; }