Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(24);
- if($_POST['act']=='batch')
- {
- $aItem=explode("\n",$_POST['item']);
- foreach($aItem as $v)
- {
- if($v)
- {
- $a=explode("\t",$v);
- $name=trim($a[0]);
- $price=trim($a[1]);
- $sql="INSERT INTO `klinik_riitem` (`item_code` ,`item_name`,item_type)
- VALUES ('zzz', '$name','14');";
- $id=query($sql);$id2=sprintf("%06s",$id);
- $sql="UPDATE `klinik_riitem` SET `item_code` = '$id2' WHERE
- `item_id` =$id";
- query($sql);
- $sql="INSERT INTO `klinik_riitemprice` (`iprice_item` ,`iprice_price`)
- VALUES($id,'".intval($price)."')";
- $id=query($sql);
- }
- }
- header('location:?option=com_ri&l=f&t=item');
- print_r($_POST);
- die();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement