gongpex

Members
  • Content count

    323
  • Joined

  • Last visited

  • Days Won

    4

gongpex last won the day on November 10 2012

gongpex had the most liked content!

Community Reputation

36 Excellent

About gongpex

  • Rank
    Member

Profile Information

  • Gender
  1. Hello everyone, Today I'm very shocked because when I woke from my slept, my computer had turned on already, this forum had opened on my browser.......... This thread -> how to escape from unwanted marriage I've never made before, I'm sure somebody use my computer when I was slept last night....... And I never used 'Hi guys' as greetings, moreover 'hihihi'...... and he/she (i don't know) maybe use bookmark to open this forum, and I usually store my username and password on browser so that I can log into this forum easily ....... This is really embarrassing .......................................................................... Honestly I must admit I love off topic, but since there is rule on this forum that off topic is prohibit, and every time I ask off topic nobody answer me , then I never ask about off topic anymore. This is not off topic but 'Fool Topic' I'm really ashamed with this->how to escape from unwanted marriage thread........ And I wonder why when I made off topic question very seldom someone answer / reply on my off topic..... but somebody who used my computer and post this 'Fool Topic' got response so many....Maybe I'm unlucky person on this forum........ That's all only can I say, I don't know what I must say................. E : I hope all of you will ignore or delete this->how to escape from unwanted marriage thread............................
  2. Hi guys hihihi Please tell me how to escape from unwanted marriage on wedding day maybe there is someone can give me some advice how to escape from unwanted marriage thx HIHIHIIHI
  3. No I tried it on apache server Only that the message nothing anymore... please help Thanks
  4. Hello everyone, Long time no see, I hope you all are fine, Today I've tried to use javabridge, according tutorial on : http://php-java-bridge.sourceforge.net/pjb/desktop-apps.php I rather confused with this tutorial because when I tried to run the example that I got when downloaded javabridge.war it won't run. For example bench.php : #!/usr/bin/php <?php //define ("JAVA_DEBUG", true); require_once ("java/Java.inc"); $here = getcwd(); $java_output = "workbook_java.xls"; $php_output = "workbook_php.xls"; ini_set("max_execution_time", 0); $sys = java("java.lang.System"); // fetch classes and compile them to native code. // use local poi.jar, if installed try { java_require("$here/exceltest.jar;$here/../../unsupported/poi.jar"); } catch (JavaException $e) { java_require("$here/exceltest.jar;http://php-java-bridge.sf.net/poi.jar"); } $excel = new java("ExcelTest"); $excel->createWorkbook("/dev/null", 1, 1); // test starts $sys->gc(); $start = java_values($sys->currentTimeMillis()); $excel = new java("ExcelTest"); $excel->createWorkbook("$here/$java_output", 200, 200); $sys->gc(); $t_java = java_values($sys->currentTimeMillis()) - $start; include("$here/excel_antitest.php"); $sys->gc(); $start = java_values($sys->currentTimeMillis()); createWorkbook("$here/$php_output", 200, 200); $sys->gc(); $t_php = java_values($sys->currentTimeMillis()) - $start; echo "$java_output\t: $t_java ms.\n"; echo "$php_output\t: $t_php ms.\t(" . $t_php/$t_java .")\n"; /* Sample results on a 1.4GHZ i686, kernel 2.6.8 -------------------------------------------------- PHP/Java Bridge Version 1.0.8: pure java mix PHP/Java pure java mix PHP/Java interpreted (-Xint) interpreted (-Xint) compiled compiled jdk 1.4: 13367 ms 42919 ms 2325 ms 22276 ms 1.5: 18342 ms 42048 ms 2227 ms 21008 ms -------------------------------------------------- PHP/Java Bridge Version 2.0.7: jdk 1.4: 13929 ms 39723 ms 2349 ms 9232 ms -------------------------------------------------- PHP/Java Bridge Version 4.3.3: jdk 1.6: - ms - ms 2120 ms 7655 ms */ ?> when I open on address bar : http://127.0.0.1/javabridge/bench/bench.php it's shown : Warning: java_require() not supported anymore. Please use and if I changed "java_require" it became : try { use $here/exceltest.jar;"$here/../../unsupported/poi.jar"; } catch (JavaException $e) { use $here/exceltest.jar;"http://php-java-bridge.sf.net/poi.jar"; } Parse error: syntax error, unexpected 'use' (T_USE) in C:\Apache24\htdocs\javabridge\bench\bench.php on line 17 I don't know what I must do, please help me Thanks
  5. Hello everyone, I look on google if we want to backup up data from mysql we run code like this : <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'root'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $table_name = "kol1"; $backup_file = "F:/test.sql"; $sql = "SELECT * INTO OUTFILE '$backup_file' FROM $table_name"; mysql_select_db('test'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not take data backup: ' . mysql_error()); } echo "Backedup data successfully\n"; mysql_close($conn); ?> This code works, but only backup one table (kol1), Q : Is there any solution to backup all table from database? please help me Thanks
  6. Hello , Thanks for reply I appreciate it
  7. Hello everyone, I had tried to generate txt file from php foreach loop, it's work, but the result is not table formatted like this : Q : Is there php plugins or something ,so that the result shown as my expectation like this : this is my code : $output[] = ''."\n".''; $output[] = ' No '.' Name Product '.' Total '."\n".''; foreach($query->result() as $row){ $results = $row->id_product; $product = $this->db->query("select product_name from master_product WHERE product_id='".$results."'"); $product_name = $product->row()->product_name; $output[] = ' '.$no.str_repeat(" ",20).''. $product_name.str_repeat(" ",20).''.$row->quantity.' '.$row->scale."\n".''; $no++; } file_put_contents(APPPATH."txt/test.txt", $output); please someone help me Thanks
  8. hmm ok, thanks for answer before, my expectation actually : to make select option that I've made, work when it changed. Here is my screen shot : If I used code on above the result is : "undefined property : start" and etc please help me Thanks
  9. Hello everyone I had tried to post data using jquery data table but it didn't work, here is my code: function table(){ $('#page').DataTable( { "pageLength": 5, "bAutoWidth": true, "processing": true, "serverSide": true, "destroy": true, "columnDefs": [ {"bSortable": false, "aTargets": [ 1, 2, 3, 4]}, { targets: 0 }, { targets: 1 }, { className:'text-center',targets: 2 }, { className:'text-center', targets: 3 }, { className:'text-center', render:function(data,type,row){ return '<a style="cursor:pointer" class="btn btn-xs btn-info my_popup_open" rowid="'+row[6]+'">Edit Data</a>'; },targets: 4 }, ], "ajax" : { "url" : "<?php echo base_url('index.php/loc/data');?>", "type" : "POST", "data": $("#location").val() } }); } and this my php code : function data(){ $location = $this->input->post("id_location"); $start = $_GET["start"]; $rowPerPage = $_GET["length"]; $orderbyIndex = $_GET["order"][0]["column"]; $orderby = $_GET["order"][0]["dir"]; $search = $_GET["search"]["value"]; $draw = $_GET["draw"]; $query = $this->db->query("select * from location where id_loc = '$location'"); // another code on bottom } I want data from Jquery data tables ($("#location").val()) can be sent to my php code Q : what I must do? please help me Thanks
  10. ugh sorry yesterday I was drunk when post on this forum, alright this is about how to make custom validator on laravel. I had renew my code after search on google : on controller (AdminController.php) namespace App\Http\Controllers; use Validator; use Illuminate\Http\Request; use Illuminate\Support\Facades\Input; use App\Http\Requests\CreateUserRequest; use App\Http\Controllers\Controller; use DB; public function postForm(CreateUserRequest $request) { return 'Success!'; } on routes : Route::post('signin', 'AdminController@postForm'); and on view : <form method="post" action="{{URL::to('signin')}}"> <div class="f_wrapper"> @if ($errors->any()) <ul>{!! implode('', $errors->all('<li style="color:red">:message</li>')) !!}</ul> @endif <div class="f_col">Admin Username</div><div class="f_col"><input name="username" type="text" class="inbox"></div> <div class="f_col_w"><span class="number">{{ $errors->first('username') }}</span></div> </form> and this is on appServiceProvider.php : <?php namespace App\Providers; use Validator; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Validator::extend('foo', function($attribute, $value, $parameters) { return substr($value, 0, 3) == '+44'; }); } /** * Register any application services. * * @return void */ public function register() { // } } and this is on http request : <?php namespace App\Http\Requests; use Illuminate\Support\Facades\Input; use App\Http\Requests\Request; use DB; class CreateUserRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'username' => 'required|foo', ]; } } This custom validator expect if you put number on input field it's should be start +44, here is the error : if I put field empty, the error message will be shown --this is ok (use laravel default validator), but if I input random number not start with +44, it will cause error like this : BadMethodCallException in Validator.php line 2694: Method [validateFoo] does not exist. Please someone help me thanks Note : please ignore post that I've made before, because I made it when I was drunk.....
  11. Hello everyone, long time no see, I hope all you are fine, I tried to create laravel form validation using this code : on : app\http\Requests\ValidationRequest.php <?php namespace App\Http\Requests; use Illuminate\Support\Facades\Input; use App\Http\Requests\Request; use DB; class ValidationRequest extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $username = Input::get('username'); $password = Input::get('password'); $tables = DB::table('admin')->where('password',$password)->where('username',$username)->count(); if(count($errors) > 0) { return [ 'username' => 'required|min:3', 'password' => 'required', ]; } else if($tables == 0){ return ['db' => 'dberr']; } } public function messages() { return [ 'username.required' => 'Username is required', 'username.min' => 'Username at least 3 character length', 'password.required' => 'Password is required', 'db.dberr' => 'Username or Password is wrong', ]; } } this my routes : Route::get('post', 'AdminController@index'); Route::post('signin', 'AdminController@store'); Route::get('post/home', 'AdminController@home'); Route::get('post/addcategory', 'AdminController@addcategory'); this is my controller : (AdminController.php) <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Input; use App\Http\Requests\ValidationRequest; use App\Http\Controllers\Controller; use DB; class AdminController extends Controller { public function index() { return view('admin.admin',['db'=>null]); } /* laravel message and form validation */ public function rules() {} public function messages() {} public function store(ValidationRequest $request){ //echo $tables; } } /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ and this is my view : <body> <form method="post" action="{{URL::to('signin')}}"> <div class="f_wrapper"> {{ $errors->first('db') }} <div class="admin_panel">Store login</div> <div> </div> <div class="f_col">Admin Username</div><div class="f_col"><input name="username" type="text" class="inbox"></div> <div class="f_col_w"><span class="number">{{ $errors->first('username') }}</span></div> <div class="f_col">Password</div><div class="f_col"><input name="password" type="password" class="inbox"></div> <div class="f_col_w"><span class="number">{{ $errors->first('password') }}</span></div> <div class="f_col"> </div><div class="f_col"><a><input type="submit" value="Sign In"></a></div> <div class="f_col_w" style="height:10px;"> </div> </div> </form> </body> I had tried to make login form using code on above but it's didn't works, please someone help me Thanks
  12. Hello everyone, I'm still new to learn java, I take code from o'reilly book about GUI, this my code : import javax.swing.*; import java.awt.*; import java.awt.event.*; public class SimpleGui3c implements ActionListener { JFrame frame; public static void main(String[] args) { SimpleGui3c gui = new SimpleGui3c(); gui.go(); } public void go(){ frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton button = new JButton("Change new colors"); button.addActionListener(this); MyDrawPanel drawpanel = new MyDrawPanel(); frame.getContentPane().add(BorderLayout.SOUTH, button); frame.getContentPane().add(BorderLayout.CENTER, drawpanel); frame.setSize(300,300); frame.setVisible(true); } public void actionPerformed(ActionEvent e){ frame.repaint(); } } and this MyDrawPanel class : import javax.swing.*; import java.awt.*; public class MyDrawPanel extends JPanel { public void paintComponent(Graphics g){ //Image img = new ImageIcon("double/image/test.jpg").getImage(); //g.drawImage(img,5,5,this); g.setColor(Color.blue); g.fillOval(70, 70, 100, 100); g.setColor(Color.orange); g.fillOval(70, 70, 100, 100); } } I had tried to change color using JButton ,so, when I clicked the button it supposed there is change color from blue, turn into orange, but this didn't work.... Maybe there is something wrong on my code? Please help me Thanks
  13. Hello everyone, Yesterday I tried to using laravel PHP framework besides CI (code igniter), and actually this more complicated than code igniter, I tried to retrieve data from database using users.blade.php file like this : <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Laravel PHP Framework</title> <style> @import url(//fonts.googleapis.com/css?family=Lato:700); body { margin:0; font-family:'Lato', sans-serif; text-align:center; color: #999; } .welcome { width: 300px; height: 200px; position: absolute; left: 50%; top: 50%; ; margin-top: -100px; } a, a:visited { text-decoration:none; } h1 { font-size: 32px; margin: 16px 0 0 0; } </style> </head> <body> @extends('layout') @section('content') @foreach($users as $user) <p>{{ $user->name }}</p> @endforeach @stop </body> </html> and this my another file : layout.blade.php <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Laravel PHP Framework</title> <style> @import url(//fonts.googleapis.com/css?family=Lato:700); body { margin:0; font-family:'Lato', sans-serif; text-align:center; color: #999; } .welcome { width: 300px; height: 200px; position: absolute; left: 50%; top: 50%; ; margin-top: -100px; } a, a:visited { text-decoration:none; } h1 { font-size: 32px; margin: 16px 0 0 0; } </style> </head> <body> <h1>Laravel quick start</h1> @yield('content') </body> </html> this my routes : <?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the Closure to execute when that URI is requested. | */ Route::get('users', function() { $users = User::all(); return View::make('users')->with('users',$users); }); and this my model (User.php) : <?php use Illuminate\Auth\UserTrait; use Illuminate\Auth\UserInterface; use Illuminate\Auth\Reminders\RemindableTrait; use Illuminate\Auth\Reminders\RemindableInterface; class User extends Eloquent implements UserInterface, RemindableInterface { use UserTrait, RemindableTrait; /** * The database table used by the model. * * @var string */ protected $table = 'users'; /** * The attributes excluded from the model's JSON form. * * @var array */ protected $hidden = array('password', 'remember_token'); } I'm still try using laravel quickstart documentation but the result like this : Whoops, looks like something went wrong.Q : what's wrong with my code?? please help me Thanks
  14. Hello everyone, today I have installed fedora OS on my computer, but I after I see this fedora linux is for server (fedora server), Q : Is fedora server can be use to build java application? note : my fedora is : 32 GB please answer Thanks
  15. Hello everyone Today I tried to create ajax shopping cart add use these code: JQuery : $(document).ready(function(){ $("#fm").on('submit',function() { // this code for form var fsb = $(this).serialize(); $.ajax({ type: "POST", url: "<?php echo base_url('index.php/product/add');?>", data : fsb, dataType: "html", success: function(response){ $("#cart-info").html(response); } }); }); }); this my php code on controller(using Code Igniter) function add() { $id = $this->input->post('product_code'); $this->db->where('product_id',$id); $query = $this->db->get('product'); $stock = $query->row()->stock; echo $stock; // show stock of product } this on views : <div id="cart-info">This code supposed changed when user submit form on above</div> <form id="fm"> <input type="text" name="product_code" value="<?php echo "A100";?>" /> <!-- this code for product id --> <button>TEST</button> </form> My purpose is to show product stock on "cart-info" when user submitted this form. This code works properly on chrome and IE but didn't work on Opera and Firefox, Q : What mistake on my code? please help Thanks