本文整理汇总了PHP中Accounts类的典型用法代码示例。如果您正苦于以下问题:PHP Accounts类的具体用法?PHP Accounts怎么用?PHP Accounts使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Accounts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildDocumentModel
function buildDocumentModel()
{
global $app_strings;
try {
$model = parent::buildDocumentModel();
$this->generateEntityModel($this->focus, 'Potentials', 'potential_', $model);
$entity = new Accounts();
if ($this->focusColumnValue('related_to')) {
$entity->retrieve_entity_info($this->focusColumnValue('related_to'), 'Accounts');
}
$this->generateEntityModel($entity, 'Accounts', 'account_', $model);
$entity = new Contacts();
if ($this->focusColumnValue('contact_id')) {
$entity->retrieve_entity_info($this->focusColumnValue('contact_id'), 'Contacts');
}
$this->generateEntityModel($entity, 'Contacts', 'contact_', $model);
$this->generateUi10Models($model);
$this->generateRelatedListModels($model);
$model->set('potential_no', $this->focusColumnValue('potential_no'));
$model->set('potential_owner', getUserFullName($this->focusColumnValue('assigned_user_id')));
return $model;
} catch (Exception $e) {
echo '<meta charset="utf-8" />';
if ($e->getMessage() == $app_strings['LBL_RECORD_DELETE']) {
echo $app_strings['LBL_RECORD_INCORRECT'];
echo '<br><br>';
} else {
echo $e->getMessage();
echo '<br><br>';
}
return null;
}
}
示例2: cancelSessions
public function cancelSessions()
{
unset($_SESSION['accountID']);
unset($_SESSION['toID']);
$accounts = new Accounts();
$accounts->userID = $_SESSION['userID'];
$accountIDs = $accounts->getAccountIDs();
foreach ($accountIDs as $aID) {
unset($_SESSION['transferSelectedAccount' . $aID]);
}
$accountPayees = new AccountPayees();
$accountPayees->userID = $_SESSION['userID'];
$toIDs = $accountPayees->getToIDs();
foreach ($toIDs as $tID) {
unset($_SESSION['transferSelectedAccountPayee' . $tID]);
}
if (isset($_SESSION['transferAmount'])) {
unset($_SESSION['transferAmount']);
}
if (isset($_SESSION['transferDescription'])) {
unset($_SESSION['transferDescription']);
}
if (isset($_SESSION['transferRemitter'])) {
unset($_SESSION['transferRemitter']);
}
if (isset($_SESSION['transferDate'])) {
unset($_SESSION['transferDate']);
}
}
示例3: create
function create($name, $description = '')
{
$roomId = $this->db->insert('rooms', array('name' => $name, 'description' => $description, 'activity' => 0, 'locked' => 0, 'guest' => 0, 'deleted' => 0));
// admin always has access
$accounts = new Accounts();
$admin = $accounts->getAdmin();
$this->db->insert('user_permissions', array('room' => $roomId, 'user' => $admin['id']));
}
示例4: setAccountSelected
public function setAccountSelected($accountID)
{
$accounts = new Accounts();
$accountIDs = $accounts->getAccountIDs();
foreach ($accountIDs as $aID) {
unset($_SESSION['paySelectedAccount' . $aID]);
}
$_SESSION['paySelectedAccount' . $accountID] = 'selected="selected"';
}
示例5: setAccountSelected
public function setAccountSelected($accountID)
{
$accounts = new Accounts();
$accounts->userID = $_SESSION['userID'];
$accountIDs = $accounts->getAccountIDs();
foreach ($accountIDs as $aID) {
unset($_SESSION['transferSelectedAccount' . $aID]);
}
$_SESSION['transferSelectedAccount' . $accountID] = 'selected="selected"';
}
示例6: getNetBalance
public function getNetBalance()
{
$accounts = new Accounts();
$accounts->userID = $_SESSION['userID'];
$nb = number_format($accounts->getNetBalance(), 2);
if ($nb >= 0) {
$nb = $nb . ' CR';
} else {
$nb = $nb . ' DR';
}
return $nb;
}
示例7: assertAccountCreated
protected function assertAccountCreated()
{
$lead = Accounts::model()->findByAttributes(array('name' => 'testAccount'));
$this->assertTrue($lead !== null);
X2_TEST_DEBUG_LEVEL > 1 && println('account created');
return $lead;
}
示例8: calc
private function calc($account_type)
{
$criteria = new CDbCriteria();
$criteria->condition = "type = :type";
$criteria->params = array(':type' => $account_type);
$accounts = Accounts::model()->findAll($criteria);
$sum = 0;
$data = array();
$data[] = array("id" => '', 'name' => Acctype::model()->getName($account_type), 'neg' => '', 'pos' => '', 'sum' => '', 'id6111' => '');
$total = array("id" => '', 'name' => Yii::t("app", "Total"), 'neg' => 0, 'pos' => 0, 'sum' => 0, 'id6111' => '');
foreach ($accounts as $account) {
//echo $this->from_date.":00<br>";
$sum = $account->getTotal($this->from_date . ":00", $this->to_date . ":00");
$neg = $account->getNeg($this->from_date . ":00", $this->to_date . ":00");
$pos = $account->getPos($this->from_date . ":00", $this->to_date . ":00");
$total['sum'] += $sum;
$total['neg'] += $neg;
$total['pos'] += $pos;
if ($sum != 0 || $neg != 0 || $pos != 0) {
$data[] = array('id' => $account->id, 'name' => $account->name, 'neg' => $neg, 'pos' => $pos, 'sum' => $sum, 'id6111' => $account->id6111);
}
}
$data[] = $total;
return $data;
}
示例9: calc
private function calc($account_type)
{
$criteria = new CDbCriteria();
$criteria->condition = "type = :type";
$criteria->params = array(':type' => $account_type);
$accounts = Accounts::model()->findAll($criteria);
$sum = 0;
$data = array();
$stime = "00:00:01";
$etime = "23:59:59";
$from_date = "01/01/{$this->year} {$stime}";
$to_date = "31/12/{$this->year} {$etime}";
foreach ($accounts as $account) {
$sum = $account->getTotal($from_date, $to_date);
if ($sum != 0) {
$accounty = array('id' => $account->id, 'name' => $account->name, 'sum' => $sum, 'id6111' => $account->id6111);
for ($x = 1; $x <= 12; $x++) {
if ($x <= 9) {
$a = "0{$x}";
} else {
$a = $x;
}
$last = 31;
while (!checkdate($x, $last, $this->year)) {
$last--;
}
$accounty[$x] = $account->getTotal("01/{$a}/{$this->year} {$stime}", "{$last}/{$a}/{$this->year} {$etime}");
}
$data[] = $accounty;
}
}
return $data;
}
示例10: createAction
public function createAction()
{
$this->view->disable();
$status = "OK";
$params = json_decode(file_get_contents('php://input'));
$model = Accounts::findFirst("name='{$params->name}'");
if ($model == null) {
$model = new Accounts();
$model->group = $params->group;
$model->name = $params->name;
$model->email = $params->email;
$model->pm = $params->pm;
$model->save();
}
echo json_encode(array("status" => $status));
}
示例11: UpdateAccount
public function UpdateAccount()
{
$account = Accounts::model()->findByPk(Yii::app()->user->getAccountid());
$model = new TimezoneForm();
$model->timezone = $account->timezone_id;
$model->account_id = $account->account_id;
return $model;
}
示例12: loadModel
public function loadModel($id)
{
$model = Accounts::model()->visible()->with('role_groups')->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例13: getSrcTax
public function getSrcTax($id)
{
$model = Accounts::model()->findByPk($id);
if ($model === null) {
return false;
} else {
return $model->src_tax;
}
}
示例14: actionIndex
public function actionIndex()
{
Yii::import("application.models.*");
set_time_limit(0);
$accounts = Accounts::model()->findAll();
foreach ($accounts as $currentValue) {
$currentValue->checkWebsiteStatus();
}
}
示例15: masterAdmin
public static function masterAdmin()
{
$result = false;
$reader = Accounts::model()->findAll();
if (count($reader) > 0) {
$result = true;
}
return $result;
}