{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":2,"cells":{"blob_id":{"kind":"string","value":"e47b73fe4b910d3beaab00a746cb3a94340bd147"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"jhonharoldpizarro2021/agricolaApp"},"path":{"kind":"string","value":"/querys/q_informe_costos.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3328,"string":"3,328"},"score":{"kind":"number","value":2.515625,"string":"2.515625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" $row[\"id_unidad_agricola\"],\n \"tc\" => $row[\"tipo_costo\"],\n \"valor\" => $row[\"valor\"],\n );\n if ( !in_array( $row[\"id_unidad_agricola\"],$suertes ) ){\n $suertes[] = $row[\"id_unidad_agricola\"];\n $nSuerte[] = $row[\"nombre_unidad_agricola\"];\n $finca[] = $row[\"id_finca\"];\n $nFinca[] = $row[\"nombre_finca\"];\n }\n }\n $informeSuertes = array();\n \n for ($i=0; $i < count($suertes); $i++){\n $queryTmp = \"SELECT * FROM qryInformeCostos WHERE id_unidad_agricola='\".$suertes[$i].\"'\";\n $resultadoTmp = mysqli_query($con, $queryTmp);\n $informeTmp = array();\n while( $rowTmp = mysqli_fetch_array( $resultadoTmp ) ){\n $informeTmp[] = array(\n \"tc\" => $rowTmp[\"tipo_costo\"],\n \"valor\" => $rowTmp[\"valor\"],\n );\n if ( !array_key_exists( $rowTmp[\"tipo_costo\"],$colores ) ){\n $queryColor = \" SELECT valor FROM parametros_generales WHERE nombre='\".$rowTmp[\"tipo_costo\"].\"' AND tipo='color' \";\n $resultadoColor = mysqli_query($con, $queryColor);\n if ($rowColor = mysqli_fetch_array($resultadoColor )){\n $colores[$rowTmp[\"tipo_costo\"]] = $rowColor[\"valor\"];\n }\n }\n }\n $informeSuertes[]=array(\n \"idFinca\" => $finca[$i],\n \"nFinca\" => $nFinca[$i],\n \"idSuerte\" => $suertes[$i],\n \"nSuerte\" => $nSuerte[$i],\n \"informes\" => $informeTmp,\n \"query\" => $queryTmp,\n ); \n }\n //retorno\n if( count($informe) > 0) {\n $retorno[\"estado\"] = \"OK\";\n $retorno[\"informe\"] = $informe;\n $retorno[\"informeSuertes\"] = $informeSuertes;\n $retorno[\"colores\"] = $colores;\n }\n else {\n $retorno[\"estado\"] = \"EMPTY\";\n }\n break; \n }\n if( !close_bd($con) ) {\n $retorno[\"msg\"] = \"Error al cerrar la conexión a la BDD\";\n }\n }\n else {\n $retorno[\"estado\"] = \"ERROR\";\n $retorno[\"msg\"] = \"Error de conexión a la BDD:\". mysqli_connect_error();\n }\n}\nelse {\n $retorno[\"estado\"] = \"ERROR\";\n $retorno[\"msg\"] = \"Parámetros no encontrados\";\n}\nheader('Content-Type: application/json; charset=utf-8');\necho json_encode( $retorno );\n\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":3,"cells":{"blob_id":{"kind":"string","value":"ae81f87dfe291586fe18e2cb1ef8530080064749"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"RenLiZhou/laravel_admin"},"path":{"kind":"string","value":"/app/Http/Controllers/Controller.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":982,"string":"982"},"score":{"kind":"number","value":2.515625,"string":"2.515625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"fails()) {\n $bags = $validator->getMessageBag()->toArray();\n foreach ($bags as $bag) {\n foreach ($bag as $item) {\n return $item;\n }\n }\n }\n return null;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":4,"cells":{"blob_id":{"kind":"string","value":"f8b576e114554e94365232a843ca549b298cc800"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"netgen-layouts/layouts-contentful"},"path":{"kind":"string","value":"/lib/Routing/EntrySluggerInterface.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":305,"string":"305"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"all();\n $this->validate($request, [\n 'name'=>'required',\n 'phone'=>'required|max:10|unique:member',\n 'password' => 'min:6|same:password2',\n ],\n [\n 'password.same' => 'Password Not Matching',\n ]);\n\n //$input = $request->all();\n //$input['password'] = Hash::make($request->password);\n\n Member::create($request->all());//strore to database\n return redirect('/');\n }\n\n /**\n * Display the specified resource.\n *\n * @param \\App\\Models\\Register $register\n * @return \\Illuminate\\Http\\Response\n */\n public function show(Register $register)\n {\n //\n }\n\n /**\n * Show the form for editing the specified resource.\n *\n * @param \\App\\Models\\Register $register\n * @return \\Illuminate\\Http\\Response\n */\n public function edit(Register $register)\n {\n //\n }\n\n /**\n * Update the specified resource in storage.\n *\n * @param \\Illuminate\\Http\\Request $request\n * @param \\App\\Models\\Register $register\n * @return \\Illuminate\\Http\\Response\n */\n public function update(Request $request, Register $register)\n {\n //\n }\n\n /**\n * Remove the specified resource from storage.\n *\n * @param \\App\\Models\\Register $register\n * @return \\Illuminate\\Http\\Response\n */\n public function destroy(Register $register)\n {\n //\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":6,"cells":{"blob_id":{"kind":"string","value":"42e089ec4638894bed82e40ad2bbde973a0fadab"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Edwin-En/Accedo"},"path":{"kind":"string","value":"/3. API con PHP/PokemonAPI/login.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1504,"string":"1,504"},"score":{"kind":"number","value":2.921875,"string":"2.921875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"prepare('SELECT id, email, password FROM usuarios WHERE email=:email');\n $records->bindParam(':email', $_POST['email']);\n $records->execute();\n $results = $records->fetch(PDO::FETCH_ASSOC);\n\n $message = '';\n\n if (count($results) > 0 && password_verify($_POST['password'], $results['password'])) {\n $_SESSION['user_id'] = $results['id'];\n header('Location: /PokemonAPI/index.php');\n } else {\n $message = \"Las contraseñas no coinciden\";\n }\n\n }\n\n?>\n\n\n\n \n \n Inicio de sesion \n\n \n\n \n \n\n \n\n

Inicia sesion

\n o Registrate \n\n \n

\n \n\n

\n \n \n \n
\n\n\n \n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":7,"cells":{"blob_id":{"kind":"string","value":"4d2dfaa51b0edabb9fecb4217f28af34635c2a55"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"eskguptha/php"},"path":{"kind":"string","value":"/read_csv.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":824,"string":"824"},"score":{"kind":"number","value":2.921875,"string":"2.921875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\n\n\t\n\n\n\n

Read data from csv using php

\n\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n \n \n \n \n \n \n \n \n \n \n \n \n \n
SKUNameCategoryPriceQty
\n\n\n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":8,"cells":{"blob_id":{"kind":"string","value":"19ddef5195ac36e49aef493cb42e45529ac43e66"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"zikezhang/LaravelAdmin"},"path":{"kind":"string","value":"/src/Verecom/Admin/User/Form/PasswordForm.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2222,"string":"2,222"},"score":{"kind":"number","value":2.8125,"string":"2.8125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"users = $users;\n $this->validator = $validator;\n $this->mailer = $mailer;\n }\n\n /**\n *\n *\n * @author ZZK\n * @link http://verecom.com\n *\n * @param $email\n *\n * @return void\n */\n public function forgot($email)\n {\n $user = $this->users->findByLogin($email);\n $this->mailer->sendReset($user);\n Event::fire('users.password.forgot', array($user));\n }\n\n /**\n * Reset a given user password\n *\n * @author ZZK\n * @link http://verecom.com\n *\n * @param array $creds\n *\n * @return bool\n */\n public function reset(array $creds)\n {\n try\n {\n if ($this->validator->with($creds)->passes())\n {\n $this->users->resetPassword($creds['code'],$creds['password']);\n return true;\n }\n }\n catch (UserNotFoundException $e)\n {\n $this->validator->add('UserNotFoundException',$e->getMessage());\n }\n\n return false;\n\n }\n\n /**\n * Get the validation errors\n *\n * @author ZZK\n * @link http://verecom.com\n *\n * @return array\n */\n public function getErrors()\n {\n return $this->validator->errors();\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":9,"cells":{"blob_id":{"kind":"string","value":"28f42776206c068a3fb1a5e3479eca82fefbbf6c"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"aheadWorks/module-langshop"},"path":{"kind":"string","value":"/Api/Data/TranslatableResource/PaginationInterface.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1107,"string":"1,107"},"score":{"kind":"number","value":2.71875,"string":"2.71875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"attributes['student_id']=ucwords($value);\n }\n\n\n public function setAmountPaidAttribute($value)\n {\n $this->attributes['amount_paid']=ucwords($value);\n }\n\n\n public function setPaymentModeAttribute($value)\n {\n $this->attributes['payment_mode']=ucwords($value);\n }\n\n\n public function setReferenceNoAttribute($value)\n {\n $this->attributes['reference_no']=strtoupper($value);\n }\n \n \n public function setReceiptNoAttribute($value)\n {\n $this->attributes['receipt_no']=strtoupper($value);\n }\n\n\n public function setDatePaiddAttribute($value)\n {\n $this->attributes['date_paid']=ucwords($value);\n }\n\n\n\n public function student()\n {\n return $this->belongsTo('App\\Model\\Student');\n }\n \n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":11,"cells":{"blob_id":{"kind":"string","value":"e363598aa8ad134e038d964173d661c38573641d"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"moahmedmish/code_repository"},"path":{"kind":"string","value":"/app/Http/Controllers/RepositoryController.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1377,"string":"1,377"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"repositoryIntegrationServices = $repositoryIntegrationServices;\n }\n\n /**\n * GET DATA FROM Code Repository.\n *\n * @param Request $request\n * @return \\Illuminate\\Http\\JsonResponse\n */\n public function get(FilterDataRequest $request,$code_repository)\n {\n $finalResults = $this->repositoryIntegrationServices->filterData($request->all(),$code_repository);\n\n if (! $finalResults && count($finalResults)) {\n return $this->_ReturnJsonResponse('Failed Operation : Something Went Wrong ...!', [], [], Response::HTTP_BAD_REQUEST);\n }\n\n return $this->_ReturnJsonResponse('Successfully Operation.', [], $finalResults, Response::HTTP_OK);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":12,"cells":{"blob_id":{"kind":"string","value":"955f0a07895735b60f4327c756169bc827da9f9d"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"koftikes/symfony-adminlte-bundle"},"path":{"kind":"string","value":"/src/Model/NotificationInterface.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":736,"string":"736"},"score":{"kind":"number","value":2.765625,"string":"2.765625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"get_columns();\n $hidden = $this->get_hidden_columns();\n $sortable = $this->get_sortable_columns();\n $action = $this->current_action();\n\n $data = $this->table_data();\n usort( $data, array( &$this, 'sort_data' ) );\n\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $totalItems = count($data);\n\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n\n $data = array_slice($data,(($currentPage-1)*$perPage),$perPage);\n $this->_column_headers = array($columns, $hidden, $sortable);\n\n $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : false;\n if(!empty($search)){\n global $wpdb;\n \n try {\n $search = sanitize_text_field( $search );\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations WHERE UserName LIKE '%$search%'\", ARRAY_A);\n if(!is_wp_error( $wpdb )){\n $this->items = $data;\n }\n } catch (\\Throwable $th) {\n //throw $th;\n }\n\n }else{\n $this->items = $data;\n }\n \n }\n\n /**\n * Override the parent columns method. Defines the columns to use in your listing table\n *\n * @return Array\n */\n public function get_columns(){\n $columns = array(\n 'cb' => '',\n 'ID' => 'ID',\n 'Orderno' => 'Order No',\n 'Mtid' => 'Mtid',\n 'Userid' => 'User ID',\n 'UserName' => 'User Name',\n 'Prodcode' => 'Product Code',\n 'Status' => 'Status',\n 'Comment' => 'Comment',\n 'Editable' => 'Editable',\n 'Expirytime' => 'Expirytime',\n 'Modifydate' => 'Modifydate'\n );\n\n return $columns;\n }\n\n /**\n * Define which columns are hidden\n *\n * @return Array\n */\n public function get_hidden_columns()\n {\n return array();\n }\n\n /**\n * Define the sortable columns\n *\n * @return Array\n */\n public function get_sortable_columns()\n {\n return array(\n 'ID' => array('ID', true),\n 'Orderno' => array('Orderno', true),\n 'Mtid' => array('Mtid', true),\n 'Userid' => array('Userid', true),\n 'UserName' => array('UserName', true)\n );\n }\n\n\n /**\n * Get the table data\n *\n * @return Array\n */\n private function table_data(){\n $data = array();\n\n global $wpdb;\n\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations ORDER BY ID ASC\", ARRAY_A);\n \n return $data;\n }\n\n /**\n * Define what data to show on each column of the table\n *\n * @param Array $item Data\n * @param String $column_name - Current column name\n *\n * @return Mixed\n */\n public function column_default( $item, $column_name ){\n switch( $column_name ) {\n case 'ID':\n case 'Orderno':\n case 'Mtid':\n case 'Userid':\n case 'UserName':\n case 'Prodcode':\n case 'Status':\n case 'Comment':\n case 'Editable':\n case 'Expirytime':\n case 'Modifydate':\n return $item[ $column_name ];\n default:\n return print_r( $item, true ) ;\n }\n }\n\n function get_bulk_actions() {\n $actions = array(\n 'products_disable' => 'Disable Lifetime License',\n 'subscription_disable' => 'Disable Subscription License',\n 'enable_products_' => 'Enable Lifetime License',\n 'enable_subscription_' => 'Enable Subscription License'\n );\n return $actions;\n }\n\n function column_cb($item) {\n return sprintf(\n '', $item['Orderno']\n ); \n }\n\n // All form actions\n function current_action(){\n global $wpdb;\n\n if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'products_disable'){\n if(isset($_REQUEST['orders']) && !empty($_REQUEST['orders'])){\n $orders_data = $_REQUEST['orders'];\n if(is_array($orders_data)){\n foreach($orders_data as $data){\n \n $order_id = $data;\n \n $order = wc_get_order( $order_id );\n if($order !== false){\n $items = $order->get_items();\n \n foreach ( $items as $item ) {\n $product_id = $item->get_product_id();\n \n if(WC_Product_Factory::get_product_type($product_id) !== 'subscription'){\n $wpdb->update($wpdb->prefix.'lic_activations', array(\n 'Editable' => 0\n ),array( 'Orderno' => $order_id ),array('%d'),array('%d'));\n }\n }\n }\n }\n }\n }else{\n print_r(\"No order selected.\");\n }\n }\n\n if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'subscription_disable'){\n if(isset($_REQUEST['orders']) && !empty($_REQUEST['orders'])){\n $orders_data = $_REQUEST['orders'];\n if(is_array($orders_data)){\n foreach($orders_data as $data){\n \n $order_id = $data;\n \n $order = wc_get_order( $order_id );\n if($order !== false){\n $items = $order->get_items();\n \n foreach ( $items as $item ) {\n $product_id = $item->get_product_id();\n \n if(WC_Product_Factory::get_product_type($product_id) === 'subscription'){\n $wpdb->update($wpdb->prefix.'lic_activations', array(\n 'Editable' => 0\n ),array( 'Orderno' => $order_id ),array('%d'),array('%d'));\n }\n }\n }\n }\n }\n }else{\n print_r(\"No orders selected.\");\n }\n \n }\n\n if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'enable_products_'){\n if(isset($_REQUEST['orders']) && !empty($_REQUEST['orders'])){\n $orders_data = $_REQUEST['orders'];\n if(is_array($orders_data)){\n foreach($orders_data as $data){\n \n $order_id = $data;\n \n $order = wc_get_order( $order_id );\n if($order !== false){\n $items = $order->get_items();\n \n foreach ( $items as $item ) {\n $product_id = $item->get_product_id();\n \n if(WC_Product_Factory::get_product_type($product_id) !== 'subscription'){\n $wpdb->update($wpdb->prefix.'lic_activations', array(\n 'Editable' => 1\n ),array( 'Orderno' => $order_id ),array('%d'),array('%d'));\n }\n }\n }\n }\n }\n }else{\n print_r(\"No orders selected.\");\n }\n \n }\n\n if(isset($_REQUEST['action']) && $_REQUEST['action'] == 'enable_subscription_'){\n if(isset($_REQUEST['orders']) && !empty($_REQUEST['orders'])){\n $orders_data = $_REQUEST['orders'];\n if(is_array($orders_data)){\n foreach($orders_data as $data){\n \n $order_id = $data;\n \n $order = wc_get_order( $order_id );\n if($order !== false){\n $items = $order->get_items();\n \n foreach ( $items as $item ) {\n $product_id = $item->get_product_id();\n \n if(WC_Product_Factory::get_product_type($product_id) === 'subscription'){\n $wpdb->update($wpdb->prefix.'lic_activations', array(\n 'Editable' => 1\n ),array( 'Orderno' => $order_id ),array('%d'),array('%d'));\n }\n }\n }\n }\n }\n }else{\n print_r(\"No order selected.\");\n }\n }\n }\n\n /**\n * Allows you to sort the data by the variables set in the $_GET\n *\n * @return Mixed\n */\n private function sort_data( $a, $b )\n {\n // Set defaults\n $orderby = 'ID';\n $order = 'asc';\n\n // If orderby is set, use this as the sort column\n if(!empty($_GET['orderby']))\n {\n $orderby = $_GET['orderby'];\n }\n\n // If order is set use this as the order\n if(!empty($_GET['order']))\n {\n $order = $_GET['order'];\n }\n\n\n $result = strcmp( $a[$orderby], $b[$orderby] );\n\n if($order === 'asc')\n {\n return $result;\n }\n\n return -$result;\n }\n\n} //class"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":14,"cells":{"blob_id":{"kind":"string","value":"a010d320967cb31a4cd28b20f2eb45c8b8a536e5"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"xiebruce/PicUploader"},"path":{"kind":"string","value":"/vendor/cloudinary/cloudinary_php/tests/TagTest.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":45334,"string":"45,334"},"score":{"kind":"number","value":2.546875,"string":"2.546875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" 'custom_value1', 'custom_attr2' => 'custom_value2');\n private static $common_image_options = array(\n 'effect' => 'sepia',\n 'cloud_name' => 'test123',\n 'client_hints' => false,\n );\n private static $fill_transformation;\n private static $fill_trans_str;\n private static $common_srcset;\n private static $breakpoints_arr;\n private static $sizes_attr;\n\n public static function setUpBeforeClass()\n {\n self::$breakpoints_arr = array(self::$min_width, 200, 300, self::$max_width);\n self::$max_images = count(self::$breakpoints_arr);\n self::$common_srcset = array('breakpoints' => self::$breakpoints_arr);\n\n self::$fill_transformation = ['width' => self::$max_width, 'height' => self::$max_width, 'crop' => 'fill'];\n self::$fill_trans_str = \"c_fill,h_\" . self::$max_width . \",w_\" . self::$max_width;\n\n self::$sizes_attr = implode(\n ', ',\n array_map(\n function ($w) {\n return \"(max-width: ${w}px) ${w}px\";\n },\n self::$breakpoints_arr\n )\n );\n\n Curl::$instance = new Curl();\n }\n\n protected function setUp()\n {\n Cloudinary::reset_config();\n Cloudinary::config(\n array(\n \"cloud_name\" => \"test123\",\n \"api_key\" => \"a\",\n \"api_secret\" => \"b\",\n \"secure_distribution\" => null,\n \"private_cdn\" => false,\n \"cname\" => null\n )\n );\n }\n\n public function test_cl_image_tag()\n {\n $tag = cl_image_tag(\"test\", array(\"width\" => 10, \"height\" => 10, \"crop\" => \"fill\", \"format\" => \"png\"));\n $this->assertEquals(\n \"\",\n $tag\n );\n }\n\n /**\n * Should create a meta tag with client hints\n */\n public function test_cl_client_hints_meta_tag()\n {\n $doc = new DOMDocument();\n $doc->loadHTML(cl_client_hints_meta_tag());\n $tags = $doc->getElementsByTagName('meta');\n $this->assertEquals($tags->length, 1);\n $this->assertEquals($tags->item(0)->getAttribute('content'), 'DPR, Viewport-Width, Width');\n $this->assertEquals($tags->item(0)->getAttribute('http-equiv'), 'Accept-CH');\n }\n\n /**\n * Check that cl_image_tag encodes special characters.\n */\n public function test_cl_image_tag_special_characters_encoding()\n {\n $tag = cl_image_tag(\n \"test's special < \\\"characters\\\" >\",\n array(\"width\" => 10, \"height\" => 10, \"crop\" => \"fill\", \"format\" => \"png\", \"alt\" => \"< test's > special \\\"\")\n );\n $expected = \"&lt; test&#039;s &gt; special &quot;\";\n\n $this->assertEquals($expected, $tag);\n }\n\n public function test_responsive_width()\n {\n // should add responsive width transformation\n $tag = cl_image_tag(\"hello\", array(\"responsive_width\" => true, \"format\" => \"png\"));\n $this->assertEquals(\n \"\",\n $tag\n );\n\n $options = array(\"width\" => 100, \"height\" => 100, \"crop\" => \"crop\", \"responsive_width\" => true);\n $result = Cloudinary::cloudinary_url(\"test\", $options);\n $this->assertEquals($options, array(\"responsive\" => true));\n $this->assertEquals($result, TagTest::DEFAULT_UPLOAD_PATH . \"c_crop,h_100,w_100/c_limit,w_auto/test\");\n Cloudinary::config(\n array(\n \"responsive_width_transformation\" => array(\n \"width\" => \"auto:breakpoints\",\n \"crop\" => \"pad\",\n ),\n )\n );\n $options = array(\"width\" => 100, \"height\" => 100, \"crop\" => \"crop\", \"responsive_width\" => true);\n $result = Cloudinary::cloudinary_url(\"test\", $options);\n $this->assertEquals($options, array(\"responsive\" => true));\n $this->assertEquals(\n $result,\n TagTest::DEFAULT_UPLOAD_PATH . \"c_crop,h_100,w_100/c_pad,w_auto:breakpoints/test\"\n );\n }\n\n public function test_width_auto()\n {\n // should support width=auto\n $tag = cl_image_tag(\"hello\", array(\"width\" => \"auto\", \"crop\" => \"limit\", \"format\" => \"png\"));\n $this->assertEquals(\n \"\",\n $tag\n );\n $tag = cl_image_tag(\"hello\", array(\"width\" => \"auto:breakpoints\", \"crop\" => \"limit\", \"format\" => \"png\"));\n $this->assertEquals(\n \"\",\n $tag\n );\n $this->cloudinary_url_assertion(\n \"test\",\n array(\"width\" => \"auto:20\", \"crop\" => 'fill'),\n TagTest::DEFAULT_UPLOAD_PATH . \"c_fill,w_auto:20/test\",\n array('responsive' => true)\n );\n $this->cloudinary_url_assertion(\n \"test\",\n array(\"width\" => \"auto:20:350\", \"crop\" => 'fill'),\n TagTest::DEFAULT_UPLOAD_PATH . \"c_fill,w_auto:20:350/test\",\n array('responsive' => true)\n );\n $this->cloudinary_url_assertion(\n \"test\",\n array(\"width\" => \"auto:breakpoints\", \"crop\" => 'fill'),\n TagTest::DEFAULT_UPLOAD_PATH . \"c_fill,w_auto:breakpoints/test\",\n array('responsive' => true)\n );\n $this->cloudinary_url_assertion(\n \"test\",\n array(\"width\" => \"auto:breakpoints_100_1900_20_15\", \"crop\" => 'fill'),\n TagTest::DEFAULT_UPLOAD_PATH . \"c_fill,w_auto:breakpoints_100_1900_20_15/test\",\n array('responsive' => true)\n );\n $this->cloudinary_url_assertion(\n \"test\",\n array(\"width\" => \"auto:breakpoints:json\", \"crop\" => 'fill'),\n TagTest::DEFAULT_UPLOAD_PATH . \"c_fill,w_auto:breakpoints:json/test\",\n array('responsive' => true)\n );\n }\n\n public function test_initial_width_and_height()\n {\n $options = array(\"crop\" => \"crop\", \"width\" => \"iw\", \"height\" => \"ih\");\n $this->cloudinary_url_assertion(\n \"test\",\n $options,\n TagTest::DEFAULT_UPLOAD_PATH . \"c_crop,h_ih,w_iw/test\"\n );\n }\n\n /**\n * @param $options\n * @param string $message\n */\n public function shared_client_hints($options, $message = '')\n {\n $tag = cl_image_tag('sample.jpg', $options);\n $this->assertEquals(\n \"\",\n $tag,\n $message\n );\n $tag = cl_image_tag('sample.jpg', array_merge(array(\"responsive\" => true), $options));\n $this->assertEquals(\n \"\",\n $tag,\n $message\n );\n }\n\n public function test_client_hints_as_option()\n {\n $this->shared_client_hints(\n array(\n \"dpr\" => \"auto\",\n \"cloud_name\" => \"test\",\n \"width\" => \"auto\",\n \"crop\" => \"scale\",\n \"client_hints\" => true,\n ),\n \"support client_hints as an option\"\n );\n }\n\n public function test_client_hints_as_global()\n {\n Cloudinary::config(array(\"client_hints\" => true));\n $this->shared_client_hints(\n array(\n \"dpr\" => \"auto\",\n \"cloud_name\" => \"test\",\n \"width\" => \"auto\",\n \"crop\" => \"scale\",\n ),\n \"support client hints as global configuration\"\n );\n }\n\n public function test_client_hints_false()\n {\n Cloudinary::config(array(\"responsive\" => true));\n $tag = cl_image_tag(\n 'sample.jpg',\n array(\n \"width\" => \"auto\",\n \"crop\" => \"scale\",\n \"cloud_name\" => \"test123\",\n \"client_hints\" => false,\n )\n );\n $this->assertEquals(\n \"\",\n $tag,\n \"should use normal responsive behaviour\"\n );\n }\n\n /**\n * @internal\n * Helper method for generating expected `img` and `source` tags\n *\n * @param string $tag_name Expected tag name(img or source)\n * @param string $public_id Public ID of the image\n * @param string $common_trans_str Default transformation string to be used in all resources\n * @param string $custom_trans_str Optional custom transformation string to be be used inside srcset resources\n * If not provided, $common_trans_str is used\n * @param array $srcset_breakpoints Optional list of breakpoints for srcset. If not provided srcset is omitted\n * @param array $attributes Associative array of custom attributes to be added to the tag\n *\n * @param bool $is_void Indicates whether tag is an HTML5 void tag (does not need to be self-closed)\n *\n * @return string Resulting tag\n */\n private function common_image_tag_helper(\n $tag_name,\n $public_id,\n $common_trans_str,\n $custom_trans_str = '',\n $srcset_breakpoints = array(),\n $attributes = array(),\n $is_void = false\n ) {\n if (empty($custom_trans_str)) {\n $custom_trans_str = $common_trans_str;\n }\n\n if (!empty($srcset_breakpoints)) {\n $single_srcset_image = function ($w) use ($custom_trans_str, $public_id) {\n return self::DEFAULT_UPLOAD_PATH . \"{$custom_trans_str}/c_scale,w_{$w}/{$public_id} {$w}w\";\n };\n $attributes['srcset'] = implode(', ', array_map($single_srcset_image, $srcset_breakpoints));\n }\n\n $tag = \"<$tag_name\";\n\n $attributes_str = implode(\n ' ',\n array_map(\n function ($k, $v) {\n return \"$k='$v'\";\n },\n array_keys($attributes),\n array_values($attributes)\n )\n );\n\n if (!empty($attributes_str)) {\n $tag .= \" {$attributes_str}\";\n }\n\n $tag .= $is_void ? \">\" : \"/>\"; // HTML5 void elements do not need to be self closed\n\n if (getenv('DEBUG')) {\n echo preg_replace('/([,\\']) /', \"$1\\n \", $tag) . \"\\n\\n\";\n }\n\n return $tag;\n }\n\n /**\n * @internal\n * Helper method for test_cl_image_tag_srcset for generating expected image tag\n *\n * @param string $public_id Public ID of the image\n * @param string $common_trans_str Default transformation string to be used in all resources\n * @param string $custom_trans_str Optional custom transformation string to be be used inside srcset resources\n * If not provided, $common_trans_str is used\n * @param array $srcset_breakpoints Optional list of breakpoints for srcset. If not provided srcset is omitted\n * @param array $attributes Associative array of custom attributes to be added to the tag\n *\n * @return string Resulting image tag\n */\n private function get_expected_cl_image_tag(\n $public_id,\n $common_trans_str,\n $custom_trans_str = '',\n $srcset_breakpoints = array(),\n $attributes = array()\n ) {\n\n Cloudinary::array_unshift_assoc(\n $attributes,\n 'src',\n self::DEFAULT_UPLOAD_PATH . \"{$common_trans_str}/{$public_id}\"\n );\n\n return $this->common_image_tag_helper(\n \"img\",\n $public_id,\n $common_trans_str,\n $custom_trans_str,\n $srcset_breakpoints,\n $attributes\n );\n }\n\n /**\n * @internal\n * Helper method for for generating expected `source` tag\n *\n * @param string $public_id Public ID of the image\n * @param string $common_trans_str Default transformation string to be used in all resources\n * @param string $custom_trans_str Optional custom transformation string to be be used inside srcset resources\n * If not provided, $common_trans_str is used\n * @param array $srcset_breakpoints Optional list of breakpoints for srcset. If not provided srcset is omitted\n * @param array $attributes Associative array of custom attributes to be added to the tag\n *\n * @return string Resulting `source` tag\n */\n private function get_expected_cl_source_tag(\n $public_id,\n $common_trans_str,\n $custom_trans_str = '',\n $srcset_breakpoints = array(),\n $attributes = array()\n ) {\n\n $attributes['srcset'] = self::DEFAULT_UPLOAD_PATH . \"{$common_trans_str}/{$public_id }\";\n\n ksort($attributes); // Used here to produce output similar to Cloudinary::html_attrs\n\n return $this->common_image_tag_helper(\n \"source\",\n $public_id,\n $common_trans_str,\n $custom_trans_str,\n $srcset_breakpoints,\n $attributes,\n true\n );\n }\n\n /**\n * Should create srcset attribute with provided breakpoints\n */\n public function test_cl_image_tag_srcset()\n {\n $expected_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n self::$breakpoints_arr\n );\n\n $tag_with_breakpoints = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array('srcset' => self::$common_srcset)\n )\n );\n\n $this->assertEquals(\n $expected_tag,\n $tag_with_breakpoints,\n 'Should create img srcset attribute with provided breakpoints'\n );\n }\n\n public function test_support_srcset_attribute_defined_by_min_width_max_width_and_max_images()\n {\n $tag_min_max_count = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array(\n 'srcset' => array(\n 'min_width' => self::$min_width,\n 'max_width' => $x = self::$max_width,\n 'max_images' => count(self::$breakpoints_arr)\n )\n )\n )\n );\n\n $expected_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n self::$breakpoints_arr\n );\n\n $this->assertEquals(\n $expected_tag,\n $tag_min_max_count,\n 'Should support srcset attribute defined by min_width, max_width, and max_images'\n );\n\n // Should support 1 image in srcset\n $tag_one_image_by_params = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array(\n 'srcset' => array(\n 'min_width' => self::$breakpoints_arr[0],\n 'max_width' => self::$max_width,\n 'max_images' => 1\n )\n )\n )\n );\n\n $expected_1_image_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(self::$max_width)\n );\n\n $this->assertEquals($expected_1_image_tag, $tag_one_image_by_params);\n\n $tag_one_image_by_breakpoints = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array('srcset' => array('breakpoints' => array(self::$max_width)))\n )\n );\n $this->assertEquals($expected_1_image_tag, $tag_one_image_by_breakpoints);\n\n // Should support custom transformation for srcset items\n $custom_transformation = array(\"transformation\" => array(\"crop\" => \"crop\", \"width\" => 10, \"height\" => 20));\n\n $tag_custom_transformation = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array(\n 'srcset' => array_merge(\n self::$common_srcset,\n $custom_transformation\n )\n )\n )\n );\n\n $custom_transformation_str = 'c_crop,h_20,w_10';\n $custom_expected_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n $custom_transformation_str,\n self::$breakpoints_arr\n );\n\n $this->assertEquals($custom_expected_tag, $tag_custom_transformation);\n\n // Should populate sizes attribute\n $tag_with_sizes = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array(\n 'srcset' => array_merge(\n self::$common_srcset,\n array('sizes' => true)\n )\n )\n )\n );\n\n $expected_tag_with_sizes = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n self::$breakpoints_arr,\n array('sizes' => self::$sizes_attr)\n );\n $this->assertEquals($expected_tag_with_sizes, $tag_with_sizes);\n\n // Should support srcset string value\n $raw_srcset_value = \"some srcset data as is\";\n $tag_with_raw_srcset = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array('attributes' => array('srcset' => $raw_srcset_value))\n )\n );\n\n $expected_raw_srcset = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(),\n array('srcset' => $raw_srcset_value)\n );\n\n $this->assertEquals($expected_raw_srcset, $tag_with_raw_srcset);\n\n // Should remove width and height attributes in case srcset is specified, but passed to transformation\n $tag_with_sizes = cl_image_tag(\n self::$public_id,\n array_merge(\n array_merge(\n self::$common_image_options,\n array('width' => 500, 'height' => 500)\n ),\n array('srcset' => self::$common_srcset)\n )\n );\n\n $expected_tag_without_width_and_height = self::get_expected_cl_image_tag(\n self::$public_id,\n 'e_sepia,h_500,w_500',\n '',\n self::$breakpoints_arr\n );\n $this->assertEquals($expected_tag_without_width_and_height, $tag_with_sizes);\n }\n\n /**\n * Should omit srcset attribute on invalid values\n *\n * @throws \\Exception\n */\n public function test_srcset_invalid_values()\n {\n $invalid_breakpoints = array(\n array('sizes' => true), // srcset data not provided\n array('max_width' => 300, 'max_images' => 3), // no min_width\n array('min_width' => '1', 'max_width' => 300, 'max_images' => 3), // invalid min_width\n array('min_width' => 100, 'max_images' => 3), // no max_width\n array('min_width' => '1', 'max_width' => '3', 'max_images' => 3), // invalid max_width\n array('min_width' => 200, 'max_width' => 100, 'max_images' => 3), // min_width > max_width\n array('min_width' => 100, 'max_width' => 300), // no max_images\n array('min_width' => 100, 'max_width' => 300, 'max_images' => 0), // invalid max_images\n array('min_width' => 100, 'max_width' => 300, 'max_images' => -17), // invalid max_images\n array('min_width' => 100, 'max_width' => 300, 'max_images' => '3'), // invalid max_images\n array('min_width' => 100, 'max_width' => 300, 'max_images' => null), // invalid max_images\n );\n\n\n $err_log_original_destination = ini_get('error_log');\n // Suppress error messages in error log\n ini_set('error_log', '/dev/null');\n\n try {\n foreach ($invalid_breakpoints as $value) {\n $tag = cl_image_tag(\n self::$public_id,\n array_merge(self::$common_image_options, array('srcset' => $value))\n );\n\n self::assertNotContains(\"srcset\", $tag);\n }\n } catch (\\Exception $e) {\n ini_set('error_log', $err_log_original_destination);\n throw $e;\n }\n\n ini_set('error_log', $err_log_original_destination);\n }\n\n public function test_cl_image_tag_responsive_breakpoints_cache()\n {\n $cache = ResponsiveBreakpointsCache::instance();\n $cache->setCacheAdapter(new KeyValueCacheAdapter(new DummyCacheStorage()));\n\n $cache->set(self::$public_id, self::$common_image_options, self::$breakpoints_arr);\n\n $expected_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n self::$breakpoints_arr\n );\n\n $image_tag = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n [\"srcset\"=> [\"use_cache\" => true]]\n )\n );\n\n $this->assertEquals($expected_tag, $image_tag);\n }\n\n public function test_create_a_tag_with_custom_attributes_legacy_approach()\n {\n $tag_with_custom_legacy_attribute = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n self::$custom_attributes\n )\n );\n\n $expected_custom_attributes_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(),\n self::$custom_attributes\n );\n\n $this->assertEquals($expected_custom_attributes_tag, $tag_with_custom_legacy_attribute);\n }\n\n public function test_create_a_tag_with_legacy_srcset_attribute()\n {\n $srcset_attribute = ['srcset' =>'http://custom.srcset.attr/sample.jpg 100w'];\n $tag_with_custom_srcset_attribute = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n $srcset_attribute\n )\n );\n\n $expected_custom_attributes_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(),\n $srcset_attribute\n );\n\n $this->assertEquals($expected_custom_attributes_tag, $tag_with_custom_srcset_attribute);\n }\n\n\n public function test_consume_custom_attributes_from_attributes_key()\n {\n $tag_with_custom_attribute = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array('attributes' => self::$custom_attributes)\n )\n );\n $expected_custom_attributes_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(),\n self::$custom_attributes\n );\n $this->assertEquals($expected_custom_attributes_tag, $tag_with_custom_attribute);\n }\n\n public function test_override_existing_attributes_with_specified_by_custom_ones()\n {\n $updated_attributes = array('alt' => 'updated alt');\n $tag_with_custom_overriden_attribute = cl_image_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array('alt' => 'original alt', 'attributes' => $updated_attributes)\n )\n );\n\n $expected_overriden_attributes_tag = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n array(),\n $updated_attributes\n );\n $this->assertEquals($expected_overriden_attributes_tag, $tag_with_custom_overriden_attribute);\n }\n\n public function test_dpr_auto()\n {\n // should support width=auto\n $tag = cl_image_tag(\"hello\", array(\"dpr\" => \"auto\", \"format\" => \"png\"));\n $this->assertEquals(\n \"\",\n $tag\n );\n }\n\n public function test_cl_sprite_tag()\n {\n $url = cl_sprite_tag(\"mytag\", array(\"crop\" => \"fill\", \"width\" => 10, \"height\" => 10));\n $this->assertEquals(\n \"\",\n $url\n );\n }\n\n public function test_cl_video_thumbnail_path()\n {\n $this->assertEquals(cl_video_thumbnail_path('movie_id'), TagTest::VIDEO_UPLOAD_PATH . \"movie_id.jpg\");\n $this->assertEquals(\n cl_video_thumbnail_path('movie_id', array('width' => 100)),\n TagTest::VIDEO_UPLOAD_PATH . \"w_100/movie_id.jpg\"\n );\n }\n\n public function test_cl_video_thumbnail_tag()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie_id.jpg\";\n $this->assertEquals(\n cl_video_thumbnail_tag('movie_id'),\n \"\"\n );\n\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"w_100/movie_id.jpg\";\n $this->assertEquals(\n cl_video_thumbnail_tag('movie_id', array('width' => 100)),\n \"\"\n );\n }\n\n public function test_cl_video_tag()\n {\n //default\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie\";\n $this->assertEquals(\n cl_video_tag('movie'),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_attributes()\n {\n //test video attributes\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie\";\n $this->assertEquals(\n cl_video_tag(\n 'movie',\n array('autoplay' => true, 'controls', 'loop', 'muted' => \"true\", 'preload', 'style' => 'border: 1px')\n ),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_transformation()\n {\n //test video attributes\n $options = array(\n 'source_types' => \"mp4\",\n 'html_height' => \"100\",\n 'html_width' => \"200\",\n 'video_codec' => array('codec' => 'h264'),\n 'audio_codec' => 'acc',\n 'start_offset' => 3,\n );\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"ac_acc,so_3,vc_h264/movie\";\n $this->assertEquals(\n cl_video_tag('movie', $options),\n \"\"\n );\n\n unset($options['source_types']);\n $this->assertEquals(\n cl_video_tag('movie', $options),\n \"\"\n );\n\n unset($options['html_height']);\n unset($options['html_width']);\n $options['width'] = 250;\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"ac_acc,so_3,vc_h264,w_250/movie\";\n $this->assertEquals(\n cl_video_tag('movie', $options),\n \"\"\n );\n\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"ac_acc,c_fit,so_3,vc_h264,w_250/movie\";\n $options['crop'] = 'fit';\n $this->assertEquals(\n cl_video_tag('movie', $options),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_fallback()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie\";\n $fallback = \"Cannot display video\";\n $this->assertEquals(\n cl_video_tag('movie', array('fallback_content' => $fallback)),\n \"\"\n );\n $this->assertEquals(\n cl_video_tag('movie', array('fallback_content' => $fallback, 'source_types' => \"mp4\")),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_source_types()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie\";\n $this->assertEquals(\n cl_video_tag('movie', array('source_types' => array('ogv', 'mp4'))),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_source_transformation()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"q_50/w_100/movie\";\n $expected_ogv_url = TagTest::VIDEO_UPLOAD_PATH . \"q_50/q_70,w_100/movie\";\n $expected_mp4_url = TagTest::VIDEO_UPLOAD_PATH . \"q_50/q_30,w_100/movie\";\n $this->assertEquals(\n cl_video_tag(\n 'movie',\n array(\n 'width' => 100,\n 'transformation' => array(array('quality' => 50)),\n 'source_transformation' => array(\n 'ogv' => array('quality' => 70),\n 'mp4' => array('quality' => 30),\n ),\n )\n ),\n \"\"\n );\n\n $this->assertEquals(\n cl_video_tag(\n 'movie',\n array(\n 'width' => 100,\n 'transformation' => array(array('quality' => 50)),\n 'source_transformation' => array(\n 'ogv' => array('quality' => 70),\n 'mp4' => array('quality' => 30),\n ),\n 'source_types' => array('webm', 'mp4'),\n )\n ),\n \"\"\n );\n }\n\n public function test_cl_video_tag_with_poster()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie\";\n\n $expected_poster_url = 'http://image/somewhere.jpg';\n $this->assertEquals(\n cl_video_tag('movie', array('poster' => $expected_poster_url, 'source_types' => \"mp4\")),\n \"\"\n );\n\n $expected_poster_url = TagTest::VIDEO_UPLOAD_PATH . \"g_north/movie.jpg\";\n $this->assertEquals(\n cl_video_tag(\n 'movie',\n array('poster' => array('gravity' => 'north'), 'source_types' => \"mp4\")\n ),\n \"\"\n );\n\n $expected_poster_url = TagTest::DEFAULT_UPLOAD_PATH . \"g_north/my_poster.jpg\";\n $this->assertEquals(\n cl_video_tag(\n 'movie',\n array(\n 'poster' => array('gravity' => 'north', 'public_id' => 'my_poster', 'format' => 'jpg'),\n 'source_types' => \"mp4\",\n )\n ),\n \"\"\n );\n\n $this->assertEquals(\n cl_video_tag('movie', array('poster' => null, 'source_types' => \"mp4\")),\n \"\"\n );\n\n $this->assertEquals(\n cl_video_tag('movie', array('poster' => false, 'source_types' => \"mp4\")),\n \"\"\n );\n }\n\n /**\n * Check that cl_video_tag encodes special characters.\n */\n public function test_cl_video_tag_special_characters_encoding()\n {\n $expected_url = TagTest::VIDEO_UPLOAD_PATH . \"movie%27s%20id%21%40%23%24%25%5E%26%2A%28\";\n\n $this->assertEquals(\n \"\",\n cl_video_tag(\"movie's id!@#$%^&*(\", array('source_types' => \"mp4\"))\n );\n }\n\n public function test_cl_video_tag_default_sources()\n {\n $expected_url = self::VIDEO_UPLOAD_PATH . \"%smovie.%s\";\n\n $this->assertEquals(\n \"\",\n cl_video_tag('movie', array('sources' => default_video_sources()))\n );\n }\n\n public function test_cl_video_tag_custom_sources()\n {\n $custom_sources = [\n [\n \"type\" => \"mp4\",\n \"codecs\" => \"vp8, vorbis\",\n \"transformations\" => [\"video_codec\" => \"auto\"]\n ],\n [\n \"type\" => \"webm\",\n \"codecs\" => \"avc1.4D401E, mp4a.40.2\",\n \"transformations\" => [\"video_codec\" => \"auto\"]\n ]\n ];\n $expected_url = self::VIDEO_UPLOAD_PATH . \"%smovie.%s\";\n\n $this->assertEquals(\n \"\",\n cl_video_tag('movie', array('sources' => $custom_sources))\n );\n }\n\n public function test_cl_video_tag_sources_codecs_array()\n {\n $custom_sources = [\n [\n \"type\" => \"mp4\",\n \"codecs\" => [\"vp8\", \"vorbis\"],\n \"transformations\" => [\"video_codec\" => \"auto\"]\n ],\n [\n \"type\" => \"webm\",\n \"codecs\" => [\"avc1.4D401E\", \"mp4a.40.2\"],\n \"transformations\" => [\"video_codec\" => \"auto\"]\n ]\n ];\n $expected_url = self::VIDEO_UPLOAD_PATH . \"%smovie.%s\";\n\n $this->assertEquals(\n \"\",\n cl_video_tag('movie', array('sources' => $custom_sources))\n );\n }\n\n public function test_cl_video_tag_sources_with_transformation()\n {\n $options = array(\n 'source_types' => \"mp4\",\n 'html_height' => \"100\",\n 'html_width' => \"200\",\n 'video_codec' => array('codec' => 'h264'),\n 'audio_codec' => 'acc',\n 'start_offset' => 3,\n 'sources' => default_video_sources()\n );\n $expected_url = self::VIDEO_UPLOAD_PATH . \"ac_acc,so_3,%smovie.%s\";\n\n $this->assertEquals(\n \"\",\n cl_video_tag('movie', $options)\n );\n }\n\n public function test_upload_tag()\n {\n $pattern = \"//\";\n $this->assertRegExp($pattern, cl_upload_tag('image'));\n $this->assertRegExp($pattern, cl_image_upload_tag('image'));\n\n $pattern = \"//\";\n $this->assertRegExp(\n $pattern,\n cl_upload_tag('image', array('chunk_size' => 5000000))\n );\n\n $pattern = \"//\";\n $this->assertRegExp(\n $pattern,\n cl_upload_tag('image', array(\"html\" => array('class' => 'classy')))\n );\n }\n\n public function test_cl_source_tag()\n {\n $expected_tag = self::get_expected_cl_source_tag(\n self::$public_id,\n self::$common_transformation_str,\n '',\n self::$breakpoints_arr,\n array('sizes' => self::$sizes_attr, \"media\" => generate_media_attr([\"max_width\" =>self::$max_width]))\n );\n\n $source_tag_with_srcset = cl_source_tag(\n self::$public_id,\n array_merge(\n self::$common_image_options,\n array(\n 'srcset' => array_merge(\n self::$common_srcset,\n array('sizes' => true)\n )\n ),\n array(\n 'media' => array(\"max_width\" =>self::$max_width)\n )\n )\n );\n\n $this->assertEquals(\n $expected_tag,\n $source_tag_with_srcset,\n 'Should create source tag with srcset and sizes attributes with provided breakpoints'\n );\n }\n\n public function test_cl_picture_tag()\n {\n $tag = cl_picture_tag(\n self::$public_id,\n self::$fill_transformation,\n [\n [\n \"max_width\" =>self::$min_width,\n \"transformation\" => [\"effect\" => \"sepia\", \"angle\" => 17, \"width\" => self::$min_width]\n ],\n [\n \"min_width\" => self::$min_width,\n \"max_width\" => self::$max_width,\n \"transformation\" => [\"effect\" => \"colorize\", \"angle\" => 18, \"width\" => self::$max_width]\n\n ],\n [\n \"min_width\" => self::$max_width,\n \"transformation\" => [\"effect\" => \"blur\", \"angle\" => 19, \"width\" => self::$max_width]\n ]\n ]\n );\n\n\n $expected_source1 = self::get_expected_cl_source_tag(\n self::$public_id,\n self::$fill_trans_str . \"/\" . \"a_17,e_sepia,w_\" . self::$min_width,\n '',\n [],\n [\"media\" => generate_media_attr([\"max_width\" =>self::$min_width])]\n );\n\n $expected_source2 = self::get_expected_cl_source_tag(\n self::$public_id,\n self::$fill_trans_str . \"/\" . \"a_18,e_colorize,w_\" . self::$max_width,\n '',\n [],\n [\"media\" => generate_media_attr([\"min_width\" => self::$min_width, \"max_width\" =>self::$max_width])]\n\n );\n\n $expected_source3 = self::get_expected_cl_source_tag(\n self::$public_id,\n self::$fill_trans_str . \"/\" . \"a_19,e_blur,w_\" . self::$max_width,\n '',\n [],\n [\"media\" => generate_media_attr([\"min_width\" => self::$max_width])]\n );\n\n $expected_img = self::get_expected_cl_image_tag(\n self::$public_id,\n self::$fill_trans_str,\n '',\n [],\n ['height' => self::$max_width, 'width' => self::$max_width]\n );\n\n $exp = \"\" . $expected_source1 . $expected_source2 . $expected_source3 . $expected_img . \"\";\n\n $this->assertEquals($exp, $tag);\n }\n\n private function cloudinary_url_assertion($source, $options, $expected, $expected_options = array())\n {\n $url = Cloudinary::cloudinary_url($source, $options);\n $this->assertEquals($expected_options, $options);\n $this->assertEquals($expected, $url);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":15,"cells":{"blob_id":{"kind":"string","value":"98b05ed17c6b2767ad5c61a6fa19ce374ab51cf7"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"geertvangent/ects"},"path":{"kind":"string","value":"/Application/Discovery/Module/TrainingInfo/Implementation/Bamaflex/SubTrajectory.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2032,"string":"2,032"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"get_default_property(self::PROPERTY_SOURCE);\n }\n\n /**\n *\n * @param int $source\n */\n public function set_source($source)\n {\n $this->set_default_property(self::PROPERTY_SOURCE, $source);\n }\n\n public function get_trajectory_id()\n {\n return $this->get_default_property(self::PROPERTY_TRAJECTORY_ID);\n }\n\n public function set_trajectory_id($trajectory_id)\n {\n $this->set_default_property(self::PROPERTY_TRAJECTORY_ID, $trajectory_id);\n }\n\n public function get_name()\n {\n return $this->get_default_property(self::PROPERTY_NAME);\n }\n\n public function set_name($name)\n {\n $this->set_default_property(self::PROPERTY_NAME, $name);\n }\n\n public static function get_default_property_names($extended_property_names = array())\n {\n $extended_property_names[] = self::PROPERTY_SOURCE;\n $extended_property_names[] = self::PROPERTY_TRAJECTORY_ID;\n $extended_property_names[] = self::PROPERTY_NAME;\n \n return parent::get_default_property_names($extended_property_names);\n }\n\n /**\n *\n * @return DataManagerInterface\n */\n public function get_data_manager()\n {\n // return DataManager :: getInstance();\n }\n\n public function get_courses()\n {\n return $this->courses;\n }\n\n public function set_courses($courses)\n {\n $this->courses = $courses;\n }\n\n public function has_courses()\n {\n return count($this->courses) > 0;\n }\n\n public function add_course($course)\n {\n $this->courses[] = $course;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":16,"cells":{"blob_id":{"kind":"string","value":"dca0c6f61110f1915cc1f6da78b2e7d755eb7eed"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"codingmetta/webshop-plenty-planty.github.io"},"path":{"kind":"string","value":"/scripts/registration-submit.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1466,"string":"1,466"},"score":{"kind":"number","value":3.203125,"string":"3.203125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"click here to log in. ';\n} else {\n echo 'Repeated Password is incorrect. Please try again.';\n}\n\n/** @fn 'Double Check Password' \n * @brief Checks if both entered passwords are the same\n */\nfunction check_password($pw, $rpw){\n if($pw == $rpw){\n return true;\n } else {\n return false;\n }\n}\n\n/** @fn 'Add User' \n * @brief Adds user with given credentials to table 'Users'\n */\nfunction add_user($conn, $rl, $fn, $sn, $em, $un, $pw)\n{\n$sql = \"INSERT INTO Users (role, forename, surname, email, username, password) VALUES ('$rl','$fn','$sn','$em', '$un', '$pw')\";\nif ($conn->query($sql) === TRUE) {\n} else {\n echo \"Error: \" . $sql . \"
\" . $conn->error;\n}\n}\n\n ?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":17,"cells":{"blob_id":{"kind":"string","value":"2551d4cd6a250f478909d7a972051a86d892c64f"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"bZez/SF5-GRC"},"path":{"kind":"string","value":"/src/Entity/Partner.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1907,"string":"1,907"},"score":{"kind":"number","value":2.75,"string":"2.75"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"users = new ArrayCollection();\n }\n\n public function getId(): ?int\n {\n return $this->id;\n }\n\n public function getNom(): ?string\n {\n return $this->nom;\n }\n\n public function setNom(string $nom): self\n {\n $this->nom = $nom;\n\n return $this;\n }\n\n public function getProduits(): ?array\n {\n return $this->produits;\n }\n\n public function setProduits(array $produits): self\n {\n $this->produits = $produits;\n\n return $this;\n }\n\n /**\n * @return Collection|User[]\n */\n public function getUsers(): Collection\n {\n return $this->users;\n }\n\n public function addUser(User $user): self\n {\n if (!$this->users->contains($user)) {\n $this->users[] = $user;\n $user->setPartner($this);\n }\n\n return $this;\n }\n\n public function removeUser(User $user): self\n {\n if ($this->users->contains($user)) {\n $this->users->removeElement($user);\n // set the owning side to null (unless already changed)\n if ($user->getPartner() === $this) {\n $user->setPartner(null);\n }\n }\n\n return $this;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":18,"cells":{"blob_id":{"kind":"string","value":"0bfe953c03db6e83aa9c8b79ff1b592349296d95"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mildphp/framework"},"path":{"kind":"string","value":"/src/Mild/Support/Events/LocaleUpdated.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":320,"string":"320"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"locale = $locale;\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":19,"cells":{"blob_id":{"kind":"string","value":"60cff38b1dc0ce25f5af042eab05ce7e87843af1"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"impact-pt/impact-ios"},"path":{"kind":"string","value":"/PhP/createApmt.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":882,"string":"882"},"score":{"kind":"number","value":2.703125,"string":"2.703125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":20,"cells":{"blob_id":{"kind":"string","value":"c4994521d8f9788f619f7a2e43097b1d4e9ef1e4"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"kolholga/oop"},"path":{"kind":"string","value":"/app/lib/User.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2109,"string":"2,109"},"score":{"kind":"number","value":3.671875,"string":"3.671875"},"int_score":{"kind":"number","value":4,"string":"4"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"age = $a;\n $this->name = $n;\n }\n*/\n\n public function __construct()\n {\n echo 'Я нахожусь в пространстве имен \\Ddd\\fff';\n }\n\n\n public function getAge() // ГЕТТЕР - метод для возвращения значения свойства age\n {\n //self::LOGIN; - обращаемся к константе\n return $this->age;\n }\n\n public function getName() // ГЕТТЕР - метод для возвращения значения свойства name\n {\n return $this->name;\n }\n\n public function setAge($age) // СЕТТЕР - метод / устанавливает возраст\n {\n if ($age > 18 && $age < 60) {\n $this->age = $age;\n }\n }\n\n public function setName($name) // СЕТТЕР - метод / устанавливает имя\n {\n $this->name = $name;\n }\n}\n\n//$man = new User('Vasya', '18'); // в $man присваиваем объект класса User\n\n//$man->name = 'Вася';\n//$man->age = '18';\n\n/*\n$man = new User; // сoздали объект User // если нет конструкторa, скобки можно не ставить\n$man->setAge(' 25');\n$man->setName(' Petya ');\necho 'My name is ' . $man->getName() . \"age\" . $man->getAge() . ' years old
';\n*/\n//echo 'My login is ' . User::LOGIN;\n\n\n/*\nvar_dump($man);\necho '
';\n\n$man2 = new User('Gena', '21');\n//$man2->name = 'Петя';\n//$man2->age = '30';\n\nvar_dump($man2);\necho '
';\n\nvar_dump($man);\n*/\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":21,"cells":{"blob_id":{"kind":"string","value":"ed7403019c0b50ada63c9d649535c3fd06ce9a74"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"pimpmypixel/confirmit-authoring"},"path":{"kind":"string","value":"/src/StructType/QuestionFormBase.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":9704,"string":"9,704"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"setStartPosition($startPosition)\n ->setNotPerformDataCleaningOnMasking($notPerformDataCleaningOnMasking)\n ->setLevel($level)\n ->setJscriptExpression($jscriptExpression)\n ->setBenchmarkType($benchmarkType)\n ->setSeed($seed)\n ->setValidationCode($validationCode)\n ->setParentGrid3DFormName($parentGrid3DFormName);\n }\n /**\n * Get StartPosition value\n * @return int\n */\n public function getStartPosition()\n {\n return $this->StartPosition;\n }\n /**\n * Set StartPosition value\n * @param int $startPosition\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setStartPosition($startPosition = null)\n {\n // validation for constraint: int\n if (!is_null($startPosition) && !is_numeric($startPosition)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, \"%s\" given', gettype($startPosition)), __LINE__);\n }\n $this->StartPosition = $startPosition;\n return $this;\n }\n /**\n * Get NotPerformDataCleaningOnMasking value\n * @return bool\n */\n public function getNotPerformDataCleaningOnMasking()\n {\n return $this->NotPerformDataCleaningOnMasking;\n }\n /**\n * Set NotPerformDataCleaningOnMasking value\n * @param bool $notPerformDataCleaningOnMasking\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setNotPerformDataCleaningOnMasking($notPerformDataCleaningOnMasking = null)\n {\n // validation for constraint: boolean\n if (!is_null($notPerformDataCleaningOnMasking) && !is_bool($notPerformDataCleaningOnMasking)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a bool, \"%s\" given', gettype($notPerformDataCleaningOnMasking)), __LINE__);\n }\n $this->NotPerformDataCleaningOnMasking = $notPerformDataCleaningOnMasking;\n return $this;\n }\n /**\n * Get Level value\n * @return int\n */\n public function getLevel()\n {\n return $this->Level;\n }\n /**\n * Set Level value\n * @param int $level\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setLevel($level = null)\n {\n // validation for constraint: int\n if (!is_null($level) && !is_numeric($level)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, \"%s\" given', gettype($level)), __LINE__);\n }\n $this->Level = $level;\n return $this;\n }\n /**\n * Get JscriptExpression value\n * @return bool\n */\n public function getJscriptExpression()\n {\n return $this->JscriptExpression;\n }\n /**\n * Set JscriptExpression value\n * @param bool $jscriptExpression\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setJscriptExpression($jscriptExpression = null)\n {\n // validation for constraint: boolean\n if (!is_null($jscriptExpression) && !is_bool($jscriptExpression)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a bool, \"%s\" given', gettype($jscriptExpression)), __LINE__);\n }\n $this->JscriptExpression = $jscriptExpression;\n return $this;\n }\n /**\n * Get BenchmarkType value\n * @return string\n */\n public function getBenchmarkType()\n {\n return $this->BenchmarkType;\n }\n /**\n * Set BenchmarkType value\n * @uses \\Confirmit\\Authoring\\EnumType\\BenchmarkFormType::valueIsValid()\n * @uses \\Confirmit\\Authoring\\EnumType\\BenchmarkFormType::getValidValues()\n * @throws \\InvalidArgumentException\n * @param string $benchmarkType\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setBenchmarkType($benchmarkType = null)\n {\n // validation for constraint: enumeration\n if (!\\Confirmit\\Authoring\\EnumType\\BenchmarkFormType::valueIsValid($benchmarkType)) {\n throw new \\InvalidArgumentException(sprintf('Value \"%s\" is invalid, please use one of: %s', $benchmarkType, implode(', ', \\Confirmit\\Authoring\\EnumType\\BenchmarkFormType::getValidValues())), __LINE__);\n }\n $this->BenchmarkType = $benchmarkType;\n return $this;\n }\n /**\n * Get Seed value\n * @return int\n */\n public function getSeed()\n {\n return $this->Seed;\n }\n /**\n * Set Seed value\n * @param int $seed\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setSeed($seed = null)\n {\n // validation for constraint: int\n if (!is_null($seed) && !is_numeric($seed)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, \"%s\" given', gettype($seed)), __LINE__);\n }\n $this->Seed = $seed;\n return $this;\n }\n /**\n * Get ValidationCode value\n * @return string|null\n */\n public function getValidationCode()\n {\n return $this->ValidationCode;\n }\n /**\n * Set ValidationCode value\n * @param string $validationCode\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setValidationCode($validationCode = null)\n {\n // validation for constraint: string\n if (!is_null($validationCode) && !is_string($validationCode)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($validationCode)), __LINE__);\n }\n $this->ValidationCode = $validationCode;\n return $this;\n }\n /**\n * Get ParentGrid3DFormName value\n * @return string|null\n */\n public function getParentGrid3DFormName()\n {\n return $this->ParentGrid3DFormName;\n }\n /**\n * Set ParentGrid3DFormName value\n * @param string $parentGrid3DFormName\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public function setParentGrid3DFormName($parentGrid3DFormName = null)\n {\n // validation for constraint: string\n if (!is_null($parentGrid3DFormName) && !is_string($parentGrid3DFormName)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($parentGrid3DFormName)), __LINE__);\n }\n $this->ParentGrid3DFormName = $parentGrid3DFormName;\n return $this;\n }\n /**\n * Method called when an object has been exported with var_export() functions\n * It allows to return an object instantiated with the values\n * @see AbstractStructBase::__set_state()\n * @uses AbstractStructBase::__set_state()\n * @param array $array the exported values\n * @return \\Confirmit\\Authoring\\StructType\\QuestionFormBase\n */\n public static function __set_state(array $array)\n {\n return parent::__set_state($array);\n }\n /**\n * Method returning the class name\n * @return string __CLASS__\n */\n public function __toString()\n {\n return __CLASS__;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":22,"cells":{"blob_id":{"kind":"string","value":"a8c1eecbc7f0ebc4290620f66ae3b1e7e88ecff3"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"MorisPae/PHPTraining"},"path":{"kind":"string","value":"/20170508/test1.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":139,"string":"139"},"score":{"kind":"number","value":3.328125,"string":"3.328125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\" . $var_int .\"
\". $var_float;\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":23,"cells":{"blob_id":{"kind":"string","value":"b0b69ee2b1dcb7587636235c70dd5abfa6536d29"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"orangeShadow/pastebin-api"},"path":{"kind":"string","value":"/src/Repositories/PastebinRepository.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2570,"string":"2,570"},"score":{"kind":"number","value":2.859375,"string":"2.859375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"api_dev_key = $api_dev_key;\n $this->client = new Client();\n }\n\n /**\n * Create Paste\n *\n * @param $attributes\n * @return string\n *\n */\n public function createPaste(array $attributes):string\n {\n $attributes['api_option'] = 'paste';\n\n return $this->sendRequest('POST', 'api/api_post.php', $attributes);\n }\n\n\n /**\n * Get paste list\n *\n * @param $attributes\n * @return string\n */\n public function getPasteList(array $attributes):string\n {\n $attributes['api_option'] = 'list';\n\n return $this->sendRequest('POST', 'api/api_post.php', $attributes);\n }\n\n /**\n * Get paste list\n *\n * @param $attributes\n * @return string\n */\n public function deletePaste(array $attributes):string\n {\n $attributes['api_option'] = 'delete';\n\n return $this->sendRequest('POST', 'api/api_post.php', $attributes);\n }\n\n /**\n * Get paste list\n *\n * @param $attributes\n * @return string\n */\n public function getPasteRaw(array $attributes):string\n {\n $attributes['api_option'] = 'show_paste';\n\n return $this->sendRequest('POST', 'api/api_raw.php', $attributes);\n }\n\n /**\n * Send request to the server through Guzzle Client\n *\n * @param $method\n * @param $path\n * @param $attributes\n * @return string\n *\n * @throws Exceptions\\InvalidResponseException\n */\n private function sendRequest(string $method, string $path, array $attributes): string\n {\n\n $attributes['api_dev_key'] = $this->api_dev_key;\n\n $request = new Request($method, $this->pastebin_host . $path, ['Content-Type' => 'application/x-www-form-urlencoded'], http_build_query($attributes, '', '&'));\n\n try {\n $response = $this->client->send($request);\n } catch (ClientException $e) {\n throw new Exceptions\\InvalidResponseException($e->getMessage(), $e->getCode(), $e);\n }\n\n return $response->getBody()->getContents();\n }\n\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":24,"cells":{"blob_id":{"kind":"string","value":"9fc9c4355f07c88fe5e04a7839b35a84a69bfdf9"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"HaruItari/target_21"},"path":{"kind":"string","value":"/common/components/WebUser.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4234,"string":"4,234"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"getModel()) {\r\n return Yii::app()->db->createCommand(\"\r\n SELECT\r\n t.role\r\n FROM\r\n user_group AS t,\r\n user\r\n WHERE\r\n t.id = user.group\r\n AND user.id = {$this->id}\r\n \")->queryScalar();\r\n }\r\n }\r\n\r\n /**\r\n * Получение flash-сообщения и обрамление его в тематические блоки.\r\n * Перегрузка стандартного метода {@link parent::getFlash}.\r\n * @param string $key Ключ сообщения\r\n * @param string $type Тип возвращаемого значения\r\n * @param mixed $defaultValue Возвращаемое значение в случае отсутствия сообщения\r\n * @param boolean $delete Удалить сообщение после вывода\r\n * @return mixed or bool\r\n */\r\n public function getFlash($key, $type = null, $defaultValue = null, $delete = true)\r\n {\r\n $return = parent::getFlash($key, $defaultValue, $delete);\r\n\r\n if (isset($return)) {\r\n switch ($type) {\r\n case 'info' :\r\n return '
' . $return . '
';\r\n break;\r\n\r\n case 'note' :\r\n return '
' . $return . '
';\r\n break;\r\n\r\n case 'error' :\r\n return '
' . $return . '
';\r\n break;\r\n\r\n default :\r\n return $return;\r\n break;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Проверка наличия flash-сообщения.\r\n * Перегрузка стандартного метода {@link parent::hasFlash}.\r\n * @param string $key Ключ сообщения\r\n * @return boolean Существование сообщения\r\n */\r\n public function hasFlash($key)\r\n {\r\n return $this->getFlash($key, null, null, false) !== null;\r\n }\r\n\r\n /**\r\n * Установка якорной страницы, на которую в дальнейшем будет возвращен пользователь.\r\n * @params string $url Фиксируемый адрес. Если не указан, присваивается текущая страница.\r\n * @return void\r\n */\r\n public function setAnchorUrl($url = null)\r\n {\r\n if($url === null)\r\n $url = Yii::app()->request->getRequestUri();\r\n\r\n $this->setState('_anchorUrl', $url);\r\n }\r\n\r\n /**\r\n * Возвращает адрес якорной страницы.\r\n * @return string\r\n */\r\n public function getAnchorUrl()\r\n {\r\n return $this->getState('_anchorUrl');\r\n }\r\n\r\n /**\r\n * @see CWebUser::beforeLogin()\r\n */\r\n protected function beforeLogin($id, $states, $fromCookie)\r\n {\r\n if ($fromCookie) {\r\n if(!empty($states['cookiesSolt']))\r\n return MUser::model()->findByAttributes(array(\r\n 'id' => $states['id'],\r\n 'cookies_solt' => $states['cookiesSolt'],\r\n ));\r\n else\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n /**\r\n * Данные о пользователе (модель MUser).\r\n * @var object\r\n */\r\n private $_model = null;\r\n\r\n /**\r\n * Получение экземпляра $this->_model.\r\n * Если он не опреелен, создание нового.\r\n * @return object\r\n */\r\n private function getModel()\r\n {\r\n if (!$this->isGuest && $this->_model === null) {\r\n $this->_model = MUser::model()->findByPk($this->id);\r\n }\r\n\r\n return $this->_model;\r\n }\r\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":25,"cells":{"blob_id":{"kind":"string","value":"043b5fbce711fc4a876aba984ccdac3894bcf3ae"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"jfoxworth/makstudio"},"path":{"kind":"string","value":"/database/migrations/2019_09_03_082133_create_builds_table.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":982,"string":"982"},"score":{"kind":"number","value":2.921875,"string":"2.921875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"bigIncrements('id');\n\t\t\t$table->bigInteger('user_id');\t\t// ID of user that stored the build\n\t\t\t$table->text('build_data');\t\t\t// Content of build\n\t\t\t$table->string('build_id'); \t\t// Something to identify that build - bench, fin wall, etc\n\t\t\t$table->softDeletes();\n\t\t\t$table->timestamps();\n\t\t});\n\t}\n\n\t/**\n\t * Reverse the migrations.\n\t *\n\t * @return void\n\t */\n\tpublic function down()\n\t{\n\t\tSchema::dropIfExists('builds');\n\t}\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":26,"cells":{"blob_id":{"kind":"string","value":"c0db680a174e29ef21182cb0578569f8a3cee0d0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"JuanRobles2164/CustomLaravelVersion"},"path":{"kind":"string","value":"/app/Console/Commands/Helpers/MakeViewHelper.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":663,"string":"663"},"score":{"kind":"number","value":2.78125,"string":"2.78125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" $(\"#loginbody\").load(\"report1.php\");\n\t';\n\texit;\n\t}\n\tif($rep == \"rep2\")\n\t{\n\techo '';\n\texit;\n\t}\n\t}\nelse\n\techo \"Incorrect User name or password\";\n?>\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":28,"cells":{"blob_id":{"kind":"string","value":"52be89f86457ce0223d902d6f455a526a1406a5e"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"StereoFlo/Example-Laravel"},"path":{"kind":"string","value":"/engine/app/Models/RoleUser.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1840,"string":"1,840"},"score":{"kind":"number","value":2.84375,"string":"2.84375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"where('user_id', $userId)->where('role_id', $roleId)->get();\n if (!$this->checkEmptyObject($role)) {\n return (bool) $this->create([\n 'role_id' => $roleId,\n 'user_id' => $userId,\n ]);\n }\n return false;\n }\n\n /**\n * @param int $userId\n * @param string $roleId\n *\n * @return bool\n */\n public function enableRoleByName(int $userId, string $roleId): bool\n {\n $getRole = $this->getRole()->getByName($roleId);\n if (empty($getRole)) {\n return false;\n }\n $role = $this->where('user_id', $userId)->where('role_id', $getRole['id'])->get();\n if (!$this->checkEmptyObject($role)) {\n return (bool) $this->create([\n 'role_id' => $getRole['id'],\n 'user_id' => $userId,\n ]);\n }\n return false;\n }\n\n /**\n * @param int $userId\n * @param int $roleId\n *\n * @return bool\n */\n public function disableRole(int $userId, int $roleId = 0): bool\n {\n return $this->where('user_id', $userId)->where('role_id', $roleId)->delete();\n }\n\n /**\n * @param int $userId\n *\n * @return bool\n */\n public function disableAllRole(int $userId): bool\n {\n return $this->where('user_id', $userId)->delete();\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":29,"cells":{"blob_id":{"kind":"string","value":"76737d51eeedea01987cccb61efca92af5478956"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"gaoxiangbo9527/php-manual"},"path":{"kind":"string","value":"/Examples/Language Reference/Constants/Syntax/Example #1 Defining Constants.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":141,"string":"141"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\t\n\t\t\n\t\t\t\n\t\t\t\t\");\n\t\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\t\t$HostRating=getHostRating($userID);\n\t\t\t\t$TotalHostRates=getLikes($userID);\n\t\t\t\t$PlayerRating=getPlayerRating($userID);\n\t\t\t\t$TotalPlayerRates=getTotalRatingsAsPlayer($userID);\n\t\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\t\tprint(\"\");\n\t\t\tprint(\"\");\n\t\tprint(\"\");\n\tprint(\"
\n\t\t\t\t\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t \t\tprint(\"Profile Picture\");\n\t\t\t\t}\n\t\t\t\tprint(\"Name:{$name}
Age:{$age}
UserName:{$username}
Host Rating:{$HostRating}/{$TotalHostRates} ({$TotalHostRates} vote(s))
Player Rating{$PlayerRating}/{$TotalPlayerRates} ({$TotalPlayerRates} vote(s))
\");\n\tif(isset($_SESSION['UserID']) AND $_SESSION['UserID'] == $userID)\n\t\tprint(\"Edit Profile Information
\");\n\t// getUpcomingGames($userID);\n}\nelse\n{\n\tif(isset($_SESSION['UserID']))\n\t{\n\t\techo \"

User does not exist.

\";\n\t}\n\telse\n\t{\n\t\t\n\t}\n}\n\n\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":31,"cells":{"blob_id":{"kind":"string","value":"d98eb5ea9d92dbc065cb468b1b09f1893d52d0aa"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mctech4/mvc-php"},"path":{"kind":"string","value":"/lib/app/util/hash.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":593,"string":"593"},"score":{"kind":"number","value":2.78125,"string":"2.78125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n \n \n \n getParams() as $k => $v) $response->setValue($k, $v);\n }\n}\n\nclass Quick_Rest_AppRunnerTest\n extends Quick_Test_Case\n implements Quick_Rest_Controller\n{\n public function setUp( ) {\n $this->_cut = new Quick_Rest_AppRunner();\n }\n\n public function testRouteCallShouldAcceptCallbacksThatAppearValid( ) {\n // valid\n $this->_cut->routeCall('GET', '/path1', 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n $this->_cut->routeCall('GET', '/path2', 'function_exists');\n $this->_cut->routeCall('GET', '/path3', create_function('$a,$b,$c', 'return;'));\n // not valid, but syntactically appear to be\n $this->_cut->routeCall('GET', '/path4', array(\"hello\", \"world\"));\n $this->_cut->routeCall('GET', '/path5', \"Hello, world\");\n }\n\n /**\n * @expectedException Quick_Rest_Exception\n */\n public function testRunCallShouldThrowExceptionIfPathNotRouted( ) {\n $this->_cut->routeCall('GET', '/foo', 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n $request = $this->_makeRequest('GET', '/bar', array(), array());\n $this->_cut->runCall($request, $this->_makeResponse());\n }\n\n public function invalidCallbackProvider( ) {\n return array(\n array(123),\n array(array(1, 2)),\n );\n }\n\n /**\n * @expectedException Quick_Rest_Exception\n * @dataProvider invalidCallbackProvider\n */\n public function testRouteCallShouldTrowExceptionIfCallbackNotValid( $callback ) {\n $this->_cut->routeCall('GET', '/call/name', $callback);\n }\n\n public function testRunCallShouldInvokeDoublecolonStringCallback( ) {\n $this->_cut->routeCall('GET|POST|OTHER', \"/call/path\", 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n foreach (array('GET', 'POST', 'OTHER') as $method) {\n $id = uniqid();\n $request = $this->_makeRequest($method, '/call/path', array('a' => 1), array('b' => $id));\n $response = $this->_cut->runCall($request, $this->_makeResponse());\n $this->assertContains($id, $response->getResponse());\n }\n }\n\n public function testRunCallShouldInvokeArrayCallbacks( ) {\n $runner = $this->_makeRunner($calls = array('a', 'b', 'c'));\n foreach ($calls as $call)\n $this->_cut->routeCall('GET', \"/call/$call\", array($runner, $call));\n foreach ($calls as $call) {\n $request = $this->_makeRequest('GET', \"/call/$call\", array(), array());\n $this->_cut->runCall($request, $this->_makeResponse());\n }\n }\n\n public function testRunCallShouldInvokeAnonymousFunctionCallbacks( ) {\n if (version_compare(phpversion(), \"5.3.0\") < 0)\n $this->markTestSkipped();\n $runner = $this->_makeRunner($calls = array('a', 'b', 'c'));\n foreach ($calls as $call)\n $this->_cut->routeCall('GET', \"/call/$call\", function ($req, $resp, $app) use ($runner) {\n $path = $req->getPath();\n $method = substr($path, strrpos($req->getPath(), '/')+1);\n $runner->$method($req, $resp, $app);\n });\n foreach ($calls as $call) {\n $request = $this->_makeRequest('GET', \"/call/$call\", array(), array());\n $this->_cut->runCall($request, $this->_makeResponse());\n }\n }\n\n public function testRunCallShouldInvokeSetCallInsteadOfPath( ) {\n $runner = $this->_makeRunner($calls = array('a'));\n $this->_cut->routeCall('ALL', 'CALLS', array($runner, 'a'));\n $this->_cut->setCall('ALL::CALLS');\n $request = $this->_makeRequest('GET', '/call/foo/bar', array(), array());\n $this->_cut->runCall($request, $this->_makeResponse());\n }\n\n public function testRunCallShouldPassUserAppToActionMethod( ) {\n $app = $this->getMock('Quick_Rest_App', array('getInstance'));\n $controller = $this->getMock('Quick_Rest_Controller', array('testAction'));\n //$this->_cut->routeCall('GET', '/test', array($controller, 'testAction'));\n $routes = array(\n 'GET::/test' => array($controller, 'testAction')\n );\n $this->_cut->setRoutes($routes);\n $request = $this->_makeRequest('GET', '/test', array(), array());\n $response = $this->_makeResponse();\n $controller->expects($this->once())->method('testAction')->with($request, $response, $app);\n $this->_cut->runCall($request, $response, $app);\n }\n\n public function xx_testSpeed( ) {\n $timer = new Quick_Test_Timer();\n $timer->calibrate(10000, array($this, '_testNullSpeed'), array(1, 2));\n echo $timer->timeit(20000, 'empty call', array($this, '_testNullSpeed'), array(1, 2));\n echo $timer->timeit(20000, 'create', array($this, '_testCreateSpeed'), array(1, 2));\n $cut = new Quick_Rest_AppRunner();\n for ($call = 'aa'; $call < 'ac'; $call++) $routes[\"GET::/$call\"] = \"class::$call\";\n $cut->setRoutes($routes);\n echo $timer->timeit(1000, 'set routes(5)', array($this, '_testRoutesSpeed'), array($cut, & $routes));\n // 560k/s for 2, 390k/s for 4, 136k/s for 16, 34k/s for 77, 4k/s for 675\n // w/o is_callable test 1.75m/sec for 675!! (by ref, or 7.7k/s by value overwrite, 11k/s first assign)\n // assigning an array is linear in the number of elements ?? ...even if assigned by reference ??\n $globals = $this->_makeGlobalsForCall('GET', '/call/name', array(), array());\n $request = $this->_makeRequest('GET', '/call/name', array(), array());\n // 640k/s\n $cut->routeCall('GET', '/call/name', 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n echo $timer->timeit(20000, 'route to string w/ request', array($this, '_testRunCallSpeed'), array($cut, $request));\n // 140k/s\n echo $timer->timeit(20000, 'route to string w/ globals', array($this, '_testRunCallSpeedGlobals'), array($cut, $globals));\n // 90k/s\n $cut->routeCall('GET', '/call/name', array(new Quick_Rest_AppRunnerTest_EchoController(), 'echoAction'));\n echo $timer->timeit(20000, 'route to callback w/ globals', array($this, '_testRunCallSpeedGlobals'), array($cut, $globals));\n // 101k/s\n echo $timer->timeit(20000, 'oneshot, handle page hit', array($this, '_testOneshotPageHitSpeed'), array($cut, $globals));\n // 65k/s (85k/s on amd 3.6 GHz)\n // NOTE: measuring inside apache to capture apc autoloading delays, more like ~1k (cold) to 4k/s (looped)\n }\n\n public function _testNullSpeed( $x, $y ) {\n }\n\n public function _testRoutesSpeed( $cut, & $routes ) {\n $cut->setRoutes($routes);\n }\n\n public function _testCreateSpeed( $x, $y ) {\n $new = new Quick_Rest_AppRunner();\n }\n\n public function _testRunCallSpeed( $cut, $request ) {\n $cut->runCall($request, new Quick_Rest_Response_Http());\n }\n\n public function _testRunCallSpeedGlobals( $cut, & $globals ) {\n $request = new Quick_Rest_Request_Http();\n $request->setParamsFromGlobals($globals);\n $response = new Quick_Rest_Response_Http();\n $cut->runCall($request, $response);\n }\n\n public function _testOneshotPageHitSpeed( $cut, & $globals ) {\n $cut = new Quick_Rest_AppRunner();\n $request = new Quick_Rest_Request_Http();\n $request->setParamsFromGlobals($globals);\n $response = new Quick_Rest_Response_Http();\n //$cut->routeCall('GET', '/call/name', 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n $cut->routeCall('GET', $request->getPath(), 'Quick_Rest_AppRunnerTest_EchoController::echoAction');\n $cut->runCall($request, $response);\n }\n\n protected function _makeGlobalsForCall( $method, $uri, Array $getargs, Array $postargs ) {\n return $globals = array(\n '_GET' => $getargs,\n '_POST' => $postargs,\n '_SERVER' => array(\n 'SERVER_PROTOCOL' => 'HTTP/1.1',\n 'REQUEST_METHOD' => strtoupper($method),\n 'REQUEST_URI' => $uri,\n ),\n );\n }\n\n protected function _makeRequest( $method, $uri, Array $getargs, Array $postargs ) {\n $request = new Quick_Rest_Request_Http();\n $globals = $this->_makeGlobalsForCall($method, $uri, $getargs, $postargs);\n $request->setParamsFromGlobals($globals);\n return $request;\n }\n\n protected function _makeResponse( ) {\n return new Quick_Rest_Response_Http();\n }\n\n protected function _makeRunner( Array $calls ) {\n $runner = $this->getMock('Quick_Rest_Controller', $calls);\n foreach ($calls as $call)\n $runner->expects($this->once())->method($call);\n return $runner;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":35,"cells":{"blob_id":{"kind":"string","value":"44e7c93fa4d1df486888989c30b2c93c15b8108b"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"netzmacht/tapatalk-client-api"},"path":{"kind":"string","value":"/src/Netzmacht/Tapatalk/Api/Users/User.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1274,"string":"1,274"},"score":{"kind":"number","value":2.96875,"string":"2.96875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n * @copyright 2014 netzmacht creative David Molineus\n * @license LGPL 3.0\n * @filesource\n *\n */\n\nnamespace Netzmacht\\Tapatalk\\Api\\Users;\n\n\nuse Netzmacht\\Tapatalk\\Transport\\MethodCallResponse;\n\nclass User\n{\n\t/**\n\t * @var int\n\t */\n\tprivate $id;\n\n\t/**\n\t * @var string\n\t */\n\tprivate $username;\n\n\t/**\n\t * @var string\n\t */\n\tprivate $avatarUrl;\n\n\n\t/**\n\t * @param int $id\n\t * @param string $username\n\t * @param string $avatar\n\t */\n\tfunction __construct($id, $username, $avatar)\n\t{\n\t\t$this->id = $id;\n\t\t$this->username = $username;\n\t\t$this->avatarUrl = $avatar;\n\t}\n\n\t/**\n\t * @param MethodCallResponse $response\n\t * @return User\n\t */\n\tpublic static function fromResponse(MethodCallResponse $response)\n\t{\n\t\treturn new static(\n\t\t\t$response->get('user_id'),\n\t\t\t$response->get('username', true),\n\t\t\t$response->get('icon_url')\n\t\t);\n\t}\n\n\n\t/**\n\t * @return mixed\n\t */\n\tpublic function getAvatarUrl()\n\t{\n\t\treturn $this->avatarUrl;\n\t}\n\n\n\t/**\n\t * @return bool\n\t */\n\tpublic function hasAvatar()\n\t{\n\t\treturn ($this->avatarUrl != null);\n\t}\n\n\n\t/**\n\t * @return int\n\t */\n\tpublic function getId()\n\t{\n\t\treturn $this->id;\n\t}\n\n\n\t/**\n\t * @return string\n\t */\n\tpublic function getUsername()\n\t{\n\t\treturn $this->username;\n\t}\n\n} "},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":36,"cells":{"blob_id":{"kind":"string","value":"b2db89ce7666651da494b824d1fa72f9e16588c9"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lx1986tao16/tandyBlog"},"path":{"kind":"string","value":"/app/Http/Controllers/Admin/TagsController.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1636,"string":"1,636"},"score":{"kind":"number","value":2.53125,"string":"2.53125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"validate($request, [\n 'name' => 'required|max:255|unique:tags',\n ]);\n\n Tag::create([\n 'name' => $request->name,\n ]);\n\n session()->flash('success', '创建Tag成功!');\n return redirect()->back();\n }\n\n public function edit($id)\n {\n $tags = Tag::findOrFail($id);\n return view('admin.tags.edit', compact('tags'));\n }\n\n public function update($id, Request $request)\n {\n $tags = Tag::findOrFail($id);\n $tags->name = $request->name;\n $tags->update();\n\n session()->flash('success', 'Tag更新成功');\n return redirect()->route('tags.index');\n }\n\n public function destroy($id)\n {\n $tag = Tag::findOrFail($id);\n $tag->delete();\n\n session()->flash('success', '删除tag成功');\n return redirect()->back();\n }\n\n public function getTags()\n {\n $tags = Tag::all();\n $tags_data = [];\n foreach ($tags as $tag) {\n array_push($tags_data, [\n \"value\" => $tag->id,\n \"text\" => $tag->name,\n ]);\n }\n\n return response()->json($tags_data);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":37,"cells":{"blob_id":{"kind":"string","value":"f6526cf0af8ac918ebb9e87c8f373b3c64a8d634"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"wwrona/php"},"path":{"kind":"string","value":"/powitalna.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":559,"string":"559"},"score":{"kind":"number","value":3.28125,"string":"3.28125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\n\n\n\t Strona powitalna\n\n\n\n

Części samochodwe

\n
\n\n\n\";\n\t}\n*/\n// A teraz to samo, tylko przy użyciu concatenation:\nfor ($i = 0; $i < 4; $i++) {\necho \"\";\n}\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":38,"cells":{"blob_id":{"kind":"string","value":"6f166812d885eb0b9a553d49bf06eef21f39b141"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"marscore/hhvm"},"path":{"kind":"string","value":"/hphp/test/zend/good/ext/standard/tests/strings/htmlspecialchars_decode_variation6.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1043,"string":"1,043"},"score":{"kind":"number","value":3.5625,"string":"3.5625"},"int_score":{"kind":"number","value":4,"string":"4"},"detected_licenses":{"kind":"list like","value":["Zend-2.0","PHP-3.01","MIT"],"string":"[\n \"Zend-2.0\",\n \"PHP-3.01\",\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"> function main() {\necho \"*** Testing htmlspecialchars_decode() : usage variations ***\\n\";\n\n//various string inputs\n$strings = array (\n \"\\tHello \\$world \".chr(0).\"\\&!)The big brown fox jumped over the\\t\\f lazy dog\\v\\n\",\n \"\\tHello \\\"world\\\"\\t\\v \\0 This is a valid\\t string\",\n \"This converts\\t decimal to \\$string\".decbin(65).\"Hello world\",\n b\"This is a binary\\t \\v\\fstring\"\n);\n\n//loop through the strings array to check if htmlspecialchars_decode() is binary safe\n$iterator = 1;\nforeach($strings as $value) {\n echo \"-- Iteration $iterator --\\n\";\n if ($iterator < 4) {\n var_dump( htmlspecialchars_decode($value) );\n } else {\n var_dump( bin2hex(htmlspecialchars_decode($value)));\n }\n\n $iterator++;\n}\n\necho \"Done\";\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":39,"cells":{"blob_id":{"kind":"string","value":"0854c5788103ec628c79b802f09496d9beed8735"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"JvMolli/2DawServidor"},"path":{"kind":"string","value":"/examenPhp/controllers/persona.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":961,"string":"961"},"score":{"kind":"number","value":3.296875,"string":"3.296875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"nombre = $nombre;\n $this->apellidos = $apellidos;\n $this->sexo = $sexo;\n $this->edad = $edad;\n $this->telefono = $telefono;\n $this->imagen = $imagen;\n $this->contraseña = $contraseña;\n }\n\n// function getJsonData(){\n// $var = get_object_vars($this);\n// foreach ($var as &$value) {\n// if (is_object($value) && method_exists($value,'getJsonData')) {\n// $value = $value->getJsonData();\n// }\n// }\n// return $var;\n// }\n\n function __toString(){\n return $this->nombre . \" \" . $this->apellidos . \" \" . $this->sexo . \" \" . $this->edad . \" \" . $this->telefono . \" \" . $this->contraseña;\n }\n\n } \n\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":40,"cells":{"blob_id":{"kind":"string","value":"db9724d43ce97b4f11e4d54e28ad08c40438f580"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"rozinCodes/school-management"},"path":{"kind":"string","value":"/API/application/controllers/api/Login.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1927,"string":"1,927"},"score":{"kind":"number","value":2.671875,"string":"2.671875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT","LicenseRef-scancode-unknown-license-reference"],"string":"[\n \"MIT\",\n \"LicenseRef-scancode-unknown-license-reference\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"load->database();\n $this->load->model(array(\"api/student_model\"));\n $this->load->model(array(\"api/common_model\"));\n $this->load->library(array(\"form_validation\"));\n $this->load->helper(\"security\");\n }\n \n\n public function admin_login_post(){\n\n $this->form_validation->set_rules(\"email\", \"Email\", \"required\");\n\n if ($this->form_validation->run() == NULL) {\n // we have some errors\n $this->response(array(\n \"status\" => 0,\n \"message\" => \"All fields are needed or filled form is not valid\"\n ) , REST_Controller::HTTP_OK);\n } else {\n\n $email = $this->security->xss_clean($this->input->post(\"email\"));\n $password = $this->security->xss_clean($this->input->post(\"password\"));\n\n $user = $this->common_model->admin_login($email, $password);\n if ($user) {\n $userdata = array(\n \"id\" => $user->ID,\n \"email\" => $user->EMAIL,\n \"first_name\" => $user->FIRST_NAME,\n \"photo\" => $user->PHOTO, \n //\"surname\" => $user->surname,\n \"roles\" => $user->ROLES_ID,\n \"authenticated\" => TRUE\n );\n\n $this->response(array(\n \"status\" => 1,\n \"message\" => \"Login Success\"\n ), REST_Controller::HTTP_OK);\n } else {\n // we have some empty field\n $this->response(array(\n \"status\" => 0,\n \"message\" => \"Login credential does not match\"\n ), REST_Controller::HTTP_OK);\n }\n }\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":41,"cells":{"blob_id":{"kind":"string","value":"64e2e363e1ec47d2ea38f353e75633e09098d4b8"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"andreadlm/unito"},"path":{"kind":"string","value":"/tweb/Vuvuzela/services/functions/authors.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1073,"string":"1,073"},"score":{"kind":"number","value":2.8125,"string":"2.8125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"prepare(AUTHOR_QUERY);\n $statement->bindValue(':num', $num, PDO::PARAM_INT);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":42,"cells":{"blob_id":{"kind":"string","value":"7a9398b48162c198ba025f87637b1dc6ec76e7c0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"big-javascript-fan/HyonMoo-WooCom"},"path":{"kind":"string","value":"/hyunmoo/framework/theme/shortcodes/one_half.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":686,"string":"686"},"score":{"kind":"number","value":2.734375,"string":"2.734375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" 'no',\r\n\t\t\t), $atts);\r\n\t\t\r\n\t\t# Overwrite Default Attributes\r\n\t\t$atts = shortcode_atts( $default_atts, $atts );\r\n\r\n\t\textract( $atts );\r\n\t\t\r\n\t\t$output=\"\";\r\n\t\tif($last == 'yes') {\r\n\t\t\t$output.= '
' .do_shortcode($content). '
';\r\n\t\t} else {\r\n\t\t\t$output.= '
' .do_shortcode($content). '
';\r\n\t\t}\r\n\t\treturn $output;\r\n\t}\r\n\t\r\n\tadd_shortcode('one_half', 'hyunmoo_shortcode_one_half');\r\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":43,"cells":{"blob_id":{"kind":"string","value":"a9c8407a8d2770795c860bcf971c304185a0313a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"nachovazquez1990/mongril_club"},"path":{"kind":"string","value":"/public_html/admin/model/consumo_class.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4804,"string":"4,804"},"score":{"kind":"number","value":2.59375,"string":"2.59375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"0){\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction create_consumo($socios_id, $productos_id, $cantidad, $importe, $fecha){\n\tglobal $link;\n\n\t$socio_id = (int) $socios_id;\n\t$producto_id = (int) $productos_id;\n\t$cantidad = (float) $cantidad;\n\t$importe = (float) $importe;\n\t$fecha = $fecha;\n\t\n\tif( !$socio_id || !$producto_id || !$cantidad || !$importe || !$fecha ){\n\t\treturn false;\n\t}\n\n\t$sql = \"INSERT INTO consumos(socios_id, productos_id, cantidad, importe, fecha)\n\t\t\tVALUES('$socios_id', '$producto_id', '$cantidad', '$importe', '$fecha')\";\n\t$query = mysqli_query($link,$sql);\n\n\tif(mysqli_insert_id($link)>0){\n\t\trestar_dinero_socio($socio_id, $importe);\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction read_consumo_by_id( $id ){\n\t\n\tglobal $link;\n\t\n\t$id = (int) $id; \n\n\t$sql = \"SELECT consumo_id, socios_id, producto, precio, importe, fecha FROM consumos\n\t\t\tLEFT JOIN socios ON socios_id = socio_id\n\t\t\tLEFT JOIN productos ON productos_id = producto_id\n\t\t\tWHERE consumo_id = '$id'\";\n\t$query = mysqli_query($link,$sql); \n\n\t$num_rows = mysqli_num_rows($query);\n\tif( $num_rows > 0 ){\n\t\treturn mysqli_fetch_assoc($query);\n\t}\n\treturn false;\n}\n\nfunction read_consumo_by_name( $producto ){\n\t\n\tglobal $link;\n\t\n\t$producto = mysqli_real_escape_string($link,$producto); \n\n\tif(!$producto){\n\t\treturn false;\n\t}\n\n\t$sql = \"SELECT consumo_id, producto, precio, fecha FROM consumos\n\t\t\tLEFT JOIN productos ON productos_id = producto_id\n\t\t\tWHERE productos.producto = '$producto'\";\n\t$query = mysqli_query($link,$sql); \n\n\t$num_rows = mysqli_num_rows($query);\n\tif( $num_rows > 0 ){\n\t\treturn mysqli_fetch_assoc($query);\n\t}\n\treturn false;\n}\n\nfunction read_all_consumos(){\n\t\n\tglobal $link;\n\t\n\t$sql = \"SELECT consumo_id, socios_id, producto, precio, cantidad, importe, fecha FROM consumos\n\t\t\tLEFT JOIN productos ON productos_id = producto_id\n\t\t\tORDER BY consumo_id DESC\";\n\t$query = mysqli_query($link,$sql); \n\n\t$num_rows = mysqli_num_rows($query);\n\tif( $num_rows > 0 ){\n\t\treturn $query;\n\t}\n\treturn false;\n}\n\nfunction delete_consumo( $id ){\n\t\n\tglobal $link;\n\t\n\t$id = (int) $id;\n\n\t$consumo = read_consumo_by_id($id);\n\t$socio_id = $consumo['socios_id'];\n\t$importe = $consumo ['importe'];\n\n\t$resultado = devolver_dinero_socio($socio_id, $importe);\n\tif ($resultado = false) {\n\t\treturn false;\n\t}\n\t$sql = \"DELETE FROM consumos\n\t\t\tWHERE consumo_id = '$id'\";\n\t$query = mysqli_query($link,$sql); \n\n\t$affected_rows = mysqli_affected_rows( $link );\n\tif( $affected_rows > 0 ){\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n\n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":44,"cells":{"blob_id":{"kind":"string","value":"144c2685e7c760594d90bcc317930f9cd4c96572"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"gcarneiro/sheer"},"path":{"kind":"string","value":"/sheer/core/action/queryGenerator/Add.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2892,"string":"2,892"},"score":{"kind":"number","value":3.1875,"string":"3.1875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"actionHandler = $actionHandler;\n\t\t\n\t}\n\t\n\t/**\n\t * Método gerador da query\n\t * @param array $data\n\t * @return mixed\n\t */\n\tpublic function getQuery ($data) {\n\t\t\n\t\t//EFETUO O PROCESSAMENTO DO FIELDLIST E DOS VALORES\n\t\t$this->createFieldListAndValuesQuery($data);\n\t\t\n\t\t//GERO O NOME DA TABLE\n\t\t$this->createTableQuery();\n\t\t\n\t\t//CRIANDO A QUERY\n\t\t$replacement = array('{table}', '{fieldlist}', '{values}');\n\t\t$value = array($this->table, $this->fieldlist, $this->values);\n\t\t$query = str_replace($replacement, $value, self::QUERY_PATTERN);\n\t\t\n\t\treturn $query;\n\t\t\n\t}\n\t\n\t/**\n\t * Método para gerar o fieldList do datasource com os fields desejados\n\t */\n\tprotected function createFieldListAndValuesQuery ($data) {\n\t\t\n\t\t$queryFieldList\t= '';\n\t\t$queryValues = '';\n\t\t$first = true;\n\t\t$fields = $this->actionHandler->getDataSource()->getFields(false);\n\t\t\n\t\t//itero por todos os fields gerando tanto o fieldList quanto capturando o seu valor\n\t\tforeach ( $fields as $field ) {\n\t\t\tif( !$first ) { \n\t\t\t\t$queryFieldList .= ', ';\n\t\t\t\t$queryValues .= ', ';\n\t\t\t}\n\t\t\t\n\t\t\t//GERANDO O FIELDLIST\n\t\t\t$queryFieldList .= $field->getId();\n\t\t\t\n\t\t\t//GERANDO O VALOR\n\t\t\t\n\t\t\t//determinando o valor enviado [considero enviado se for array ou tiver pelo menos um caracter]\n\t\t\t$valorEnviado = false;\n\t\t\tif( isset($data[$field->getId()]) && ( is_array($data[$field->getId()]) || strlen($data[$field->getId()]) > 0 ) ) {\n\t\t\t\t$valorEnviado = true;\n\t\t\t}\n\t\t\t\n\t\t\t//se o valor foi enviado corretamente\n\t\t\tif( $valorEnviado ) {\n\t\t\t\t//Removo a conversao input=>primitive daqui e jogo pro actionClass para conseguir inserir arquivos\n// \t\t\t\t$sqlValue = $field::formatInputDataToPrimitive($data[$field->getId()]);\n\t\t\t\t$sqlValue = addslashes($data[$field->getId()]);\n\t\t\t\t$queryValues .= '\"'.$sqlValue.'\"';\n\t\t\t}\n\t\t\t//o valor não foi enviado\n\t\t\telse {\n\t\t\t\tif( $field->getSetNullIfBlank() ) {\n\t\t\t\t\t$queryValues .= 'NULL';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$queryValues .= '\"\"';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\t$queryFieldList = '('.$queryFieldList.')';\n\t\t$queryValues = '('.$queryValues.')';\n\t\t\n\t\t$this->fieldlist = $queryFieldList;\n\t\t$this->values = $queryValues;\n\t}\n\t\n\t/**\n\t * Método para gerar o campo \"table\" da query\n\t */\n\tprotected function createTableQuery () {\n\t\t$this->table = $this->actionHandler->getDataSource()->getTable();\n\t}\n\t\n\t\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":45,"cells":{"blob_id":{"kind":"string","value":"7245389bf5ad8ab0a8174c6b297e4f8e673e62e0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Ashiyro/Mon-Framework"},"path":{"kind":"string","value":"/Components/Router/Router.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1445,"string":"1,445"},"score":{"kind":"number","value":2.96875,"string":"2.96875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"router = new FastRouteRouter();\n }\n\n /**\n * @param string $path\n * @param string|callable $callable\n * @param string $name\n */\n public function get(string $path, $callable, ?string $name = null)\n {\n $this->router->addRoute(new ZendRoute($path, $callable, ['GET'], $name));\n }\n\n\n public function post(string $path, $callable, ?string $name = null)\n {\n $this->router->addRoute(new ZendRoute($path, $callable, ['POST'], $name));\n }\n\n /**\n * @param ServerRequestInterface $request\n * @return Route|null\n */\n public function match(ServerRequestInterface $request): ?Route\n {\n $result = $this->router->match($request);\n if ($result->isSuccess()) {\n return new Route(\n $result->getMatchedRouteName(),\n $result->getMatchedMiddleware(),\n $result->getMatchedParams()\n );\n }\n return null;\n }\n\n public function generateUri(string $name, array $params): ?string\n {\n return $this->router->generateUri($name, $params);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":46,"cells":{"blob_id":{"kind":"string","value":"51418500e4421e4f5773232a7df85b39db603e6f"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"commercetools/commercetools-sdk-php-v2"},"path":{"kind":"string","value":"/lib/commercetools-api/src/Models/ShippingMethod/ShippingMethodAddZoneActionBuilder.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1760,"string":"1,760"},"score":{"kind":"number","value":2.515625,"string":"2.515625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"\n */\nfinal class ShippingMethodAddZoneActionBuilder implements Builder\n{\n /**\n\n * @var null|ZoneResourceIdentifier|ZoneResourceIdentifierBuilder\n */\n private $zone;\n\n /**\n *

Value to add to zoneRates.

\n *\n\n * @return null|ZoneResourceIdentifier\n */\n public function getZone()\n {\n return $this->zone instanceof ZoneResourceIdentifierBuilder ? $this->zone->build() : $this->zone;\n }\n\n /**\n * @param ?ZoneResourceIdentifier $zone\n * @return $this\n */\n public function withZone(?ZoneResourceIdentifier $zone)\n {\n $this->zone = $zone;\n\n return $this;\n }\n\n /**\n * @deprecated use withZone() instead\n * @return $this\n */\n public function withZoneBuilder(?ZoneResourceIdentifierBuilder $zone)\n {\n $this->zone = $zone;\n\n return $this;\n }\n\n public function build(): ShippingMethodAddZoneAction\n {\n return new ShippingMethodAddZoneActionModel(\n $this->zone instanceof ZoneResourceIdentifierBuilder ? $this->zone->build() : $this->zone\n );\n }\n\n public static function of(): ShippingMethodAddZoneActionBuilder\n {\n return new self();\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":47,"cells":{"blob_id":{"kind":"string","value":"3965246462eb3b518e19185905c4c9a77144d973"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mcordingley/HashBin"},"path":{"kind":"string","value":"/src/Hasher.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":222,"string":"222"},"score":{"kind":"number","value":3.109375,"string":"3.109375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"_request->get('count', 10);\n if ($perPage > 500) {\n $perPage = 500;\n }\n elseif ($perPage <= 0) {\n $perPage = 10;\n }\n\n // page number\n $pageNumber = ($this->_request->get('offset', 0) / $perPage) + 1;\n\n /**\n * Pager Configuration\n */\n $this->_pager->setCurrentPageNumber($pageNumber);\n $this->_pager->setItemCountPerPage($perPage);\n $fields = $this->_pager->getFields();\n $fieldsIndex = array_keys($fields);\n\n /**\n * Formatting datas\n */\n $items = $this->_pager->getItems();\n $infos = $this->_pager->getPages();\n\n $datas = array();\n foreach ($items as $obj) {\n $item = array();\n foreach ($fields as $field) {\n $item[$field->getProperty()] = $field->readData($obj);\n }\n $datas[] = $item;\n }\n\n $response = array(\n \"fromPage\" => $this->_request->get('fromPage', 0),\n \"total\" => $infos->totalItemCount,\n \"count\" => count($datas),\n \"stories\" => $datas\n );\n\n return $this->jsonResponse($response);\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":49,"cells":{"blob_id":{"kind":"string","value":"e241420ba1f687eb110432bd2be84b2297dabe76"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"hanxiao84322/coach_system"},"path":{"kind":"string","value":"/models/Activity.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":5233,"string":"5,233"},"score":{"kind":"number","value":2.671875,"string":"2.671875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["BSD-3-Clause"],"string":"[\n \"BSD-3-Clause\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" '周末班',\n self::DAILY => '日常班'\n ];\n\n //课程状态\n const NEW_ADD = 1;\n const BEGIN_SIGN_UP = 2;\n const END_SIGN_UP = 3;\n const DOING = 4;\n const END = 5;\n\n static public $statusList = [\n self::NEW_ADD => '未开始报名',\n self::BEGIN_SIGN_UP => '报名开始',\n self::END_SIGN_UP => '报名结束',\n self::DOING => '进行中',\n self::END => '结束',\n ];\n\n public $already_recruit_count;\n\n /**\n * @inheritdoc\n */\n public static function tableName()\n {\n return 'activity';\n }\n\n /**\n * @inheritdoc\n */\n public function rules()\n {\n return [\n [['category', 'level_id', 'recruit_count', 'sign_up_status', 'status', 'lesson', 'score'], 'integer'],\n [['sign_up_begin_time', 'sign_up_end_time', 'begin_time', 'end_time', 'create_time', 'update_time'], 'safe'],\n [['content','bus','near_site'], 'string'],\n [['name', 'create_user', 'update_user'], 'string', 'max' => 45],\n [['address', 'launch', 'organizers', 'join_teams'], 'string', 'max' => 50]\n ];\n }\n\n /**\n * @inheritdoc\n */\n public function attributeLabels()\n {\n return [\n 'id' => 'ID',\n 'name' => '名称',\n 'category' => '分类',\n 'level_id' => '级别',\n 'recruit_count' => '招收人数',\n 'sign_up_begin_time' => '报名开始时间',\n 'sign_up_end_time' => '报名结束时间',\n 'sign_up_status' => '报名状态',\n 'begin_time' => '开始时间',\n 'end_time' => '结束时间',\n 'status' => '状态',\n 'lesson' => '课时',\n 'address' => '地址',\n 'score' => '活动积分',\n 'launch' => '发起者',\n 'organizers' => '主办方',\n 'join_teams' => '参训着',\n 'content' => '内容',\n 'bus' => '公交路线',\n 'near_site' => '周边站点',\n 'create_time' => '创建时间',\n 'create_user' => '创建人',\n 'update_time' => '更新时间',\n 'update_user' => '更新人',\n ];\n }\n\n /**\n * @return \\yii\\db\\ActiveQuery\n */\n public function getLevel()\n {\n return $this->hasOne(Level::className(), ['id' => 'level_id']);\n }\n\n /**\n * @return \\yii\\db\\ActiveQuery\n */\n public function getActivityUsers()\n {\n return $this->hasMany(ActivityUsers::className(), ['activity_id' => 'id']);\n }\n\n public static function getAll()\n {\n $rows = (new \\yii\\db\\Query())\n ->select(['id', 'name'])\n ->from(self::tableName())\n ->where(['status'=>'1'])\n ->all();\n return $rows;\n }\n\n public static function getCategoryName($category)\n {\n return isset(self::$categoryList[$category]) ? self::$categoryList[$category] : $category;\n }\n\n public static function getSignUpStatusName($signUpStatus)\n {\n return isset(self::$signUpStatusList[$signUpStatus]) ? self::$signUpStatusList[$signUpStatus] : $signUpStatus;\n }\n\n public static function getStatusName($status)\n {\n return isset(self::$statusList[$status]) ? self::$statusList[$status] : $status;\n }\n\n public static function getOneActivityNameById($activityId)\n {\n $sql = \"SELECT name FROM `activity` WHERE id='\" . $activityId . \"'\";\n $result = Yii::$app->db->createCommand($sql)->queryOne();\n return $result['name'];\n }\n\n\n public function beforeSave($insert = '')\n {\n if (parent::beforeSave($this->isNewRecord)) {\n if ($this->isNewRecord) {\n $this->create_time = date('Y-m-d H:i:s', time());\n $this->create_user = 'admin';\n $this->update_time = date('Y-m-d H:i:s', time());\n $this->update_user = 'admin';\n } else {\n $this->update_time = date('Y-m-d H:i:s', time());\n $this->update_user = 'admin';\n }\n return true;\n } else {\n return false;\n }\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":50,"cells":{"blob_id":{"kind":"string","value":"0fd6ed1f77dbe0c992f76b3fb542f199cfdef076"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"JayDeeJaye/anaconda-jdj-f"},"path":{"kind":"string","value":"/apis/apiHeader.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":947,"string":"947"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"getCode() ?: 400;\n\theader(\"Content-Type: application/json\", NULL, $code);\n\techo json_encode([\"error\" => $e->getMessage()],JSON_PRETTY_PRINT);\n\texit;\n});\n\n// Get the request verb\n$verb = $_SERVER['REQUEST_METHOD'];\n\n// Get the api route keys from the url for GET, PUT, and DELETE\nswitch($verb) {\n case 'GET':\n case 'PUT':\n case 'DELETE':\n //GET, PUT, and DELETE requests have the form api.php/target\n\n $my_path_info = str_replace($_SERVER['SCRIPT_NAME'],'',$_SERVER['REQUEST_URI']);\n $url_pieces = explode('/', $my_path_info);\n}\n\n// Get the data from the PUT and POST requests \nswitch($verb) {\n case 'PUT':\n case 'POST':\n $params = json_decode(file_get_contents(\"php://input\"), true);\n if(!$params) {\n throw new Exception(\"Data missing or invalid\");\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":51,"cells":{"blob_id":{"kind":"string","value":"673f1c6173757c3db81787284e7288497f6f10c2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"andrii-androshchuk/api-framework"},"path":{"kind":"string","value":"/framework/configuration/configuration.class.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":7908,"string":"7,908"},"score":{"kind":"number","value":2.84375,"string":"2.84375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" \n * @copyright 2013 (c) Androschuk Andriy\n *\n * @version 0.1\n */\n\n \nclass Configuration {\n \n\t// Singletone\n private static $p_instance;\n \n // Files\n private $config_file_path;\n private $config_file_hash; \n private $php_config_file_path;\n \n // Parameters\n private $parameters = array();\n\n\n private function __construct() {}\n\n \n /**\n * @name initialize\n * Load configurations. \n * \n * @param string : name of configuration's file\n */\n public function initialize($configuration_name = \"main\") {\n \n $this->config_file_path = APPLICATION_CONFIGURATION_PATH . $configuration_name . \".cfg\";\n \n // The .cfg file doesn't exists\n if (!file_exists($this->config_file_path)) {\n \n Log::error(\"Not found .cfg file in path: $this->config_file_path\", \"Configuration\");\n }\n\n // Get hash of file\n $this->config_file_hash = md5_file($this->config_file_path);\n \n // Build path to .php configuration file\n $this->php_config_file_path = APPLICATION_CACHE_PATH . \"configuration\\\\\" . $this->config_file_hash . \".php\";\n \n // If file doesn't exists then create new \n if (!file_exists($this->php_config_file_path)) {\n \n Log::notice(\"Not found .php (compiled) configuration file in path: $this->php_config_file_path\", \"Configuration\");\n\n // Load data from .cfg file\n $file = file($this->config_file_path);\n \n if(count($file) == 0) {\n\n Log::notice(\"In configuration's file $this->config_file_path is not found keys\", \"Configuration\");\n\n return;\n }\n \n // Output string to .php configuration file\n $configuration_str = ''$value',\";\n }\n\n unset($connection_name);\n unset($file);\n \n // Delete last coma & space in array list\n $configuration_str = substr($configuration_str, 0, strlen($configuration_str) - 1);\n \n $configuration_str .= '); Configuration::instance()->loadFromArray($configuration_array);';\n \n \n // Put it into .php file\n file_put_contents($this->php_config_file_path, $configuration_str);\n \n Log::success(\"Created new configuration .php file: $this->php_config_file_path\", \"Configuration\");\n \n \n // Find and delete previous file of configuration from cache\n $files = scandir(APPLICATION_CACHE_PATH . \"configuration\");\n \n foreach ($files as $file) {\n \n if(!in_array($file, array(\".\", \"..\", \".svn\", $this->config_file_hash . \".php\"))) {\n\n unlink(APPLICATION_CACHE_PATH . \"configuration\\\\\" . $file);\n \n Log::success(\"Deleted cache configuration file: \" . APPLICATION_CACHE_PATH . \"configuration\\\\\" . $file, \"Configuration\");\n } \n }\n \n unset($files);\n }\n\n // Loading configuration\n require_once $this->php_config_file_path;\n }\n \n \n /**\n * @name instance\n * Singletone function.\n * \n * @return instance of itself \n */\n public static function instance() {\n \n if(!self::$p_instance) {\n \n self::$p_instance = new self();\n }\n \n return self::$p_instance;\n }\n \n \n /**\n * @name get\n * The function returns value of configuration parameter.\n * \n * @param string : name of configuration key\n * @return value of it.\n */ \n public function _get($_key) {\n\n if(!isset($this->parameters[$_key])) {\n \n Log::error(\"Unknow configuration key: $_key\", \"Configuration\");\n }\n \n // If parameter is boolean the return is as boolean type.\n switch($this->parameters[$_key]) {\n \n case \"true\": {\n \n return true;\n } break;\n \n case \"false\": {\n \n return false;\n } break;\n \n default: {\n \n return $this->parameters[$_key];\n } break;\n }\n }\n \n \n /**\n * @name loadFromArray\n * The function that takes parameters from array and puts it into private array.\n * \n * @param array : array of parameters\n */ \n public function loadFromArray($_arr) {\n\n $this->parameters = $_arr;\n\n Log::success(\"Configuration loaded from file: $this->php_config_file_path\", \"Configuration\");\n Log::success(\"Configuration keys count:\" . count($this->parameters), \"Configuration\"); \n }\n\n\n /**\n * @name get\n * The function return value of paramter\n * \n * @param string : name of parameter\n */\n public static function get($n) {\n\n return self::instance()->_get($n);\n }\n\t\n\t\n /**\n * @name clearCache\n * The function make clean up in cache directory\n */\n\tpublic static function clearCache() {\n\t\t\n \t$files = scandir(APPLICATION_CACHE_PATH . \"configuration\");\n \n\t\t// delete '.' & '..'\n\t\tunset($files[0]);\n\t\tunset($files[1]);\n\t\t\t \n foreach ($files as $file) {unlink(APPLICATION_CACHE_PATH . \"configuration\\\\\" . $file);\n \n Log::success(\"Deleted cache configuration file: \" . APPLICATION_CACHE_PATH . \"configuration\\\\\" . $file, \"Configuration\"); \n }\t\t\n\t}\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":52,"cells":{"blob_id":{"kind":"string","value":"cc2cb4e911a729be112a191245f99d677d7e1800"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"savalonso/SEVRI"},"path":{"kind":"string","value":"/controladora/ctrUsuarios.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3286,"string":"3,286"},"score":{"kind":"number","value":2.734375,"string":"2.734375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"setCedula($_POST['cedula']);\n\t\t$usuario->setNombre($_POST['nombre']);\n\t\t$usuario->setPrimerApellido($_POST['primerApellido']);\n\t\t$usuario->setSegundoApellido($_POST['segundoApellido']);\n\t\t$usuario->setTelefono($_POST['telefono']);\n\t\t$usuario->setCorreo($_POST['email']);\n\t\t$usuario->setClave($_POST['clave']);\n\t\t$usuario->setCargo($_POST['cargo']);\n\t\t$usuario->setTipo($_POST['tipo']);\n\t\t$dataUsuarios = new dtUsuario;\n\t\t\n\t\tif($dataUsuarios->insertarUsuario($usuario) == true){\n\t\t\techo 'Se ha insertado correctamente el usuario.';\n\t\t} else {\n\t\t\techo 'No se ha insertado el usuario.';\n\t\t}\n\t}\n\t\n\tfunction actualizarUsuarios(){\n\t\t\n\t\tinclude_once (\"../dominio/dUsuario.php\");\n\t\tinclude_once (\"../data/dtUsuario.php\");\n\t\t\n\t\t$usuario = new dUsuario();\n\t\t$usuario->setNombre($_POST['nombre']);\n\t\t$usuario->setPrimerApellido($_POST['primerApellido']);\n\t\t$usuario->setSegundoApellido($_POST['segundoApellido']);\n\t\t$usuario->setTelefono($_POST['telefono']);\n\t\t$usuario->setCorreo($_POST['email']);\n\t\t$usuario->setClave($_POST['clave']);\n\t\t$usuario->setCargo($_POST['cargo']);\n\t\t$usuario->setTipo($_POST['tipo']);\n\t\t$cedula = $_POST['cedula'];\n\t\t$dataUsuario = new dtUsuario();\n\t\t\n\t\tif($dataUsuario->actualizarUsuario($usuario,$cedula) == true){\n\t\t\techo 'Se ha modificado correctamente el usuario.';\n\t\t} else {\n\t\t\techo 'No se ha modificado el usuario.';\n\t\t}\n\t}\n\t\n\t\n\tfunction eliminarUsuarios(){\n\t\t\n\t\tinclude_once (\"../dominio/dUsuario.php\");\n\t\tinclude_once (\"../data/dtUsuario.php\");\n\t\t\n\t\t$cedula = $_POST['cedula'];\n\t\t$dataUsuarios = new dtUsuario;\n\t\t\n\t\tif($dataUsuarios->eliminarUsuarios($cedula) == true){\n\t\t\techo 'Se ha eliminado correctamente el usuario.';\n\t\t} else {\n\t\t\techo 'No se ha eliminado el usuario.';\n\t\t}\n\t}\n\t\n\tfunction marcarMensajeLeido(){\n\t\t\n\t\tinclude_once (\"../logica/logicaUsuario.php\");\n\t\t\n\t\t$idMensaje = $_POST['idMensaje'];\n\t\t$logica = new logicaUsuario;\n\t\t$logica->marcarMensajeLeido($idMensaje);\n\t\techo \"true\";\n\t}\n\t\n\t\n\tfunction contarMensajesNoLeidos(){\n\t\t\n\t\tinclude_once (\"../logica/logicaUsuario.php\");\n\t\t\n\t\t$idUsuario = $_POST['cedula'];\n\t\t$logica = new logicaUsuario;\n\t\t$cantidadMensajes = $logica->contarMensajesNuevos($idUsuario);\n\t\techo $cantidadMensajes;\n\t}\n\t\n\tfunction ExisteUsuario(){\n\t\t\n\t\tinclude_once (\"../logica/logicaUsuario.php\");\n\t\t\n\t\t$usuario = $_POST['usuario'];\n\t\t$clave = $_POST['clave'];\n\t\t$logica = new logicaUsuario;\n\t\t$datos = $logica->ObtenerDatosUsuario($usuario,$clave);\n\t\t$datos = ctrUsuarios::Convertir_UTF8($datos);\n\t\techo \"\".json_encode($datos).\"\";\n\t}\n\t\n\tfunction Convertir_UTF8($array){\n\t\tforeach ($array as $key => $value) {\n\t\t\t$array[$key] = utf8_encode($value);\n\t\t}\n\t\treturn $array;\n\t}\n}\n\n\n$op = $_POST['opcion'];\n$control = new ctrUsuarios;\n\nif($op == 1){\n\t$control->insertarUsuarios();\n}\nelse if($op == 2){\t\n\t$control->actualizarUsuarios();\n}\nelse if($op == 3){\t\n\t$control->eliminarUsuarios();\n}\nelse if($op == 4){\t\n\t$control->contarMensajesNoLeidos();\n}\nelse if($op == 5){\t\n\t$control->marcarMensajeLeido();\n}\nelse if($op == 6){\t\n\t$control->ExisteUsuario();\n}\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":53,"cells":{"blob_id":{"kind":"string","value":"970098632fbc6a98a0737868a77674a717fe5547"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"fdask/nottingham"},"path":{"kind":"string","value":"/src/Player.class.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4372,"string":"4,372"},"score":{"kind":"number","value":3.40625,"string":"3.40625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"cardHand = new Deck();\n\t\t$this->cardHand->setName(\"Hand\");\n\t\t$this->cardHand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardPublicStand = new Deck();\n\t\t$this->cardPublicStand->setName(\"Market stand\");\n\t\t$this->cardPublicStand->setState(Card::STATE_FACEUP);\n\n\t\t$this->cardHiddenStand = new Deck();\n\t\t$this->cardHiddenStand->setName(\"Contraband Stash\");\n\t\t$this->cardHiddenStand->setState(Card::STATE_FACEDOWN);\n\n\t\t$this->cardAux = new Deck();\n\t\t$this->cardAux->setName(\"Aux Deck\");\n\t\t$this->cardAux->setState(Card::STATE_FACEDOWN);\n\t}\n\n\t/**\n\t* returns a string representation of the player\n\t*\n\t* @return string\n\t**/\n\tpublic function __toString() {\n\t\t$ret = $this->getName() . \" [\" . $this->getGold() . \"]\";\n\n\t\tif ($this->getDoneTurn()) {\n\t\t\t$ret .= \" - DONE\";\n\t\t}\n\n\t\t$ret .= \"\\n\";\n\t\n\t\t$ret .= $this->getCardHand() . \"\\n\";\n\t\t$ret .= $this->getCardPublicStand() . \"\\n\";\n\t\t$ret .= $this->getCardHiddenStand() . \"\\n\";\n\n\t\tif (count($this->getCardAux()) > 0) {\n\t\t\t$ret .= $this->getCardAux() . \"\\n\";\n\t\t}\n\n\t\treturn $ret;\n\t}\n\n\t/**\n\t* sets the name property\n\t*\n\t* @param string $name\n\t**/\n\tpublic function setName($name) {\n\t\t$this->name = $name;\n\t}\n\n\t/**\n\t* returns the name property\n\t*\n\t* @return string\n\t**/\n\tpublic function getName() {\n\t\treturn $this->name;\n\t}\n\n\t/**\n\t* sets the gold property\n\t*\n\t* @param integer $gold\n\t**/\n\tpublic function setGold($gold) {\n\t\t$this->gold = $gold;\n\t}\n\n\t/**\n\t* adds an amount to the gold property\n\t*\n\t* @param integer $amount\n\t* @return integer the new gold count\n\t**/\n\tpublic function addGold($amount) {\n\t\t$this->gold += $amount;\n\n\t\treturn $this->gold;\n\t}\n\n\t/**\n\t* removes an amount from the gold property\n\t*\n\t* @param integer $amount\n\t* @return integer the new gold\n\t**/\n\tpublic function removeGold($amount) {\n\t\t// don't let the level fall below 1!\n\t\t$this->gold = (($this->gold - $amount) >= 0) ? ($this->gold - $amount) : 0;\n\n\t\treturn $this->gold;\n\t}\n\n\t/**\n\t* returns the gold property\n\t*\n\t* @return integer\n\t**/\n\tpublic function getGold() {\n\t\treturn $this->gold;\n\t}\n\n\t/**\n\t* sets the cardHand property\n\t*\n\t* @param Deck $deck\n\t**/\n\tpublic function setCardHand(Deck $deck) {\n\t\t$this->cardHand = $deck;\n\t}\n\n\t/**\n\t* gets the cardHand property\n\t*\n\t* @return Deck\n\t**/\n\tpublic function getCardHand() {\n\t\treturn $this->cardHand;\n\t}\n\n\t/**\n\t* sets the cardPublicStand property\n\t*\n\t* @param Deck $deck\n\t**/\n\tpublic function setCardPublicStand(Deck $deck) {\n\t\t$this->cardPublicStand = $deck;\n\t}\n\n\t/**\n\t* gets the cardPublicStand property\n\t*\n\t* @return Deck\n\t**/\n\tpublic function getCardPublicStand() {\n\t\treturn $this->cardPublicStand;\n\t}\n\n\t/**\n\t* sets the cardHiddenStand property\n\t*\n\t* @param Deck $deck\n\t**/\n\tpublic function setCardHiddenStand(Deck $deck) {\n\t\t$this->cardHiddenStand = $deck;\n\t}\n\n\t/**\n\t* gets the cardHiddenStand property\n\t*\n\t* @return Deck\n\t**/\n\tpublic function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}\n\n\t/**\n\t* sets the cardAux property\n\t*\n\t* @param Deck $deck\n\t**/\n\tpublic function setCardAux(Deck $deck) {\n\t\t$this->cardAux = $deck;\n\t}\n\n\t/**\n\t* gets the cardAux property\n\t*\n\t* @return Deck\n\t**/\n\tpublic function getCardAux() {\n\t\treturn $this->cardAux;\n\t}\n\n\t/**\n\t* sets the doneTurn property\n\t* \n\t* @param boolean $bool\n\t**/\n\tpublic function setDoneTurn($bool) {\n\t\t$this->doneTurn = $bool;\n\t}\n\n\t/**\n\t* gets the doneTurn property\n\t*\n\t* @return boolean\n\t**/\n\tpublic function getDoneTurn() {\n\t\treturn $this->doneTurn;\t\n\t}\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":54,"cells":{"blob_id":{"kind":"string","value":"adb07974c5d21f7d1be6e10590ed5981423fc8bb"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Noabs/PHPubuntu01"},"path":{"kind":"string","value":"/PhpToetsP7/index.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2010,"string":"2,010"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"query(\"SELECT * FROM land ORDER BY $get_land DESC\");\r\n\r\n?>\r\n\r\n

Welkom op de site van het Songfestival

\r\n\r\n
\r\n \r\n \r\n \r\n Land toevoegen\r\n ';\r\n echo '';\r\n echo '';\r\n echo '';\r\n echo '';\r\n echo '';\r\n }\r\n if (isset($_POST['vote'])) {\r\n $query = $pdo->prepare(\"UPDATE `land` SET\r\n `land` = :land,\r\n `zanger` = :zanger,\r\n `punten` = :punten\r\n WHERE `id` = :id\r\n \");\r\n $query->bindParam(':id', $_POST['id']);\r\n $query->bindParam(':land', $_POST['land']);\r\n $query->bindParam(':zanger', $_POST['zanger']);\r\n $query->bindParam(':punten', $_POST['punten']+1);\r\n $query->execute();\r\n header(\"Location: index.php\");\r\n }\r\n ?>\r\n
\r\n

Land

\r\n
\r\n

Zanger

\r\n
\r\n

Punten

\r\n
', $row['land'] . '', $row['zanger'] . '', $row['punten'] . '' ?> ';\r\n echo 'Wijzig pagina
\r\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":55,"cells":{"blob_id":{"kind":"string","value":"a4d5b6e12357c42a6300ec916103a6535a28b8ed"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"terion-name/PHPoAuthLib"},"path":{"kind":"string","value":"/src/OAuth/OAuth2/Service/Odnoklassniki.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":5251,"string":"5,251"},"score":{"kind":"number","value":2.875,"string":"2.875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"baseApiUri = new Uri('http://api.odnoklassniki.ru/api/');\n }\n }\n \n /**\n * @return \\OAuth\\Common\\Http\\Uri\\UriInterface\n */\n public function getAuthorizationEndpoint()\n {\n return new Uri('http://www.odnoklassniki.ru/oauth/authorize');\n }\n\n /**\n * @return \\OAuth\\Common\\Http\\Uri\\UriInterface\n */\n public function getAccessTokenEndpoint()\n {\n return new Uri('http://api.odnoklassniki.ru/oauth/token.do');\n }\n\n\t/**\n\t * @param string $appKey\n\t * @return $this\n\t */\n\tpublic function setApplicationKey($appKey)\n\t{\n\t\t$this->applicationKey = $appKey;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * @return string\n\t */\n\tpublic function getApplicationKey()\n\t{\n\t\treturn $this->applicationKey;\n\t}\n\n /**\n * @param string $responseBody\n * @return \\OAuth\\Common\\Token\\TokenInterface|\\OAuth\\OAuth2\\Token\\StdOAuth2Token\n * @throws \\OAuth\\Common\\Http\\Exception\\TokenResponseException\n */\n protected function parseAccessTokenResponse($responseBody)\n {\n\t$data = json_decode($responseBody, true); \n\n if( null === $data || !is_array($data) ) {\n throw new TokenResponseException('Unable to parse response.');\n } elseif( isset($data['error'] ) ) {\n throw new TokenResponseException('Error in retrieving token: \"' . $data['error'] . '\"');\n }\n\n $token = new StdOAuth2Token();\n\n $token->setAccessToken( $data['access_token'] );\n $token->setLifeTime(1800); // token has fixed expire and it's value is not returned by service\n\n if( isset($data['refresh_token'] ) ) {\n $token->setRefreshToken( $data['refresh_token'] );\n unset($data['refresh_token']);\n }\n\n unset( $data['access_token'] );\n\n\t if ( $this->applicationKey ) {\n\t\t $data['application_key'] = $this->applicationKey;\n\t }\n //unset( $data['expires_in'] );\n $token->setExtraParams( $data );\n\t\n return $token;\n }\n\n\t/**\n\t * This is a full override of parent::request because Odnoklassniki API requires different logic of api requests\n\t *\n\t * Sends an authenticated API request to the path provided.\n\t * If the path provided is not an absolute URI, the base API Uri (must be passed into constructor) will be used.\n\t *\n\t * @param $path string|UriInterface\n\t * @param string $method HTTP method\n\t * @param array $body Request body if applicable (key/value pairs)\n\t * @param array $extraHeaders Extra headers if applicable. These will override service-specific any defaults.\n\t * @return string\n\t * @throws ExpiredTokenException\n\t * @throws MissingApplicationKeyException\n\t * @throws Exception\n\t */\n\tpublic function request($path, $method = 'GET', array $body = array(), array $extraHeaders = array())\n\t{\n\t\t$uri = $this->determineRequestUriFromPath($path, $this->baseApiUri);\n\t\t$token = $this->storage->retrieveAccessToken($this->service());\n\t\t$extraParams = $token->getExtraParams();\n\t\t$storedAppKey = isset($extraParams['application_key']) ? $extraParams['application_key'] : null;\n\n\t\tif ( empty($body['application_key']) ) {\n\t\t\tif ( $this->applicationKey ) {\n\t\t\t\t$body['application_key'] = $this->applicationKey;\n\t\t\t}\n\t\t\telseif ( $storedAppKey ) {\n\t\t\t\t$body['application_key'] = $storedAppKey;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new MissingApplicationKeyException('Application key not found');\n\t\t\t}\n\t\t}\n\n\t\tif ( strpos($path, '?') ) {\n\t\t\t$query = explode('?', $path);\n\t\t\t$query = end($query);\n\t\t\tparse_str($query, $queryParams);\n\t\t\t$body += $queryParams;\n\t\t}\n\n\t\tif( ( $token->getEndOfLife() !== TokenInterface::EOL_NEVER_EXPIRES ) &&\n\t\t\t( $token->getEndOfLife() !== TokenInterface::EOL_UNKNOWN ) &&\n\t\t\t( time() > $token->getEndOfLife() ) ) {\n\n\t\t\tthrow new ExpiredTokenException('Token expired on ' . date('m/d/Y', $token->getEndOfLife()) . ' at ' . date('h:i:s A', $token->getEndOfLife()) );\n\t\t}\n\n\t\tksort($body);\n\n\t\t$sig = '';\n\t\tforeach ($body as $k=>$v) {\n\t\t\t$sig .= $k . '=' . $v;\n\t\t}\n\t\t$sig = md5($sig . md5( $token->getAccessToken() . $this->credentials->getConsumerSecret() ) );\n\t\t$body['sig'] = $sig;\n\n\t\t$uri->addToQuery( 'access_token', $token->getAccessToken() );\n\t\tforeach ($body as $qK => $qV) {\n\t\t\t$uri->addToQuery( $qK, $qV );\n\t\t}\n\n\t\t$body = array();\n\n\t\t$extraHeaders = array_merge( $this->getExtraApiHeaders(), $extraHeaders );\n\n\t\treturn $this->httpClient->retrieveResponse($uri, $body, $extraHeaders, $method);\n\t}\n\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":56,"cells":{"blob_id":{"kind":"string","value":"1e6e97afa960bf779dbd3f783aece3be065fdbcb"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"lapaygroup/RussianPost"},"path":{"kind":"string","value":"/src/Entity/AddressReturn.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8967,"string":"8,967"},"score":{"kind":"number","value":2.71875,"string":"2.71875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"index))\n throw new \\InvalidArgumentException('Не передан почтовый индекс!');\n\n if (empty($this->place))\n throw new \\InvalidArgumentException('Не передан населенный пункт!');\n\n if (empty($this->region))\n throw new \\InvalidArgumentException('Не передан регион (область)!');\n\n $params = [];\n $params['address-type'] = $this->getAddressType();\n if (!is_null($this->area))\n $params['area'] = $this->area;\n\n if (!is_null($this->building))\n $params['building'] = $this->building;\n\n if (!is_null($this->corpus))\n $params['corpus'] = $this->corpus;\n\n if (!is_null($this->hotel))\n $params['hotel'] = $this->hotel;\n\n if (!is_null($this->house))\n $params['house'] = $this->house;\n\n $params['index'] = $this->index;\n\n if (!is_null($this->house))\n $params['house'] = $this->house;\n\n if (!is_null($this->letter))\n $params['letter'] = $this->letter;\n\n if (!is_null($this->location))\n $params['location'] = $this->location;\n\n if (!is_null($this->manual_address_input))\n $params['manual-address-input'] = $this->manual_address_input;\n\n if (!is_null($this->num_address_type))\n $params['num-address-type'] = $this->num_address_type;\n\n if (!is_null($this->office))\n $params['office'] = $this->office;\n\n $params['place'] = $this->place;\n $params['region'] = $this->region;\n\n if (!is_null($this->room))\n $params['room'] = $this->room;\n\n if (!is_null($this->slash))\n $params['slash'] = $this->slash;\n\n if (!is_null($this->street))\n $params['street'] = $this->street;\n\n if (!is_null($this->vladenie))\n $params['vladenie'] = $this->vladenie;\n\n return $params;\n }\n\n /**\n * @return string\n */\n public function getAddressType()\n {\n return $this->address_type;\n }\n\n /**\n * @param string $address_type\n */\n public function setAddressType($address_type)\n {\n $this->address_type = $address_type;\n }\n\n /**\n * @return string|null\n */\n public function getArea()\n {\n return $this->area;\n }\n\n /**\n * @param string|null $area\n */\n public function setArea($area)\n {\n $this->area = $area;\n }\n\n /**\n * @return string|null\n */\n public function getBuilding()\n {\n return $this->building;\n }\n\n /**\n * @param string|null $building\n */\n public function setBuilding($building)\n {\n $this->building = $building;\n }\n\n /**\n * @return string|null\n */\n public function getCorpus()\n {\n return $this->corpus;\n }\n\n /**\n * @param string|null $corpus\n */\n public function setCorpus($corpus)\n {\n $this->corpus = $corpus;\n }\n\n /**\n * @return string|null\n */\n public function getHotel()\n {\n return $this->hotel;\n }\n\n /**\n * @param string|null $hotel\n */\n public function setHotel($hotel)\n {\n $this->hotel = $hotel;\n }\n\n /**\n * @return string|null\n */\n public function getHouse()\n {\n return $this->house;\n }\n\n /**\n * @param string|null $house\n */\n public function setHouse($house)\n {\n $this->house = $house;\n }\n\n /**\n * @return string\n */\n public function getIndex()\n {\n return $this->index;\n }\n\n /**\n * @param string $index\n */\n public function setIndex($index)\n {\n $this->index = $index;\n }\n\n /**\n * @return string|null\n */\n public function getLetter()\n {\n return $this->letter;\n }\n\n /**\n * @param string|null $letter\n */\n public function setLetter($letter)\n {\n $this->letter = $letter;\n }\n\n /**\n * @return string|null\n */\n public function getLocation()\n {\n return $this->location;\n }\n\n /**\n * @param string|null $location\n */\n public function setLocation($location)\n {\n $this->location = $location;\n }\n\n /**\n * @return bool|null\n */\n public function getManualAddressInput()\n {\n return $this->manual_address_input;\n }\n\n /**\n * @param bool|null $manual_address_input\n */\n public function setManualAddressInput($manual_address_input)\n {\n $this->manual_address_input = $manual_address_input;\n }\n\n /**\n * @return string|null\n */\n public function getNumAddressType()\n {\n return $this->num_address_type;\n }\n\n /**\n * @param string|null $num_address_type\n */\n public function setNumAddressType($num_address_type)\n {\n $this->num_address_type = $num_address_type;\n }\n\n /**\n * @return string|null\n */\n public function getOffice()\n {\n return $this->office;\n }\n\n /**\n * @param string|null $office\n */\n public function setOffice($office)\n {\n $this->office = $office;\n }\n\n /**\n * @return string\n */\n public function getPlace()\n {\n return $this->place;\n }\n\n /**\n * @param string $place\n */\n public function setPlace($place)\n {\n $this->place = $place;\n }\n\n /**\n * @return string\n */\n public function getRegion()\n {\n return $this->region;\n }\n\n /**\n * @param string $region\n */\n public function setRegion($region)\n {\n $this->region = $region;\n }\n\n /**\n * @return string|null\n */\n public function getRoom()\n {\n return $this->room;\n }\n\n /**\n * @param string|null $room\n */\n public function setRoom($room)\n {\n $this->room = $room;\n }\n\n /**\n * @return string|null\n */\n public function getSlash()\n {\n return $this->slash;\n }\n\n /**\n * @param string|null $slash\n */\n public function setSlash($slash)\n {\n $this->slash = $slash;\n }\n\n /**\n * @return string|null\n */\n public function getStreet()\n {\n return $this->street;\n }\n\n /**\n * @param string|null $street\n */\n public function setStreet($street)\n {\n $this->street = $street;\n }\n\n /**\n * @return string|null\n */\n public function getVladenie()\n {\n return $this->vladenie;\n }\n\n /**\n * @param string|null $vladenie\n */\n public function setVladenie($vladenie)\n {\n $this->vladenie = $vladenie;\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":57,"cells":{"blob_id":{"kind":"string","value":"b9ccf5e59a493afcf4d657eb451ffafc1c173edb"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"FnMartha/cs_project"},"path":{"kind":"string","value":"/src/App/Controllers/Mpesa.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1497,"string":"1,497"},"score":{"kind":"number","value":2.625,"string":"2.625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"_apiKey = \"some api prod\";\n $this->_apiUsername = \"username prod\";\n $this->_productName = 'Product';\n $this->_mode = $mode;\n } else {\n $this->_apiKey = \"Some sandbox api key\";\n $this->_apiUsername = \"sandbox username\";\n $this->_productName = 'Product';\n $this->_mode = $mode;\n }\n\n }\n\n public function checkout(array $postData)\n {\n $metadata = array(\n \"house_id\" => $postData['houseId'],\n \"action_type\"=>\"booking\"\n );\n $gateway = new AfricasTalkingGateway($this->_apiUsername, $this->_apiKey, $this->_mode);\n try {\n\n $transactionId = $gateway->initiateMobilePaymentCheckout(\n $this->_productName,\n $postData['phone_number'],\n $this->_currencyCode,\n $postData['amount'],\n $metadata\n );\n\n return $transactionId;\n\n } catch (AfricasTalkingGatewayException $e) {\n return [\n \"error\" => $e->getMessage()\n ];\n }\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":58,"cells":{"blob_id":{"kind":"string","value":"426a694f40fe6a4153758443e9443b6ee289aa0a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"markthelaw/bullshit_messenger_phalcon"},"path":{"kind":"string","value":"/index.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":8463,"string":"8,463"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"registerDirs(array(\n __DIR__ . '/models/'\n))->register();\n\n\n//Read the configuration\n$di = new \\Phalcon\\DI\\FactoryDefault();\n$di->set('db',function(){\nreturn new MysqlAdapter(array(\n\"host\" => \"localhost\",\n\"username\" => \"root\",\n\"password\" => \"1234567890\",\n\"dbname\" => \"test_db\"\n));\n});\n $di->set('modelsManager', function() {\n return new Phalcon\\Mvc\\Model\\Manager();\n });\n\n\n$app = new Phalcon\\Mvc\\Micro($di);\n//$logger = new FileAdapter(\"app/logs/test.log\");\n//$logger->close();\n//$logger->error(\"This is another error\");\n\n$app->get('/loop', function () use ($app){\n$a = array(1,2,3,17);\nforeach($a as $v){\necho $v; \n}\n\n});\n//login as user using id\n$app->get('/get/{id}', function ($id) use ($app) {\n/* $phql = \"Select * from users\";\n$users = $app->modelsManager->executeQuery($phql);\n//echo json_encode($data); \n // try{\n*/\n$query = \"select id from users where id=\".$id;\n $users = $app['db']->query($query);\n$data = array();\n$user = $users-> fetch();\nif(empty($user[\"id\"])){\n//echo \"it is not found\";\n$data[]=array('id'=> \"null\");\necho json_encode($data);\n}\n\nelse{\n$data[]=array('id' => $user[\"id\"]);\necho json_encode($data); \n}\n});\n//return the hashed password if user is found\n//else return empty, so we can use 1 function and determine if user exists, every user must have a password\n$app->get('/get/hashedPasswordAndRegID/{username}', function ($username) use ($app) {\n$query = \"select hashedPassword from users where name=\".\"$username\";\n$phql = \"Select * from Users where name = :username:\";\n$returnHashedPassword = $app->modelsManager->executeQuery($phql,array('username'=>$username))->getFirst();\n$data = array();\n//if password not found, just return a empty\nif(empty($returnHashedPassword->hashedPassword)){\n//echo \"it is not found\";, we will just return an empty string, i hate dealing with NULL in java\n$data=array('hashedPassword' => \"\",'regid'=>\"\");\necho json_encode($data);\n//echo \"username is: \".$username; \n}\n\nelse{\n$data=array('hashedPassword' => $returnHashedPassword->hashedPassword,'regid'=>$returnHashedPassword->gcm_regid);\necho json_encode($data); \n//echo \"username is \".$username; \n//echo $returnHashedPassword;\n}\n});\n\n//get User and return json with username and gcm_id\n//purpose: for user to manually add user to their user list.\n$app->get('/get/usernameAndRegid/{username}', function ($username) use ($app) {\n$phql = \"Select * from Users where name = :username:\";\n$returnHashedPassword = $app->modelsManager->executeQuery($phql,array('username'=>$username))->getFirst();\n$data = array();\n//if password not found, just return a empty\nif(empty($returnHashedPassword->name)){\n//echo \"it is not found\";, we will just return an empty string, i hate dealing with NULL in java\n$data=array('username' => \"\",'regid'=>\"\");\necho json_encode($data);\n//echo \"username is: \".$username; \n}\n\nelse{\n$data=array('username' => $returnHashedPassword->name,'regid'=>$returnHashedPassword->gcm_regid);\necho json_encode($data); \n//echo \"username is \".$username; \n//echo $returnHashedPassword;\n}\n});\n$app->get('/test',function(){echo\"you are in test\";});\n\n//send a bullshit message\n\n//this function is for client to send a request to local, and local can store the message, then local will submit a message to GCM \n$app->post('/post/message', function () use ($app){\n// echo json_encode(array(\"some\", \"important\", \"data\"));\n$message = $app->request->getJsonRawBody();\n$logger = Logger::getLogger(\"main\");\n\n$phql=\"INSERT INTO Messages (send, receiver, message)\".\"VALUES(:send:,:receiver:,:message:)\";\n$status=$app->modelsManager->executeQuery($phql, array(\n'send'=>$message->send,\n'receiver'=>$message->receiver,\n'message'=>'bullshit'\n));\n\n#here we try to post to GCM as well\n$gcm = new GCM();\n$gcm_regid = [$message->receiver];\n$logger->info(\"gcm_regid is: \". $gcm_regid[0]); \n\n$gcm_message = array(\"message\"=> \"bullshit\",\"sender\"=>$message->send);\n$result = $gcm->send_notification($gcm_regid, $gcm_message);\n#end of GCM Post Code\n\n\n\n\n$response= new Phalcon\\Http\\Response();\nif($status->success()==true)\n{\n//Change the HTTP status\n $response->setStatusCode(201, \"Created\");\n\n $message->id = $status->getModel()->id;\n\n $response->setJsonContent(array('status' => 'OK', 'data' => $message));\n}\nelse{\n//Change the HTTP status\n $response->setStatusCode(409, \"Conflict\");\n\n //Send errors to the client\n $errors = array();\n foreach ($status->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n\n $response->setJsonContent(array('status' => 'ERROR', 'messages' => $errors));\n}\n#temporary replace response with result\n\n#return $response;\nreturn $result;\n});\n\n\n#register to the local server with the GCM ID, this should be call by the device\n$app->post('/post/registerid',function() use ($app){\n\n$registerUser = $app->request->getJsonRawBody();\n$logger = Logger::getLogger(\"main\");\n$checkIfUserExistPHQL =\"Select name from Users where \";#does not work for now, needs to learn more about PHQL\n$createUserPHQL=\"INSERT INTO Users (gcm_regid, name, email,hashedPassword)\".\"VALUES(:gcm_regid:,:name:,:email:,:hashedPassword:)\";\n$status=$app->modelsManager->executeQuery($createUserPHQL, array(\n'gcm_regid'=>$registerUser->gcm_regid,\n'name'=>$registerUser->name,\n'email'=>$registerUser->email,\n'hashedPassword'=>$registerUser->hashedPassword));\n\n$logger->info(\"gcm_regid\". $registerUser->name); \n\n$response= new Phalcon\\Http\\Response();\nif($status->success()==true)\n{\n//Change the HTTP status\n $response->setStatusCode(201, \"Created\");\n\n $message= $status->getModel()->gcm_regid;\n\n $response->setJsonContent(array('status' => 'OK', 'data' => $registerUser));\n}\nelse{\n//Change the HTTP status\n $response->setStatusCode(409, \"Conflict\");\n\n //Send errors to the client\n $errors = array();\n foreach ($status->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n\n $response->setJsonContent(array('status' => 'ERROR', 'messages' => $errors));\n}\nreturn $response;\n});\n\n\n\n$app->post('/post/updateid',function() use ($app){\n\n$updateUser = $app->request->getJsonRawBody();\n$logger = Logger::getLogger(\"main\");\n$updateUserPHQL=\"UPDATE Users SET gcm_regid = :gcm_regid: WHERE name = :name:\";\n$status=$app->modelsManager->executeQuery($updateUserPHQL, array(\n'gcm_regid' => $updateUser->gcm_regid,\n'name' => $updateUser->name\n));\n\n$logger->info(\"gcm_regid: \". $updateUser->gcm_regid); \n\n$response= new Phalcon\\Http\\Response();\nif($status->success()==true)\n{\n//Change the HTTP status\n $response->setStatusCode(201, \"Created\");\n\n $message= $status->getModel()->gcm_regid;\n\n $response->setJsonContent(array('status' => 'OK', 'data' => $updateUser->gcm_regid));\n}\nelse{\n//Change the HTTP status\n $response->setStatusCode(409, \"Conflict\");\n\n //Send errors to the client\n $errors = array();\n foreach ($status->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n\n $response->setJsonContent(array('status' => 'ERROR', 'messages' => $errors));\n}\nreturn $response;\n});\n\n\n\n\n\n$app->get('/get/messages/test',function() use ($app){\n$phql=\"select * from Messages\";\n$messages =$app->modelsManager->executeQuery($phql);\nforeach($messages as $message){\necho $message->message;\n}\n\n});\n\n\n$app->get('/get/messages', function () use ($app) {\n // echo json_encode(array(\"some\", \"important\", \"data\"));\n/*$phql = \"Select * from messages\";\n//$messages = $app->modelsManager->executeQuery($phql);\n$data = array();\n foreach ($messages as $message) {\n $data[] = array(\n 'send' => $message->send,\n 'receiver' => $mesage->receiver,\n );\n }\n\n echo json_encode($data);\n*/\n$message = Messages::findFirst(1);\necho $message->receiver;\n});\n\n\n$app->get('/say/welcome/{name}', function ($name) {\n echo \"

Welcome $name!

\";\n});\n\n$app->notFound(function () use ($app) {\n $app->response->setStatusCode(404, \"Not Found\")->sendHeaders();\n echo 'This is crazy, but this page was not found!';\n});\n\n\n$app->handle();\n\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":59,"cells":{"blob_id":{"kind":"string","value":"4aa13d8864919ed506c0b64c191ea7ed8f1a58be"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"webbinders/eng"},"path":{"kind":"string","value":"/newEmptyPHP.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":836,"string":"836"},"score":{"kind":"number","value":3.109375,"string":"3.109375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"';\r\necho getTimestamp($d2);\r\necho '
';\r\necho getTimestamp($d2)-getTimestamp($d1);\r\necho '
';\r\necho date('Y-m-d',getTimestamp($d2)-getTimestamp($d1));\r\nfunction getTimestamp($strDate) {\r\n $dateAndTime = explode(' ', $strDate);\r\n $dateArr = explode('-', $dateAndTime[0]);\r\n $timeArr = explode(':', $dateAndTime[1]);\r\n return mktime($timeArr[0], $timeArr[1], $timeArr[2], $dateArr[1], $dateArr[2], $dateArr[0]);\r\n}\r\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":60,"cells":{"blob_id":{"kind":"string","value":"e3b16eb8589b1549761e097aae159ba52b910197"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"NHZEX/nxAdmin-6x"},"path":{"kind":"string","value":"/app/Service/DeployTool/EnvFormat.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1643,"string":"1,643"},"score":{"kind":"number","value":2.890625,"string":"2.890625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["Apache-2.0"],"string":"[\n \"Apache-2.0\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" $value) {\n if (is_bool($value)) {\n $value = var_export($value, true);\n } elseif (is_numeric($value)) {\n } elseif (is_string($value)) {\n $value = \"\\\"{$value}\\\"\";\n }\n\n if (!empty($ts) && $ts !== substr($key, 0, 3)) {\n $text .= PHP_EOL;\n }\n $text .= \"{$key}={$value}\\n\";\n $ts = substr($key, 0, 3);\n }\n return $text;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":61,"cells":{"blob_id":{"kind":"string","value":"7f3f0883135a39702d26610cdbfa1710646055c0"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"MistaZidane/pay"},"path":{"kind":"string","value":"/src/index.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2638,"string":"2,638"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"apiKey = $apiKey;\n $this->apiPassword = $apiPassword;\n $this->apiUser = $apiUser;\n $this->returnUrl = $returnUrl;\n $this->notifyUrl = $notifyUrl;\n $this->mode = $mode;\n }\n /**\n * Used to perform the Transaction\n */\n public function makePayment($amountTobePaid)\n {\n\n $this->transactionId = uniqid();\n $encodedAuth = base64_encode($this->apiUser . \":\" . $this->apiPassword);\n $postRequest = array(\n \"total_amount\" => $amountTobePaid,\n \"return_url\" => $this->returnUrl,\n \"notify_url\" => $this->notifyUrl,\n \"transaction_id\" => $this->transactionId,\n \"description\"=> \"PayUnit web payments\"\n );\n $cURLConnection = curl_init();\n if($this->mode === \"test\"){\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/sandbox/gateway/initialize\");\n }else{\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/api/gateway/initialize\");\n }\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postRequest)); \n $secArr = array(\n \"x-api-key: {$this->apiKey}\",\n \"authorization: Basic: {$encodedAuth}\",\n 'Accept: application/json',\n 'Content-Type: application/json',\n \"mode: {$this->mode}\"\n );\n $all = array_merge($postRequest,$secArr);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER,$all);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n $jsonArrayResponse = json_decode($apiResponse);\n echo(isset($jsonArrayResponse));\n if(isset($jsonArrayResponse->body->transaction_url)){\n echo(\"dfdgdg\");\n //die();\n header(\"Location: {$jsonArrayResponse->body->transaction_url}\");\n exit(); \n }\n else{\n echo($apiResponse);\n }\n }\n}\n?>\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":62,"cells":{"blob_id":{"kind":"string","value":"4a5ab863710b4ae9c3d6dd07d041cf989038212c"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Sywooch/ams"},"path":{"kind":"string","value":"/models/ModelsPicture.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":887,"string":"887"},"score":{"kind":"number","value":2.625,"string":"2.625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["BSD-3-Clause"],"string":"[\n \"BSD-3-Clause\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" 'ID',\n '_key' => 'Key',\n 'modelid' => 'Modelid',\n 'mediaid' => 'Mediaid',\n 'date_added' => 'Date Added',\n ];\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":63,"cells":{"blob_id":{"kind":"string","value":"458e168a2225eb9d5a0c6e12b1ac6e8ed36b1fe5"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"tux12042/Ptut"},"path":{"kind":"string","value":"/html/traitement/creationCompte.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3201,"string":"3,201"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\r\nsuccess){\r\n // Google a répondu avec un succès\r\n // On traite le formulaire\r\n }else{\r\n echo'google n a pas reçus 2';\r\n }\r\n}\r\n\r\n\r\n\r\necho'google est passé';\r\n//-STOP GOOGLE\r\n$identifiant = htmlspecialchars($_POST['nom']) . ' ' . htmlspecialchars($_POST['prenom']);\r\n$mail = htmlspecialchars($_POST['mail']);\r\necho $identifiant;\r\n $verifMail = $bdd->query('SELECT `nom` FROM utilisateur WHERE nom LIKE \"'. $mail .'\"');\r\n \r\n $dejaMail = $verifMail->rowCount();\r\n $verifMail->CloseCursor();\r\n\r\n \r\n if ($_POST['mdp_verif'] == $_POST['mdp']) {\r\n\r\n \r\n\r\n\r\n if($dejaMail == 0){\r\n echo' mail inexistant ont peu créer compte ';\r\n \r\n // modification mdp\r\n $mdp = password_hash($_POST['mdp'], PASSWORD_DEFAULT);\r\n $num = htmlspecialchars($_POST['num']);\r\n \r\n $req = $bdd->prepare('INSERT INTO utilisateur VALUES (NULL, :nom, :mail, :mdp, :tel)');\r\n // INSERT INTO utilisateur VALUES (NULL, :nom, :mail, :mdp,current_timestamp(), \"\") \r\n \r\n $req->execute(array(\r\n 'nom' => $identifiant,\r\n 'mail' => $mail,\r\n 'mdp' => $mdp,\r\n 'tel' => $num\r\n ));\r\n\r\n $idrecup = $bdd->prepare('SELECT id FROM utilisateur WHERE nom = :nom');\r\n$idrecup ->execute(array('nom' => $identifiant));\r\n$idutilisateur = $idrecup ->fetch();\r\n echo \"Votre compte à été créer avec succès \";\r\n $_SESSION['id'] = $idutilisateur['id'];\r\n $_SESSION['nom'] = $identifiant;\r\n echo $_SESSION['nom'];\r\n // header('location: ../pages/principale.php');\r\n }\r\n else{\r\n echo \"Erreur le compte existe déjà\";\r\n \r\n \r\n }\r\n\r\n} else {\r\n\r\n\r\n echo 'Problème vos mots de passe ne correspondent pas, recommencez';\r\n}\r\n\r\n\r\n\r\n }\r\n }\r\n else\r\n {\r\n echo \"Erreur Aucunes données envoyé\";\r\n };\r\n \r\n \r\n\r\n\r\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":64,"cells":{"blob_id":{"kind":"string","value":"b6a8704ca088105467a5c207189d48cc8e80455f"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"ritenn/laravel-rplidar-a1"},"path":{"kind":"string","value":"/src/Main/Process.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4049,"string":"4,049"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"isActive = true;\n $this->lidarCommunication = $lidarCommunication;\n $this->port = $port;\n\n $this->main();\n }\n\n /**\n * Main program loop.\n */\n public function main() : void\n {\n while ( $this->isActive ) {\n\n if ( config('rplidar.debug')['enable'] )\n {\n Memory::remember('time', time());\n }\n\n if ($this->shouldOpenPort()) {\n\n $resource = $this->port->open();\n\n if ( $resource && is_resource($resource) )\n {\n $this->portResource = $resource;\n Memory::remember('port', 'opened');\n }\n }\n\n if ($this->shouldClosePort()) {\n $this->port->close($this->portResource);\n Memory::remember('port', 'closed');\n }\n\n if ($this->shouldRunMotor()) {\n $this->lidarCommunication->runMotor(true);\n Memory::remember('motor', 'running');\n }\n\n if ($this->shouldStopMotor()) {\n $this->lidarCommunication->runMotor(false);\n Memory::remember('motor', 'holding');\n }\n\n if ( $this->shouldSendCommand() ) {\n\n if ($this->lidarCommunication->sendCommand($this->portResource, Memory::getByKey('command'))) {\n Memory::remember('command', null);\n }\n }\n\n if ( isset($this->portResource) && is_resource($this->portResource) ) {\n $this->lidarCommunication->parseData($this->portResource);\n }\n\n /**\n * Sometimes there are problems with semaphore and unserialize if it's reading too quickly.\n */\n $isStillActive = Memory::getByKey('process_active');\n $this->isActive = is_null( $isStillActive ) ? true : $isStillActive;\n }\n\n Memory::forget();\n }\n\n /**\n * @param string $key\n * @return bool\n */\n public function readAndToggle(string $key) : bool\n {\n $state = Memory::getByKey($key);\n\n if (!is_null($state) && filter_var($state, FILTER_VALIDATE_BOOLEAN))\n {\n Memory::remember($key, false);\n }\n\n return is_null($state) ? false : $state;\n }\n\n /**\n * @return bool|null\n */\n public function shouldOpenPort() : ?bool\n {\n return $this->readAndToggle('open_port');\n }\n\n /**\n * @return bool|null\n */\n public function shouldClosePort() : ?bool\n {\n return $this->readAndToggle('close_port');\n }\n\n /**\n * @return bool|null\n */\n public function shouldRunMotor() : ?bool\n {\n return $this->readAndToggle('run_motor');\n }\n\n /**\n * @return bool|null\n */\n public function shouldStopMotor() : ?bool\n {\n return $this->readAndToggle('stop_motor');\n }\n\n /**\n * @return bool|null\n */\n public function shouldSendCommand() : ?bool\n {\n return $this->readAndToggle('command');\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":65,"cells":{"blob_id":{"kind":"string","value":"694d04d8c6bd56999d71799ea6c3c440e5f6bdf3"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Kennon1st/arokdb"},"path":{"kind":"string","value":"/src/Entity/Faction.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3543,"string":"3,543"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"cards = new ArrayCollection();\n }\n\n /**\n * @inheritdoc\n */\n public function setId($id)\n {\n $this->id = $id;\n }\n\n /**\n * @inheritdoc\n */\n public function getId()\n {\n return $this->id;\n }\n\n /**\n * @inheritdoc\n */\n public function setCode($code)\n {\n $this->code = $code;\n }\n\n /**\n * @inheritdoc\n */\n public function getCode()\n {\n return $this->code;\n }\n\n /**\n * @inheritdoc\n */\n public function setName($name)\n {\n $this->name = $name;\n }\n\n /**\n * @inheritdoc\n */\n public function getName()\n {\n return $this->name;\n }\n\n /**\n * @inheritdoc\n */\n public function setIsPrimary($isPrimary)\n {\n $this->isPrimary = $isPrimary;\n }\n\n /**\n * @inheritdoc\n */\n public function getIsPrimary()\n {\n return $this->isPrimary;\n }\n\n /**\n * @inheritdoc\n */\n public function setOctgnId($octgnId)\n {\n $this->octgnId = $octgnId;\n }\n\n /**\n * @inheritdoc\n */\n public function getOctgnId()\n {\n return $this->octgnId;\n }\n\n /**\n * @inheritdoc\n */\n public function addCard(CardInterface $card)\n {\n $this->cards->add($card);\n }\n\n /**\n * @inheritdoc\n */\n public function removeCard(CardInterface $card)\n {\n $this->cards->removeElement($card);\n }\n\n /**\n * @inheritdoc\n */\n public function getCards()\n {\n return $this->cards;\n }\n\n /**\n * @inheritdoc\n */\n public function serialize()\n {\n return [\n 'code' => $this->code,\n 'name' => $this->name,\n 'is_primary' => $this->isPrimary,\n 'octgn_id' => $this->octgnId\n ];\n }\n\n /**\n * @inheritdoc\n * @throws Exception\n */\n public function unserialize($serialized)\n {\n throw new Exception(\"unserialize() method unsupported\");\n }\n\n /**\n * @return string\n */\n public function __toString()\n {\n return $this->name ?: '';\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":66,"cells":{"blob_id":{"kind":"string","value":"bc7cb66c3eeb13f1112ceb40035cb8538db2f5c4"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"YuloVS/SorteoMujer"},"path":{"kind":"string","value":"/app/Http/Requests/StoreInscripcionRequest.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2036,"string":"2,036"},"score":{"kind":"number","value":2.71875,"string":"2.71875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" 'digits_between:7,8|required|integer|unique:App\\Models\\Inscripcion,dni',\n 'nombre' => 'required|regex:/[a-zA-ZÁáÉéÍíÓóÚúÑ ñ]+/|max:255',\n 'apellido' => 'required|regex:/[a-zA-ZÁáÉéÍíÓóÚúÑ ñ]+/|max:255',\n 'telefono' => 'required|integer|digits_between:9,10',\n 'email' => 'required|email',\n 'direccion' => 'required|regex:/[a-zA-Z0-9ÁáÉéÍíÓóÚúÑñ ]+/|max:255'\n ];\n }\n\n public function messages()\n : array\n {\n return [\n 'dni.digits_between' => 'Ingrese un DNI válido.',\n 'dni.required' => 'Debe ingresar su DNI',\n 'dni.integer' => 'Ingrese un DNI válido.',\n 'dni.unique' => 'Esta persona ya está participando.',\n\n 'nombre.required' => 'Debe ingresar su nombre.',\n 'nombre.regex' => 'Ingrese un nombre válido.',\n 'nombre.max' => 'Ingrese un nombre válido.',\n\n 'apellido.required' => 'Debe ingresar su apellido.',\n 'apellido.regex' => 'Ingrese un apellido válido.',\n 'apellido.max' => 'Ingrese un apellido válido.',\n\n 'telefono.required' => 'Debe ingresar un número de contacto.',\n 'telefono.integer' => 'Debe ingresar un número válido.',\n 'telefono.digits_between' => 'Debe ingresar un número válido.',\n\n 'email.required' => 'Debe ingresar un email de contacto.',\n 'email.email' => 'Debe ingresar un email válido.',\n\n 'direccion.required' => 'Debe ingresar una dirección.',\n 'direccion.regex' => 'Ingrese una dirección válida.',\n 'direccion.max' => 'Ingrese solamente calle, número y barrio.',\n\n ];\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":67,"cells":{"blob_id":{"kind":"string","value":"7d1214293ed681288823de4d65dc0de0a96a3c5a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"CIFP-Virgen-de-Gracia/dwec2021_ejemplos"},"path":{"kind":"string","value":"/ejemplosUD7/EjemploAjaxJSON/personas.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1054,"string":"1,054"},"score":{"kind":"number","value":2.59375,"string":"2.59375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"query($consulta)) {\n if ($result->num_rows > 0) {\n $jsondata[\"success\"] = true;\n $jsondata[\"data\"][\"message\"] = sprintf(\"Se han encontrado %d usuarios\", $result->num_rows);\n $jsondata[\"data\"][\"users\"] = array();\n while ($row = $result->fetch_object()) {\n $jsondata[\"data\"][\"users\"][] = $row;\n }\n } else {\n $jsondata[\"success\"] = false;\n $jsondata[\"data\"] = array(\n 'message' => 'No se encontró ningún resultado.'\n );\n }\n} else {\n\n $jsondata[\"success\"] = false;\n $jsondata[\"data\"] = array(\n 'message' => $database->error\n );\n}\n\n$database->close();\n\nheader(\"Content-Type: application/json\", true);\necho json_encode($jsondata, JSON_FORCE_OBJECT);\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":68,"cells":{"blob_id":{"kind":"string","value":"a2a89587ed9f8e128749511d5f1d01ed203bb574"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"marciomrs4/sgv"},"path":{"kind":"string","value":"/tests/system/model/TbPagamentoPedido.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1905,"string":"1,905"},"score":{"kind":"number","value":2.703125,"string":"2.703125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"tablename\n\t\t\t\t\t(ped_codigo, tpa_codigo, ppe_valor)\n\t\t\t\t\tVALUES(?, ?, ?)\");\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$stmt = $this->conexao->prepare($query);\n\n\t\t\t$stmt->bindParam(1, $dados['ped_codigo'],\\PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(2, $dados['tpa_codigo'],\\PDO::PARAM_STR);\n\t\t\t$stmt->bindParam(3, $dados['ppe_valor'],\\PDO::PARAM_INT);\n\t\t\t\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\treturn $this->conexao->lastInsertId();\n\t\t\t\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\Exception($e->getMessage());\n\t\t}\n\t\t\n\n\t}\n\t\n\tpublic function findAll()\n\t{\n\n\t\ttry {\n\t\t\t$stmt = $this->conexao->prepare(\"select * from tb_itens_pedido\");\n\t\t\t\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\treturn $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\t\t\t\n\t\t\t//return $stmt->fetch(\\PDO::FETCH_ASSOC);\n\n\t\t\t\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\Exception($e->getMessage());\n\t\t}\n\t}\n\n public function getTipoPagamento($ped_codigo)\n {\n try {\n\n $query = (\"SELECT (SELECT tpa_descricao\n FROM tb_tipo_pagamento\n WHERE tpa_codigo = PAG.tpa_codigo) AS tipo_pagamento\n FROM tb_pagamento_pedido AS PAG\n WHERE ped_codigo = ?\");\n\n $stmt = $this->conexao->prepare($query);\n\n $stmt->bindParam(1,$ped_codigo,\\PDO::PARAM_INT);\n\n $stmt->execute();\n\n $tipoPagamento = $stmt->fetch(\\PDO::FETCH_ASSOC);\n\n return $tipoPagamento['tipo_pagamento'];\n\n } catch (\\Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }\n\t\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":69,"cells":{"blob_id":{"kind":"string","value":"022240e3c5d204ea8b433eba1ebdd1a48e42f6d6"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"mariuszkrzaczkowski/YetiForceCRM"},"path":{"kind":"string","value":"/modules/SSalesProcesses/dashboards/ActualSalesOfTeam.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2524,"string":"2,524"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["LicenseRef-scancode-warranty-disclaimer"],"string":"[\n \"LicenseRef-scancode-warranty-disclaimer\"\n]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n */\n\n/**\n * Class to Team's actual sales widget.\n */\nclass SSalesProcesses_ActualSalesOfTeam_Dashboard extends SSalesProcesses_TeamsEstimatedSales_Dashboard\n{\n\t/**\n\t * Function to get search params in address listview.\n\t *\n\t * @param int $owner number id of user\n\t * @param string $status\n\t * @param mixed $row\n\t * @param mixed $time\n\t *\n\t * @return string\n\t */\n\tpublic function getSearchParams($row, $time)\n\t{\n\t\t$conditions = [];\n\t\t$listSearchParams = [];\n\t\tif (!empty($owner)) {\n\t\t\tarray_push($conditions, ['assigned_user_id', 'e', $owner]);\n\t\t}\n\t\tif (!empty($time)) {\n\t\t\tarray_push($conditions, ['actual_date', 'bw', implode(',', \\App\\Fields\\Date::formatRangeToDisplay(explode(',', $time)))]);\n\t\t}\n\t\t$listSearchParams[] = $conditions;\n\t\treturn '&viewname=All&search_params=' . json_encode($listSearchParams);\n\t}\n\n\t/**\n\t * Function to get data to chart.\n\t *\n\t * @param string $time\n\t * @param bool $compare\n\t * @param int|string $owner\n\t *\n\t * @return array\n\t */\n\tpublic function getEstimatedValue(string $timeString, bool $compare = false, $owner = false): array\n\t{\n\t\t$queryGenerator = new \\App\\QueryGenerator('SSalesProcesses');\n\t\t$queryGenerator->setFields(['assigned_user_id']);\n\t\t$queryGenerator->setGroup('assigned_user_id');\n\t\t$queryGenerator->addCondition('actual_date', $timeString, 'bw', true, false);\n\t\tif ('all' !== $owner) {\n\t\t $queryGenerator->addNativeCondition(['smownerid' => $owner]);\n\t\t}\n\t\t$sum = new \\yii\\db\\Expression('SUM(actual_sale)');\n\t\t$queryGenerator->setCustomColumn(['actual_sale' => $sum]);\n\t\t$query = $queryGenerator->createQuery();\n\t\t$listView = $queryGenerator->getModuleModel()->getListViewUrl();\n\t\t$dataReader = $query->createCommand()->query();\n\t\t$chartData = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$chartData['datasets'][0]['data'][] = round($row['actual_sale'], 2);\n\t\t\t$chartData['datasets'][0]['backgroundColor'][] = '#95a458';\n\t\t\t$chartData['datasets'][0]['links'][] = $listView . $this->getSearchParams($row['assigned_user_id'], $timeString);\n\t\t\t$ownerName = \\App\\Fields\\Owner::getUserLabel($row['assigned_user_id']);\n\t\t\t$chartData['labels'][] = \\App\\Utils::getInitials($ownerName);\n\t\t\t$chartData['fullLabels'][] = $ownerName;\n\t\t}\n\t\t$chartData['show_chart'] = (bool) isset($chartData['datasets']);\n\t\t$dataReader->close();\n\t\treturn $chartData;\n\t}\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":70,"cells":{"blob_id":{"kind":"string","value":"38324fc7eb6502245306cf9c2964619b00fe20a2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"jepsonwu/mycode"},"path":{"kind":"string","value":"/dm/DM/Oauth/Qq.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":7629,"string":"7,629"},"score":{"kind":"number","value":2.765625,"string":"2.765625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"appid = isset($options['appid']) ? $options['appid'] : '';\n $this->appkey = isset($options['appkey']) ? $options['appkey'] : '';\n $this->callback_url = isset($options['callback_url']) ? $options['callback_url'] : '';\n }\n \n /**\n * 获取授权URL\n * @param $state 状态值\n * @param $scope 授权列表\n * @return array 授权URL和状态值\n */\n public function getAuthorizeURL($state = NULL, $scope = NULL )\n { \n //构造请求参数列表\n $params = array(\n \"response_type\" => \"code\",\n \"client_id\" => $this->appid,\n \"redirect_uri\" => $this->callback_url,\n \"state\" => $state,\n \"scope\" => $scope\n );\n\n return self::GET_AUTH_CODE_URL.http_build_query($params);\n }\n\n /**\n * 获取请求token的url\n * @param $code 调用authorize时返回的code\n * @param $state 状态值\n * @return string access_token\n */\n public function getAccessToken( $state, $code )\n {\n //验证state防止CSRF攻击\n if($_GET['state'] != $state){\n exit(\"The state does not match. You may be a victim of CSRF.\");\n }\n\n //请求参数列表\n $keysArr = array(\n \"grant_type\" => \"authorization_code\",\n \"client_id\" => $this->appid,\n \"redirect_uri\" => urlencode($this->callback_url),\n \"client_secret\" => $this->appkey,\n \"code\" => $code\n );\n \n //构造请求access_token的url\n $response = $this->get(self::GET_ACCESS_TOKEN_URL, $keysArr);\n\n if(strpos($response, \"callback\") !== false){\n\n $lpos = strpos($response, \"(\");\n $rpos = strrpos($response, \")\");\n $response = substr($response, $lpos + 1, $rpos - $lpos -1);\n $msg = json_decode($response);\n\n if(isset($msg->error)){\n echo \"

error:

\" . $msg->error;\n echo \"

msg :

\" . $msg->error_description;\n exit;\n }\n }\n\n $params = array();\n parse_str($response, $params);\n $_SESSION['access_token'] = $params[\"access_token\"];\n return $params[\"access_token\"];\n }\n\n /**\n * 获取openid\n * @param $access_token \n * @return string openid\n */\n public function getOpenid($access_token)\n {\n //请求参数列表\n $keysArr = array(\n \"access_token\" => $access_token\n );\n\n $response = $this->get(self::GET_OPENID_URL, $keysArr);\n\n //检测错误是否发生\n if(strpos($response, \"callback\") !== false){\n\n $lpos = strpos($response, \"(\");\n $rpos = strrpos($response, \")\");\n $response = substr($response, $lpos + 1, $rpos - $lpos -1);\n }\n\n $user = json_decode($response);\n if(isset($user->error)){\n echo \"

error:

\" . $user->error;\n echo \"

msg :

\" . $user->error_description;\n exit;\n }\n\n //记录openid\n $_SESSION['openid'] = $user->openid;\n return $user->openid;\n }\n\n /**\n * 获取用户信息\n * @param string $access_token 授权的access_token\n * @param string $openid 第三方用户的唯一标识\n * @return string 用户信息\n */\n public function get_user_info($access_token, $openid)\n {\n //请求参数列表\n $keysArr = array(\n \"access_token\" => $_SESSION['access_token'],\n \"oauth_consumer_key\" => $this->appid,\n \"openid\" => $_SESSION['opendi'],\n \"format\" => 'json'\n );\n $response = $this->get(self::GET_USER_INFO, $keysArr);\n\n //检查返回ret判断api是否成功调用\n if($response->ret != 0){\n echo \"

error:

\" . $response->ret;\n echo \"

msg :

\" . $response->msg;\n exit; \n }\n $response = json_decode($response);\n $responseArr = $this->objToArr($response);\n return $responseArr;\n \n }\n\n /**\n * 对象到数组转换\n * @param object $obj 需转换的对象\n * @return array 返回转换后的数组\n */\n private function objToArr($obj)\n {\n if(!is_object($obj) && !is_array($obj)) {\n return $obj;\n }\n $arr = array();\n foreach($obj as $k => $v){\n $arr[$k] = $this->objToArr($v);\n }\n return $arr;\n }\n\n /**\n * 拼接url\n * @param string $baseURL 基于的url\n * @param array $keysArr 参数列表数组\n * @return string 返回拼接的url\n */\n public function combineURL($baseURL,$keysArr)\n {\n $combined = $baseURL;\n $valueArr = array();\n\n foreach($keysArr as $key => $val){\n $valueArr[] = \"$key=$val\";\n }\n\n $keyStr = implode(\"&\",$valueArr);\n $combined .= ($keyStr);\n \n return $combined;\n }\n\n /**\n * 服务器通过get请求获得内容\n * @param string $url 请求的url,拼接后的\n * @return string 请求返回的内容\n */\n public function get_contents($url)\n {\n if (ini_get(\"allow_url_fopen\") == \"1\") {\n $response = file_get_contents($url);\n }else{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n $response = curl_exec($ch);\n curl_close($ch);\n }\n\n //请求为空\n if(empty($response)){\n return false;\n }\n return $response;\n }\n\n /**\n * get方式请求资源\n * @param string $url 基于的baseUrl\n * @param array $keysArr 参数列表数组 \n * @return string 返回的资源内容\n */\n public function get($url, $keysArr){\n $combined = $this->combineURL($url, $keysArr);\n return $this->get_contents($combined);\n }\n\n /**\n * post方式请求资源\n * @param string $url 基于的baseUrl\n * @param array $keysArr 请求的参数列表\n * @param int $flag 标志位\n * @return string 返回的资源内容\n */\n public function post($url, $keysArr, $flag = 0){\n\n $ch = curl_init();\n if(! $flag) curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n curl_setopt($ch, CURLOPT_POST, TRUE); \n curl_setopt($ch, CURLOPT_POSTFIELDS, $keysArr); \n curl_setopt($ch, CURLOPT_URL, $url);\n $ret = curl_exec($ch);\n\n curl_close($ch);\n return $ret;\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":71,"cells":{"blob_id":{"kind":"string","value":"f3983051d66366cf158f8c79317775b932a75fe1"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"greezybacon/phlite"},"path":{"kind":"string","value":"/src/Forms/Fields/TextboxField.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2581,"string":"2,581"},"score":{"kind":"number","value":2.65625,"string":"2.65625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":" new TextboxField(array(\n 'id'=>1, 'label'=>'Size', 'required'=>false, 'default'=>16,\n 'validator' => 'number')),\n 'length' => new TextboxField(array(\n 'id'=>2, 'label'=>'Max Length', 'required'=>false, 'default'=>30,\n 'validator' => 'number')),\n 'validator' => new ChoiceField(array(\n 'id'=>3, 'label'=>'Validator', 'required'=>false, 'default'=>'',\n 'choices' => array('phone'=>'Phone Number','email'=>'Email Address',\n 'ip'=>'IP Address', 'number'=>'Number', ''=>'None'))),\n 'validator-error' => new TextboxField(array(\n 'id'=>4, 'label'=>'Validation Error', 'default'=>'',\n 'configuration'=>array('size'=>40, 'length'=>60),\n 'hint'=>'Message shown to user if the input does not match the validator')),\n 'placeholder' => new TextboxField(array(\n 'id'=>5, 'label'=>'Placeholder', 'required'=>false, 'default'=>'',\n 'hint'=>'Text shown in before any input from the user',\n 'configuration'=>array('size'=>40, 'length'=>40),\n )),\n );\n }\n\n function validateEntry($value) {\n parent::validateEntry($value);\n $config = $this->getConfiguration();\n $validators = array(\n '' => null,\n 'email' => array(array('Validator', 'is_email'),\n 'Enter a valid email address'),\n 'phone' => array(array('Validator', 'is_phone'),\n 'Enter a valid phone number'),\n 'ip' => array(array('Validator', 'is_ip'),\n 'Enter a valid IP address'),\n 'number' => array('is_numeric', 'Enter a number')\n );\n // Support configuration forms, as well as GUI-based form fields\n $valid = $this->get('validator');\n if (!$valid) {\n $valid = $config['validator'];\n }\n if (!$value || !isset($validators[$valid]))\n return;\n $func = $validators[$valid];\n $error = $func[1];\n if ($config['validator-error'])\n $error = $config['validator-error'];\n if (is_array($func) && is_callable($func[0]))\n if (!call_user_func($func[0], $value))\n $this->_errors[] = $error;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":72,"cells":{"blob_id":{"kind":"string","value":"ee1890465b9d876772afbdcb4358d4c5217f15e2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"LeonNasc/PACO"},"path":{"kind":"string","value":"/views/labref.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1433,"string":"1,433"},"score":{"kind":"number","value":2.640625,"string":"2.640625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\n\n
\n

\n
\n
\n
\n

-

\n
\n\n
\n \n \n
\n\n
\n
\n
\n \n\n
\n\n\n\n
\n \n

Pacientes em acompanhamento por

\n
\n \n
\n
\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":73,"cells":{"blob_id":{"kind":"string","value":"7331affab9c1ebc59bd18cf8ac02d39184394883"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"abdulrahimanpathan/ca"},"path":{"kind":"string","value":"/app/Repositories/PointsRepository.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":447,"string":"447"},"score":{"kind":"number","value":2.59375,"string":"2.59375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"leftJoin('teams', 'results.winner_id', '=', 'teams.id')\n\t\t\t\t ->groupBy('teams.id')\n\t\t\t\t ->orderByDesc('points')\n\t\t\t\t ->orderBy('teams.name')\n\t\t\t\t ->get();\n\t\treturn $points;\n\t}\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":74,"cells":{"blob_id":{"kind":"string","value":"0bc959d8e1740a10f2ee2d8cc0c32ddb025ab43c"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"nyyelin/jfood"},"path":{"kind":"string","value":"/dashboard.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":9097,"string":"9,097"},"score":{"kind":"number","value":2.53125,"string":"2.53125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\n
\n\n \n
\n
\n
\n
\n
\n
Today
\n
\n\n prepare($sql);\n $stmt->bindParam(':order_date',$order_date);\n // $stmt->bindParam(':enddate',$dates);\n $stmt->execute();\n $rows=$stmt->rowCount();\n // var_dump($rows);\n $rows=$stmt->fetch();\n \n\n // var_dump($rows) ;\n // die();\n ?>\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n\n \n
\n
\n
\n
\n
\n
This Week
\n
\n\n prepare($sql);\n $stmt->bindParam(':day',$order_date);\n $stmt->bindParam(':enddate',$dates);\n $stmt->execute();\n $rows=$stmt->fetch();\n \n\n // var_dump($rows) ;\n // die();\n ?>\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n\n \n
\n
\n
\n
\n
\n
Monthly
\n \n
\n\n prepare($sql);\n $stmt->bindParam(':day',$order_date);\n // $stmt->bindParam(':enddate',$dates);\n $stmt->execute();\n $rows=$stmt->fetch();\n \n\n // var_dump($rows) ;\n // die();\n ?>\n \n \n
\n\n
\n
\n \n
\n
\n
\n
\n
\n\n \n
\n
\n
\n
\n
\n
Pending Requests
\n
18
\n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n
\n

Order List

\n \n
\n\n \n
\n
\n
Tday Order
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n prepare($sql);\n $stmt->bindParam(':dates',$order_date);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n $i = 1;\n foreach($rows as $orders)\n {\n $id = $orders['id'];\n $voucherno = $orders['voucherno'];\n $orderdate = $orders['order_date'];\n $status = $orders['status'];\n $noti = $orders['noti'];\n \n\n \n ?>\n\n\n \n \n \n \n \n \n\n \n \n\n \n \n
NoVoucher NoOrder DateAction
NoVoucher NoOrder DateAction
\n\n \" class=\"btn btn-info\">\n \n Detail\n \n \n \" class=\"btn btn-danger\" onclick=\"return confirm('Are You sure to delete!!!')\">Delete\n\n
\n
\n
\n
\n\n\n\n\n

\n 404 error not fonund\n

\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":75,"cells":{"blob_id":{"kind":"string","value":"28ee51fc60ad8a1aac270609454a015c925ba08d"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"p3web/E_Archive_uni"},"path":{"kind":"string","value":"/model/data_access/access_field_of_study.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":4524,"string":"4,524"},"score":{"kind":"number","value":2.703125,"string":"2.703125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":" 64]\n ];\n }\n\n /**\n * @inheritdoc\n */\n public function attributeLabels()\n {\n return [\n 'user_id' => 'User ID',\n 'fname' => 'Fname',\n 'lname' => 'Lname',\n 'company' => 'Company',\n 'user_status' => 'User Status',\n 'date_create' => 'Date Create',\n \t'inventars' => 'Inventar N',\n \t'pass' => 'Password'\n ];\n }\n\n /**\n * @return \\yii\\db\\ActiveQuery\n */\n public function getTblHistories()\n {\n return $this->hasMany(TblHistory::className(), ['user_id' => 'user_id']);\n }\n public function getEquips()\n {\n \treturn $this->hasOne(Equips::className(), ['user_id' => 'user_id']);\n }\n \n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":77,"cells":{"blob_id":{"kind":"string","value":"07ded18caae8be8677274bf5824258d060d5b15c"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"webplumbr/uql-backend"},"path":{"kind":"string","value":"/app/Lib/Helpers.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1296,"string":"1,296"},"score":{"kind":"number","value":3.40625,"string":"3.40625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"left) && isset($node->right)) {\n $leaves = [];\n $leaves[] = has_children($node->left);\n $leaves[] = has_children($node->right);\n return $leaves;\n } else if (isset($node->left)) {\n return has_children($node->left);\n } else if (isset($node->right)) {\n return has_children($node->right);\n } else {\n return $node->root;\n }\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":78,"cells":{"blob_id":{"kind":"string","value":"5d3fd3dfcf8844a0335310b0cab287bf5f7535dc"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"ihksans/TA-Persuratan"},"path":{"kind":"string","value":"/app/Exports/SuratKeluarExporter.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":463,"string":"463"},"score":{"kind":"number","value":2.578125,"string":"2.578125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"setIp($ip);\n $this->setTerm($term);\n }\n\n /**\n * @ORM\\PrePersist()\n */\n public function prePersist()\n {\n $this->setDateCreated(new \\DateTime());\n }\n\n /**\n * Get id\n *\n * @return integer \n */\n public function getId()\n {\n return $this->id;\n }\n\n /**\n * Set ip\n *\n * @param string $ip\n * @return TermVote\n */\n public function setIp($ip)\n {\n $this->ip = $ip;\n\n return $this;\n }\n\n /**\n * Get ip\n *\n * @return string \n */\n public function getIp()\n {\n return $this->ip;\n }\n\n /**\n * Set dateCreated\n *\n * @param \\DateTime $dateCreated\n * @return TermVote\n */\n public function setDateCreated($dateCreated)\n {\n $this->dateCreated = $dateCreated;\n\n return $this;\n }\n\n /**\n * Get dateCreated\n *\n * @return \\DateTime \n */\n public function getDateCreated()\n {\n return $this->dateCreated;\n }\n\n /**\n * Set term\n *\n * @param \\AppBundle\\Entity\\Term $term\n * @return TermVote\n */\n public function setTerm(\\AppBundle\\Entity\\Term $term = null)\n {\n $this->term = $term;\n\n return $this;\n }\n\n /**\n * Get term\n *\n * @return \\AppBundle\\Entity\\Term \n */\n public function getTerm()\n {\n return $this->term;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":80,"cells":{"blob_id":{"kind":"string","value":"8783463d0acaae1b35345ee8b6883c1aa905ffd5"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"aaronpk/p3k-micropub"},"path":{"kind":"string","value":"/src/p3k/Micropub/Error.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1066,"string":"1,066"},"score":{"kind":"number","value":2.984375,"string":"2.984375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT","Apache-2.0"],"string":"[\n \"MIT\",\n \"Apache-2.0\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"_error = $error;\n $this->_property = $property;\n $this->_description = $description;\n }\n\n public function toArray() {\n return [\n 'error' => $this->_error,\n 'error_property' => $this->_property,\n 'error_description' => $this->_description,\n ];\n }\n\n public function toMf2() {\n return $this->toArray();\n }\n\n public function __toString() {\n return json_encode($this->toArray());\n }\n\n public function __get($k) {\n switch($k) {\n case 'error':\n return $this->_error;\n case 'error_property':\n return $this->_property;\n case 'error_description':\n return $this->_description;\n }\n throw new Exception('A Micropub error occurred, and you attempted to access the Error object as though it was a successful request. You should check that the object returned was an error and handle it properly.');\n }\n\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":81,"cells":{"blob_id":{"kind":"string","value":"2f952bb4dd92da4097a20f567aa3df74c3040ee2"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"henrikperrochon/TripNaut"},"path":{"kind":"string","value":"/Library/Models/WorldModel.class.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":701,"string":"701"},"score":{"kind":"number","value":2.75,"string":"2.75"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"model = $model;\n\t}\n\n\tpublic function getAllCatPlace() {\n\t\treturn $this->model->get();\n\t}\n\n\tpublic function getCatPlaceById($id) {\n\t\treturn $this->model->find($id);\n\t}\n\n\tpublic function getCatPlaceByPagination($count = 25) {\n\t\treturn $this->model->paginate($count);\n\t}\n}"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":83,"cells":{"blob_id":{"kind":"string","value":"1fc34d2a67467fbe05d8e9fff6ec83195b526136"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"nritr/iap"},"path":{"kind":"string","value":"/admin/php/utils/ErrorManager.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1207,"string":"1,207"},"score":{"kind":"number","value":3.109375,"string":"3.109375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"ex=$ex;\n }\n \n public function getCode() {\n if ($this->ex!=null)\n return $this->ex->getCode();\n return 0;\n }\n \n public function getMessage() {\n if ($this->ex!=null)\n return $this->ex->getMessage();\n return null;\n }\n \n public function setData($data) {\n $this->data = $data;\n }\n \n private function getData() {\n return ($this->data == \"\" ? \"null\" : $this->data);\n }\n public function getJsonResponse($encode=true) {\n\n $status = ((string)$this->ex==null ? \"success\" : \"fail\");\n $ret = \"{\".\n \"\\\"status\\\":\\\"\".$status.\"\\\", \".\n \"\\\"error\\\": \".\n \"{\".\n \"\\\"code\\\":\\\"\".$this->getCode().\"\\\",\".\n \"\\\"message\\\":\\\"\".$this->getMessage().\"\\\"\".\n \"},\".\n \"\\\"data\\\":\".($encode==true ? json_encode($this->getData()) : $this->getData()).\n \"}\";\n return $ret;\n }\n}\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":84,"cells":{"blob_id":{"kind":"string","value":"0c19e4ddd66f349d24a2217f2208dee27ff0e938"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"onlineMeriam/ping_pong_game"},"path":{"kind":"string","value":"/Joueur.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":315,"string":"315"},"score":{"kind":"number","value":3.484375,"string":"3.484375"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"userName = $userName; \n // $this->id = $userId; \n } \n public function getName() \n { \n return $this->userName; \n } \n public function getId() \n { \n return $this->userId; \n } \n}\n?>"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":85,"cells":{"blob_id":{"kind":"string","value":"9b34a1378aaa37f97acc7b8e1315c503361bd3db"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Code4PuertoRico/myturn"},"path":{"kind":"string","value":"/counter.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":1717,"string":"1,717"},"score":{"kind":"number","value":2.5625,"string":"2.5625"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"\n\n\n\n\n\n\n\n\n
\n
\n
\n
\n\".$turn;?>

\n\n
\n\n
\nThis application is in its alpha version, please notify if bugs | myturn.pr@gmail.com | &copy; myturn\n
\n\n\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":86,"cells":{"blob_id":{"kind":"string","value":"ff397ec7d888996d388dca5e29cb5003f42d8f05"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"Intervention/gif"},"path":{"kind":"string","value":"/src/Encoder/ImageDescriptorEncoder.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":2338,"string":"2,338"},"score":{"kind":"number","value":2.8125,"string":"2.8125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"source = $source;\n }\n\n /**\n * Encode current source\n *\n * @return string\n */\n public function encode(): string\n {\n return implode('', [\n ImageDescriptor::SEPARATOR,\n $this->encodeLeft(),\n $this->encodeTop(),\n $this->encodeWidth(),\n $this->encodeHeight(),\n $this->encodePackedField(),\n ]);\n }\n\n /**\n * Encode left value\n *\n * @return string\n */\n protected function encodeLeft(): string\n {\n return pack('v*', $this->source->getLeft());\n }\n\n /**\n * Encode top value\n *\n * @return string\n */\n protected function encodeTop(): string\n {\n return pack('v*', $this->source->getTop());\n }\n\n /**\n * Encode width value\n *\n * @return string\n */\n protected function encodeWidth(): string\n {\n return pack('v*', $this->source->getWidth());\n }\n\n /**\n * Encode height value\n *\n * @return string\n */\n protected function encodeHeight(): string\n {\n return pack('v*', $this->source->getHeight());\n }\n\n /**\n * Encode size of local color table\n *\n * @return string\n */\n protected function encodeLocalColorTableSize(): string\n {\n return str_pad(decbin($this->source->getLocalColorTableSize()), 3, '0', STR_PAD_LEFT);\n }\n\n /**\n * Encode reserved field\n *\n * @return string\n */\n protected function encodeReservedField(): string\n {\n return str_pad('0', 2, '0', STR_PAD_LEFT);\n }\n\n /**\n * Encode packed field\n *\n * @return string\n */\n protected function encodePackedField(): string\n {\n return pack('C', bindec(implode('', [\n (int) $this->source->getLocalColorTableExistance(),\n (int) $this->source->isInterlaced(),\n (int) $this->source->getLocalColorTableSorted(),\n $this->encodeReservedField(),\n $this->encodeLocalColorTableSize(),\n ])));\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":87,"cells":{"blob_id":{"kind":"string","value":"6520f42ad559a1c9a9b13edc5ea8a0667e2854a4"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"vench/vl"},"path":{"kind":"string","value":"/www/protected/models/Currency.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":3070,"string":"3,070"},"score":{"kind":"number","value":2.796875,"string":"2.796875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"findAll(array(\n 'condition'=>'Enable=1',\n )); \n \n $timeActual = time() - self::TIME_ACTUAL;\n foreach($models as $model) {\n if($update || $model->DateTimeUpdate < $timeActual) {\n $model->updateValue();\n }\n }\n return $models;\n }\n \n \n \n /**\n * Получить список всех валют.\n * @param boolean $load если true, то дает возможность загружать новые валюты, если других валют нет. \n * @return type \n */\n public static function getCurrencyList($load = false) {\n $models = self::model()->findAll(array(\n 'condition'=>'Enable=0',\n ));\n if(sizeof($models) == 0 && $load) {\n $currencyProvider = CurrencyProvider::getInstance();\n $data = $currencyProvider->getValuteies();\n foreach($data as $item){\n $model = new Currency();\n foreach($item as $key=>$value){\n $model->{$key} = $value;\n }\n $model->DateTimeUpdate = $currencyProvider->getDateTime();\n $model->Enable = 0;\n \n if($model->save()) {\n array_push($models, $model);\n } \n }\n }\n return $models;\n }\n \n /**\n * Обновляем валюту из удаленного источника.\n */\n public function updateValue() {\n $currencyProvider = CurrencyProvider::getInstance();\n $data = $currencyProvider->getValuteByCharCode($this->CharCode);\n if(isset($data['Value'])) {\n $this->Value = $data['Value'];\n $this->DateTimeUpdate = $currencyProvider->getDateTime();\n $this->save();\n }\n }\n \n /**\n *\n * @return type \n */\n public function rules() {\n return array(\n array('NumCode,CharCode,Nominal,Name,Value,DateTimeUpdate,Enable', 'safe'),\n );\n }\n \n /**\n *\n * @return string \n */\n public function tableName() {\n return '{{Currency}}';\n }\n}\n\n?>\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":88,"cells":{"blob_id":{"kind":"string","value":"28a22a055800914a7854ee3827b9bafc473cdc6a"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"jetimob/juno-sdk-php-laravel"},"path":{"kind":"string","value":"/src/Entity/Notification/Payer.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":625,"string":"625"},"score":{"kind":"number","value":2.671875,"string":"2.671875"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":["MIT"],"string":"[\n \"MIT\"\n]"},"license_type":{"kind":"string","value":"permissive"},"text":{"kind":"string","value":"id;\n }\n\n /**\n * @return string|null\n */\n public function getName(): ?string\n {\n return $this->name;\n }\n\n /**\n * @return Address|null\n */\n public function getAddress(): ?Address\n {\n return $this->address;\n }\n}\n"},"download_success":{"kind":"bool","value":true,"string":"true"}}},{"rowIdx":89,"cells":{"blob_id":{"kind":"string","value":"e5dc81b86bf5c6d349038fec729bd7ca1e29f980"},"language":{"kind":"string","value":"PHP"},"repo_name":{"kind":"string","value":"parastoo-62/sample"},"path":{"kind":"string","value":"/app/Framework/shortcodes/sw_thumb_nav_carousel.php"},"src_encoding":{"kind":"string","value":"UTF-8"},"length_bytes":{"kind":"number","value":37532,"string":"37,532"},"score":{"kind":"number","value":2.53125,"string":"2.53125"},"int_score":{"kind":"number","value":3,"string":"3"},"detected_licenses":{"kind":"list like","value":[],"string":"[]"},"license_type":{"kind":"string","value":"no_license"},"text":{"kind":"string","value":"config['name']\t\t\t= __('Carousel With Thumbnails', 'swedenWp' );\n $this->config['tab']\t\t\t= __('Content Elements', 'swedenWp' );\n $this->config['icon']\t\t\t= swedenBuilder::$path['imagesURL'].\"sc-postslider.png\";\n $this->config['order']\t\t\t= 2;\n $this->config['target']\t\t\t= 'avia-target-insert';\n $this->config['shortcode'] \t\t= 'sw_thumb_nav_carousel';\n $this->config['shortcode_nested'] = array('sw_thumb_carousel_slide');\n $this->config['tooltip'] \t = __('Display a carousel element with thumb navigation', 'swedenWp' );\n }\n\n /**\n * Popup Elements\n *\n * If this function is defined in a child class the element automatically gets an edit button, that, when pressed\n * opens a modal window that allows to edit the element properties\n *\n * @return void\n */\n function popup_elements()\n {\n $this->elements = array(\n\n array(\n \"name\" => __(\"Slides\", 'swedenWp' ),\n \"desc\" => __(\"Add, edit, and remove slides\", 'swedenWp' ),\n \"type\" \t\t\t=> \"modal_group\",\n \"id\" \t\t\t=> \"content\",\n \"modal_title\" \t=> __(\"Edit Form Element\", 'swedenWp' ),\n \"std\"\t\t\t=> array(\n array('title'=>__('Slide 1', 'swedenWp' ), 'tags'=>''),\n array('title'=>__('Slide 2', 'swedenWp' ), 'tags'=>''),\n\n ),\n\n 'subelements' \t=> array(\n\n array(\n \"name\" => __(\"Display Related Articles\", 'swedenWp' ),\n \"desc\" => __(\"Choose \\\"Yes\\\" to display related articles after this slide\", 'swedenWp' ),\n \"id\" => \"is_related\",\n \"type\" => \"select\",\n \"subtype\" => array(\n __('No', 'swedenWp' ) =>'no',\n __('Yes', 'swedenWp' ) =>'yes',\n ),\n \"std\" => \"no\",\n ),\n array(\n \"name\" => __(\"Related Articles Format\", \"swedenWp\"),\n \"desc\" => __(\"Choose format of related articles\"),\n \"id\" => \"show_type\",\n \"type\" => \"select\",\n \"required\" => array('is_related','equals','yes'),\n \"std\" => \"3cols\",\n \"subtype\" => array(\n __('Three Columns', 'swedenWp') =>'3cols',\n //__('Single Column', 'swedenWp') =>'1col',\n )\n ),\n array(\n\t\t\t\t\t\t\t \"name\" \t=> __(\"Related Article - Left\", 'swedenWp' ),\n\t\t\t\t\t\t\t \"desc\" \t=> __(\"Select first related article\", 'swedenWp' ),\n\t\t\t\t\t\t\t \"id\" \t=> \"linka\",\n\t\t\t\t\t\t\t \"type\" \t=> \"linkpickerB\",\n\t\t\t\t\t\t\t \"container_class\" =>\"avia-element-fullwidth\",\n\t\t\t\t\t\t\t \"required\" => array('show_type','equals','3cols'),\n\t\t\t\t\t\t\t \"fetchTMPL\"\t=> true,\n\t\t\t\t\t\t\t \"subtype\" => array(\n\t\t\t\t\t\t\t __('Single Entry', 'swedenWp' ) =>'single',\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t \"std\" \t=> \"\"),\n array(\n \"name\" \t=> __(\"Related Article - Center\", 'swedenWp' ),\n\t\t\t\t\t\t\t\t \"desc\" \t=> __(\"Select second related article\", 'swedenWp' ),\n\t\t\t\t\t\t\t\t \"id\" \t=> \"linkb\",\n\t\t\t\t\t\t\t\t \"type\" \t=> \"linkpickerB\",\n\t\t\t\t\t\t\t\t \"container_class\" =>\"avia-element-fullwidth\",\n\t\t\t\t\t\t\t\t \"required\" => array('show_type','equals','3cols'),\n\t\t\t\t\t\t\t\t \"fetchTMPL\"\t=> true,\n\t\t\t\t\t\t\t\t \"subtype\" => array(\n\t\t\t\t\t\t\t\t //__('Set Manually', 'swedenWp' ) =>'manual',\n\t\t\t\t\t\t\t\t __('Single Entry', 'swedenWp' ) =>'single',\n\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t\t \"std\" \t=> \"\"),\n array(\n \"name\" => __(\"Related Article - Right\", 'swedenWp' ),\n \"desc\" => __(\"Select third related article\", 'swedenWp' ),\n \"id\" => \"linkc\",\n \"type\" => \"linkpickerB\",\n \"container_class\" =>\"avia-element-fullwidth\",\n \"required\" => array('show_type','equals','3cols'),\n \"fetchTMPL\" => true,\n \"subtype\" => array(\n //__('Set Manually', 'swedenWp' ) =>'manual',\n __('Single Entry', 'swedenWp' ) =>'single',\n ),\n \"std\" => \"\"),\n//This stuff isn't being used in any of the current thumbnail carousels, but could be desired later\n/*\n array(\n \"name\" => __(\"Related Article\", 'swedenWp' ),\n \"desc\" => __(\"Select related article\", 'swedenWp' ),\n \"id\" => \"link\",\n \"type\" => \"linkpicker\",\n \"container_class\" =>\"avia-element-fullwidth\",\n \"required\" => array('show_type','equals','1col'),\n \"fetchTMPL\" => true,\n \"subtype\" => array(\n __('Set Manually', 'swedenWp' ) =>'manually',\n //__('Single Entry', 'swedenWp' ) =>'single',\n ),\n \"std\" => \"manually\"),\n*/\n array(\n \"name\" => __(\"Choose Image\",'swedenWp' ),\n \"desc\" => __(\"Upload a new image or choose an existing image from the media library\",'swedenWp' ),\n \"id\" => \"src\",\n \"type\" => \"image\",\n \t\t\"fetch\" => \"id\",\n \"title\" => __(\"Insert Image\",'swedenWp' ),\n \"button\" => __(\"Insert\",'swedenWp' ),\n \"std\" => swedenBuilder::$path['imagesURL'].\"placeholder.jpg\"\n ),\n//This stuff isn't being used in any of the current thumbnail carousels, but could be desired later - ESP\n // array(\n // \"name\" => __(\"Title\", 'swedenWp' ),\n // \"desc\" => __(\"Title\", 'swedenWp' ),\n // \"id\" => \"title\",\n // \"type\" => \"input\",\n // \"std\" => \"\",\n // ),\n // array(\n // \"name\" => __(\"Caption\", 'swedenWp' ),\n // \"desc\" => __(\"Caption of photo (optional)\", 'swedenWp' ),\n // \"id\" => \"content\",\n // \"required\" => array('is_related','equals','no'),\n // \"type\" => \"tiny_mce\",\n // \"std\" => \"\",\n // ),\n\n // array(\n // \"name\" => __(\"Has Video?\", 'swedenWp' ),\n // \"desc\" => __(\"Will this slide be a video?\", 'swedenWp' ),\n // \"id\" => \"is_video\",\n // \"required\" => array('is_related','equals','no'),\n // \"type\" => \"select\",\n // \"subtype\" => array(\n // __('no', 'swedenWp' ) =>'no',\n // __('yes', 'swedenWp' ) =>'yes',\n // ),\n // \"std\" => \"no\",\n // ),\n // array(\n // \"name\" => __(\"Video Type\", 'swedenWp' ),\n // \"desc\" => __(\"Choose if video is scene7 or other\", 'swedenWp' ),\n // \"id\" => \"videotype\",\n // \"type\" => \"select\",\n // \"std\" => \"scene7\",\n // \"required\" => array('is_video','equals','yes'),\n // \"subtype\" => array(\n // __('scene7', 'swedenWp' ) =>'scene7',\n // __('other', 'swedenWp' ) =>'other',\n // )\n // ),\n\n // array(\n // \"name\" => __(\"Choose Video\",'swedenWp' ),\n // \"desc\" => __(\"Either upload a new video, choose an existing video from your media library or link to a video by URL\",'swedenWp' ).\"

\".\n // __(\"A list of all supported Video Services can be found on\",'swedenWp' ).\n // \" WordPress.org

\".\n // __(\"Working examples, in case you want to use an external service:\",'swedenWp' ). \"
\".\n // \"http://vimeo.com/18439821
\".\n // \"http://www.youtube.com/watch?v=G0k3kHtyoqc
\",\n\n // \"id\" => \"video_src\",\n // \"type\" => \"video\",\n // \"title\" => __(\"Insert Video\",'swedenWp' ),\n // \"button\" => __(\"Insert\",'swedenWp' ),\n // \"std\" => \"\",\n // \"required\" => array('videotype','equals','other')\n // ),\n\n // array(\n // \"name\" => __(\"Scene7 video ID\", 'swedenWp' ),\n // \"desc\" => __(\"Enter Scene7 video ID\", 'swedenWp' ),\n // \"id\" => \"scene7_id\",\n // \"type\" => \"input\",\n // \"std\" => \"\",\n // \"required\" => array('videotype','equals','scene7')\n // ),\n // array(\n // \"name\" => __(\"Video Format\", 'swedenWp' ),\n // \"desc\" => __(\"Choose if you want to display a modern 16:9 or classic 4:3 Video, or use a custom ratio\", 'swedenWp' ),\n // \"id\" => \"format\",\n // \"type\" => \"select\",\n // \"std\" => \"16:9\",\n // \"required\" => array('is_video','equals','yes'),\n // \"subtype\" => array(\n // __('16:9', 'swedenWp' ) =>'16-9',\n // __('4:3', 'swedenWp' ) =>'4-3',\n // __('Custom Ratio', 'swedenWp' ) =>'custom',\n // )\n // ),\n\n // array(\n // \"name\" => __(\"Video width\", 'swedenWp' ),\n // \"desc\" => __(\"Enter a value for the width\", 'swedenWp' ),\n // \"id\" => \"width\",\n // \"type\" => \"input\",\n // \"std\" => \"16\",\n // \"required\" => array('format','equals','custom')\n // ),\n\n // array(\n // \"name\" => __(\"Video height\", 'swedenWp' ),\n // \"desc\" => __(\"Enter a value for the height\", 'swedenWp' ),\n // \"id\" => \"height\",\n // \"type\" => \"input\",\n // \"std\" => \"9\",\n // \"required\" => array('format','equals','custom')\n // )\n\n )\n )\n );\n\n }\n\n /**\n * Editor Element - this function defines the visual appearance of an element on the swedenBuilder Canvas\n * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container\n * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className\n *\n *\n * @param array $params this array holds the default values for $content and $args.\n * @return $params the return array usually holds an innerHtml key that holds item specific markup.\n */\n function editor_element($params)\n {\n $heading = \"\";\n $template = $this->update_template(\"heading\", \" - {{heading}}\");\n if(!empty($params['args']['heading'])) $heading = \"- \".$params['args']['heading'].\"\";\n\n $params['innerHtml'] = \"\";\n $params['innerHtml'].= \"
\".$this->config['name'].\"
\";\n $params['innerHtml'].= \"
\".$heading.\"
\";\n\n return $params;\n }\n\n /**\n * Editor Sub Element - this function defines the visual appearance of an element that is displayed within a modal window and on click opens its own modal window\n * Works in the same way as Editor Element\n * @param array $params this array holds the default values for $content and $args.\n * @return $params the return array usually holds an innerHtml key that holds item specific markup.\n */\n function editor_sub_element($params)\n {\n $template = $this->update_template(\"title\", \"{{title}}\");\n\t\t\t\t //$imgThumb = $this->update_template(\"src\", \"\");\n\t\t\t\t $imgThumb = $this->update_template(\"img_fakeArg\", \"{{img_fakeArg}}\");\n\t\t\t\t if(is_numeric($params['args']['src'])) {\n\t\t\t\t \t$thumb = isset($params['args']['src']) ? wp_get_attachment_image($params['args']['src']) : \"\";\n\t\t\t\t } else {\n\t\t\t\t \t$thumb = \"\";\n\t\t\t\t }\n $params['innerHtml'] = \"\";\n //$params['innerHtml'] .= \"
\";\n $params['innerHtml'] .= \"
\".$thumb.\"
\";\n $params['innerHtml'] .= \"
\".$params['args']['title'].\"
\";\n $params['innerHtml'] .= \"
\";\n\n return $params;\n }\n\n /**\n * Frontend Shortcode Handler\n *\n * @param array $atts array of attributes\n * @param string $content text within enclosing form of shortcode element\n * @param string $shortcodename the shortcode found, when == callback name\n * @return string $output returns the modified html string\n */\n function shortcode_handler($atts, $content = \"\", $shortcodename = \"\", $meta = \"\")\n {\n\n //wp_register_script('product_carousel', plugins_url('js/per-pas-belanja-online.js', __FILE__), array('jquery'), '1.0.0');\n //wp_enqueue_script('product_carousel');\n\n $atts = shortcode_atts(array(\n 'type' => 'slider',\n 'title' => '',\n 'autoplay'\t\t=> 'false',\n 'animation' => 'fade',\n 'interval'\t\t=> 5,\n 'navigation' => 'arrows',\n 'heading'\t\t=> '',\n 'columns' => 3,\n 'handle'\t\t=> $shortcodename,\n 'carousel_type' => \"home\",\n 'scale' => \"no\",\n 'content'\t\t=> ShortcodeHelper::shortcode2array($content),\n 'class'\t\t\t=> $meta['el_class']\n ), $atts);\n\n $slider = new sw_thumb_carousel_slide($atts);\n\n return $slider->html();\n }\n\n }\n}\n\nif ( !class_exists( 'sw_thumb_carousel_slide' ) )\n{\n class sw_thumb_carousel_slide\n {\n static $slider = 0; \t\t\t\t//slider count for the current page\n protected $config;\t \t\t\t\t//base config set on initialization\n\n function __construct($config)\n {\n global $avia_config;\n $output = \"\";\n\n $this->config = array_merge(array(\n 'type' => 'grid',\n 'autoplay'\t\t=> 'false',\n 'animation' => 'fade',\n 'handle'\t\t=> '',\n 'heading'\t\t=> '',\n 'navigation' => 'arrows',\n 'columns' => 3,\n 'interval'\t\t=> 5,\n 'class'\t\t\t=> \"\",\n 'css_id'\t\t=> \"\",\n 'content'\t\t=> array()\n ), $config);\n }\n\n public function html()\n {\n global $swedenUnlimited;\n\n $output = \"\";\n $counter = 0;\n swedendSliderHelper::$slider++;\n if(empty($this->config['content'])) return $output;\n\n //$html .= empty($this->subslides) ? $this->default_slide() : $this->advanced_slide();\n extract($this->config);\n\n $slide_count = count($content);\n\n $slides = '';\n $thumbs = '';\n\n $counter = 0;\n foreach($content as $key => $value)\n {\n if ($value['attr']['is_related'] == 'no') {\n $slides .= $this->slide_content($value['attr'],$value['content'],$counter);\n }\n else {\n $slides .= $this->related_article_content($value['attr'],$value['content'],$counter);\n }\n $thumbs .= $this->thumb_content($value['attr'],$value['content'],$counter);\n $counter++;\n }\n\n //set up slideshow\n\n $output .= '
';\n //create image carousel\n $output .= '
';\n $output .= '
';\n $output .= '
';\n $output .= $slides;\n $output .= '
';\n $output .= '
';\n $output .= '';\n $output .= '';\n $output .= '
';\n\n if(!$swedenUnlimited['client']->isPhone) {\n $output .= '
';\n $output .= '
';\n $output .= '
';\n $output .= $thumbs;\n $output .= '
';\n $output .= '
';\n $output .= '';\n $output .= '';\n $output .= '
';\n }\n\n $output .= '
';\n\n return $output;\n }\n\n /**\n * Slide Content Handler\n *\n * @param array $atts array of attributes\n * @param string $content text within enclosing form of shortcode element\n * @param string $shortcodename the shortcode found, when == callback name\n * @return string $output returns the modified html string\n */\n\n protected function slide_content($atts, $content = \"\", $counter) {\n \tglobal $swedenUnlimited;\n $output = \"\";\n $class = \"\";\n $alt = \"\";\n $title = \"\";\n\n extract(shortcode_atts(array('src'=>'', 'attachment'=>'', 'title'=>'', 'category'=>'', 'card_type'=>'','align'=>'', 'show_type' => '', 'link'=>'', 'linka'=>'', 'linkb'=>'', 'linkc'=>'', 'target'=>'no'), $atts));\n\n $alt = $title;\n\n $slidenum = $counter+1;\n $slidedisplaynum = $slidenum;\n if ($counter<10) {\n $slidenumdisplaynum = \"0\".$slidenum;\n }\n\n $output .='
';\n if (!empty($src)) {\n \tif (is_numeric($src)) {\n \t\t$output .= '
';\n \t\tif($swedenUnlimited['client']->isPhone)\n \t\t\t// get phone image\n \t\t\t$output .= wp_get_attachment_image($src, '1/2-image-with-text');\n \t\telse if($swedenUnlimited['client']->isTablet)\n \t\t\t// get tablet image\n \t\t\t$output .= wp_get_attachment_image($src, '1/1-image-with-text+hero');\n \t\telse\n \t\t\t$output.= wp_get_attachment_image($src, '1/1-image-with-text+hero');\n \t\t$output .= '
';\n \t} else if($attachment) {\n $output .= '
';\n if($swedenUnlimited['client']->isPhone)\n \t// get phone image\n \t$output .= wp_get_attachment_image($attachment, '1/2-image-with-text');\n else if($swedenUnlimited['client']->isTablet)\n \t// get tablet image\n \t$output .= wp_get_attachment_image($attachment, '1/1-image-with-text+hero');\n else\n \t$output.= wp_get_attachment_image($attachment, '1/1-image-with-text+hero');\n $output .= '
';\n } else {\n $output .='
';\n }\n }\n $output .='
';\n $output .='
'.$title.'
';\n $output .='
'.$content.'
';\n $output .='
';\n $output .='
';\n\n return $output;\n }\n\n /**\n * Thumb Content Handler\n *\n * @param array $atts array of attributes\n * @param string $content text within enclosing form of shortcode element\n * @param string $shortcodename the shortcode found, when == callback name\n * @return string $output returns the modified html string\n */\n\n protected function thumb_content($atts, $content = \"\", $counter) {\n \tglobal $swedenUnlimited;\n $output = \"\";\n $class = \"\";\n $alt = \"\";\n $title = \"\";\n\n extract(shortcode_atts(array('src'=>'', 'attachment'=>'', 'title'=>'', 'category'=>'', 'card_type'=>'','align'=>'', 'show_type' => '', 'link'=>'', 'linka'=>'', 'linkb'=>'', 'linkc'=>'', 'target'=>'no'), $atts));\n\n $alt = $title;\n\n $slidenum = $counter+1;\n $slidedisplaynum = $slidenum;\n if ($counter<10) {\n $slidenumdisplaynum = \"0\".$slidenum;\n }\n\n\n\n $output .='
';\n if (!empty($src)) {\n if(is_numeric($src)) {\n $output .= '
';\n if($swedenUnlimited['client']->isPhone)\n \t// get phone image\n \t$output .= wp_get_attachment_image($src, 'small-thumbnail');\n else if($swedenUnlimited['client']->isTablet)\n \t// get tablet image\n \t$output .= wp_get_attachment_image($src, 'small-thumbnail');\n else\n \t$output.= wp_get_attachment_image($src, 'small-thumbnail');\n $output .= '
';\n // can't remove this attachment because of old data input. :S grrrr..\n } else if($attachment) {\n \t$output .= '
';\n \tif($swedenUnlimited['client']->isPhone)\n \t\t// get phone image\n \t\t$output .= wp_get_attachment_image($attachment, 'small-thumbnail');\n \telse if($swedenUnlimited['client']->isTablet)\n \t\t// get tablet image\n \t\t$output .= wp_get_attachment_image($attachment, 'small-thumbnail');\n \telse\n \t\t$output.= wp_get_attachment_image($attachment, 'small-thumbnail');\n \t$output .= '
';\n } else {\n \t// if we don't get the attachment\n \t// image is from outside of wordpress or it's default image.\n \t// so no need to hit the db server again here\n \t/*\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $src ));\n $output .='
'. wp_get_attachment_image($attachment[0],'small-thumbnail') .'
';\n */\n $output .='
';\n }\n }\n $output .='
';\n\n return $output;\n }\n\n /**\n * Related Article Content Handler (when user makes the last slide a related article)\n *\n * @param array $atts array of attributes\n * @param string $content text within enclosing form of shortcode element\n * @param string $shortcodename the shortcode found, when == callback name\n * @return string $output returns the modified html string\n */\n\n protected function related_article_content($atts, $content = \"\", $counter) {\n $title = \"\";\n extract(shortcode_atts(array('src'=>'', 'attachment'=>'', 'title'=>'', 'category'=>'', 'card_type'=>'','align'=>'', 'linka' => '', 'linkb' => '', 'linkc' => '', 'link'=>'', 'target'=>'no', 'show_type' => ''), $atts));\n \n $alt = $title;\n $pId = explode(',', $linka);\n\n $que = array();\n $class = \" \";\n $output = \"\";\n $out_output = \"\";\n $i = 0;\n\n // ugly...I know. will be updated once all test is done.\n if ($show_type == '3cols') {\n \tif($pId[2] == '' || $pId[3] == '') {\n \t\t$queB = explode(',', $linkb);\n \t\t$queC = explode(',', $linkc);\n \t\t$pId[2] = $queB[1];\n \t\t$pId[3] = $queC[1];\n \t}\n $que = array($pId[1], $pId[2], $pId[3]);\n $output .= \"