Thức ăn liên quan sức khoẻ

Lá lốt

Lá lốt chữa bệnh đau nhức xương khớp: lấy 5-10g lá lốt phơi khô, sắc hai chén nước còn nửa chén, uống trong ngày. Nên uống khi thuốc còn ấm, sau bữa ăn tối, uống trong vòng 10 ngày. Lá lốt có thể dùng tươi, phơi hoặc sấy khô.

Lá lốt còn được dùng để nấu nước ngâm tay chân cho người bị bệnh tê thấp, hay đổ mồ hôi tay, mồ hôi chân.

Lá lốt có vị nồng, hơi cay, có tính ấm, chống hàn (như bị lạnh bụng), giảm đau, chống phong hàn ở mức thấp, tay chân lạnh, tê tê, nôn mửa, đầy hơi, khó tiêu (có lẽ vì thế mà được dùng với thịt bò nướng vốn khó tiêu), đau đầu vì cảm lạnh…

Nước sắc toàn cây trị đầy bụng, nôn mửa vì bị hàn. Nước sắc rễ chữa tê thấp vì bị khí hàn. Cành lá sắc đặc ngậm chữa đau răng. Lá tươi giã nát, phối hợp với lá khế, lá đậu ván trắng, mỗi thứ 50g thêm nước gạn uống giải độc, chữa say nắng.

Lưu ý: những người đang bị vị nhiệt táo bón (khô lưỡi, môi nẻ, đi tiêu khó khăn, nóng bức trong người) không nên dùng lá lốt.

Trứng vịt lộn
Ăn nhiều trứng vịt lộn mỗi ngày có thể làm tăng lượng cholesterol xấu trong máu, góp phần gây ra các bệnh tim mạch, huyết áp, đái đường, không tốt cho người bệnh gout. Hợp lý nhất là trẻ em chỉ nên ăn tối đa 1 trứng/ 1 ngày, người lớn tối đa 2 trứng/ngày.

Rau răm:
Ăn nhiều rau răm sống sinh nóng rét, giảm khả năng sinh dục. Phụ nữ hành kinh ăn nhiều rau răm sống dễ bị sinh rong huyết. Các sản phụ cũng không nên ăn nhiều rau răm vì sẽ ảnh hưởng không tốt đến thai nhi.

How to make an extension to virtuemart which will allow you to add distributors and then chose distributor for each product?

First I’ll try to explain what needs to be achieved. If you have a big online store and you try to remember all your distributors (people and companies which you take your goods from and then you sell these goods to the customers) it won’t be easy. Especially if there are more people working in your online shop. So the issue is that virtuemartdoesn’t have distributors support. What needs to be done is write an extension to virtuemart which will add distributors to the menu of modules (manufacturers, tax rates, vendors, ets.).

This extension will allow you to add distributors (like you add manufacturers) and when you are in the product details page you will have the ability to choose the distributor from which this product comes from, the same way like you choose manufacturer of the product.

So I used the manufacturers extension for base to create this distributors extension. And since I have no idea how to make a real extension which will install automatically I will write the steps here:First I’ll try to explain what needs to be achieved. If you have a big online store and you try to remember all your distributors (people and companies which you take your goods from and then you sell these goods to the customers) it won’t be easy. Especially if there are more people working in your online shop. So the issue is that virtuemart doesn’t have distributors support. What needs to be done is write an extension to virtuemart which will add distributors to the menu of modules (manufacturers, tax rates, vendors, ets.).

This extension will allow you to add distributors (like you add manufacturers) and when you are in the product details page you will have the ability to choose the distributor from which this product comes from, the same way like you choose manufacturer of the product.

So I used the manufacturers extension for base to create this distributors extension. And since I have no idea how to make a real extension which will install automatically I will write the steps here:

1. Add one more menu item to the virtumart menu (virtuemart modules)

To do this go to the your-site/administrator/components/com_virtuemart/header.php and add one more menu item.

Find this code: case ‘manufacturer’:

and paste this code before it:

