Scroll to top

Haloo! Selamat Datang di Komunitas Private Training Web Development (26715 Members, 207 Projects, 2132 Topic, 5569 Comments)

Cara Menggunakan Num_Rows/Count Dll Yang Berhubungan Pada Ci
indrianto adi Mengatakan : Members -
  1. Assallammualaikm mas robby gimana kita menampilkan jumlah daftar peserta yang di paket A
  2. contoh kasus nya adalah
  3. saya memiliki daftar paket keberangkatan dengan id_=5(diambil per/id) kemudian ada customer daftar paket di id_=5/sesuai id yang dipilih dan saya ingin menampilkan di view tabel bahwa di paket trsbut sudah ada 2 orang(hanya contoh) , intinya adalah saya ingin menampilkan jumlah orang yang terdaftar pada paket yang dipilih seperti gambar dibawah ini yang saya tandai kotak merah
  4. terima kasih.
  5. berikut tablenya
  6.  
  7. CREATE TABLE `tbl_customer` (
  8. `nama_depan` varchar(80) NOT NULL,
  9. `id_cus` int(12) NOT NULL,
  10. `id_` int(12) NOT NULL,
  11. `id_paket` int(12) NOT NULL,
  12. `keberangkatan_tanggal` varchar(30) NOT NULL,
  13. `id_agent` int(12) NOT NULL,
  14. `kode_cus` varchar(20) NOT NULL,
  15. `nama_tengah` varchar(80) NOT NULL,
  16. `nama_belakang` varchar(80) NOT NULL,
  17. `tempat_lahir` varchar(80) NOT NULL,
  18. `tgl_lahir` date NOT NULL,
  19. `id_status_menikah` int(12) NOT NULL,
  20. `id_jenis_kelamin` int(12) NOT NULL,
  21. `no_pasport` varchar(45) NOT NULL,
  22. `tgl_issued_pasport` date NOT NULL,
  23. `tgl_expired_pasport` date NOT NULL,
  24. `tempat_imigrasi_pasport` varchar(80) NOT NULL,
  25. `no_identitas` varchar(30) NOT NULL,
  26. `alamat` text NOT NULL,
  27. `no_telp` varchar(15) NOT NULL,
  28. `no_hp` varchar(15) NOT NULL,
  29. `email` varchar(100) NOT NULL,
  30. `no_virtual_account` varchar(100) NOT NULL,
  31. `foto` varchar(100) NOT NULL,
  32. `nama_mahrom` varchar(80) NOT NULL,
  33. `hub_mahrom` varchar(15) NOT NULL
  34. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  35.  
  36. -- phpMyAdmin SQL Dump
  37. -- version 4.5.1
  38. -- http://www.phpmyadmin.net
  39. --
  40. -- Host: 127.0.0.1
  41. -- Generation Time: Jun 18, 2017 at 05:59 AM
  42. -- Server version: 10.1.13-MariaDB
  43. -- PHP Version: 5.6.20
  44.  
  45. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  46. SET time_zone = "+00:00";
  47.  
  48.  
  49. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  50. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  51. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  52. /*!40101 SET NAMES utf8mb4 */;
  53.  
  54. --
  55. -- Database: `db_travel`
  56. --
  57.  
  58. -- --------------------------------------------------------
  59.  
  60. --
  61. -- Table structure for table `bld_paket`
  62. --
  63.  
  64. CREATE TABLE `bld_paket` (
  65. `id_` int(12) NOT NULL,
  66. `id_paket` int(12) NOT NULL,
  67. `keberangkatan_tanggal` varchar(50) NOT NULL,
  68. `program_hari` varchar(2) NOT NULL,
  69. `harga` double NOT NULL,
  70. `fee` double NOT NULL,
  71. `name` varchar(9) NOT NULL
  72. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  73.  
  74. --
  75. -- Dumping data for table `bld_paket`
  76. --
  77.  
  78. INSERT INTO `bld_paket` (`id_`, `id_paket`, `keberangkatan_tanggal`, `program_hari`, `harga`, `fee`, `name`) VALUES
  79. (1, 10, '30 april 2017', '9', 28000000, 0, ''),
  80. (2, 11, '28 Mei 2017', '9', 0, 0, ''),
  81. (3, 11, '28 mei 2017', '9', 0, 0, ''),
  82. (4, 12, '28 mei-awal juli 2017', '40', 0, 0, ''),
  83. (5, 16, 'November 2017', '12', 15000000, 0, ''),
  84. (6, 16, 'November 2017', '09', 20000000, 1000000, ''),
  85. (7, 16, 'November 2017', '12', 25500000, 1000000, 'QUAD'),
  86. (8, 16, 'November 2017', '12', 26500000, 1000000, 'TRIPLE'),
  87. (9, 16, 'November 2017', '12', 27000000, 1000000, 'DOUBLE'),
  88. (10, 16, 'November 2017', '15', 27500000, 1000000, 'QUAD'),
  89. (11, 16, 'November 2017', '15', 28500000, 1000000, 'TRIPLE'),
  90. (12, 16, 'November 2017', '15', 29000000, 1000000, 'DOUBLE'),
  91. (13, 20, 'November 2017', '12', 28000000, 1000000, 'QUAD'),
  92. (14, 20, 'November 2017', '12', 29500000, 1000000, 'TRIPLE'),
  93. (15, 20, 'November 2017', '12', 30000000, 1000000, 'DOUBLE'),
  94. (16, 16, 'Mulai November 2017 (awal musim)', '9', 23000000, 1000000, 'QUAD'),
  95. (17, 16, 'Mulai November 2017 (awal musim)', '9', 24500000, 1000000, 'TRIPLE'),
  96. (18, 16, 'Mulai November 2017 (awal musim)', '9', 25000000, 1000000, 'DOUBLE'),
  97. (19, 11, '28 mei-1 juli 2018', '40', 25000000, 0, 'QUAD'),
  98. (20, 11, '28 mei-1 juli 2018', '40', 28000000, 0, 'TRIPLE'),
  99. (21, 11, '28 mei-1 juli 2018', '40', 40000000, 0, 'DOUBLE');
  100.  
  101. --
  102. -- Indexes for dumped tables
  103. --
  104.  
  105. --
  106. -- Indexes for table `bld_paket`
  107. --
  108. ALTER TABLE `bld_paket`
  109. ADD PRIMARY KEY (`id_`);
  110.  
  111. --
  112. -- AUTO_INCREMENT for dumped tables
  113. --
  114.  
  115. --
  116. -- AUTO_INCREMENT for table `bld_paket`
  117. --
  118. ALTER TABLE `bld_paket`
  119. MODIFY `id_` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
  120. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  121. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  122. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  123.  
  124.  
Ada 1 File Kiriman :
1. Untitled50.png (98 KB)
indrianto adi Mengatakan :
Members -
  1. ralat tabel customer
  2. -- phpMyAdmin SQL Dump
  3. -- version 4.5.1
  4. -- http://www.phpmyadmin.net
  5. --
  6. -- Host: 127.0.0.1
  7. -- Generation Time: Jun 18, 2017 at 05:55 AM
  8. -- Server version: 10.1.13-MariaDB
  9. -- PHP Version: 5.6.20
  10.  
  11. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  12. SET time_zone = "+00:00";
  13.  
  14.  
  15. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  16. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  17. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  18. /*!40101 SET NAMES utf8mb4 */;
  19.  
  20. --
  21. -- Database: `db_travel`
  22. --
  23.  
  24. -- --------------------------------------------------------
  25.  
  26. --
  27. -- Table structure for table `tbl_customer`
  28. --
  29.  
  30. CREATE TABLE `tbl_customer` (
  31. `nama_depan` varchar(80) NOT NULL,
  32. `id_cus` int(12) NOT NULL,
  33. `id_` int(12) NOT NULL,
  34. `id_paket` int(12) NOT NULL,
  35. `keberangkatan_tanggal` varchar(30) NOT NULL,
  36. `id_agent` int(12) NOT NULL,
  37. `kode_cus` varchar(20) NOT NULL,
  38. `nama_tengah` varchar(80) NOT NULL,
  39. `nama_belakang` varchar(80) NOT NULL,
  40. `tempat_lahir` varchar(80) NOT NULL,
  41. `tgl_lahir` date NOT NULL,
  42. `id_status_menikah` int(12) NOT NULL,
  43. `id_jenis_kelamin` int(12) NOT NULL,
  44. `no_pasport` varchar(45) NOT NULL,
  45. `tgl_issued_pasport` date NOT NULL,
  46. `tgl_expired_pasport` date NOT NULL,
  47. `tempat_imigrasi_pasport` varchar(80) NOT NULL,
  48. `no_identitas` varchar(30) NOT NULL,
  49. `alamat` text NOT NULL,
  50. `no_telp` varchar(15) NOT NULL,
  51. `no_hp` varchar(15) NOT NULL,
  52. `email` varchar(100) NOT NULL,
  53. `no_virtual_account` varchar(100) NOT NULL,
  54. `foto` varchar(100) NOT NULL,
  55. `nama_mahrom` varchar(80) NOT NULL,
  56. `hub_mahrom` varchar(15) NOT NULL
  57. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  58.  
  59. --
  60. -- Dumping data for table `tbl_customer`
  61. --
  62.  
  63. INSERT INTO `tbl_customer` (`nama_depan`, `id_cus`, `id_`, `id_paket`, `keberangkatan_tanggal`, `id_agent`, `kode_cus`, `nama_tengah`, `nama_belakang`, `tempat_lahir`, `tgl_lahir`, `id_status_menikah`, `id_jenis_kelamin`, `no_pasport`, `tgl_issued_pasport`, `tgl_expired_pasport`, `tempat_imigrasi_pasport`, `no_identitas`, `alamat`, `no_telp`, `no_hp`, `email`, `no_virtual_account`, `foto`, `nama_mahrom`, `hub_mahrom`) VALUES
  64. ('test', 1, 5, 16, 'November 2017', 2, '', '1', '2', 'jakar', '2017-06-14', 0, 0, 'B21235', '2017-05-31', '2017-07-08', 'Jakarta timur', '', 'adahkhk', '', '0132131545', 'indriantoadi8@gmail.com', '', '', 'ahmad nur romli', 'Orang tua'),
  65. ('afaf', 2, 5, 16, 'November 2017', 0, '', 'aafafaf', 'afafaf', '', '1970-01-01', 0, 0, '', '1970-01-01', '1970-01-01', '', '', 'afafafa', '', '', '', '', '', '', '');
  66.  
  67. --
  68. -- Indexes for dumped tables
  69. --
  70.  
  71. --
  72. -- Indexes for table `tbl_customer`
  73. --
  74. ALTER TABLE `tbl_customer`
  75. ADD PRIMARY KEY (`id_cus`);
  76.  
  77. --
  78. -- AUTO_INCREMENT for dumped tables
  79. --
  80.  
  81. --
  82. -- AUTO_INCREMENT for table `tbl_customer`
  83. --
  84. ALTER TABLE `tbl_customer`
  85. MODIFY `id_cus` int(12) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  86. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  87. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  88. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  89.  

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!