Beispiel #1
0
 /** nested table constructor */
 public function nested_table($instance_name = '', $field = '', $inner_tbl = '', $tbl_field = '')
 {
     if ($instance_name && $field && $inner_tbl && $tbl_field) {
         $fdata = $this->_parse_field_names($field, 'nested_table');
         foreach ($fdata as $fitem) {
             $this->inner_table_instance[$instance_name] = $fitem['table'] . '.' . $fitem['field'];
             // name of nested object will be stored in parent instance
             $instance = Xcrud::get_instance($instance_name);
             // just another xcrud object
             $instance->table($this->prefix . $inner_tbl);
             $instance->is_inner = true;
             // nested flag
             $fdata2 = $this->_parse_field_names($tbl_field, 'nested_table', $inner_tbl);
             $instance->inner_where[$fitem['table'] . '.' . $fitem['field']] = key($fdata2);
             // this connects nested table with parent
             return $instance;
             // only one cycle
         }
     }
 }
Beispiel #2
0
 public function index()
 {
     //dd($_POST);
     echo Xcrud::get_requested_instance();
     //echo "hello";
 }
 public function index()
 {
     $data = Xcrud::get_instance()->table('inti_online_meeting_rooms')->columns('room_name,description,created_at')->fields('room_name,description')->label('room_name', 'Judul Rapat')->label('description', 'Deskripsi')->label('created_at', 'Tanggal Dibuat')->column_pattern('room_name', '<a href="https://rtc.intifadah.net/{slug}" class="xcrud-action" ><b color="red">{room_name}</a></b>')->pass_var('creator', \Auth::user()->id)->pass_var('created_at', date('Y-m-d H:i:s'))->before_insert('save_online_meeting', app_path() . '/config/function.php')->where("creator = '" . \Auth::user()->id . "'")->unset_title()->unset_limitlist()->unset_view()->unset_csv()->limit(10);
     return $this->render('webrtc.meeting.manage', ['data' => $data], ['title' => $this->setTitle(trans('global.about'))]);
 }
 public function donation($slug)
 {
     if (!$this->exists()) {
         return $this->notFound();
     }
     $community = $this->communityRepostory->get($slug);
     if ($this->community->present()->isAdmin()) {
         $data = Xcrud::get_instance()->table('inti_community_donations')->columns('donor_name,address,telp,email,date,amount')->fields('donor_name,address,telp,email,date,amount')->column_name('donor_name', 'Nama Donatur')->column_name('address', 'Alamat')->column_name('telp', 'Telp')->column_name('email', 'Email')->column_name('date', 'Tanggal')->column_name('amount', 'Jumlah')->label('donor_name', 'Nama Donatur')->label('address', 'Alamat')->label('telp', 'Telp')->label('email', 'Email')->label('date', 'Tanggal')->label('amount', 'Jumlah')->pass_var('community_id', $community->id)->where("inti_community_donations.community_id = '" . $community->id . "'")->change_type('amount', 'price', '0', array('prefix' => 'Rp ', 'separator' => '.', 'point' => ','))->field_callback('amount', 'nice_input_jumlah_uang', app_path() . '/config/function.php')->before_insert('save_donation', app_path() . '/config/function.php')->unset_title()->unset_limitlist()->unset_view()->sum('amount')->unset_edit()->unset_csv()->order_by('id', 'desc')->limit(10);
     } else {
         $data = Xcrud::get_instance()->table('inti_community_donations')->columns('donor_name,address,telp,email,date,amount')->fields('donor_name,address,telp,email,date,amount')->column_name('donor_name', 'Nama Donatur')->column_name('address', 'Alamat')->column_name('telp', 'Telp')->column_name('email', 'Email')->column_name('date', 'Tanggal')->column_name('amount', 'Jumlah')->label('donor_name', 'Nama Donatur')->label('address', 'Alamat')->label('telp', 'Telp')->label('email', 'Email')->label('date', 'Tanggal')->label('amount', 'Jumlah')->pass_var('community_id', $community->id)->where("inti_community_donations.community_id = '" . $community->id . "'")->change_type('amount', 'price', '0', array('prefix' => 'Rp ', 'separator' => '.', 'point' => ','))->field_callback('amount', 'nice_input_jumlah_uang', app_path() . '/config/function.php')->before_insert('save_donation', app_path() . '/config/function.php')->unset_title()->unset_limitlist()->unset_view()->sum('amount')->unset_edit()->unset_remove()->unset_add()->unset_csv()->order_by('id', 'desc')->limit(10);
     }
     return $this->render('community.page.manage', ['data' => $data, 'header' => 'Hasil Donasi'], ['title' => $this->setTitle(trans('global.about'))]);
 }