case ‘distributor’:
?>
<h3 class=”title-smenu” title=”distributor” onclick=”SwitchMenu(’<?php echo $modCount ?>’)”>
<?php echo Distributor
?>
</h3>
<div class=”section-smenu”>
<ul>
<li class=”item-smenu vmicon vmicon-16-content”>
<a href=”<?php $sess->purl($_SERVER['PHP_SELF'].”?pshop_mode=admin&amp;page=distributor.distributor_list”) ?>”><?php echo “Distributor list” ?></a>
</li>
<li class=”item-smenu vmicon vmicon-16-editadd”>
<a href=”<?php $sess->purl($_SERVER['PHP_SELF'].”?pshop_mode=admin&amp;page=distributor.distributor_form”) ?>”><?php echo “Add distributor” ?></a>
<hr />
</li>
</ul>
</div>
<?php
$modCount++;
break;


2. Create a new table in the DB for example called jos_vm_distributor

I have created a table similar to the on for the manufacturers

Field Type Collation Attributes Null Default Extra Action
int(11) No auto_increment
varchar(64) utf8_general_ci Yes NULL
varchar(255) utf8_general_ci Yes NULL
text utf8_general_ci Yes NULL

3. Add the record for the distributors in the jos_vm_module table

Add a record to the DB like this one in the jos_vm_module table. Choose some ID and write the name “distributor”, And don’t forget to add Y to published.

It is possible to do this 3-th step from the virtuemart backend -> admin -> list modules,  but I’m not sure.


4. Add some functions to the newly published module.

Go to virtuemart backend -> admin -> list modules. Go to function list for the distributor module.

Add this functions: distributorAdd, distributorDelete, distributorUpdate (see virtuemart manual for help with adding new functions)

5. Now create the files for the distributor.

- /administrator/components/com_virtuemart/html/distributor.distributor_form.php

- /administrator/components/com_virtuemart/html/distributor.distributor_list.php

-/administrator/components/com_virtuemart/classes/ps_distributor.php

You could download my files from here above.

6. Add the code to support distributors in the product details page.

(this is a helpfull article – Add a New Field to Products in Joomla! VirtueMart)

6.1. First of all we have to ctreate a new table in the database which will link the distributors to the products. In my case it’s called jos_vm_product_dist_xref.

You should do it the same way the  jos_vm_product_mf_xref is fone. Add the two fields and the two indexes to the table.

6.2. Open ps_product.html and add these lines:

6.2.1. After these lines :

if (empty($d['manufacturer_id'])) {
$d['manufacturer_id'] = “1″;

}

add

if (empty($d['distributor_id'])) {
$d['distributor_id'] = “1″;
}

6.2.2. Before:

$q = “INSERT INTO #__{vm}_product_mf_xref VALUES (”;
$q .= “‘”.$d['product_id'].”‘, ‘”.vmRequest::getInt(’manufacturer_id’).”‘)”;
$db->setQuery($q); $db->query();

add:

$q = “INSERT INTO #__{vm}_product_dist_xref VALUES (”;
$q .= “‘”.$d['product_id'].”‘, ‘”.vmRequest::getInt(’distributor_id’).”‘)”;
$db->setQuery($q); $db->query();

6.2.3. After:

$q = “UPDATE #__{vm}_product_mf_xref SET “;
$q .= ‘manufacturer_id=’.vmRequest::getInt(’manufacturer_id’).’ ‘;
$q .= ‘WHERE product_id = ‘.$d['product_id'];
$db->query($q);

add:

$q = “UPDATE #__{vm}_product_dist_xref SET “;
$q .= ‘distributor_id=’.vmRequest::getInt(’distributor_id’).’ ‘;
$q .= ‘WHERE product_id = ‘.$d['product_id'];
$db->query($q);

6.2.4. After:

/* Delete product – manufacturer xref */
$q = “DELETE FROM #__{vm}_product_mf_xref WHERE product_id=’$product_id’”;
$db->setQuery($q); $db->query();

add:

/* Delete product – distributor xref */
$q = “DELETE FROM #__{vm}_product_dist_xref WHERE product_id=’$product_id’”;
$db->setQuery($q); $db->query();

6.2.5. After this function :

function get_manufacturer_id($product_id) {}

add:

/**
* Function to get the distributor id the product $product_id is assigned to
* @author soeren
* @param int $product_id
* @return int The distributor id
*/
function get_distributor_id($product_id) {
$db = new ps_DB;

$q = “SELECT distributor_id FROM #__{vm}_product_dist_xref “;
$q .= “WHERE product_id=’$product_id’ “;

$db->query($q);
$db->next_record();
if ($db->f(”distributor_id”)) {
return $db->f(”distributor_id”);
}
else {
return false;
}
}

