本文整理匯總了PHP中Images::getUsedStorage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Images::getUsedStorage方法的具體用法?PHP Images::getUsedStorage怎麽用?PHP Images::getUsedStorage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Images
的用法示例。
在下文中一共展示了Images::getUsedStorage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getSummarySettings
/**
* Returns array of summarized settings for current client
* @return array Tier_Name,Users_Count, Projects_Count, Storage_Count, Base_Fee, Additional_Users,Additional_Projects,Additional_Storage,Additional_Fee
*/
public static function getSummarySettings($client_id) {
$result = array();
$i= 0;
$limiter ='';
$client_id = $client_id ? $client_id :Yii::app()->user->clientID;
$css = ClientServiceSettings::model()->findByPk($client_id);
$result['Tiers_Str'] = $css->Service_Level_ID;
$tiers_array = explode(',',$result['Tiers_Str']);
foreach ($tiers_array as $id) {
$settings = ServiceLevelSettings::model()->findByPk($id);
if ($i != 0) {$limiter = ', ';}
if ($settings->Service_Level_ID == 1) {
$w9_exist =true;
$w9_price = $settings->Base_Fee;
$result['levels_checksum']+=1;
}
if ($settings->Service_Level_ID == 2) {
$result['levels_checksum']+=5;
}
if ($settings->Service_Level_ID == 3) {
$result['levels_checksum']+=10;
}if ($settings->Service_Level_ID == 4) {
$result['levels_checksum']+=20;
}
$result['Tier_Name'] .= $limiter.$settings->Tier_Name;
$i++;
}
$add_users_price = $settings->Additional_User_Fee;
$add_projects_price = $settings->Additional_Project_Fee;
$add_storage_price = $settings->Additional_Storage_Fee;
$result['Base_Fee'] = ClientServiceSettings::CalculateBaseFee($tiers_array);
$result['Users_Count'] = $settings->Users_Count;
$result['Projects_Count'] = $settings->Projects_Count;
$result['Storage_Count'] = $settings->Storage_Count;
$result['Additional_Users'] =$css->Additional_Users;
$result['Additional_Projects'] =$css->Additional_Projects;
$result['Additional_Storage'] =$css->Additional_Storage;
$result['Storage_Index'] = ServiceLevelSettings::getStorageIndexByValue($css->Additional_Storage);
$result['Additional_Fee'] = $add_users_price * $css->Additional_Users + $add_projects_price*($css->Additional_Projects) + $add_storage_price* ($result['Storage_Index']);
//$result['Additional_Storage'] =$settings-> Additional_Storage;
$users = UsersClientList::model()->findAllByAttributes(array(
'Client_ID'=>$client_id
));
$result['Used_Users'] =count($users);
$result['Used_Projects'] = Projects::clientProjectUsage();
$result['Used_Storage'] = ceil(Images::getUsedStorage($client_id));
return $result;
}
示例2: number_format
//'class'=>'txtfield',
'min'=>$summary_sl_settings['Used_Projects'],
'max'=>ServiceLevelSettings::MAX_PROJECTS,
'value'=>$total_projects,
'data-value'=>$total_projects
)); ?>
</div>
<div class="row">
<? $used_space = number_format(Images::getUsedStorage(Yii::app()->user->clientID),2);?>
<label for="service_add_storage_input">
<span class="red">*</span> Additional Storage <br/> (used <?=$used_space; ?> of <?=$client_service_settings->Additional_Storage + $summary_sl_settings['Storage_Count']?> GB allowed )
$<?=$serviceLevels[0]->Additional_Storage_Fee;?>
</label>
<?php
$total_storage = $client_service_settings->Additional_Storage + $summary_sl_settings['Storage_Count'];
//$total_storage = 10;
//min value calculation
$min_storage = ceil($used_space);
//$min_storage = ceil(4);
?>
<input type="text" id="input_for_storage_spin" style="display: none;" data-min-value="<?=$min_storage?>" data-value="<?=$total_storage?>" data-usedstorage="<?=number_format(Images::getUsedStorage(Yii::app()->user->clientID),2)?>" value="0" >
</div>
</div>
<div class="center">
<br/><br/>
<button id="add_service_submit" class="not_active_button" style="margin: 10px;">Submit</button>
</div>
<?php $this->endWidget();?>
</div>
示例3: checkUploadPossibility
public static function checkUploadPossibility($filesize) {
$availableStorage = ClientServiceSettings::getAvailableStorage(Yii::app()->user->clientID);
$usedStorage = Images::getUsedStorage(Yii::app()->user->clientID);
if (($usedStorage + $filesize/(1024*1024*1024)) > $availableStorage) {
return false;
} else {
return true;
}
}