function index() { global $basedomain; $dataUser['table'] = "bsn_users"; $dataUser['condition'] = array('type' => 2, 'n_status' => 1, 'idUser' => $this->user['idUser']); $getUser = $this->userHelper->fetchData($dataUser); $dataPengaduan = $this->mpengaduan->getPengaduan($this->user['idUser']); if ($getUser) { $this->view->assign('user', $getUser[0]); } if ($_POST['token']) { if ($_POST['pass']) { $pass = _p('pass'); $oldPass = sha1($getUser[0]['salt'] . $pass . $getUser[0]['salt']); if ($getUser[0]['password'] == $oldPass) { $pass1 = _p('pass1'); if ($pass1) { $_POST['password'] = sha1($getUser[0]['salt'] . $pass1 . $getUser[0]['salt']); } } } $signup = $this->contentHelper->saveData($_POST, "_users"); // redirect($basedomain . 'profil'); } $this->view->assign('dataPengaduan', $dataPengaduan); return $this->loadView('akun/profile'); }
function addProduct() { $category = _p('category'); $name = _p('name'); $description = _p('description'); $meta_desc = _p('meta_descriptoion'); $meta_key = _p('meta_keywords'); $model = _p('model'); $sku = _p('sku'); $upc = _p('upc'); $ean = _p('ean'); $jan = _p('jan'); $isbn = _p('isbn'); $mpn = _p('mpn'); $weight = _p('weight'); $weight_class = _p('weight_class'); $length = _p('length'); $width = _p('width'); $height = _p('height'); $length_class = _p('length_class'); $location = _p('location'); $price = _p('price'); $quantity = _p('quantity'); $minimum = _p('minimum'); $substract = _p('substract'); $shipping = _p('shipping'); $status = _p('status'); $date_added = date('Y-m-d H:i:s'); $pathUpload = ""; $image = uploadFile('gambar', $pathUpload, 'image'); $query_product = "INSERT INTO ck_product (`model`, `sku`, `upc`, `ean`, `jan`, `isbn`, `mpn`, `location`, `quantity`, `image`, `shipping`, `price`, `weight`, `weight_class_id`, `length`, `width`, `height`, `length_class_id`, `subtract`, `minimum`, `sort_order`, `status`, `date_added`) VALUES ('{$model}', '{$sku}', '{$upc}', '{$ean}', '{$jan}', '{$isbn}', '{$mpn}', '{$location}', {$quantity}, '{$image}', '{$shipping}', {$price}, {$weight}, '{$weight_class}', {$length}, {$width}, {$height}, '{$length_class}', '{$substract}', {$minimum}, '', {$status}, '{$date_added}' )"; echo "<br />" . $query_product; echo "<br />"; pr($image); }
public function RenderTable() { foreach ($this->objConstantArray as $objConstant) { $strName = $objConstant->Variable->Name; if (QApplication::$Login) { $strName .= ' <a href="/edit_constant.php/' . $objConstant->Id . '" class="class_property_link" title="Edit">Edit</a>'; } $strType = $objConstant->Variable->VariableType; $strValue = $objConstant->Variable->DefaultValue; $strDescription = $objConstant->Variable->ShortDescriptionAsHtml; ?> <tr> <td class="class_property_name"><?php _p($strName, false); ?> </td> <td class="class_property_type"><?php _p($strType, false); ?> </td> <td class="class_property_value"><?php _p($strValue, false); ?> </td> <td class="class_property_description"><?php _p($strDescription, false); ?> </td> </tr> <?php } }
function goLogin() { // pr($_POST);exit; $username = _p('username'); $password = _p('password'); // pr($data); $sql = "SELECT * FROM admin_member WHERE username = '******' LIMIT 1"; // pr($sql);exit; $res = $this->fetch($sql, 0, 0); // pr($res);exit; if ($res) { $salt = sha1($password . $res['salt']); // pr($salt);exit; // $getRule = "SELECT * FROM cdc_group_rule WHERE groupID = {$res['usertype']} LIMIT 1 "; // $res['rule'] = $this->fetch($getRule); // pr($res); // exit; if ($res['password'] == $salt) { // $_SESSION['admin'] = $res; $this->session->set_session($res); return true; } } return false; }
function updateCategory() { global $CONFIG; $id = _p('category_id'); $parent = _p('parent'); $name = _p('name'); $description = _p('description'); $meta_description = _p('meta_description'); $meta_keywords = _p('meta_keywords'); $top = _p('top'); $column = _p('column'); $sort_order = _p('sort_order'); $status = _p('status'); $pathUpload = ""; $date_modified = date('Y-m-d H:i:s'); if ($_FILES['gambar']['name'] == "") { $query = "UPDATE ck_category SET parent_id={$parent}, top={$top}, `column`={$column}, sort_order={$sort_order}, status={$status}, date_modified = '{$date_modified}' WHERE category_id = {$id}"; } else { $image = uploadFile('gambar', $pathUpload, 'image'); $query = "UPDATE ck_category SET image='{$image}', parent_id={$parent}, top={$top}, `column`={$column}, sort_order={$sort_order}, status={$status}, date_modified='{$date_modified}' WHERE category_id = {$id}"; } $query_desc = "UPDATE ck_category_description SET name = '{$name}', description = '{$description}', meta_description = '{$meta_description}', meta_keyword = '{$meta_keywords}' WHERE category_id = {$id}"; $result_query = $this->query($query); $result_desc = $this->query($query_desc); // pr ($_FILES['gambar']); // echo ("<br/>"); // pr ($image); // echo ("<br/>"); // echo "<br />".$query; // exit(); return $result_desc && $result_query; }
public function setting() { global $CONFIG, $basedomain; $id = $this->admin['admin']['id']; $x = form_validation($_POST); unset($x['token']); if (isset($_POST['old_password'])) { $old_password = sha1($x['old_password'] . $this->admin['admin']['salt']); if ($old_password == $this->admin['admin']['password']) { unset($x['old_password']); unset($x['repassword']); $x['password'] = sha1($x['password'] . $this->admin['admin']['salt']); } else { echo "<script>alert('Denied. Wrong password');window.location.href='" . $CONFIG['admin']['base_url'] . "profile'</script>"; } } else { $x['password'] = $this->admin['admin']['password']; } $data = $this->models->updSettings($x, $id); if (_p('token')) { $getUser = $this->models->updSess($x); if ($getUser) { echo "<script>alert('Settings has been saved.');window.location.href='" . $CONFIG['admin']['base_url'] . "profile'</script>"; } else { redirect($basedomain . $CONFIG['admin']['login']); } exit; } }
function goLogin() { // pr($_POST); $email = _p('email'); $password = _p('password'); // pr($data); $data['status'] = false; $newCred = array(); $sql = "SELECT * FROM social_member WHERE email = '{$email}' AND usertype IN (1) AND n_status = 1 LIMIT 1"; // pr($sql); $res = $this->fetch($sql); // pr($res); // exit; if ($res) { $salt = sha1($res['salt'] . $password); // pr($salt);exit; if ($res['password'] == $salt) { $loginCount = intval($res['login_count'] + 1); $lastLogin = date('Y-m-d H:i:s'); $sqlu = "UPDATE social_member SET last_login = '******' ,login_count = {$loginCount} WHERE id = {$res['id']} LIMIT 1"; $result = $this->query($sqlu); // $_SESSION['user'] = $res; $ignoreFIeld = array('salt', 'password', 'email_token', 'email', 'username'); foreach ($res as $key => $val) { if (!in_array($key, $ignoreFIeld)) { $newCred[$key] = $val; } } $this->set_session->set_session($newCred); return $newCred; } } return false; }
public function Render($blnPrint = true) { if (!$this->blnModified) { return; } if (count($this->arrData)) { $strDataArray = 'new Array('; foreach ($this->arrData as $strData) { $strDataArray .= sprintf("'%s', ", $strData); } $strDataArray = substr($strDataArray, 0, strlen($strDataArray) - 2); $strDataArray .= ')'; } else { $strDataArray = ''; } $strRendered = ''; $strRendered .= sprintf("\$('%s').flushCache();", $this->strSelector); $strRendered .= sprintf("\$('%s').autocomplete(%s);", $this->strSelector, $strDataArray); $this->blnModified = false; error_log("_______END RENDERING JS: " . ($this->blnModified ? 'true' : 'false')); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
private function displayGenericExceptionPage($e, $context = null) { if ($this->report || $this->report === null) { echo '<html>' . "\n"; echo ' <head>' . "\n"; echo ' <title>Oops, Uncaught Exception</title>' . "\n"; echo ' <style>' . "\n"; echo ' body{font-family: "Open Sans",arial,sans-serif; background: #FFF; color:#333; margin:2em}' . "\n"; echo ' code{background:#E0941B;border-radius:4px;padding:2px 6px}' . "\n"; echo ' </style>' . "\n"; echo ' </head>' . "\n"; echo ' <body>' . "\n"; echo ' <h1>Oops, uncaught exception !</h1>' . "\n"; echo ' <h2>This is embarrassing, but server made a booboo</h2>' . "\n"; echo ' <p><code>' . $e->getMessage() . '</code></p>' . "\n"; echo ' <h3>From:</h3>' . "\n"; echo ' <p><code>' . $e->getFile() . ' on line ' . $e->getLine() . '</code></p>' . "\n"; echo ' <h3>Call stack</h3>' . "\n"; echo ' <pre>' . $e->getTraceAsString() . '</pre>' . "\n"; if ($this->dumpContext) { echo '<h3>Context:</h3>'; _p($context); } echo ' </body>' . "\n"; echo '</html>'; } exit(1); }
public function RenderTableForVariables($objVariableArray) { $strBackgroundColor = 'style="background-color: #eee0fa;"'; foreach ($objVariableArray as $objVariable) { $strName = $objVariable->Variable->Name; if (QApplication::$Login) { $strName .= ' <a href="/edit_variable.php/' . $objVariable->Id . '" class="class_property_link" title="Edit">Edit</a>'; } switch ($objVariable->InheritenceState) { case InheritenceState::Interited: $strClass = ' class_property_inherited'; $strDetails = '<br/><span style="color: #999999;">Inherits From: </span><b>' . $objVariable->QcodoClass->Name . '</b>'; break; case InheritenceState::Overrides: $strClass = ' class_property_overrides'; $strDetails = '<br/><span style="color: #999999;">Overrides: </span><b>' . $objVariable->OverridesVariable->QcodoClass->Name . '</b>'; break; default: $strClass = null; $strDetails = null; } if ($objVariable->StaticFlag) { $strDetails = 'Static: </span><b>Yes</b><br/><span style="color: #999999;">Protection Level: </span><b>' . ProtectionType::ToString($objVariable->ProtectionTypeId) . '</b>' . $strDetails; } else { $strDetails = 'Protection Level: </span><b>' . ProtectionType::ToString($objVariable->ProtectionTypeId) . '</b>' . $strDetails; } $strName .= '<div class="class_methods_detail"><span style="color: #999999;">' . $strDetails . '</div>'; $strType = $objVariable->Variable->VariableType; if ($objVariable->ReadOnlyFlag) { $strType .= '<br/><span class="class_property_subspan">(Read-Only)</span>'; } $strValue = $objVariable->Variable->DefaultValue; $strDescription = $objVariable->Variable->ShortDescriptionAsHtml; ?> <tr> <td class="class_property_name<?php _p($strClass); ?> "><?php _p($strName, false); ?> </td> <td class="class_property_type"><?php _p($strType, false); ?> </td> <td class="class_property_value"><?php _p($strValue, false); ?> </td> <td class="class_property_description"><?php _p($strDescription, false); ?> </td> </tr> <?php } }
function DisplayMonospacedText($strText) { $strText = QApplication::HtmlEntities($strText); $strText = str_replace(' ', ' ', $strText); $strText = str_replace(' ', ' ', $strText); $strText = str_replace("\r", '', $strText); $strText = str_replace("\n", '<br/>', $strText); _p($strText, false); }
public function Render($blnPrint = true) { $strRendered = sprintf("\$('%s').selectmenu();", $this->strSelector); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function RenderAsJSCall($blnPrint) { $strRendered = sprintf('$("head").append(\'%s\');', $this->__toString()); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function RenderAsJSCall($blnPrint) { $strRendered = sprintf('$("head").append($(\'<scr\' + \'ipt type="text/javascript" src="%s"></scr\' + \'ipt>\'));', $this->strSrc); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
function DisplayMonospacedText($strText) { //$strText = htmlentities($strText); //$strText = str_replace(' ', ' ', $strText); //$strText = str_replace(' ', ' ', $strText); //$strText = str_replace("\r", '', $strText); //$strText = str_replace("\n", '<br/>', $strText); _p($strText, false); }
public function Render($blnPrint = true) { $strRendered = parent::Render(); $strRendered .= sprintf("<iframe id='%s' src='%s' initCall='true' %s ><p>Your browser does not support iframes.</p></iframe>", $this->strControlId, $this->strSrc, $this->GetAttrString()); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { $strProperties = MJaxApplication::ConvertArrayToJason($this->arrProperties); $strRendered = sprintf("\$('%s').jqFancyTransitions(%s);", $this->strSelector, $strProperties); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { $strParameters = implode(",", $this->arrParameters); $strRendered = sprintf("MJaxTouch.%s(%s);\n", $this->strFunction, $strParameters); if ($blnPrint) { _p($strRendered); } else { return $strRendered; } }
public function Render($blnPrint = true) { $strRendered = parent::Render(); $strRendered .= sprintf("<input id='%s' name='%s' class='ui-widget' type='text' value='%s' />", $this->strControlId, $this->strControlId, $this->strText); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Run() { ob_clean(); header('Content-type: text/xml'); if (QApplication::$EncodingType) printf("<?xml version=\"1.0\" encoding=\"%s\" ?>\r\n", QApplication::$EncodingType); else _p("<?xml version=\"1.0\" ?>\r\n", false); _p($this->GetXml(), false); }
public function Render($blnPrint = true) { $strRendered = "var jQT = new \$.jQTouch("; $strRendered .= MJaxApplication::ConvertArrayToJason($this->arrConfig); $strRendered .= ");\n"; if ($blnPrint) { _p($strRendered); } else { return $strRendered; } }
public function Render($blnPrint = true) { //Render Actions first if applicable $strRendered = parent::Render(); $strRendered .= sprintf("<a id='%s' name='%s' %s>%s</a>", $this->strControlId, $this->strControlId, $this->GetAttrString(), $this->strText); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { //Render Actions first if applicable $strRendered = parent::Render(); $strRendered .= sprintf("<img id='%s' name='%s' src='%s' %s></img>", $this->strControlId, $this->strControlId, $this->strSrc, $this->objStyle->__toAttr()); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { //Render Actions first if applicable $strRendered = parent::Render(); $strRendered .= sprintf("<input id='%s' name='%s' type='button' value='%s'></input>", $this->strControlId, $this->strControlId, $this->strText); if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
function ajax() { $id = _p('id'); $n_status = _p('n_status'); $data = $this->models->updateStatusFrame($id, $n_status); if ($data) { print json_encode(array('status' => true)); } else { print json_encode(array('status' => false)); } exit; }
public function RenderCss($blnPrint = true, $blnAjaxFormating = false) { $strRendered = "." . $this->strClassName . "{\n"; $strRendered .= $this->objStyle->__toCss(true); $strRendered .= "}\n"; $this->blnModified = false; if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { if (!$this->blnModified) { return; } $strRendered = sprintf("\$('%s').selectmenu();", $this->strSelector); $this->blnModified = false; if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { if (!$this->blnModified) { return; } $strRendered = sprintf("\$('%s').limit('%s', '%s');", $this->strSelector, $this->intLimitCount, $this->strCountEleSelector); $this->blnModified = false; if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { if (!$this->blnModified) { return; } $strProperties = MJaxApplication::ConvertArrayToJason($this->arrProperties); $strRendered = sprintf("\$('%s').datepicker(%s);", $this->strSelector, $strProperties); $this->blnModified = false; if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }
public function Render($blnPrint = true) { $strRendered = parent::Render(); $strRendered .= sprintf("<ul id='%s' name='%s' %s>\n", $this->strControlId, $this->strControlId, $this->GetAttrString()); foreach ($this->arrChildControls as $objListItem) { //render list items $strRendered .= $objListItem->Render(false); } $strRendered .= "</ul>\n"; if ($blnPrint) { _p($strRendered, false); } else { return $strRendered; } }