6.2.6. After function get_mf_name($product_id) {}

add

/**
* Functon to get the name of the distributor this product is assigned to
*
* @param int $product_id
* @return string the distributor name
*/
function get_d_name($product_id) {
$db = new ps_DB;

$q = “SELECT d_name,#__{vm}_distributor_kefi.distributor_id FROM #__{vm}_product_dist_xref,#__{vm}_distributor_kefi “;
$q .= “WHERE product_id=’$product_id’ “;
$q .= “AND #__{vm}_distributor_kefi.distributor_id=#__{vm}_product_dist_xref.distributor_id”;

$db->query($q);
$db->next_record();
if ($db->f(”d_name”)) {
return $db->f(”d_name”);
}
else {
return “”;
}
}

/**
* Functon to get the id of the distributor this product is assigned to
*
* @param int $product_id
* @return string the distributor id
*/
function get_d_id($product_id) {
$db = new ps_DB;

$q = “SELECT d_name,#__{vm}_distributor_kefi.distributor_id FROM #__{vm}_product_dist_xref,#__{vm}_distributor_kefi “;
$q .= “WHERE product_id=’$product_id’ “;
$q .= “AND #__{vm}_distributor_kefi.distributor_id=#__{vm}_product_dist_xref.distributor_id”;

$db->query($q);
$db->next_record();
if ($db->f(”distributor_id”)) {
return $db->f(”distributor_id”);
}
else {
return “”;
}
}

6.3. Open product.product_form.php and modify:

6.3.1.After:

require_once( CLASSPATH.’ps_manufacturer.php’ );

add:

require_once( CLASSPATH.’ps_distributor.php’ );

6.3.2. After :

// Get the Manufacturer ID
$db2->query(”SELECT manufacturer_id FROM #__{vm}_product_mf_xref WHERE product_id=’$product_id’”);
$db2->next_record();
$manufacturer_id = $db2->f(”manufacturer_id”);

add:

// Get the Distributor ID
$db2->query(”SELECT distributor_id FROM #__{vm}_product_dist_xref WHERE product_id=’$product_id’”);
$db2->next_record();
$distributor_id = $db2->f(”distributor_id”);

6.3.3. After :

<tr class=”row0″>
<td width=”21%”><div style=”text-align:right;font-weight:bold;”> <?php echo $VM_LANG->_(’PHPSHOP_PRODUCT_FORM_VENDOR’) ?>:</div></td>
<td width=”79%” ><?php ps_vendor::list_vendor($db->sf(”vendor_id”));  ?></td>
</tr>

add:

<tr class=”row1″>
<td width=”21%” ><div style=”text-align:right;font-weight:bold;”> <?php echo “Distributor” ?>:</div></td>
<td width=”79%” ><?php ps_distributor::list_distributor(@$distributor_id);  ?></td>
</tr>

That’s it…

Source: http://www.kavdesign.net/blog/programming/how-to-make-an-extension-to-virtuemart-which-will-allow-you-to-add-distributors-to-the-products/

Ballad of Hochiminh

Cloud computing

  1. What is cloud computing?
  2. Is cloud computing the ultimate agile web-development technology?
  3. Is cloud computing the way of the future?
  4. Does cloud computing have any relevance for the business you are working for?

Học làm chồng!

Đằng sau cuộc sống hôn nhân, người phụ nữ luôn là người gánh chịu thiệt thòi. Cuộc sống gia đình bộn bề với trăm công nghìn việc, nàng không có thời gian để chăm sóc cho bản thân và thư giãn. Một người chồng tâm lý sẽ làm cho vợ yêu đời hơn, để quên đi những gánh nặng cuộc sống.
Học làm chồng!
Hãy sắp xếp thời gian tổ chức cho nàng một chuyến picnic, du lịch mạo hiểm vào những ngày nghỉ lễ hoặc những ngày cuối tuần. Thỉnh thoảng, mua tặng nàng một món quà… Đó chính là cách để bạn hâm nóng tình cảm vợ chồng. Sau đây là 19 lời khuyên bổ ích sẽ làm cho nàng ngập tràn hạnh phúc. Đọc tiếp »
Follow

Get every new post delivered to your Inbox.