Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function addloanAction(){
- if ( $this->session->has('sid') ){
- $co = $this->session->get('sid') ;
- $user = Customers::find("cid = '$co'") ;
- if ( $this->request->isPost() ){
- $amount = $this->request->getPost("amount") ;
- $asset = $this->request->getPost("asset") ;
- $assetprice = $this->request->getPost("price") ;
- $this->response->redirect('user/added') ;
- $rand =rand(10000,99999);
- $strrand = (string)$rand;
- $strasset = (string)$asset;
- $intp = (int)$assetprice;
- $json = '{'."\n".'"type" : "'.$strasset.'"'."\n".',"price" : "'.$intp.'"'."\n".'}';
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "mydb";
- $conn = new mysqli($servername, $username, $password, $dbname);
- $sql = "INSERT INTO loan_information VALUES ($strrand,$amount,0.01,100)";
- $conn->query($sql);
- $sql = "INSERT INTO loan_by (cid,loanid,asset_information) VALUES ($co,$strrand,'$json')";
- $conn->query($sql);
- }
- }else {
- var_dump("Don't User") ;
- exit() ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement