Jump to content

deib97

Members
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Age
    30

Contact Methods

  • Yahoo
    deib97
  • Skype
    deib97

deib97's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, i have source code like this : <script type="text/javascript"> var rowNum = 0; function addRow(frm) { rowNum ++; var row = '<p id="rowNum'+rowNum+'">Item name: <input type="text" name="name[]" value="'+frm.add_name.value+'"> Satuan: <input type="text" size="5" name="satuan[]" value="'+frm.add_satuan.value+'"> Item quantity: <input type="text" name="qty[]" size="20" value="'+frm.add_qty.value+'"> <input type="button" value="Remove" onclick="removeRow('+rowNum+');"></p>'; jQuery('#itemRows').append(row); frm.add_qty.value = ''; frm.add_name.value = ''; frm.add_satuan.value = ''; } function removeRow(rnum) { jQuery('#rowNum'+rnum).remove(); } </script> This code, for make dynamic row when add operation. Then, item name is input text. How change this input : <select name="group" class='arial11' id="group"> <?php $qdepart = mysql_query("select * from pemakai_group order by group_name asc"); if($qdepart != null){ while($ddepart = mysql_fetch_array($qdepart)){ $no++; if( $data[id_group] == $ddepart[id_group] ){ $seldepart[$no] = "selected";} echo "<option value=\"$ddepart[id_group]\" $seldepart[$no]>$ddepart[group_name]</option>"; } } ?> </select>
  2. I want to print data from response json? I was debug with firebug and show this : {"umumu":"","levelu":1,"nameu":""} How to echo data array just levelu. But i don't know how to make it? thanks
  3. I have one table but i try to make like the result not finished. Hmm.. can you see my table : I want to declare sum for parent kd_rekening in same row for "Anggaran" => jns_anggaran =1 and "Perubahan" => jns_anggaran = 2. And child ust load field nilai. Thanks before
  4. any one can help me??
  5. I was trying for make a query for replace it. Because I dont understand with complex condition i make a query for each condition, but after i append all query each condition to one new table, sum of rows not same like table so2. I has 2 tables : so2 and pl2. maybe can be help me i attach in my dropbox *.sql : so2.sql and pl2.sql For distinct pl2 : i use this query : SELECT YEAR(`HRG_DATE`) AS Yr, MONTH(`HRG_DATE`) AS Mnth, DAY(`HRG_DATE`) AS Day, COUNT(*) AS Total FROM `pl2` GROUP BY YEAR(`HRG_DATE`), MONTH(`HRG_DATE`) And this image for describe condition : image Sorry i not attach media in here, bandwith killer. :pirate: And i was make query every condition, this example for no.3(image) like this : (for checking before i hide so2.`PLIDR` , so2.`PLVLS`) SELECT so2.`ORJ_DATE` , so2.`CUS_CODE` , so2.`INV_CODE` , so2.`PLIDR` , so2.`PLVLS` , pl2.`HRG_DATE` , pl2.`CUS_CODE` , pl2.`INV_CODE` , pl2.`HRG_NETT` , pl2.`HRG_VALA` FROM so2 INNER JOIN pl2 ON so2.CUS_CODE = pl2.CUS_CODE AND so2.INV_CODE = pl2.INV_CODE WHERE DATE( so2.ORJ_DATE ) BETWEEN '2013-01-02' AND '2013-06-27' ORDER BY so2.ORJ_DATE ASC How to make single query like this condition?? thanks for helping me..
  6. I'll try bro...thanks
  7. This example was made by the developer first. And now without sufficient documentation that I have to create a new one. I also feel confused with this kind of this report generation. Here it is from the echo of a table. Maybe if there was a code or library to make report like this.
  8. When i create report continous page when printing always not clear and not prefect. Any solution for make a report when preview like this and when printing can be constans with paper measure.?
  9. DROP TRIGGER IF EXISTS `auto_update_tabel_alat`; DELIMITER // CREATE TRIGGER `auto_update_tabel_alat` AFTER INSERT ON `mutasi_alat` FOR EACH ROW update alat set cabang_terakhir=(SELECT mutasi_alat.id_cabang FROM mutasi_alat where mutasi_alat.tgl_berlaku=(select max(mutasi_alat.tgl_berlaku) from mutasi_alat where id_alat=NEW.id_alat)) where id=NEW.id_alat // DELIMITER ;
  10. DROP TRIGGER IF EXISTS `auto_update_tabel_alat`; DELIMITER // CREATE TRIGGER `auto_update_tabel_alat` AFTER INSERT ON `mutasi_alat` FOR EACH ROW update alat set cabang_terakhir=NEW.id_cabang where id=NEW.id_alat // DELIMITER ; Still not complete..
  11. Hi, i have 2 table, a table alat and a table mutasi_alat. Every I do action insert to the table mutasi_alat, with a relation alat.id_alat and insert date newer then the value that is in the table mutasi_alat.id_cabang. The table will trigger an update to the table alat.cabang_terakhir. Table 1 : alat Table 2 : mutasi_alat I want to be trigger update into table alat after any action insert in table mutasi_alat. Do I have to make a single trigger or storeprocedure with this conditions? thanks
  12. Hi, im back Barand. How to automatically call storeprocedure if the date now on server is 2014-01-01, 2015-01-01, ....? Or maybe i must manual action for call it.
  13. Finally i change name of storeprocedure. Thanks Barand help me..solved :happy-04:
  14. Hi Barand, I try your code : CREATE PROCEDURE auto_insert (IN ulang INT) BEGIN INSERT INTO hari_libur (tgl_libur, keterangan, ulangi) SELECT MAX(tgl_libur) + INTERVAL 1 YEAR , keterangan , 1 FROM hari_libur WHERE ulangi = 1 GROUP BY CONCAT(MONTH(tgl_libur),DAY(tgl_libur)); END CALL auto_insert(1) Yes, success... But this generate insert all. Maybe im wrong? cmiiw
  15. I have table like this : CREATE TABLE IF NOT EXISTS `hari_libur` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tgl_libur` date NOT NULL, `keterangan` varchar(64) NOT NULL, `ulangi` int(1) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; -- -- Dumping data for table `hari_libur` -- INSERT INTO `hari_libur` (`id`, `tgl_libur`, `keterangan`, `ulangi`) VALUES (1, '2010-12-25', 'Hari Raya Natal', 1), (2, '2010-08-17', 'Proklamasi Kemerdekaan RI', 1), (3, '2010-01-01', 'Tahun Baru Masehi', 1), (4, '2012-08-19', 'Hari raya Idul Fitri', 0), (5, '2012-08-20', 'Hari Raya Idul Fitri', 0); I want to auto insert for "ulangi" = 1 is repeat every year when i call a storeprocedure. How to make it? So i dont entry data every start year. thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.