public function actionLogs() { $this->activeMenu = self::MENU_SUBS_LOGS; $this->hasPrivilege(Acl::ACTION_VIEW); $this->pageTitle = Lang::t('SUBS_LOGS'); $searchModel = new Subs(); $subs_model_class_name = $searchModel->getClassName(); $this->render('logs', array('model' => $searchModel)); }
public function testBehaviors() { if (!class_exists('Mongo')) { $this->markTestSkipped("Mongo class does not exist, test skipped"); return; } Phalcon\DI::reset(); $di = new Phalcon\DI(); $di->set('mongo', function () { $mongo = new MongoClient(); return $mongo->phalcon_test; }); $di->set('collectionManager', function () { return new Phalcon\Mvc\Collection\Manager(); }); //Timestampable $subscriber = new Subs(); $subscriber->email = '*****@*****.**'; $subscriber->status = 'I'; $this->assertTrue($subscriber->save()); $this->assertEquals(preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $subscriber->created_at), 1); //Softdelete $subscriber = Subs::findFirst(); $this->assertTrue($subscriber->delete()); $this->assertEquals($subscriber->status, 'D'); $this->assertEquals(Subs::count(), 1); }
</div> </div> </div> </div> <?php $this->endWidget(); ?> <div class="col-md-12"> <?php if (Yii::app()->request->isPostRequest) { $searchModel = new Subs(); $subs_model_class_name = $searchModel->getClassName(); $client = $_POST[$subs_model_class_name]['msisdn']; $cond = "msisdn = '{$client}'"; $searchModel = Subs::model()->searchModel(array(), 100, 'sync_date', $cond); if (!empty($searchModel)) { $service_id = $searchModel->serviceid; $search = " dest_msisdn = '{$client}' "; $textSmses = Incoming::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'timestamp', $search); $terminations = Terminations::model()->searchModel(array(), $this->settings[Constants::KEY_PAGINATION], 'timestamp', $search); $this->renderPartial('repos', array('searchModel' => $searchModel, 'textSmses' => $textSmses, 'terminations' => $terminations)); } } ?> </div>