function index() { $a_post = convertXMLPOSTBooking($this->input->post()); $this->load->model('travflex/search_model'); $service_name = 'Booking'; try { $arrCompleteServ = array(); foreach ($a_post as &$post) { if ($post['OrgResId'] != '' and $post['OrgHBId'] != '') { $service_name = 'Amend Booking'; } $this->searchProduct($post); $this->bookingProduct($post); $data = $this->postBookingProduct($post); if ($data === FALSE) { continue; } $arrCompleteServ[] = $data; } //check hotel and period was same ...do concat!! if ($this->postbook_model->checkCompletedService($arrCompleteServ) === TRUE) { if ($a_post[0]['isConcatHBID'] == 'TRUE') { $this->postbook_model->concatBookId($arrCompleteServ); } } $abooking = array("ResNo" => randomID(), "Status" => $arrCompleteServ[0]['Status'], "PaxPassport" => $post['PaxPassport'], "OSRefNo" => $post['OSRefNo'], "FinishBook" => $post['FinishBook'], "RPCurrency" => $arrCompleteServ[0]["RPCurrency"], "CompleteService" => $arrCompleteServ, "UnCompleteService" => array()); } catch (Exception $ex) { log_message('INFO', 'ERROR MSG => ' . $ex->getMessage() . '; LINE => ' . $ex->getLine()); $abooking['errors']['error'] = $ex->getMessage(); } $this->load->view('travflex/book_response', array('bookInfo' => $abooking)); xmllog21s($service_name, $this->log_21); }
/** * User password reset controller. * * Allows users to begin the password reset process. * * @package User */ // process the form if ('POST' == $_SERVER['REQUEST_METHOD']) { $users = new Model_User(); $users->where('email = ?', $_REQUEST['email']); if (1 == $users->getTotal()) { // get userid, resetkey, and set to expire in 1 day $user = $users->getFirst(); $userid = $user->get('userid'); $resetkey = randomID(); $expire = date('Y-m-d H:i:s', time() + 86400); // create an entry in the password reset table $reset = Model_UserReset::Create(); $reset->set('userid', $userid); $reset->set('resetkey', $resetkey); $reset->set('expire', $expire); $reset->save(); // construct e-mail body $mm = new Pagemill($pm->root()->fork()); $mm->setVariable('username', $user->get('username')); $mm->setVariable('reseturl', sprintf('http://%s%s/password?userid=%d&resetkey=%s', $_SERVER['HTTP_HOST'], TYPEF_WEB_DIR, $userid, $resetkey)); $body = str_replace('&', '&', $mm->writeString('<pm:include template="/users/reset.eml" />', true)); // e-mail the user so they can reset their password $mailer = new Mailer(); $mailer->Configure();
<?php $this->output->setContentType('xml'); $arrCompleteServices = array_filter($arrCompleteServices); if (empty($arrCompleteServices)) { $arrCompleteServices = array(); } if (isset($err['response']['errors'])) { $msg = ''; foreach ($err['response']['errors'] as $err) { $msg .= $err; } echo $RP = f_error_Please_send_requestXML('BookingHotel', 'BookHotel_Response', $msg); } else { $abooking = array("ResNo" => randomID(), "Status" => $arrCompleteServices[0]['Status'], "PaxPassport" => $post[0]['PaxPassport'], "OSRefNo" => $post[0]['OSRefNo'], "FinishBook" => $post[0]['FinishBook'], "RPCurrency" => $arrCompleteServices[0]["RPCurrency"], "CompleteService" => $arrCompleteServices, "UnCompleteService" => array()); echo generateXMLBookHotelInfo($abooking); }
private function prebookHotel(&$post) { $this->prebook_model->setBooking_id(date('Ymd') . randomID()); $this->prebook_model->getRequest($post); $post['response'] = $this->httpcurl->open($this->url)->setRequestHeader('Content-Type', 'text/xml')->send($post['request']); }
<div class="form-group"> <label for="email">Email address</label> <input type="text" class="form-control" id="email" name="email" placeholder="Enter email"> </div> <div class="form-group"> <label for="bugDesc">Bug Description</label> <textarea id="bugDesc" name="bugDesc" cols="30" rows="10"></textarea> </div> <h4>Session Information <span class="whats-this info-session"><a href="#info-sessionModal" data-toggle="modal">What's This?</a></span> </h4> <div class="form-group"> <label for="bugID">Bug Submission ID</label> <input type="text" class="form-control" id="bugID" name="bugID" value="<?php echo randomID(); ?> " readonly="readonly"> </div> <div class="form-group"> <label for="pageName">Page</label> <input type="text" class="form-control" id="pageName" name="pageName" value="<?php echo $_SERVER['REQUEST_URI']; ?> " readonly="readonly"> </div> <div class="form-group"> <label for="browser">Browser Information</label> <input type="text" class="form-control" id="browser" name="browser" value="<?php
<?php require_once '../connection/db.php'; ?> <?php $formName = "contact"; $formID = randomID(); $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $intent = $_POST['intent']; $message = $_POST['message']; $sql = "INSERT INTO kpContact (formID, name, email, phone, intent, message) \n\t\t\t\tVALUES ('{$formID}', '{$name}','{$email}','{$phone}','{$intent}','{$message}')"; if ($dbBugger->query($sql) === TRUE) { echo 'Message successfully sent. '; } else { echo 'Error: ' . $dbBugger->error; } echo $formID; mysqli_close($dbBugger); ?> <?php require_once '../notifiers/internal-email-notify.php'; ?> <?php function randomID() {
/** * Call randomID() recursively until an ID not already in DB is found * *@access public *@return string ID */ function generateIDSession() { global $db, $l; $this->error = ""; $result = randomID(); // check if id already in DB or not $query = "SELECT count(*) FROM dns_session\n WHERE sessionID='" . $result . "'"; $res = $db->query($query); $line = $db->fetch_row($res); if ($db->error()) { $this->error = $l['str_trouble_with_db']; return 0; } if ($line[0] != 0) { $result = $this->generateIDSession(); } return $result; }
/** * Generate unique ID for account recovery * *@access public *@return string ID if success, 0 if error */ function generateIDRecovery() { global $dbauth, $l, $config; $this->error = ""; $result = randomID(); # check if id already in DB or not $query = sprintf("SELECT COUNT(*) FROM %s WHERE %s='%s'", $config->userdbrecoverytable, $config->userdbrecoveryfldid, $result); $res = $dbauth->query($query); $line = $dbauth->fetch_row($res); if ($dbauth->error()) { $this->error = $l['str_trouble_with_db']; return 0; } if ($line[0] != 0) { $result = $this->generateIDRecovery(); } return $result; }
foreach ($qn->result() as $row) { //echo $row->name; //$p = $row->photo . "_blur.png"; echo "Hola {$row->name} !<br>"; echo "<img src='{$row->photo}' /><br><br>"; } /*$rows = $qn->result(); echo "Hi $qn->result()->name !<br>"; echo "<img src='$qn->result()->photo' /><br><br>";*/ echo "<a href='" . $logout . "'><button>Logout</button></a>"; } else { $image = 'https://graph.facebook.com/' . $graphId . '/picture?width=300'; $pic = '/YOUR/PATH/' . $graphId . '.jpg'; file_put_contents($pic, file_get_contents($image)); exec('convert ' . $pic . ' -blur 0x3 ' . $pic . '_blur.png'); $data = array('name' => $name, 'user_id' => randomID(), 'photo' => 'http://localhost/public/img/' . $graphId . '.jpg_blur.png', 'graphid' => $graphId); $this->db->insert('users', $data); } /* if(empty($q)){ $image = 'https://graph.facebook.com/'.$graphId.'/picture?width=300'; $pic = '/var/www/html/public/img/'.$graphId.'.jpg'; file_put_contents($pic, file_get_contents($image)); exec('convert '.$pic.' -blur 0x3 '.$pic.'_blur.png'); $data = array( 'name' => $name, 'user_id' => randomID(), 'photo' => $pic, 'graphid' => $graphId
$mailer = new TypeframeMailer(); $mailer->Configure(); $mailer->IsHTML(true); $mailer->AddAddress($_POST['email']); $mailer->Subject = 'Your Account Pre-Approval from ' . TYPEF_TITLE; $mailer->Body = $body; $mailer->Send(); } // set flag in template $pm->setVariable('typef_require_approval', true); } elseif (TYPEF_REQUIRE_CONFIRMATION) { // set flag in template $pm->setVariable('typef_require_confirmation', true); // get userid, confirmkey, and set to expire in 3 days $userid = $user->get('userid'); $confirmkey = randomID(); $expire = date('Y-m-d H:i:s', time() + 259200); // create an entry in the user confirmation table $user_confirm = Model_UserConfirm::Create(); $user_confirm->set('confirmkey', $confirmkey); $user_confirm->set('userid', $userid); $user_confirm->set('expire', $expire); $user_confirm->save(); // construct e-mail body $mm = new Pagemill($pm->root()->fork()); $mm->setVariable('username', $user->get('username')); $mm->setVariable('confirmurl', sprintf('http://%s%s/confirm?userid=%d&confirmkey=%s', $_SERVER['HTTP_HOST'], TYPEF_WEB_DIR, $userid, $confirmkey)); $body = str_replace('&', '&', $mm->writeString('<pm:include template="/users/register/confirmation.eml" />', true)); // e-mail the user so they can confirm their registration $mailer = new Mailer(); $mailer->Configure();
$result = false; } else { echo "{$randomString}<br>"; } $x++; } } $method = "select"; switch ($method) { case 'insert': /*new user*/ $id = randomID('users'); $sql = "INSERT INTO `dethandeengrrej`.`users` (`id`, `nickname`, `password`, `email`, `userlevel`, `created`, `lastlogdin`) VALUES ('random string of 16 characters', 'username', 'password hased', 'E-mail', 'userlvl', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);"; break; case 'select': $id = randomID('users'); $sql = "SELECT * FROM `users`;"; # code... break; default: # code... break; } /*presenterar datan som json*/ $myArray = array(); if ($result = $conn->query($sql)) { while ($row = $result->fetch_array(MYSQL_ASSOC)) { $myArray[] = $row; } echo json_encode($myArray); }