© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group
<?php
$dbname = $modx->db->config['dbase'];
$dbprefix = $modx->db->config['table_prefix'];
$mod_table = $dbprefix."manager_shopkeeper";
$mod_config_table = $dbprefix."manager_shopkeeper_config";
$theme = $modx->config['manager_theme'];
$charset = $modx->config['modx_charset'];
$manager_language = $modx->config['manager_language'];
$text="";
$user_id=$modx->getLoginUserID();
$count_query = mysql_query("SELECT COUNT(*) FROM $mod_table WHERE userid='".$user_id."'");
$total = mysql_result($count_query, 0);
global $modx, $shopCart, $langTxt;
$shopCart->config['orderDataTpl'] = $template;
$shopCart->config['additDataTpl'] = '@FILE:assets/snippets/shopkeeper/module/templates/additData.tpl';
$langTxt = array(
"noOrders" => "Заказов нет",
"currency" => "Валюта",
"currencyDefault" => "руб.",
"phase1" => "Новый",
"phase2" => "В процессе выполнения",
"phase3" => "Отправлен",
"phase4" => "Выполнен",
"phase5" => "Возникли проблемы",
"phase6" => "Оплата получена"
);
if($total>0){
$data_query = $modx->db->select("id, short_txt, content, allowed, addit, price, currency, status, DATE_FORMAT(date,'%d.%m.%Y %k:%i') AS date", $mod_table, "userid='".$user_id."'", "id DESC", "");
$summa=0;
$num = 1;
$text1='';
while ($data = mysql_fetch_array($data_query)){
$text1.='<tr>';
$text1.='<td width="20" align="center">'.$data["id"].'</td>';
$text1.='<td width="100">'.$data["date"].'</td>';
$descr = $data['content'];
$L1 = unserialize($descr);
foreach ($L1 as $i => $value) {}
$document_tvs=$modx->getTemplateVarOutput(true, $value[0]);
$pagetitle=$document_tvs['pagetitle'];
$text1.='<td width="50%"><a href="[~'.$value[0].'~]">'.$pagetitle.'</a></td>';
$text1.='<td align="center">'.$value[1].'</td>';
$text1.='<td align="center">'.$value[2].'</td>';
$text1.='<td align="center">';
if(!empty($data['price'])){
$text1.=$data['price'];
$summa=$summa+$data['price'];
}
$text1.= $data['currency'];
$text1.='</td>';
$text1.='<td width="160" class="status'.$data['status'].'" align="center">'.$langTxt['phase'.$data['status']].'</td>';
$text1.='</tr>';
++$num;
}
//подгружаем чанк. producthistory - название чанка
$txt = $modx->parseChunk('producthistory', array(
'ShopHistory' => $text1,
'SummaOrder' => $summa
),
'[+',
'+]'
);
echo($txt);
}
else{
echo '<div class="nogood">'.$langTxt['noOrders'].'</div>';
}
?><table>
<tr><th>№</th><th>Дата</th><th>Состав заказа</th><th>Кол-во</th><th>Цена за 1 ед.</th><th>Общая сумма</th><th>Статус</th></tr>
[+ShopHistory+]
</table>
Общая стоимость всех заказов: [+SummaOrder+] руб.<?php
require_once('googleTranslate.class.php');
/* Initialize the class translate class */
$gt = new GoogleTranslateWrapper();
$sampleText = "Bonjour de cette partie du monde";
/* translate(string, to_language, from_language) */
echo $gt->translate($sampleText , "en", "fr");
/* This should print 'Hello from this part of the world' */
?>