protected static function update() { global $current_user; $id = $_POST['id']; $url = isset($_POST['url']) ? $_POST['url'] : null; $name = isset($_POST['name']) ? $_POST['name'] : null; $tags = isset($_POST['tags']) ? explode(',', $_POST['tags']) : null; if ($url) { insert('UPDATE bookmark SET url="' . $url . '" WHERE id=' . $id); } if ($name) { insert('UPDATE bookmark SET name="' . $name . '" WHERE id=' . $id); } if ($tags) { $db_tags = select('SELECT id FROM tag INNER JOIN classification ON tag.id=classification.tag_id WHERE user_id=' . $current_user['id'] . ' AND bookmark_id=' . $id); foreach ($db_tags as $tag) { $index = array_search($tag['id'], $tags); if ($index) { unset($tags[$index]); } else { // $tag is in the db but not in tags so delete it from the db insert('DELETE FROM classification WHERE bookmark_id=' . $id . ' AND tag_id=' . $tag['id']); } } foreach ($tags as $tag) { insert('INSERT INTO classification (bookmark_id,tag_id) VALUES (' . $id . ',' . $tag . ')'); } } }
function questionsAvailable($courseId) { $options = []; $diff1 = []; $diff2 = []; $diff3 = []; $counter = []; $questions = select("SELECT id, difficulty FROM questions WHERE category_id ='{$courseId}'"); foreach ($questions as $question) { $options[] = select("SELECT id FROM options WHERE question_id =" . $question['id']); if ($question['difficulty'] == 1) { $diff1[] = $question['difficulty']; } if ($question['difficulty'] == 2) { $diff2[] = $question['difficulty']; } if ($question['difficulty'] == 3) { $diff3[] = $question['difficulty']; } } $numQuestions = count($questions); $numOptions = count($options) * 4; $counter[] = count($questions); $counter[] = count($options) * 4; $counter[] = count($diff1); $counter[] = count($diff2); $counter[] = count($diff3); return array($numQuestions, $numOptions); //return $counter; }
function changePassword($userId, $prevPass, $newPass1, $newPass2) { $msg = []; if (empty($prevPass) || empty($newPass1) || empty($newPass2)) { $msg[] = "All fields are required"; } else { // retrieve user previous password $password = select("SELECT password FROM users WHERE id =" . $userId)[0]; if ($password['password'] != md5($prevPass)) { $msg[] = " Incorrect current password"; } if ($newPass1 == $newPass2) { $passlength = strlen($newPass1); if (!($passlength >= 5 && $passlength <= 20)) { $msg[] = "New password characters out of required range( 5 - 20 )"; } } else { $msg[] = "New passwords do not match"; } if (count($msg) == 0) { // no errors $newPass1 = escape($newPass1); $password_hash = md5($newPass1); if (mysql_query("UPDATE users SET password = '******' WHERE id ='" . $userId . "'")) { $msg[] = "Password has been successfully updated"; } else { $msg[] = "Unable to save changes"; } } } return $msg; }
public function process() { AddRatingFieldToSchema::process(); $main = Product::getInstanceByID($this->request->get('id'), true); if ($main->parent->get()) { $main->parent->get()->load(); $var = $main->toArray(); $var['custom'] = $main->custom->get(); $this->request->set('variation', $var); $this->request->set('activeVariationID', $this->request->get('id')); $main = $main->parent->get(); $this->request->set('id', $main->getID()); $productArray = $main->toArray(); $handle = empty($productArray['URL']) ? $productArray['name_lang'] : $productArray['URL']; $this->request->set('producthandle', $handle); } ActiveRecord::clearPool(); $variations = $main->getRelatedRecordSet('Product', select()); $handle = $main->URL->get() ? $main->URL->get() : $main->getValueByLang('name', 'en'); foreach ($variations as $variation) { $variation->setValueByLang('name', 'en', $main->getValueByLang('name', 'en') . ' ' . $variation->sku->get()); $variation->URL->set($handle . ' ' . $variation->sku->get()); $variation->parent->set(null); } $variations->toArray(); }
function basicAPI($parameter) { header('Content-Type: application/json'); require '../php/config.php'; if (isset($_GET['src'])) { $records = array(); switch ($_GET['src']) { case 'chart': $records = select($mysqli, "SELECT {$parameter} AS name, count(*) AS data FROM toscana GROUP BY {$parameter}"); for ($i = 0; $i < count($records); $i++) { $records[$i]['data'] = array(intval($records[$i]['data'])); } break; case 'map': $raw_records = select($mysqli, "SELECT {$parameter} AS type, nome AS name, indirizzo AS address, lt, lg FROM toscana ORDER BY RAND() LIMIT 1000"); for ($i = 0; $i < count($raw_records); $i++) { $records[$raw_records[$i]['type']][] = $raw_records[$i]; } break; } return json_encode($records); } else { return json_encode(array('status' => 'error', 'details' => 'no src provided')); } }
function reason() { extract($_REQUEST); if (!isset($supid) || !is_numeric($supid)) { return select(); } $sql = "SELECT id, date, reason_id, amount FROM cubit.recon_balance_ct\n\t\t\tWHERE supid='{$supid}'\n\t\t\tORDER BY id DESC"; $balance_rslt = db_exec($sql) or errDie("Unable to retrieve balances."); $sql = "SELECT id, reason FROM cubit.recon_reasons ORDER BY reason ASC"; $reason_rslt = db_exec($sql) or errDie("Unable to retrieve reasons."); $balance_out = ""; while (list($bal_id, $date, $reason_id, $amount) = pg_fetch_array($balance_rslt)) { $reasons_sel = "\n\t\t<select name='oreason_id'>\n\t\t\t<option value='0'>[None]</option>"; pg_result_seek($reason_rslt, 0); while (list($id, $reason) = pg_fetch_array($reason_rslt)) { if ($reason_id == $id) { $sel = "selected='selected'"; } else { $sel = ""; } $reasons_sel .= "<option value='{$id}' {$sel}>{$reason}</option>"; } $reasons_sel .= "</select>"; $balance_out .= "\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>{$date}</td>\n\t\t\t<td>{$reasons_sel}</td>\n\t\t\t<td>\n\t\t\t\t<input type='text' name='amount[{$bal_id}]' value='{$amount}' size='8' />\n\t\t\t</td>\n\t\t\t<td><input type='checkbox' name='remove[{$bal_id}]' value='{$bal_id}' /></td>\n\t\t</tr>"; } pg_result_seek($reason_rslt, 0); $reason_sel = "\n\t<select name='nreason_id'>\n\t\t<option value='0'>[None]</option>"; while (list($id, $reason) = pg_fetch_array($reason_rslt)) { $reason_sel .= "<option value='{$id}'>{$reason}</option>"; } $reason_sel .= "</select>"; $OUTPUT = "\n\t<center>\n\t<h3>Add Balance According to Creditor</h3>\n\t<form method='post' action='" . SELF . "'>\n\t<input type='hidden' name='key' value='reason_update' />\n\t<input type='hidden' name='supid' value='{$supid}' />\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr>\n\t\t\t<th>Date</th>\n\t\t\t<th>Reason</th>\n\t\t\t<th>Amount</th>\n\t\t\t<th>Remove</th>\n\t\t</tr>\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>" . date("Y-m-d") . "</td>\n\t\t\t<td>{$reason_sel}</td>\n\t\t\t<td><input type='text' name='namount' size='8' /></td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t{$balance_out}\n\t</table>\n\t<input type='submit' value='Update' />\n\t</form>\n\t<table " . TMPL_tblDflts . ">\n\t\t<tr class='" . bg_class() . "'>\n\t\t\t<td>\n\t\t\t\t<a href='recon_statement_ct.php?key=display&supid={$supid}'\n\t\t\t\tstyle='font-size: 1.3em'>\n\t\t\t\t\tReturn to Statement\n\t\t\t\t</a>\n\t\t\t</td>\n\t\t</tr>\n\t</center>"; return $OUTPUT; }
function cls_games() { global $reglament, $tournament, $tour, $auth; if (!$tournament) { $this->tournament = 1; } else { $this->tournament = $tournament; } if (!$reglament) { $this->reglament = $this->maxreglament(); } else { $this->reglament = $reglament; } //$q=select("select ReglamentID,TournamentID from ut_reglaments where (ReglamentID='$this->reglament') order by Tour2 desc"); //$this->reglament=$q[ReglamentID]; $q = select("select DivisionID from ut_teams where TeamID='{$auth->team}'"); $this->division = $q[0]; $q = select("select SeasonID from ut_seasons where StartDate>0 order by Num desc limit 0,1"); $this->season = $q[0]; if (!$tour) { $this->tour = $this->maxtour(); } else { $this->tour = $tour; } }
function insert_data($db, $message) { #gather variables we'll need. $safe_title = $db->real_escape_string($message["title"]); $safe_ingredients = $db->real_escape_string($message["ingredients"]); $safe_instructions = $db->real_escape_string($message["instructions"]); $cat_id = "nothing"; #determine which cat_id(table column)to assign to the new recipe row. switch ($message["category"]) { case "meat": $cat_id = 4; break; case "veggies": $cat_id = 5; break; case "bread": $cat_id = 6; break; default: $db->close(); die("Invalid category value."); break; } #now let's use a prepared statement to use dynamic data in an INSERT INTO query. $sql = $db->prepare("INSERT INTO recipestbl VALUES(NULL,?,?,?,?)"); $sql->bind_param("sssi", $safe_title, $safe_ingredients, $safe_instructions, $cat_id); $sql->execute(); $recent_insert = $db->insert_id; select($db, $recent_insert); $sql->free_result(); }
protected function indexAction() { $this->view->title = 'Тестовый раздел'; $this->view->headers = array(array('title' => 'Тестовый раздел')); $testModel = new Admin_Model_Test(); /// Example mfa - выбор списка записей элементов $this->view->mfa = $testModel->mfa(select()->where(array('test_field' => '1test_f'))); /// Example mfo - выбор одного элемента из базы записей, необходимо обязательно указать название поля в селекте $this->view->mfo = $testModel->mfo(select('test_id')->where(array('test_field2' => '3test_f2'))); /// Example mfs - выбор одного элемента из базы записей, необходимо обязательно указать название поля в селекте $this->view->mfs = $testModel->mfs(select('test_field')->where(array('test_field2' => '4test_f2'))); /// Example mfm - выборка fetchMap /** @param $keyField - поле ключа * @param $valueField - поле значения * @param $sql - условие выборки * @param $count - количество * @param $keyPrintFormat - формат записи ключа * @return array['$keyField'] = $valueField */ $this->view->mfm = $testModel->mfm(select()->where()); /// выборка количества записей c условием $this->view->count = $testModel->count(select()->where()); /// Example save - сохранение или обновление записи // $testModel->save( select()->where() ); $this->render('test'); }
function first_schedule($tournament, $members, $numplayers) { global $stage, $id, $fights, $num; $id = $tournament; $q = select("select * from ft_tournaments where TournamentID='{$id}'"); if ($q[StatusID] != 0) { return 0; } if ($members + 1 != $numplayers) { return 0; } $r = select("select * from ft_stages where TournamentTypeID={$q['TournamentTypeID']} and Tour1=1 limit 0,1"); $res2 = runsql("select * from ft_tournament_members where TournamentID='{$id}' order by rand()"); for ($k = 1; $k <= $numplayers; $k++) { $r2 = mysql_fetch_array($res2); $users[$k] = $r2[UserID]; } if ($r[TypeID] == 0) { for ($k = 1; $k <= $numplayers; $k++) { runsql("update ft_tmp_agreements set UserID1='{$users[$k]}',\nLogin1=(select concat(if(GuildID>0 and GuildStatusID=1,concat('<img src=/images/gd_guilds/small/',GuildID,'.jpg border=0 align=absmiddle>','</a> '),''),'<a href=/users/',UserID,'/>',Login,'</a>') from ut_users where UserID='{$users[$k]}') \n where TournamentID='{$id}' and Tour=1 and Pair1='{$k}'"); runsql("update ft_tmp_agreements set UserID2='{$users[$k]}',\nLogin2=(select concat(if(GuildID>0 and GuildStatusID=1,concat('<img src=/images/gd_guilds/small/',GuildID,'.jpg border=0 align=absmiddle>','</a> '),''),'<a href=/users/',UserID,'/>',Login,'</a>') from ut_users where UserID='{$users[$k]}') \n where TournamentID='{$id}' and Tour=1 and Pair2='{$k}'"); } } else { for ($k = 1; $k <= $numplayers; $k++) { runsql("update ft_tmp_agreements set UserID1='{$users[$k]}',\nLogin1=(select concat(if(GuildID>0 and GuildStatusID=1,concat('<img src=/images/gd_guilds/small/',GuildID,'.jpg border=0 align=absmiddle>','</a> '),''),'<a href=/users/',UserID,'/>',Login,'</a>') from ut_users where UserID='{$users[$k]}') \n where TournamentID='{$id}' and Stage=1 and Pair1='{$k}'"); runsql("update ft_tmp_agreements set UserID2='{$users[$k]}',\nLogin2=(select concat(if(GuildID>0 and GuildStatusID=1,concat('<img src=/images/gd_guilds/small/',GuildID,'.jpg border=0 align=absmiddle>','</a> '),''),'<a href=/users/',UserID,'/>',Login,'</a>') from ut_users where UserID='{$users[$k]}') \n where TournamentID='{$id}' and Stage=1 and Pair2='{$k}'"); runsql("update ft_groups set UserID='{$users[$k]}',Login=(select concat(if(GuildID>0 and GuildStatusID=1,concat('<a href=/guilds/',GuildID,'><img src=/images/gd_guilds/small/',GuildID,'.jpg border=0 align=absmiddle>','</a> '),''),'<a href=/users/',UserID,'/>',Login,'</a>') from ut_users where UserID='{$users[$k]}') where TournamentID='{$id}' and Stage=1 and Pair='{$k}'"); } } runsql("delete from ft_agreements where TournamentID='{$id}'"); runsql("insert into ft_agreements\n(UserID1,UserID2,TypeID,ExtraGlad,LimitGlad,LimitSkl,Timeout,TournamentID,Stage,Tour,Fight,Pair,NumFights,StageTypeID,Approved,StatusID,Date,Login1,Login2) \n(select UserID1,UserID2,TypeID,ExtraGlad,LimitGlad,LimitSkl,Timeout,TournamentID ,Stage,Tour,Fight,Pair,NumFights,StageTypeID, 1,2,unix_timestamp(),Login1,Login2\nfrom ft_tmp_agreements where TournamentID='{$id}' and Tour=1 and Fight=1)"); runsql("update ft_tournaments set StatusID=1 where TournamentID='{$id}'"); }
public function process() { if (!$this->response instanceof ActionResponse) { return; } $products = $this->response->get('products'); $ids = array(); foreach ($products as $key => $product) { $ids[$product['ID']] = !empty($product['parentID']) ? $product['parentID'] : $product['ID']; } if (!$ids) { return; } $f = select(in(f('ProductImage.productID'), array_values($ids)), new LikeCond(f('ProductImage.title'), '%Virtual Mirror%')); $hasMirror = array(); foreach (ActiveRecordModel::getRecordSetArray('ProductImage', $f) as $mirror) { $hasMirror[$mirror['productID']] = true; } foreach ($ids as $realID => $parentID) { if (!empty($hasMirror[$parentID])) { $hasMirror[$realID] = true; } } foreach ($products as $key => $product) { if ($hasMirror[$product['ID']]) { $products[$key]['hasMirror'] = true; } } $this->response->set('hasMirror', $hasMirror); $this->response->set('products', $products); }
public function edit() { $newsletter = ActiveRecordModel::getInstanceById('NewsletterMessage', $this->request->get('id'), ActiveRecordModel::LOAD_DATA); $form = $this->getForm(); $form->setData($newsletter->toArray()); $form->set('users', 1); $form->set('subscribers', 1); $response = new ActionResponse('form', $form); $groupsArray = array_merge(ActiveRecord::getRecordSetArray('UserGroup', select()), array(array('ID' => null, 'name' => $this->translate('Customers')))); usort($groupsArray, array($this, 'sortGroups')); $response->set('groupsArray', $groupsArray); $newsletterArray = $newsletter->toArray(); $text = strlen($newsletterArray['text']); $html = strlen($newsletterArray['html']); if ($text && $html) { $newsletterArray['format'] = self::FORMAT_HTML_TEXT; } else { if ($text) { $newsletterArray['format'] = self::FORMAT_TEXT; } else { if ($html) { $newsletterArray['format'] = self::FORMAT_HTML; } } } $response->set('newsletter', $newsletterArray); $response->set('sentCount', $newsletter->getSentCount()); $response->set('recipientCount', $this->getRecipientCount($form->getData())); return $response; }
function GetImage($id) { $this->load->database(); $this->db - select('id', $id); $result = $this->db->get('cbir_index')->result_array(); return $result; }
function confirm(&$frm) { if ($frm->validate("confirm")) { return select($frm); } $frm->setkey("write"); return $frm->getfrm_input(); }
public static function getInstance(OrderedItem $item, ProductFile $file) { $instance = $item->getRelatedRecordSet('OrderedFile', select(eq('OrderedFile.productFileID', $file->getID())))->shift(); if (!$instance) { $instance = self::getNewInstance($item, $file); } return $instance; }
function scalar($sql, $conn) { $rows = select($sql, $conn); if (count($rows) > 0) { return array_shift($rows[0]); } else { return null; } }
protected function getSelectFilter() { if (!$this->selectFilter) { $this->selectFilter = select(eq('CustomerOrder.isFinalized', true), isnotnull('CustomerOrder.invoiceNumber')); $this->selectFilter->setOrder(f('CustomerOrder.dateCompleted'), 'DESC'); $this->selectFilter->setLimit(1); } return $this->selectFilter; }
function cached($comics_id) { $r = select("SELECT id from images where comics_id = " . $comics_id . " LIMIT 1"); if (empty($r)) { return false; } else { return true; } }
private function loadDefaultImage() { if (!isset($this->object['DefaultImage']) && isset($this->object['defaultImageID'])) { $defaultImageArray = ActiveRecordModel::getRecordSetArray('ProductImage', select(eq(f('ProductImage.ID'), $this->object['defaultImageID']))); if (count($defaultImageArray) > 0) { $this->object['DefaultImage'] = array_merge(current($defaultImageArray), array('Product' => ActiveRecord::getArrayData('Product-' . $this->object['ID']))); } } }
/** * Load entity * * @param array $entity * @param array $crit * @param array $opts * * @return array */ function flat_load(array $entity, array $crit = [], array $opts = []) : array { $stmt = db()->prepare(select($entity['attr']) . from($entity['tab']) . where($crit, $entity['attr'], $opts) . order($opts['order'] ?? [], $entity['attr']) . limit($opts['limit'] ?? 0, $opts['offset'] ?? 0)); $stmt->execute(); if (!empty($opts['one'])) { return $stmt->fetch() ?: []; } return $stmt->fetchAll(); }
function ui() { print "<form id='submitform' name='submitform' action='book_statistic_compareData.php' method='POST'>"; select(0); print "<br>\r\n"; select(1); print "<br>\r\n"; print "<button type='submit'>Compare books you have viewed in list.</button>\r\n"; print "</form>\r\n"; }
function afficherFormulaire($modification = false) { if ($modification) { $legende = 'Modifiez le contact client choisi puis validez'; } else { $legende = 'Nouveau contact client'; $_POST['ARCHIVE'] = 0; } return creerFieldset($legende, array(select('Client :', 'CLIENT', donner_liste('CLIENT', 'CLI'), 3, 3), input('Nom du contact* :', 'NOM', 3, 3, true), sautLigne(), input('Prénom du contact* :', 'PRENOM', 3, 3, true), input('E-mail du contact* :', 'EMAIL', 3, 3, true), sautLigne(), input('Portable du contact* :', 'PRT', 3, 3, true), select('Fonction du contact* :', 'FONCTION', array('' => '') + donner_liste('FONCTION', 'FCT'), 3, 3, false), sautLigne(), radio('Etat du contact :', 'ARCHIVE', 'Archivé', 'Encours', 3, 1, 2), sautLigne(), input('Commentaire :', 'COMMENTAIRE', 3, 3))); }
protected static function login() { $username = $_POST['username']; $password = pw_encode($_POST['password']); $result = select('SELECT * from user WHERE username = "******" AND password = "******"'); if (count($result) > 0) { $_SESSION['user'] = array('username' => $username, 'id' => $result[0]['id'], 'is_admin' => $result[0]['admin']); } }
public function testUpdate() { $res = $this->connection->execute($this->users->update()->values(array('password' => 'password'))); $this->assertEquals(2, $res->rowCount()); $res = $this->connection->execute(select(array($this->users->login, $this->users->password))); $this->assertEquals(array(array('login' => 'jdoe', 'password' => 'password'), array('login' => 'jane', 'password' => 'password')), $res->fetchAll()); $res = $this->connection->execute($this->users->update()->values(array('fullname' => 'John I. Doe jr.'))->where($this->users->fullname->like('John Doe'))); $this->assertEquals(1, $res->rowCount()); $res = $this->connection->execute(select(array($this->users->fullname))); $this->assertEquals(array(array('fullname' => 'John I. Doe jr.'), array('fullname' => 'Jane Doe')), $res->fetchAll()); }
public static function getThemeByProduct(Product $product) { $c = eq(__CLASS__ . '.productID', $product->getID()); $c->addOr(self::getCategoryCondition($product->getCategory())); $f = select($c); $f->setOrder(new ARExpressionHandle('CategoryPresentation.productID=' . $product->getID()), 'DESC'); self::setCategoryOrder($product->getCategory(), $f); // check if a theme is defined for this product particularly $set = ActiveRecordModel::getRecordSet(__CLASS__, $f, array('Category')); return self::getInheritedConfig($set); }
/** * affiche le formulaire correspondant à l'ajout ou à la modification d'un collaborateur interne * @param bool $modification */ function afficherFormulaire($modification = false) { if ($modification) { $legende = 'Modifiez le collaborateur externe choisi puis validez'; //$mailApsa = input('Email Apsaroke :', 'EMAILAPSA', 3, 3, true, 'hidden'); } else { $legende = 'Nouveau collaborateur externe'; //$mailApsa = input('Email Apsaroke :', 'EMAILAPSA', 3, 3, true, 'hidden'); } return creerFieldset($legende, array(select('Civilité :', 'CIVILITE', array('M.' => 'M.', 'Mme.' => 'Mme.', 'Mlle.' => 'Mlle.'), 3, 3), input('Prénom* :', 'PRENOM', 3, 3, true), sautLigne(), input('Nom* :', 'NOM', 3, 3, true), input('Nom de jeune fille :', 'NOMJEUNEFILLE', 3, 3), sautLigne(), radio('Etat :', 'ETAT', 'Actif', 'Inactif', 3, 1, 1), inputMNEMO('Mnémonique* :', 'MNEMONIC', 3, 3, 'offset1'), '<span id="txtHint"></span>', sautLigne(), input('Numéro de téléphone :', 'TEL', 3, 3), input('Numéro de téléphone portable* :', 'PRT', 3, 3, true), sautLigne(), input('E-mail :', 'EMAIL', 3, 3), select('Fournisseur* :', 'FOURNISSEUR', donner_liste('fournisseur', 'FOU'), 3, 3), sautLigne(), radio('Archiver :', 'ARCHIVE', 'Oui', 'Non ', 3, 1, 1))); }
protected function postProcessData() { $addresses = array(); foreach ($this->data as $key => $shipment) { $id = !empty($shipment['shippingAddressID']) ? $shipment['shippingAddressID'] : $shipment['CustomerOrder']['shippingAddressID']; $addresses[$id] = $key; } foreach (ActiveRecordModel::getRecordSetArray('UserAddress', select(in('UserAddress.ID', array_keys($addresses)))) as $address) { $this->data[$addresses[$address['ID']]]['ShippingAddress'] = $address; } }
public function delete($id) { $data_update = array('is_delete' => '1'); update('company_mst', $id, $data_update); $developers = select('company_with_developer', 'id,developer_id', array('where' => array('company_id' => $id)), array('single' => FALSE)); foreach ($developers as $developer) { $d_id = $developer['developer_id']; update('developers_mst', $d_id, $data_update); } $this->session->set_flashdata('success', 'Company has been Successfully Deleted.'); redirect('/admin/company'); }
/** * Created by JetBrains PhpStorm. * User: Fawaz * Date: 8/28/13 * Time: 12:17 PM * To change this template use File | Settings | File Templates. */ function get_website_configurations() { $query = "SELECT name, value FROM " . tbl('config'); $results = select($query); $data = array(); if ($results) { foreach ($results as $config) { $data[$config['name']] = $config['value']; } } return $data; }
private function getShippingMethods() { ClassLoader::import('application.model.delivery.ShippingService'); $methods = array(); $f = select(); $f->setOrder(f('DeliveryZone.ID')); $f->setOrder(f('ShippingService.position')); foreach (ActiveRecord::getRecordSetArray('ShippingService', $f, array('DeliveryZone')) as $service) { $methods[$service['ID']] = $service['name_lang'] . ' (' . $service['DeliveryZone']['name'] . ')'; } return $methods; }