'; function lookupCurrencies(){ $this->focus = new Currency(); $this->list = $this->focus->get_full_list('name'); $this->focus->retrieve('-99'); if(is_array($this->list)){ $this->list = array_merge(Array($this->focus), $this->list); }else{ $this->list = Array($this->focus); } } function handleAdd(){ global $current_user; if($current_user->is_admin){ if(isset($_POST['edit']) && $_POST['edit'] == 'true' && isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['conversion_rate']) && !empty($_POST['conversion_rate']) && isset($_POST['symbol']) && !empty($_POST['symbol'])){ $currency = new Currency(); if(isset($_POST['record']) && !empty($_POST['record'])){ $currency->retrieve($_POST['record']); } $currency->name = $_POST['name']; $currency->status = $_POST['status']; $currency->symbol = $_POST['symbol']; $currency->iso4217 = $_POST['iso4217']; $currency->conversion_rate = unformat_number($_POST['conversion_rate']); $currency->save(); $this->focus = $currency; } } } function handleUpdate(){ global $current_user; if($current_user->is_admin){ if(isset($_POST['id']) && !empty($_POST['id'])&&isset($_POST['name']) && !empty($_POST['name']) && isset($_POST['rate']) && !empty($_POST['rate']) && isset($_POST['symbol']) && !empty($_POST['symbol'])){ $ids = $_POST['id']; $names= $_POST['name']; $symbols= $_POST['symbol']; $rates = $_POST['rate']; $isos = $_POST['iso']; $size = sizeof($ids); if($size != sizeof($names)|| $size != sizeof($isos) || $size != sizeof($symbols) || $size != sizeof($rates)){ return; } $temp = new Currency(); for($i = 0; $i < $size; $i++){ $temp->id = $ids[$i]; $temp->name = $names[$i]; $temp->symbol = $symbols[$i]; $temp->iso4217 = $isos[$i]; $temp->conversion_rate = $rates[$i]; $temp->save(); } }} } function getJavascript(){ // wp: DO NOT add formatting and unformatting numbers in here, add them prior to calling these to avoid double calling // of unformat number return $this->javascript . <<