query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
this function gets the listings of services in table format
function makeServiceList() { $dbMain = $this->dbconnect(); $stmt = $dbMain ->prepare("SELECT service_key, service_type, club_id FROM service_info WHERE service_key ='$this->serviceKey' AND group_type ='$this->groupType'"); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($service_key, $service_type, $club_id); while ($stmt->fetch()) { // echo"$service_key $service_type <br>"; $result = $dbMain -> query("SELECT club_name FROM club_info WHERE club_id = '$club_id'"); $row = mysqli_fetch_array($result, MYSQLI_NUM); $service_location = $row[0]; if($club_id == "0") { $service_location = 'All Locations'; } $this->serviceType = $service_type; /* //create color rows static $cell_count = 1; if($cell_count == 2) { $color = "#D8D8D8"; $color2 = "D8D8D8"; $cell_count = ""; }else{ $color = "#FFFFFF"; $color2 = "FFFFFF"; } $cell_count = $cell_count + 1; //$this->cellCount++; */ $comp_type_a="comp_type$this->groupType$this->cellCount"; $comp_type_b ='[]'; $comp_type ="$comp_type_a$comp_type_b"; $comp_a ="comp$this->groupType$this->cellCount"; $comp_b ='[]'; $comp = "$comp_a$comp_b"; $this->getTerms($service_key, $comp_type, $comp_a); //f the service month exiss in the available upgrades it allows it to print if($this->termsArray != null) { $terms = explode("|", $this->termsArray); $term1 = $terms[0]; $term2 = $terms[1]; $term3 = $terms[2]; $term4 = $terms[3]; $this->termsArray = null; //this sets up the renewal rate if it is a class or a date string $checkString = "$term1 $term2 $term3 $term4"; if(preg_match("/Class\(s\)/", $checkString)) { $disabled = 'disabled="disabled"'; $rate_value = 'NA'; }else{ $disabled = null; $rate_value = null; } //create color rows static $cell_count = 1; if($cell_count == 2) { $color = "#D8D8D8"; $color2 = "D8D8D8"; $cell_count = ""; }else{ $color = "#FFFFFF"; $color2 = "FFFFFF"; } $cell_count = $cell_count + 1; $records ="<tr id=\"a$i\" style=\"background-color: $color\"> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$this->cellCount.</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$service_type<br><span class=\"locationColor\">$service_location</span></b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term1</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term2</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term3</b></font></td> <td align=\"left\" valign =\"top\"><font face=\"Arial\" size=\"1\" color=\"black\"><b>$term4</b></font></td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"\" size=\"8\" maxlength=\"8\" disabled=\"disabled\" onClick=\"return fieldChange(this.value, '$this->cellCount$this->groupType', this.name);\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"$rate_value\" size=\"8\" maxlength=\"8\" $disabled onClick=\"return fieldChange2(this.value, this.name)\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"text\" name=\"$comp\" id=\"$comp_a\" value=\"$rate_value\" size=\"8\" maxlength=\"8\" disabled=\"disabled\"/ > </td> <td align=\"left\" valign =\"top\"><input type=\"button\" name=\"save1\" value=\"Clear\" onClick=\"clearRowGroup('$comp_type','$comp','$this->cellCount$this->groupType')\"/> </td> </tr> "; $this->cellCount++; $this->cellRows++; } $checkString = null; } //this sets up the number of rows of a grouptype and creates the summary divs to delete in javascript switch($this->groupType) { case"S": $this->singleRows = $this->cellCount-1; $this->singleSummaryDivs= $this->createSummaryDivs($this->singleRows, $this->groupType); break; case"F": $this->familyRows = $this->cellRows-1; $this->familySummaryDivs= $this->createSummaryDivs($this->familyRows, $this->groupType); break; case"B": $this->businessRows = $this->cellRows-1; $this->businessSummaryDivs= $this->createSummaryDivs($this->businessRows, $this->groupType); break; case"O": $this->organizationRows = $this->cellRows-1; $this->organizationSummaryDivs= $this->createSummaryDivs($this->organizationRows, $this->groupType); break; } return "$records"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderServicesList() {}", "function getServices() {\n\t\t$results = \"\";\n\t\t$sql = 'SELECT * FROM Service';\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "function service_list_json(){\r\n\t\t\t$aColumns = array( 'sl','branch','invoice','date','type','customer','net_amount','action' );\r\n\t\t\t\r\n\t\t\t//Array of database search columns//\r\n\t\t\t$sColumns = array('customer','invoice','net_amount');\r\n\t\t\t\r\n\t\t\t//Indexed column (used for fast and accurate table attributes) //\r\n\t\t\t$sIndexColumn = \"service_id\";\r\n\t\t\t\r\n\t\t\t//DB tables to use//\r\n\t\t\t$sTable = \"tbl_service \r\n\t\t\t\t\t INNER JOIN tbl_branch ON service_branch=branch_id\r\n\t\t\t\t\t INNER JOIN tbl_payment_method ON service_type=payment_method_id\r\n\t\t\t\t\t INNER JOIN tbl_customer ON service_customer=customer_id\";\r\n\t\t\t\r\n\t\t\t//Paging//\r\n\t\t\t$sLimit = \"\";\r\n\t\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\r\n\t\t\t{\r\n\t\t\t\t$sLimit = \"LIMIT \".( $_GET['iDisplayStart'] ).\", \".\r\n\t\t\t\t\t( $_GET['iDisplayLength'] );\r\n\t\t\t}\r\n\t\r\n\t\t\t//Ordering//\r\n\t\t\tif ( isset( $_GET['iSortCol_0'] ) )\r\n\t\t\t{\r\n\t\t\t\t$sOrder = \"ORDER BY \";\r\n\t\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\"\r\n\t\t\t\t\t\t\t\".( $_GET['sSortDir_'.$i] ) .\", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\r\n\t\t\t\tif ( $sOrder == \"ORDER BY\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$sOrder = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//Filtering//\r\n\t\t\t$sWhere = \"\";\r\n\t\t\tif ( $_GET['sSearch'] != \"\" )\r\n\t\t\t{\r\n\t\t\t\t$sWhere = \"WHERE (\";\r\n\t\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".( $_GET['sSearch'] ).\"%' OR \";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\r\n\t\t\t\t$sWhere .= ')';\r\n\t\t\t}\r\n\t\r\n\t\t\t//Individual column filtering//\r\n\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t{\r\n\t\t\t\tif ( $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $sWhere == \"\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere = \"WHERE \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere .= \" AND \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".($_GET['sSearch_'.$i]).\"%' \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//SQL queries//\r\n\t\t\t$sQuery\t\t\t= \"SELECT SQL_CALC_FOUND_ROWS service_id as sl,branch_name as branch,service_invoice as invoice,\r\n\t\t\t\t\t\t\tDATE_FORMAT(service_date,'%d/%m/%Y') as date,payment_method_title as type,\r\n\t\t\t\t\t\t\tcustomer_name as customer,service_amount as amount,service_tax as tax,service_discount as discount,\r\n\t\t\t\t\t\t\tservice_total as total,service_net_amount as net_amount,service_id as id,\r\n\t\t\t\t\t\t\tservice_status as status\r\n\t\t\t\t\t\t\tFROM $sTable\r\n\t\t\t\t\t\t\t$sWhere\r\n\t\t\t\t\t\t\t$sOrder\r\n\t\t\t\t\t\t\t$sLimit\";\r\n\t\t\t$rResult \t\t= $this->db->query($sQuery);\r\n\t\r\n\t\t\t//Data set length after filtering//\r\n\t\t\t$fQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable $sWhere\";\r\n\t\t\t$fResult\t\t= $this->db->query($fQuery);\r\n\t\t\t$FilteredTotal\t= $fResult->num_rows();\r\n\t\r\n\t\t\t//Total data set length //\r\n\t\t\t$tQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable\";\r\n\t\t\t$tResult\t\t= $this->db->query($tQuery);\r\n\t\t\t$Total\t\t\t= $tResult->num_rows();\r\n\t\r\n\t\t\t//Output\r\n\t\t\t\r\n\t\t\tif($_GET['sEcho']==1){\r\n\t\t\t\t\r\n\t\t\t\t$cStart=0;\r\n\t\t\t\t$cEnd=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=0;\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$cStart=$_GET['iDisplayStart'];\r\n\t\t\t\t$cEnd=$_GET['iDisplayStart']=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=intval($cStart/$cLength);\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\t$output = array(\r\n\t\t\t\t\"cStart\"\t\t\t\t=> $cStart,\r\n\t\t\t\t\"cEnd\"\t\t\t\t\t=> $cEnd,\r\n\t\t\t\t\"cLength\"\t\t\t\t=> $cLength,\r\n\t\t\t\t\"cPage\"\t\t\t\t\t=> $cPage,\r\n\t\t\t\t\"cTotalPage\"\t\t\t=> $cTotalPage,\r\n\t\t\t\t\"sEcho\" \t\t\t\t=> intval($_GET['sEcho']),\r\n\t\t\t\t\"iTotalRecords\" \t\t=> $Total,\r\n\t\t\t\t\"iTotalDisplayRecords\" \t=> $FilteredTotal,\r\n\t\t\t\t\"aaData\" \t\t\t\t=> array()\r\n\t\t\t);\r\n\t\t\t$result\t= $rResult->result_array();\r\n\t\t\t$j=$cStart+1;\r\n\t\t\tforeach($result as $aRow){\r\n\t\t\t\t\r\n\t\t\t\t$row = array();\r\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( $aColumns[$i] == \"sl\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$row[] = $j;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//else if($aColumns[$i] == \"amount\"){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//if(PR_TAX_INCLUDE){\r\n\t\t\t\t\t\t\t//$row[]=$aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//else{\r\n\t\t\t\t\t\t\t//$row[]=number_format($aRow[ $aColumns[$i] ]+ $aRow['pr_tax_amount'],DECIMAL_DIGITS);\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\t\t\t\t\telse if( $aColumns[$i] == \"status\" ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$row[] = \"<button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Extra Small Button</button>\";\r\n\t\t\t\t\t\t$row[] = $this->Common_model->status_template($aRow['status']);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if( $aColumns[$i] == \"action\" ){\r\n\t\t\t\t\t\t$id\t\t=$aRow['id'];\r\n\t\t\t\t\t\t//if($aRow['status']==2){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//$row[]\t= \"<a href='Purchase/purchase_confirm/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Confirm</button></a>\";\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//if($aRow['status']==5){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$row[]\t= \"<a href='Service/service_details/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Details</button></a>\";\r\n\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( $aColumns[$i] != ' ' )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// General output \r\n\t\t\t\t\t\t$row[] = $aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$output['aaData'][] = $row;\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo json_encode( $output );\r\n\t\t}", "public function getList()\n {\n $query = (new Query());\n $query->select(['services.id as id, services.name as name, COUNT(orders.id) as count'])\n ->from('services')\n ->rightJoin('orders', '`orders`.`service_id` = `services`.`id`');\n\n $this->filter($query);\n\n return $query->groupBy('orders.service_id')\n ->all();\n }", "function draw_servicestatus_table()\n{ $meta_pref_option = 'servicestatus_table_options';\n\n // defaults\n //$sortby=\"host_name:a,service_description\";\n $sortby = \"\";\n $sortorder = \"asc\";\n $page = 1;\n $records = 15;\n $search = \"\";\n\n // default to use saved options\n $s = get_user_meta(0, $meta_pref_option);\n $saved_options = unserialize($s);\n if (is_array($saved_options)) {\n if (isset($saved_options[\"sortby\"]))\n $sortby = $saved_options[\"sortby\"];\n if (isset($saved_options[\"sortorder\"]))\n $sortorder = $saved_options[\"sortorder\"];\n if (isset($saved_options[\"records\"]))\n $records = $saved_options[\"records\"];\n //if(array_key_exists(\"search\",$saved_options))\n //$search=$saved_options[\"search\"];\n }\n //echo \"SAVED OPTIONS: \";\n //print_r($saved_options);\n\n // grab request variables\n $show = grab_request_var(\"show\", \"services\");\n $host = grab_request_var(\"host\", \"\");\n $hostgroup = grab_request_var(\"hostgroup\", \"\");\n $servicegroup = grab_request_var(\"servicegroup\", \"\");\n $hostattr = grab_request_var(\"hostattr\", 0);\n $serviceattr = grab_request_var(\"serviceattr\", 0);\n $hoststatustypes = grab_request_var(\"hoststatustypes\", 0);\n $servicestatustypes = grab_request_var(\"servicestatustypes\", 0);\n\n // fix for \"all\" options\n if ($hostgroup == \"all\")\n $hostgroup = \"\";\n if ($servicegroup == \"all\")\n $servicegroup = \"\";\n if ($host == \"all\")\n $host = \"\";\n\n $sortby = grab_request_var(\"sortby\", $sortby);\n $sortorder = grab_request_var(\"sortorder\", $sortorder);\n $records = grab_request_var(\"records\", $records);\n $page = grab_request_var(\"page\", $page);\n $search = trim(grab_request_var(\"search\", $search));\n if ($search == _(\"Search...\"))\n $search = \"\";\n\n // save options for later\n $saved_options = array(\n \"sortby\" => $sortby,\n \"sortorder\" => $sortorder,\n \"records\" => $records,\n //\"search\" => $search\n );\n $s = serialize($saved_options);\n set_user_meta(0, $meta_pref_option, $s, false);\n\n\n $output = '';\n\n $output .= \"<form action='\" . get_base_url() . \"includes/components/xicore/status.php'>\";\n $output .= \"<input type='hidden' name='show' value=\\\"\" . encode_form_val($show) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='sortby' value=\\\"\" . encode_form_val($sortby) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='sortorder' value=\\\"\" . encode_form_val($sortorder) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='host' value=\\\"\" . encode_form_val($host) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='hostgroup' value=\\\"\" . encode_form_val($hostgroup) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='servicegroup' value=\\\"\" . encode_form_val($servicegroup) . \"\\\">\\n\";\n\n $output .= '<div class=\"servicestatustablesearch\">';\n\n $output .= '\n <input type=\"text\" size=\"15\" name=\"search\" id=\"hostsearchBox\" value=\"\" class=\"form-control condensed\" placeholder=\"'._('Search').'...\">\n <button type=\"submit\" class=\"btn btn-xs btn-default\" name=\"searchButton\" id=\"searchButton\"><i class=\"fa fa-search\"></i></button>\n </div>\n </form>';\n\n // ajax updater args\n $ajaxargs = array();\n $ajaxargs[\"host\"] = $host;\n $ajaxargs[\"hostgroup\"] = $hostgroup;\n $ajaxargs[\"servicegroup\"] = $servicegroup;\n $ajaxargs[\"sortby\"] = $sortby;\n $ajaxargs[\"sortorder\"] = $sortorder;\n $ajaxargs[\"records\"] = $records;\n $ajaxargs[\"page\"] = $page;\n $ajaxargs[\"search\"] = $search;\n $ajaxargs[\"hostattr\"] = $hostattr;\n $ajaxargs[\"serviceattr\"] = $serviceattr;\n $ajaxargs[\"hoststatustypes\"] = $hoststatustypes;\n $ajaxargs[\"servicestatustypes\"] = $servicestatustypes;\n\n $id = \"servicestatustable_\" . random_string(6);\n\n $output .= \"<div class='servicestatustable' id='\" . $id . \"'>\\n\";\n $output .= get_throbber_html();\n $output .= \"</div>\";\n\n // build args for javascript\n $n = 0;\n $jargs = \"{\";\n foreach ($ajaxargs as $var => $val) {\n if ($n > 0)\n $jargs .= \", \";\n $jargs .= \"\\\"\" . encode_form_val($var) . \"\\\" : \\\"\" . encode_form_val($val) . \"\\\"\";\n $n++;\n }\n $jargs .= \"}\";\n\n // ajax updater\n $output .= '\n <script type=\"text/javascript\">\n $(document).ready(function(){\n \n get_' . $id . '_content();\n \n $(\"#' . $id . '\").everyTime(30*1000, \"timer-' . $id . '\", function(i) {\n get_' . $id . '_content();\n });\n \n function get_' . $id . '_content(){\n $(\"#' . $id . '\").each(function(){\n var optsarr = {\n \"func\": \"get_servicestatus_table\",\n \"args\": ' . $jargs . '\n }\n var opts=array2json(optsarr);\n get_ajax_data_innerHTML(\"getxicoreajax\",opts,true,this);\n });\n }\n\n });\n </script>\n ';\n\n //return $output;\n echo $output;\n}", "function listServices()\n{\n global $LANG_ADMIN, $LANG_TRB, $_CONF, $_IMAGE_TYPE, $_TABLES;\n\n require_once $_CONF['path_system'] . 'lib-admin.php';\n\n $retval = '';\n\n $header_arr = array( # display 'text' and use table field 'field'\n array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false),\n array('text' => $LANG_TRB['service'], 'field' => 'name', 'sort' => true),\n array('text' => $LANG_TRB['ping_method'], 'field' => 'method', 'sort' => true),\n array('text' => $LANG_TRB['service_ping_url'], 'field' => 'ping_url', 'sort' => true),\n array('text' => $LANG_ADMIN['enabled'], 'field' => 'is_enabled', 'sort' => false)\n );\n\n $defsort_arr = array('field' => 'name', 'direction' => 'asc');\n\n $menu_arr = array (\n array('url' => $_CONF['site_admin_url'] . '/trackback.php?mode=editservice',\n 'text' => $LANG_ADMIN['create_new']),\n array('url' => $_CONF['site_admin_url'],\n 'text' => $LANG_ADMIN['admin_home']));\n\n $retval .= COM_startBlock($LANG_TRB['services_headline'], '',\n COM_getBlockTemplate('_admin_block', 'header'));\n\n $retval .= ADMIN_createMenu(\n $menu_arr,\n $LANG_TRB['service_explain'],\n $_CONF['layout_url'] . '/images/icons/trackback.' . $_IMAGE_TYPE\n );\n\n $text_arr = array(\n 'has_extras' => true,\n 'form_url' => $_CONF['site_admin_url'] . '/trackback.php',\n 'help_url' => getHelpUrl() . '#ping'\n );\n\n $query_arr = array(\n 'table' => 'pingservice',\n 'sql' => \"SELECT * FROM {$_TABLES['pingservice']} WHERE 1=1\",\n 'query_fields' => array('name', 'ping_url'),\n 'default_filter' => \"\",\n 'no_data' => $LANG_TRB['no_services']\n );\n\n // this is a dummy variable so we know the form has been used if all services\n // should be disabled in order to disable the last one.\n $form_arr = array('bottom' => '<input type=\"hidden\" name=\"serviceChanger\" value=\"true\"' . XHTML . '>');\n\n $retval .= ADMIN_list('pingservice', 'ADMIN_getListField_trackback',\n $header_arr, $text_arr, $query_arr, $defsort_arr,\n '', SEC_createToken(), '', $form_arr);\n $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));\n\n if ($_CONF['trackback_enabled']) {\n $retval .= freshTrackback ();\n }\n if ($_CONF['pingback_enabled']) {\n $retval .= freshPingback ();\n }\n\n return $retval;\n}", "public function all_service_info(){\r\n $query = \"SELECT * FROM tbl_aboutus_service WHERE publication_status = 1 ORDER BY service_id DESC LIMIT 6\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function get_all_services_listing($data) {\n $this->db->select('*');\n $this->db->from('business_programs');\n $this->db->where('business_id', $data->business_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $details = array();\n foreach ($query_result as $result) {\n $this->db->select('business_services.*,business_services_details.*');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services.id = business_services_details.service_id');\n $this->db->where('business_services.program_id', $result->id);\n $query1 = $this->db->get();\n $query_result1 = $query1->result();\n array_push($details, $query_result1);\n }\n\n return $details;\n }", "function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function service_detail_list_json(){\r\n\t\t\t$aColumns = array( 'sl','service_title','unit_rate','qty','amount','tax','tax_amount','discount','total' );\r\n\t\t\t\r\n\t\t\t//Array of database search columns//\r\n\t\t\t$sColumns = array('service_title','qty','total');\r\n\t\t\t\r\n\t\t\t//Indexed column (used for fast and accurate table attributes) //\r\n\t\t\t$sIndexColumn = \"service_item_id\";\r\n\t\t\t\r\n\t\t\t//DB tables to use//\r\n\t\t\t$sTable = \"tbl_service_item \r\n\t\t\t\t\t INNER JOIN tbl_service ON service_item_service=service_id\r\n\t\t\t\t\t INNER JOIN tbl_service_head ON service_item_head=service_head_id\r\n\t\t\t\t\t INNER JOIN tbl_tax ON service_item_tax_id=tax_id\";\r\n\t\t\t\r\n\t\t\t//Paging//\r\n\t\t\t$sLimit = \"\";\r\n\t\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\r\n\t\t\t{\r\n\t\t\t\t$sLimit = \"LIMIT \".( $_GET['iDisplayStart'] ).\", \".\r\n\t\t\t\t\t( $_GET['iDisplayLength'] );\r\n\t\t\t}\r\n\t\r\n\t\t\t//Ordering//\r\n\t\t\tif ( isset( $_GET['iSortCol_0'] ) )\r\n\t\t\t{\r\n\t\t\t\t$sOrder = \"ORDER BY \";\r\n\t\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\"\r\n\t\t\t\t\t\t\t\".( $_GET['sSortDir_'.$i] ) .\", \";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\r\n\t\t\t\tif ( $sOrder == \"ORDER BY\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$sOrder = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//Filtering//\r\n\t\t\t$sWhere = \"\";\r\n\t\t\tif ( $_GET['sSearch'] != \"\" )\r\n\t\t\t{\r\n\t\t\t\t$sWhere = \"WHERE (\";\r\n\t\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".( $_GET['sSearch'] ).\"%' OR \";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\r\n\t\t\t\t$sWhere .= ')';\r\n\t\t\t}\r\n\t\r\n\t\t\t//Individual column filtering//\r\n\t\t\tfor ( $i=0 ; $i<count($sColumns) ; $i++ )\r\n\t\t\t{\r\n\t\t\t\tif ( $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( $sWhere == \"\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere = \"WHERE \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$sWhere .= \" AND \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sWhere .= $sColumns[$i].\" LIKE '%\".($_GET['sSearch_'.$i]).\"%' \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t//SQL queries//\r\n\t\t\t$sQuery\t\t\t= \"SELECT SQL_CALC_FOUND_ROWS service_item_id as sl,service_head_title as service_title,service_item_unit_rate as unit_rate,\r\n\t\t\t\t\t\t\tservice_item_qty as qty,service_item_amount as amount,tax_name as tax,tax_percentage as tax_perc,\r\n\t\t\t\t\t\t\tservice_item_tax_amount as tax_amount,service_item_discount_amt as discount,service_item_total as total,service_item_id as id\r\n\t\t\t\t\t\t\tFROM $sTable\r\n\t\t\t\t\t\t\t$sWhere\r\n\t\t\t\t\t\t\t$sOrder\r\n\t\t\t\t\t\t\t$sLimit\";\r\n\t\t\t$rResult \t\t= $this->db->query($sQuery);\r\n\t\r\n\t\t\t//Data set length after filtering//\r\n\t\t\t$fQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable $sWhere\";\r\n\t\t\t$fResult\t\t= $this->db->query($fQuery);\r\n\t\t\t$FilteredTotal\t= $fResult->num_rows();\r\n\t\r\n\t\t\t//Total data set length //\r\n\t\t\t$tQuery\t\t\t= \"SELECT $sIndexColumn FROM $sTable\";\r\n\t\t\t$tResult\t\t= $this->db->query($tQuery);\r\n\t\t\t$Total\t\t\t= $tResult->num_rows();\r\n\t\r\n\t\t\t//Output\r\n\t\t\t\r\n\t\t\tif($_GET['sEcho']==1){\r\n\t\t\t\t\r\n\t\t\t\t$cStart=0;\r\n\t\t\t\t$cEnd=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=0;\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$cStart=$_GET['iDisplayStart'];\r\n\t\t\t\t$cEnd=$_GET['iDisplayStart']=$_GET['iDisplayLength'];\r\n\t\t\t\t$cLength=$_GET['iDisplayLength'];\r\n\t\t\t\t$cPage=intval($cStart/$cLength);\r\n\t\t\t\t$cTotalPage=ceil($FilteredTotal/$_GET['iDisplayLength']);\r\n\t\t\t}\r\n\t\t\t$output = array(\r\n\t\t\t\t\"cStart\"\t\t\t\t=> $cStart,\r\n\t\t\t\t\"cEnd\"\t\t\t\t\t=> $cEnd,\r\n\t\t\t\t\"cLength\"\t\t\t\t=> $cLength,\r\n\t\t\t\t\"cPage\"\t\t\t\t\t=> $cPage,\r\n\t\t\t\t\"cTotalPage\"\t\t\t=> $cTotalPage,\r\n\t\t\t\t\"sEcho\" \t\t\t\t=> intval($_GET['sEcho']),\r\n\t\t\t\t\"iTotalRecords\" \t\t=> $Total,\r\n\t\t\t\t\"iTotalDisplayRecords\" \t=> $FilteredTotal,\r\n\t\t\t\t\"aaData\" \t\t\t\t=> array()\r\n\t\t\t);\r\n\t\t\t$result\t= $rResult->result_array();\r\n\t\t\t$j=$cStart+1;\r\n\t\t\tforeach($result as $aRow){\r\n\t\t\t\t\r\n\t\t\t\t$row = array();\r\n\t\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( $aColumns[$i] == \"sl\" )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$row[] = $j;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//else if($aColumns[$i] == \"amount\"){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//if(PR_TAX_INCLUDE){\r\n\t\t\t\t\t\t\t//$row[]=$aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//else{\r\n\t\t\t\t\t\t\t//$row[]=number_format($aRow[ $aColumns[$i] ]+ $aRow['pr_tax_amount'],DECIMAL_DIGITS);\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//else if( $aColumns[$i] == \"status\" ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$row[] = \"<button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Extra Small Button</button>\";\r\n\t\t\t\t\t\t//$row[] = $this->Common_model->status_template($aRow['status']);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//else if( $aColumns[$i] == \"action\" ){\r\n\t\t\t\t\t\t//$id\t\t=$aRow['id'];\r\n\t\t\t\t\t\t//if($aRow['status']==2){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//$row[]\t= \"<a href='Purchase/purchase_confirm/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Confirm</button></a>\";\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t//if($aRow['status']==5){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//$row[]\t= \"<a href='Service/service_details/$id/' class='on-default edit-row edit-icon'><button type='button' style='margin-top:-5px; margin-bottom:-5px;' class='btn btn-xs btn-primary'>Details</button></a>\";\r\n\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//}\r\n\t\t\t\t\telse if ( $aColumns[$i] != ' ' )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// General output \r\n\t\t\t\t\t\t$row[] = $aRow[ $aColumns[$i] ];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$output['aaData'][] = $row;\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo json_encode( $output );\r\n\t\t}", "function AllServices(){\n return $this->db->get($this->service)->result();\n }", "function get_service_list() {\n\t\tglobal $wpdb;\n\t\t\n\t\t$services = $wpdb->get_results( \n\t\t\t\"\n\t\t\tSELECT ID, Title\n\t\t\tFROM cp_Categories\n\t\t\tWHERE 1\n\t\t\t\",\n\t\t\tARRAY_A\n\t\t);\n\t\t\n\t\treturn $services;\n\t}", "public function getServices()\n\t\t{\n\n\t\t\t$service_id = $this->input->get('service_id') ;\n\t\t\techo json_encode($this->mdl_services->all()->result() ) ;\n\t\t}", "public function tableList()\n {\n $list = (self::MODEL)::orderBy('clientes.created_at', 'DESC');\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ClientTransformer::tableList($list));\n }", "public function listsServicesGet()\r\n {\r\n $response = Services::with('regimen')->get();\r\n return response()->json($response,200);\r\n }", "public function tableList()\n {\n $list = (self::MODEL)::with(['cliente', 'endereco'])\n ->join('clientes', 'clientes.id', '=', 'pedidos.cliente_id')\n ->leftJoin('pedido_notas', 'pedido_notas.pedido_id', '=', 'pedidos.id')\n ->orderBy('pedidos.created_at', 'DESC');\n\n $list = $this->handleRequest($list);\n\n return $this->listResponse(OrderTransformer::tableList($list));\n }", "public function viewservice(){\n\t\t\tif(isset($this->service_id)){\n\t\t\t\t $this->sql=\"SELECT * FROM tbl_service WHERE service_id='$this->service_id'\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t$this->sql=\"SELECT * FROM tbl_service ORDER BY service_id DESC\";\n\t\t\t\n\t\t\t}\n\t\t\t$this->res=mysqli_query($this->conxn,$this->sql) or trigger_error($this->err=mysqli_error($this->conxn));\n\t\t\t$this->numRows=mysqli_num_rows($this->res);// or trigger_error($this->err=mysqli_error($this->conxn));\n\t\t\t$this->data=array();\n\t\t\t\n\t\t\tif($this->numRows>0){\n\t\t\t\twhile($this->row=mysqli_fetch_assoc($this->res)){\n\t\t\t\t\tarray_push($this->data,$this->row);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\treturn $this->data;\n\t\t\n}", "function getServices() {\n $sql = 'SELECT * FROM services';\n\n $results = mysqli_query($GLOBALS['con'], $sql);\n\n if (mysqli_num_rows($results) > 0) {\n return $results;\n }\n }", "public function buildDefaultCostTables() {\n\t\t// Get services table data\n\t\t$service_list = new ServicesInfo;\n\t\t$service_list = $service_list->getServicesTableData($id_list = NULL); // Note that the sizeof($service_data) == 8\n\t\t$cost_table_array = array();\n\t\tforeach ($service_list as $value) {\n\t\t\t$cost_table_array[$value['svc_name']][] = array('svc_id' => $value['svc_id'], 'svc_name' => '', 'cost_desc' => '', 'cost_code' => '', 'cost_ro_count' => '', 'cost_parts_sale' => '', 'cost_parts_cost' => '', 'cost_labor_sale' => '');\n\t\t}\n\t\treturn $cost_table_array;\n\t}", "public function get_servicios(){\n\t\t$query = $this->db->get('servicios');\n\t\treturn $query->result_array();\n\t}", "public function getListOfTables() {}", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "private function _getServiceList()\n {\n Modules_CustomServices_DataLayer::init();\n $configs = Modules_CustomServices_DataLayer::loadServiceConfigurations();\n\n // Configs are objects, but the list view needs associative arrays.\n $config_to_array = function($config) {\n return [\n 'name' => '<a href=\"' . htmlspecialchars(pm_Context::getActionUrl('index', 'view') . '/id/' . urlencode($config->unique_id)) . '\">' . htmlspecialchars($config->display_name) . '</a>',\n 'type' => self::_configTypeName($config->config_type),\n 'plesk_service_id' => '<code>' . htmlspecialchars('ext-' . pm_Context::getModuleId() . '-' . $config->unique_id) . '</code>',\n 'run_as_user' => $config->run_as_user\n ];\n };\n $data = array_map($config_to_array, $configs);\n\n // Prepare the list for presentation.\n $list = new pm_View_List_Simple($this->view, $this->_request);\n $list->setData($data);\n $list->setColumns([\n 'name' => [\n 'title' => 'Name',\n 'noEscape' => TRUE,\n 'searchable' => TRUE,\n 'sortable' => TRUE\n ],\n 'type' => [\n 'title' => 'Type',\n 'noEscape' => FALSE,\n 'searchable' => FALSE,\n 'sortable' => FALSE\n ],\n 'plesk_service_id' => [\n 'title' => 'Service ID',\n 'noEscape' => TRUE,\n 'searchable' => TRUE,\n 'sortable' => FALSE\n ],\n 'run_as_user' => [\n 'title' => 'System user',\n 'noEscape' => FALSE,\n 'searchable' => TRUE,\n 'sortable' => TRUE\n ]\n ]);\n $list->setDataUrl(['action' => 'list-data']);\n $list->setTools([\n [\n 'title' => 'Add service (simple)',\n 'description' => 'Add a new service that wraps a process',\n 'class' => 'sb-add-new',\n 'link' => pm_Context::getActionUrl('index', 'add') . '/type/process'\n ],\n [\n 'title' => 'Add service (manual)',\n 'description' => 'Add a new manually controlled service',\n 'class' => 'sb-add-new',\n 'link' => pm_Context::getActionUrl('index', 'add') . '/type/manual'\n ]\n ]);\n return $list;\n }", "public function listTable()\n {\n // Searching the data\n $places = Place::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'places' => $places,\n ];\n\n //dd($data);\n\n return $data;\n }", "public function get_service_head(){\r\n\t\t\r\n\t\t$data['results']=$this->Common_model->get_service_head();\r\n\t\techo json_encode($data);\r\n\t}", "function serviceList(&$smartyServiceList,$abcBar=false,$searchBox=false,$topList=false) {\n\t\t//\tfunction makeServiceListQuery($char=all,$limit=true,$count=false) {\n\t\t$query = $this->makeServiceListQuery($this->piVars['char']);\n\t\tif (!$query) {\n\t\t\treturn false;\n\t\t}\n\t\t$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);\n\n\t\t$row_counter = 0;\n\n\t\t// WS-VERSIONING: collect all new records and place them at the beginning of the array!\n\t\t// the new records have no name in live-space and therefore would be delegated\n\t\t// to the very end of the list through the order by clause in function makeServiceListQuery....\n\t\t$eleminated_rows=0;\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))\t{\n\t\t\t// WS-VERSIONING: get the Preview from the Core!!!!\n\t\t\t// copied from tt_news\n\t\t\t// the function versionOL() in /t3lib/class.t3lib_page.php does\n\t\t\t// the rendering of the version records for preview.\n\t\t\t// i.e. a new, not yet published record has the name ['PLACEHOLDER'] and is hidden in live-workspace,\n\t\t\t// class.t3lib_page.php replaces the fields in question with content from its\n\t\t\t// version-workspace-equivalent for preview purposes!\n\t\t\t// for it to work the result must also contain the records from live-workspace which carry the hidden-flag!!!\n\t\t\tif ($this->versioningEnabled) {\n\t\t\t\t// remember: versionOL generates field-list and cannot handle aliases!\n\t\t\t\t// i.e. there must not be any aliases in the query!!!\n\t\t\t\t$GLOBALS['TSFE']->sys_page->versionOL('tx_civserv_service',$row);\n\n\t\t\t\tif($this->previewMode){\n\t\t\t\t\t$row['realname']=$row['sv_name'];\n\t\t\t\t\t$row['name']=$row['realname'];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif(is_array($row)){\n\t\t\t\t$services[$row_counter]['uid']=$row['uid']; //needed for preview-sorting see below\n\t\t\t\t$services[$row_counter]['t3ver_state']=$row['t3ver_state'];\n\t\t\t\t$services[$row_counter]['fe_group']=$row['fe_group'];\n\t\t\t\t// customLinks will only work if there is an according rewrite-rule in action!!!!\n\t\t\t\tif(!$this->conf['useCustomLinks_Services']){\n\t\t\t\t\t$services[$row_counter]['link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'service',id => $row['uid']),$this->conf['cache_services'],1));\n\t\t\t\t}else{\n\t\t\t\t\t$services[$row_counter]['link'] = strtolower($this->convert_plus_minus(urlencode($this->replace_umlauts($this->strip_extra($row['realname'].\"_\".$row['uid']))))).\".html\";\n\t\t\t\t}\n\t\t\t\tif ($row['name'] == $row['realname']) {\n\t\t\t\t\t$services[$row_counter]['name'] = $row['name'];\n\t\t\t\t} else {\n\t\t\t\t\t// this will only happen in LIVE context\n\t\t\t\t\t$services[$row_counter]['name'] = $row['name'] . ' (= ' . $row['realname'] . ')';\n\t\t\t\t}\n\t\t\t\t// mark the version records for the FE, could be done by colour in template as well!\n\t\t\t\tif($row['_ORIG_pid']==-1 && $row['t3ver_state']==0){ // VERSION records\n\t\t\t\t\t$services[$row_counter]['name'].=\" DRAFT: \".$row['uid'];\n\t\t\t\t\t$services[$row_counter]['preview']=1;\n\t\t\t\t}elseif($row['_ORIG_pid']==-1 && $row['t3ver_state']==-1){ // NEW records\n\t\t\t\t\t$services[$row_counter]['name'].=\" NEW: \".$row['uid'];\n\t\t\t\t\t$services[$row_counter]['preview']=1;\n\t\t\t\t}else{\n\t\t\t\t\t// LIVE!!\n\t\t\t\t\t#$services[$row_counter]['name'].= \" \".$row['uid'];\n\t\t\t\t}\n\n\n\t\t\t\t//for the online_service list we want form descr. and service picture as well.\n\t\t\t\tif($this->piVars['mode'] == \"online_services\"){\n\t\t\t\t\t$res_online_services = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t\t'tx_civserv_form.fo_descr,\n\t\t\t\t\t\t tx_civserv_service.sv_image,\n\t\t\t\t\t\t tx_civserv_service.sv_image_text',\n\t\t\t\t\t\t'tx_civserv_service',\n\t\t\t\t\t\t'tx_civserv_service_sv_form_mm',\n\t\t\t\t\t\t'tx_civserv_form',\n\t\t\t\t\t\t' AND tx_civserv_service.uid = ' . $row['uid'] .\n\t\t \t\t\t\t $this->cObj->enableFields('tx_civserv_form').\n\t\t\t\t\t\t' AND tx_civserv_form.fo_status >= 2',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\n\t\t\t\t\tif ($online_sv_row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_online_services) ) { //we only accept one online-form per service!!!!\n\t\t\t\t\t\t$imagepath = $this->conf['folder_organisations'] . $this->community['id'] . '/images/';\n\t\t\t\t\t\t#function getImageCode($image,$path,$conf,$altText)\t{\n\t\t\t\t\t\t$imageCode = $this->getImageCode($online_sv_row['sv_image'],$imagepath,$this->conf['service-image.'],$online_sv_row['sv_image_text']);\n\t\t\t\t\t\t$services[$row_counter]['descr']=$online_sv_row['fo_descr'];\n\t\t\t\t\t\t$services[$row_counter]['image']=$imageCode;\n\t\t\t\t\t\t$services[$row_counter]['image_text']=$online_sv_row['sv_image_text'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// highlight_external services in list view!! (works only if function makeServiceListQuery returns pid-value!)\n\t\t\t\t$mandant = t3lib_div::makeInstanceClassName('tx_civserv_mandant');\n\t\t\t\t$mandantInst = new $mandant();\n\t\t\t\t$service_community_id= $mandantInst->get_mandant($row['pid']);\n\t\t\t\t$service_community_name = $mandantInst->get_mandant_name($row['pid']);\n\t\t\t\tif($this->community['id'] != $service_community_id){\n\t\t\t\t\t$services[$row_counter]['name'] .= \" <i> - \".$service_community_name.\"</i>\";\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}else{\n\t\t\t\t// NULL-rows (obsolete)\n\t\t\t\t$eleminated_rows++;\n\t\t\t}\n\t\t} //end while\n\n\n\t\tif($this->previewMode){\n\t\t\t// we need to re_sort the services_array in order to incorporate the\n\t\t\t// new services which appear at the very end (due to \"order by name\" meets \"[PLACEHOLDER]\")\n\n\t\t\t#http://forum.jswelt.de/serverseitige-programmierung/10285-array_multisort.html\n\t\t\t#http://www.php.net/manual/en/function.array-multisort.php\n\t\t\t#http://de.php.net/array_multisort#AEN9158\n\n\t\t\t//found solution here:\n\t\t\t#http://www.php-resource.de/manual.php?p=function.array-multisort\n\n\t\t\t$lowercase_uids=array();\n\t\t\t//ATTENTION: multisort is case sensitive!!!\n\t\t\tfor($i=0; $i<count($services); $i++){\n\t\t\t\t$name=$services[$i]['name'];\n\t\t\t\t// service-name starts with lowercase letter\n\t\t\t\tif(strcmp(substr($name,0,1), strtoupper(substr($name,0,1)))>0){\n\t\t\t\t\t// make it uppercase\n\t\t\t\t\t$services[$i]['name']=strtoupper(substr($name,0,1)).substr($name,1,strlen($name));\n\t\t\t\t\t// remember which one it was you manipulated\n\t\t\t\t\t$lowercase_uids[]=$services[$i]['uid'];\n\t\t\t\t}\n\t\t\t\t$sortarray[$i] = $services[$i]['name'];\n\t\t\t}\n\n\t\t\t// DON'T! or else multisort won't work! (must be something about keys and indexes??)\n\t\t\t# natcasesort($sortarray);\n\n\t\t\t// $services is sorted by $sortarray as in SQL \"ordery by name\"\n\t\t\t// $sortarray itself gets sorted by multisort!!!\n\t\t\tif(is_array($sortarray) && count($sortarray)>0){\n\t\t\t\tarray_multisort($sortarray, SORT_ASC, $services);\n\t\t\t}\n\n\t\t\tfor($i=0; $i<count($services); $i++){\n\t\t\t\t$name=$services[$i]['name'];\n\t\t\t\t// reset the converted service-names to their initial value (lowercase first letter)\n\t\t\t\tif(in_array($services[$i]['uid'],$lowercase_uids)){\n\t\t\t\t\t$services[$i]['name']=strtolower(substr($name,0,1)).substr($name,1,strlen($name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Retrieve the service count\n\t\t$row_count = 0;\n\t\t//\tfunction makeServiceListQuery($char=all,$limit=true,$count=false) {\n\t\t$query = $this->makeServiceListQuery($this->piVars['char'],false,true);\n\t\t$res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db,$query);\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$row_count += $row['count(*)'];\n\t\t}\n\n\t\t$row_count = $row_count-$eleminated_rows;\n\t\t$this->internal['res_count'] = $row_count;\n\n\t\tif(!$this->previewMode){\n\t\t\t$this->internal['results_at_a_time']= $this->conf['services_per_page'];\n\t\t}else{\n\t\t\t$this->internal['results_at_a_time']=10000; //in Preview Mode we need ALL records - new ones from the end of the alphabethical list are to be included!!!\n\t\t}\n\n\t\t$this->internal['maxPages'] = $this->conf['max_pages_in_pagebar'];\n\n\n\t\t$smartyServiceList->assign('services', $services);\n\n\t\tif ($abcBar) {\n\t\t\t$query = $this->makeServiceListQuery(all,false);\n\t\t\t$smartyServiceList->assign('abcbar',$this->makeAbcBar($query));\n\t\t}\n\t\t$smartyServiceList->assign('heading',$this->getServiceListHeading($this->piVars['mode'],intval($this->piVars['id'])));\n\n\n\t\t// if the title is set here it will overwrite the value we want in the organisationDetail-View\n\t\t// but we do need it for circumstance and user_groups!\n\t\t$GLOBALS['TSFE']->page['title'] = $this->getServiceListHeading($this->piVars['mode'],intval($this->piVars['id']));\n\n\t\tif($this->piVars['char']>''){\n\t\t\t $GLOBALS['TSFE']->page['title'] .= ': '.$this->pi_getLL('tx_civserv_pi1_service_list.abc_letter','Letter').' '.$this->piVars['char'];\n\t\t}\n\n\t\tif ($searchBox) {\n\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t$smartyServiceList->assign('searchbox', $this->pi_list_searchBox('',true));\n\t\t}\n\n\t\tif ($topList) {\n\t\t\tif (!$this->calculate_top15($smartyServiceList,false,$this->conf['topCount'])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//test bk: the service_list template is being used by several modes, change the subheading in accordance with the modes!!!\n\t\tif($this->piVars['mode'] == 'organisation')$smartyServiceList->assign('subheading',$this->pi_getLL('tx_civserv_pi1_service_list.available_services','Here you find the following services'));\n\t\t$smartyServiceList->assign('pagebar',$this->pi_list_browseresults(true,'', ' '.$this->conf['abcSpacer'].' '));\n\n\t\treturn true;\n\t}", "public static function select_all_our_services()\n {\n $query = new Query;\n $services = $query->select(['core_products.*','core_product_categories.category_name','core_product_sub_categories.sub_category_name', 'core_product_models.model_name','core_product_categories.metric AS metric','core_product_images.*'])\n ->from('core_products')\n ->leftJoin('core_product_categories', 'core_product_categories.category_id=core_products.category_id')\n ->leftJoin('core_product_sub_categories', 'core_product_sub_categories.sub_category_id=core_products.sub_category_id')\n ->leftJoin('core_product_models', 'core_product_models.model_id=core_products.model_id')\n ->innerJoin('core_product_images', 'core_product_images.product_id=core_products.product_id')\n ->orderBy(['core_products.product_id' => SORT_DESC])\n ->groupBy('core_products.product_id')\n ->where(\"core_products.product_status = 1\")\n ->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->all();\n return $services;\n }", "public function service_listing() {\n // $user = array(\n // 'id' => encrypt($temp['id']),\n // 'email' => $temp['sClEmail'],\n // );\n \n $breadcrumbs = [['link' => \"/client-dashboard\", 'name' => \"Dashboard\"], ['name' => \"Service Listing\"]];\n\n $data = $this->getServiceData(\"all\", Auth::id());\n\n return view('/pages/client_user/client/client-service-listing',[\n 'breadcrumbs' => $breadcrumbs,\n // 'user'=> $user,\n ])->with(\"serviceList\", $data);\n }", "function services (){\n // \n //Get the selected destination \n if(isset($_REQUEST['attraction'])){\n $attraction=$_REQUEST['attraction'];\n }\n //\n //Die if no destination is provided\n else{\n throw new Exception(\"No attraction found\");\n }\n //\n //\n //return the attractions using the destination primary key\n $sql= $this->chk(\n \"SELECT \n services.services,\n services.name,\n attraction.attraction\n FROM \n services \n Inner Join \n atservice on atservice.services=services.services\n Inner Join\n attraction on atservice.attraction=attraction.attraction\n WHERE \n `attraction`.`attraction` = $attraction\"\n );\n // \n $service= $this->sqlData($sql);\n echo ($service); \n }", "public function actionserviceTypeListing()\n\t{\n ob_start();\n Yii::app()->theme='back'; \n $res=ServiceTypes::model()->findAll();\n //echo \"<pre>\";print_r($res);die;\n $this->render('servicetypelisting',array('list'=>$res));\n\t}", "private function GetServices($_list)\n\t{\n\t\t//Get Database\n\t\t$_database = $this->ConnectDatabase();\n\t\t//Create Data\n\t\t$_data = array($_list);\n\t\t//Call and return Database Function\n\t\treturn $this->CallDatabase(\n\t\t\t$_database,\n\t\t\t$_data,\n\t\t\tfunction($_pdo, $_parameters)\n\t\t\t{\n\t\t\t\t$_cond = '(' . $_parameters[0] . ')';\n\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tid,\n\t\t\t\t\t\tname\n\t\t\t\t\tFROM `Services`\n\t\t\t\t\tWHERE `id` IN \" . $_cond\n\t\t\t\t);\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\n\t\t\t\t$_data = array();\n\t\t\t\twhile ($_row = $_query->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t\tarray_push($_data, $_row);\n\t\t\t\t}\n\t\t\t\treturn $_data;\n\t\t\t}\n\t\t);\n }", "public function getServices() {\n $services = Service::active()->get()->toArray();\n $outputArray = array();\n if ($services) {\n foreach ($services as $key => $value) {\n $begin = new DateTime($value['start_date']);\n $end = new DateTime($value['end_date']);\n if ($value['service_type'] == 'daily') {\n\n $interval = DateInterval::createFromDateString('1 day');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#605ca8\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n if ($value['service_type'] == 'weekly') {\n\n $schedule = Schedule::where('service_id', $value['id'])->get()->toArray();\n\n $weekNumber = array();\n for ($i = 0; $i < count($schedule); $i++) {\n $weekNumber[] = $schedule[$i]['week_number'];\n }\n\n $interval = DateInterval::createFromDateString('1 day');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n if (in_array($dt->format(\"w\"), $weekNumber)) {\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#f012be\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n }\n\n if ($value['service_type'] == 'monthly') {\n $interval = DateInterval::createFromDateString('1 month');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"#00a65a\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n\n if ($value['service_type'] == 'yearly') {\n $interval = DateInterval::createFromDateString('1 year');\n $period = new DatePeriod($begin, $interval, $end);\n\n foreach ($period as $key => $dt) {\n $timestamp = strtotime($dt->format(\"Y-m-d\"));\n $myobj = new \\stdClass();\n $myobj->title = $value['title'];\n $myobj->start = $dt->format(\"Y-m-d\");\n \n $scheduleArray = $this->getScheduleService($value['id'], $timestamp);\n \n if (date(\"Y-m-d\") <= $dt->format(\"Y-m-d\") && !empty($scheduleArray['availability'])) {\n $myobj->color = \"orange\";\n $myobj->url = url(\"/reservation/\" . $value['id'] . '/' . $timestamp);\n } else {\n $myobj->color = \"gray\";\n }\n array_push($outputArray, $myobj);\n }\n }\n }\n }\n// echo \"<pre>\";\n// print_r($outputArray);\n// echo \"</pre>\";\n echo json_encode($outputArray);\n }", "function listarServiciosTerminados()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function getServices();", "abstract protected function _listTables();", "public function get_trending_services()\n {\n if (isGuest()) {\n // only get national\n $sql = \"SELECT ss.id,ss.Code,ss.Name,COUNT(sa.id) AS Applications FROM Service_Services ss\n LEFT OUTER JOIN Service_Applications sa ON sa.ServiceID = ss.id\n WHERE ss.deletedAt IS NULL\n AND ss.LocationScopeID = 1\n AND ss.Status = 1\n AND ss.InOrganization = 0\n GROUP BY ss.id\n ORDER BY Applications DESC\n LIMIT 10\";\n } else {\n $userID = current_user();\n $sql = \"SELECT ss.id,ss.Code,ss.Name,COUNT(sa.id) AS Applications FROM Service_Services ss\n JOIN UserAccountInformation ua ON (\n ua.id = {$userID} AND (\n (ss.LocationScopeID = 1) OR\n (ss.RegionalID = ua.RegionalID AND ss.LocationScopeID = 2) OR \n (ss.ProvincialID = ua.ProvincialID AND ss.LocationScopeID = 3) OR\n (ss.MunicipalityCityID = ua.MunicipalityCityID AND (ss.LocationScopeID = 4 OR ss.LocationScopeID = 5)) OR\n (ss.BarangayID = ua.BarangayID AND ss.LocationScopeID = 6)\n )\n )\n LEFT OUTER JOIN Service_Applications sa ON sa.ServiceID = ss.id\n WHERE ss.deletedAt IS NULL\n AND ss.Status = 1\n AND ss.InOrganization = 0\n GROUP BY ss.id\n ORDER BY Applications DESC\n LIMIT 10\";\n }\n\n $results = $this->db->query($sql)->result_array();\n if (count($results)) {\n response_json(array(\n 'status' => true,\n 'data' => $results\n ));\n } else {\n response_json(array(\n 'status' => false,\n 'message' => 'No service found.'\n ));\n }\n }", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "public function readall(){\r\t\t\t$query=\"select `ct_services`.* from `ct_services`, `ct_services_method`, `ct_service_methods_units` where `ct_services`.`status` = 'E' and `ct_services_method`.`status` = 'E' and `ct_service_methods_units`.`status` = 'E' and `ct_services_method`.`service_id` = `ct_services`.`id` and `ct_service_methods_units`.`services_id` = `ct_services`.`id` group by `ct_services`.`id`, `ct_services`.`title`, `ct_services`.`description`, `ct_services`.`color`, `ct_services`.`image`, `ct_services`.`status`, `ct_services`.`position` ORDER BY `ct_services`.`position`\";\r\t\t\t$result=mysqli_query($this->conn,$query);\r\t\t\treturn $result;\r\t\t}", "public function listedesservicesAction()\r\n {\r\n $tservices = new Pits_Model_DbTable_TServicesplaces();\r\n $select = $tservices->select();\r\n $adapter = new Zend_Paginator_Adapter_DbTableSelect($select);\r\n $paginator = new Zend_Paginator($adapter);\r\n $paginator->setItemCountPerPage(10);\r\n $paginator->setCurrentPageNumber($this->view->page = $this->getRequest()->getParam('page', 1));\r\n $this->view->services = $paginator;\r\n }", "function get_services($db) {\n $query = \"SELECT service_id, serv_description from Services\";\n $statement = $db->prepare($query);\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n return $result;\n}", "public function listing() {\n return array(\n '#header' => array($this->t('Title'), $this->t('Description'), $this->t('Operations')),\n '#type' => 'table',\n ) + $this->listingLevel($this->paymentStatusManager->hierarchy(), 0);\n }", "private function _formatTable( $services, $currency = false ) {\n\t\t$converter = null;\n\t\tif ( $currency ) {\n\t\t\t$converter = new CURRENCYCONVERTER();\n\t\t}\n\t\t$finalTable = array();\n\t\tforeach ( array_keys( $services ) as $service ) {\n\t\t\tif ( $currency != false && $currency != $services[ $service ][0] ) {\n\t\t\t\t$temp = $services[ $service ][1];\n\t\t\t\t$services[ $service ][1] = $converter->convert(\n\t\t\t\t\t$services[ $service ][1],\n\t\t\t\t\t$currency,\n\t\t\t\t\t$services[ $service ][0]\n\t\t\t\t);\n\t\t\t}\n\t\t\t$finalTable[ $service ] = $services[ $service ][1];\n\t\t}\n\t\treturn $finalTable;\n\t}", "public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }", "function getServiceDetail(){\n $serviceData = DB::table('servicing')\n ->get();\n return $serviceData;\n }", "function get_services($username) {\n\t\t$conn = db_connect();\n\t\t$result = $conn->query(\"select id,photo,service_name from services\");\n\t\tif (!$result)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t//create an array of the services\n\t\t$url_array = array();\n\t\tfor ($count = 1; $row = $result->fetch_row(); ++$count) {\n\t\t\t$url_array[$count][0] = $row[0];\n\t\t\t$url_array[$count][1] = $row[1];\n\t\t\t$url_array[$count][2] = $row[2];\t\n\t\t}\n\t\treturn $url_array;\n\t}", "public function getTables();", "public function getTables();", "public function getTables();", "public function getResultList()\n {\n /* @var $pager \\Sys25\\RnBase\\Backend\\Utility\\BEPager */\n $pager = $this->usePager() ? \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\n \\Sys25\\RnBase\\Backend\\Utility\\BEPager::class,\n $this->getSearcherId().'Pager',\n $this->getModule()->getName(),\n // @TODO: die PageId solle noch konfigurierbar gemacht werden.\n $pid = 0\n ) : null;\n\n list($fields, $options) = $this->getFieldsAndOptions();\n\n // Get counted data\n $cnt = $this->getCount($fields, $options);\n\n if ($pager) {\n $pager->setListSize($cnt);\n $pager->setOptions($options);\n }\n\n // Get data\n $search = $this->searchItems($fields, $options);\n $items = &$search['items'];\n $content = '';\n $this->showItems($content, $items, ['items_map' => $search['map']]);\n\n $data = [\n 'table' => $content,\n 'totalsize' => $cnt,\n 'items' => $items,\n ];\n\n if ($pager) {\n $pagerData = $pager->render();\n\n // der zusammengeführte Pager für die Ausgabe\n // nur wenn es auch Ergebnisse gibt. sonst reicht die noItemsFoundMsg\n $sPagerData = '';\n if ($cnt) {\n $sPagerData = $pagerData['limits'].' - '.$pagerData['pages'];\n }\n $data['pager'] = '<div class=\"pager\">'.$sPagerData.'</div>';\n }\n\n return $data;\n }", "public function client_all_services(){\n $service = Service::where('user_id',Auth::user()->id)->where('status', 0)->get();\n //dd($service);\n return view('admin.pages.client_services.all_services', compact('service'));\n }", "public function mostrarTablaServicios(){\n\n\t\t$item = null;\n \t$valor = null;\n\n \t\t$servicios = ControladorServicios::ctrMostrarServicios($item, $valor);\n\n \t\t$datosJson = '{\n\t\t \"data\": [';\n\n\t\t for($i = 0; $i < count($servicios); $i++){\n\n\t\t \t/*============================================\n\t\t \t= TRAEMOS LAS ACCIONES =\n\t\t \t============================================*/\n\n\t\t \tif(isset($_GET[\"perfilOculto\"]) && $_GET[\"perfilOculto\"] == \"Administrador\"){\n\n\t\t \t\t$botones = \"<div class='btn-group'><button class='btn btn-warning btnEditarServicio' idServicio='\".$servicios[$i][\"idservicio\"].\"' data-toggle='modal' data-target='#modalEditarServicio'><i class='fas fa-edit'></i></button><button class='btn btn-danger btnEliminarServicio' idServicio='\".$servicios[$i][\"idservicio\"].\"'><i class='fas fa-times'></i></button></div>\";\n\n\t\t \t}else{\n\n\t\t \t\t$botones = \"\";\n\n\t\t \t}\n\t\t \t\n\t\t \t/*===== End of TRAEMOS LAS ACCIONES ======*/\n\t\t \t\n\t\t \t$datosJson .= '[\n\t\t \"'.($i+1).'\",\n\t\t \"'.$servicios[$i][\"descripcion\"].'\",\n\t\t \"$ '.number_format($servicios[$i][\"precio\"], 2).'\",\n\t\t \"'.$servicios[$i][\"fecha\"].'\",\n\t\t \"'.$botones.'\"\n\t\t ],';\n\n\t\t }\n\n\t\t $datosJson = substr($datosJson, 0, -1);\n\t\t \n\t\t$datosJson .= ']\n\n\t\t}';\n\n\t\techo $datosJson;\n\n\t}", "public function listAllAvailableServices()\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/services/available.json\");\n\t\t$data = $data->{'services'};\n\t\t$serviceArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$serviceArray->append(new Service($data[$i], $this));\n\t\t}\n\t\treturn $serviceArray;\n }", "public function toTabular() {\n\t\tsetlocale(LC_MONETARY, 'en_GB');\n\n\t\t$totalCount = 0; // Count get the total journey price\n\t\techo '<table width=\"50%\" cellpadding=\"5\" cellspacing=\"5\">';\n\t\t\techo '<tr><th align=\"left\">Station From</th><th align=\"left\">Station To</th><th align=\"left\">Prices</th></tr>';\n\n\t\t\tforeach ( $this->prices as $hop ) {\n\t\t\t\techo '<tr><td>'.$hop['station.from'].'</td>';\n\t\t\t\techo '<td>'.$hop['station.to'].'</td><td>';\n\n\t\t\t\t$prices = array();\n\t\t\t\tforeach ( $hop['station.prices'] as $price ) {\n\t\t\t\t\t$prices[] = $price->nodeValue;\n\t\t\t\t}\n\n\t\t\t\tasort($prices);\n\t\t\t\t$fmt = '<strong>Selected Price:</strong>&pound;%i ';\n\t\t\t\techo money_format($fmt, floatval(str_replace('£', '', $prices[0]))) . \"\\n\";\n\t\t\t\t$totalCount += str_replace('£', '', $prices[0]);\n\t\t\t\techo '</td></tr>';\n\n\t\t\t}\n\t\techo '</table>';\n\n\t\t$fmt = '<strong>Total Cost is </strong> &pound;%i ';\n\t\techo money_format($fmt, $totalCount) . \"\\n\";\n\n\t\techo ' for ' . $this->getPostField('numberOfAdults') . ' adult(s) ';\n\t\techo ' and ' . $this->getPostField('numberOfChildren') . ' child(s).';\n\t}", "private function getCompleteList(): array\n {\n $stmt = $this->connection->executeQuery(\n '\n SELECT sip.ip_address, sip.netmask, sip.first_ip_address, sip.last_ip_address,\n s.service_id, t.tariff_id, t.download_speed, t.upload_speed\n FROM service_ip sip\n INNER JOIN service_device sd ON sip.service_device_id = sd.service_device_id\n INNER JOIN service s ON s.service_id = sd.service_id\n INNER JOIN tariff t ON t.tariff_id = s.tariff_id\n WHERE s.status != :statusEnded\n AND s.deleted_at IS NULL\n ORDER BY sip.ip_address\n ',\n [\n 'statusEnded' => Service::STATUS_ENDED,\n ]\n );\n\n return $stmt->fetchAll();\n }", "function get_all_service_type()\n {\n $this->db->order_by('ID_SERVICE_TYPE', 'desc');\n return $this->db->get('SERVICE_TYPE')->result_array();\n }", "public function selectAllServiceData(){\n $sql = \"SELECT * FROM servicii_prestate ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function getList()\n {\n $service = list_services::all();\n return view('page.services',compact('service'));\n }", "public function index()\n {\n return ServicesApi::collection($this->services->whereNull('deleted_at')->get());\n\n }", "public function all_about_us_services_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_service ORDER BY service_id DESC\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function tableList()\n {\n $list = (self::MODEL)\n ::join('product_imeis', 'product_imeis.id', 'product_defects.product_imei_id')\n ->join('produtos', 'produtos.sku', 'product_defects.product_sku')\n ->with([\n 'productImei',\n 'product',\n ])\n ->orderBy('created_at', 'DESC');\n\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ProductDefectTransformer::tableList($list));\n }", "public function getServices()\n\t{\n\t\t$senddata= array();\n\t\t$finalsenddata= array();\n\t\t$services = Contactuspage::get()->toArray();\n\t\tforeach($services as $key=>$service)\n\t\t{\n\t\t\t$senddata['id'] \t\t\t= $service['id'];\n\t\t\t$senddata['title'] \t\t\t= $service['title'];\n\t\t\t$senddata['content'] \t\t= $service['content'];\n\t\t\tarray_push($finalsenddata,$senddata);\n\t\t}\n\t\t$siteSettings = SiteSettings::find(1)->toArray();\n\t\t$data['status'] = 1;\n\t\t$data['msg'] = 'Successfull.';\n\t\t$data['heading_text'] = $siteSettings['service_header'];\n\t\t$data['data'] = $finalsenddata;\n\t\techo json_encode($data);\n\t}", "public function getTableServicios($id)\n\t{\n\t\tif(! intval( $id )){\n\t\t\treturn false;\n\t\t}\n\t\t$id=$this->db->real_escape_string($id);\n\t\t$sql= \"\n\t\t\tSELECT ss.id,ss.codigo,ss.nombre,s.nombre paquete, s.descripcion\n\t\t\tFROM servicio_paquete sp \n\t\t\tINNER JOIN servicio s on s.id=sp.id_serviciopaquete \n\t\t\tINNER JOIN servicio ss on ss.id=sp.id_servicio\n\t\t\tWHERE sp.id_serviciopaquete=$id;\";\n\t\t$res=$this->db->query($sql);\n\t\t$set = array();\n\t\tif(!$res){ die(\"Error getting result getAllArr\".$sql); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t{ $set[] = $row; }\n\t\t}\n\t\treturn $set;\n\n\t}", "public function serviceSelectAll(){\n $data = $this->getDataAccessObject()->daoSelectAll();\n return $data;\n }", "public function getAllServiceItems()\n {\n $qbo = $this->container->get(\"numa.quickbooks\")->init();\n\n $ItemService = new \\QuickBooks_IPP_Service_Item();\n\n $qbItems = $ItemService->query($qbo->getContext(), $qbo->getRealm(), \"SELECT * FROM Item WHERE type='service' ORDER BY name \");\n $r = array();\n foreach ($qbItems as $item) {\n $r[$item->getName()] = $item->getName();\n }\n\n return $r;\n }", "function draw_hoststatus_table()\n{ $meta_pref_option = 'hoststatus_table_options';\n\n // defaults\n //$sortby=\"host_name:a,service_description\";\n $sortby = \"\";\n $sortorder = \"asc\";\n $page = 1;\n $records = 15;\n $search = \"\";\n\n // default to use saved options\n $s = get_user_meta(0, $meta_pref_option);\n if ($s) {\n $saved_options = unserialize($s);\n if (is_array($saved_options)) {\n if (isset($saved_options[\"sortby\"]))\n $sortby = $saved_options[\"sortby\"];\n if (isset($saved_options[\"sortorder\"]))\n $sortorder = $saved_options[\"sortorder\"];\n if (isset($saved_options[\"records\"]))\n $records = $saved_options[\"records\"];\n //if(array_key_exists(\"search\",$saved_options))\n // $search=$saved_options[\"search\"];\n }\n //echo \"SAVED OPTIONS: \";\n //print_r($saved_options);\n }\n\n // grab request variables\n $show = grab_request_var(\"show\", \"services\");\n $host = grab_request_var(\"host\", \"\");\n $hostgroup = grab_request_var(\"hostgroup\", \"\");\n $servicegroup = grab_request_var(\"servicegroup\", \"\");\n $hostattr = grab_request_var(\"hostattr\", 0);\n $serviceattr = grab_request_var(\"serviceattr\", 0);\n $hoststatustypes = grab_request_var(\"hoststatustypes\", 0);\n $servicestatustypes = grab_request_var(\"servicestatustypes\", 0);\n\n // fix for \"all\" options\n if ($hostgroup == \"all\")\n $hostgroup = \"\";\n if ($servicegroup == \"all\")\n $servicegroup = \"\";\n if ($host == \"all\")\n $host = \"\";\n\n $sortby = grab_request_var(\"sortby\", $sortby);\n $sortorder = grab_request_var(\"sortorder\", $sortorder);\n $records = grab_request_var(\"records\", $records);\n $page = grab_request_var(\"page\", $page);\n $search = trim(grab_request_var(\"search\", $search));\n if ($search == _(\"Search...\"))\n $search = \"\";\n\n // save options for later\n $saved_options = array(\n \"sortby\" => $sortby,\n \"sortorder\" => $sortorder,\n \"records\" => $records,\n //\"search\" => $search\n );\n $s = serialize($saved_options);\n set_user_meta(0, $meta_pref_option, $s, false);\n\n\n $output = '';\n\n $output .= \"<form action='\" . get_base_url() . \"includes/components/xicore/status.php'>\";\n $output .= \"<input type='hidden' name='show' value='hosts'>\\n\";\n\n $output .= \"<input type='hidden' name='sortby' value=\\\"\" . encode_form_val($sortby) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='sortorder' value=\\\"\" . encode_form_val($sortorder) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='host' value=\\\"\" . encode_form_val($host) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='hostgroup' value=\\\"\" . encode_form_val($hostgroup) . \"\\\">\\n\";\n $output .= \"<input type='hidden' name='servicegroup' value=\\\"\" . encode_form_val($servicegroup) . \"\\\">\\n\";\n\n $output .= '<div class=\"servicestatustablesearch\">';\n $output .= '\n <input type=\"text\" size=\"15\" name=\"search\" id=\"hostsearchBox\" value=\"\" class=\"form-control condensed\" placeholder=\"'._('Search').'...\">\n <button type=\"submit\" class=\"btn btn-xs btn-default\" name=\"searchButton\" id=\"searchButton\"><i class=\"fa fa-search\"></i></button>\n </div>\n </form>';\n\n // ajax updater args\n $ajaxargs = array();\n $ajaxargs[\"host\"] = $host;\n $ajaxargs[\"hostgroup\"] = $hostgroup;\n $ajaxargs[\"servicegroup\"] = $servicegroup;\n $ajaxargs[\"sortby\"] = $sortby;\n $ajaxargs[\"sortorder\"] = $sortorder;\n $ajaxargs[\"records\"] = $records;\n $ajaxargs[\"page\"] = $page;\n $ajaxargs[\"search\"] = $search;\n $ajaxargs[\"hostattr\"] = $hostattr;\n $ajaxargs[\"serviceattr\"] = $serviceattr;\n $ajaxargs[\"hoststatustypes\"] = $hoststatustypes;\n $ajaxargs[\"servicestatustypes\"] = $servicestatustypes;\n\n $id = \"hoststatustable_\" . random_string(6);\n\n $output .= \"<div class='hoststatustable' id='\" . $id . \"'>\\n\";\n $output .= get_throbber_html();\n $output .= \"</div>\";\n\n // build args for javascript\n $n = 0;\n $jargs = \"{\";\n foreach ($ajaxargs as $var => $val) {\n if ($n > 0)\n $jargs .= \", \";\n $jargs .= \"\\\"\" . htmlentities($var) . \"\\\" : \\\"\" . htmlentities($val) . \"\\\"\";\n $n++;\n }\n $jargs .= \"}\";\n\n // ajax updater\n $output .= '\n <script type=\"text/javascript\">\n $(document).ready(function(){\n\n get_' . $id . '_content();\n \n $(\"#' . $id . '\").everyTime(30*1000, \"timer-' . $id . '\", function(i) {\n get_' . $id . '_content();\n });\n \n function get_' . $id . '_content(){\n $(\"#' . $id . '\").each(function(){\n var optsarr = {\n \"func\": \"get_hoststatus_table\",\n \"args\": ' . $jargs . '\n }\n var opts=array2json(optsarr);\n get_ajax_data_innerHTML(\"getxicoreajax\",opts,true,this);\n });\n }\n\n });\n </script>\n ';\n\n //return $output;\n echo $output;\n}", "public static function getServices($user=null) {\n\t\tif ($user!=null)\t$portlist=$user->getRol()->getServices();\n\t\telse \t\t\t\t\t$portlist=$this->getDoctrine()->getRepository(Service::class)->findAll();\n\t\t$data=array(\"total\"=>count($portlist),\"rows\"=>array());\n\t\tforeach($portlist as $port) {\n\t\t\t$row=array(\"id\"=>$port->getId(), \"port\"=>$port->getPort(), \"name\"=>$port->getName());\n\t\t\t$data[\"rows\"][]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "public static function list() {\n self::init();\n $columns = self::getListTableColumns();\n $columns = array_map(function($object) {\n return $object['label'];\n }, $columns);\n $columns = array_values($columns);\n\n $columnsSql = implode(', ', self::$listTableColumnsKeys);\n $data = self::$wpdb->get_results(\n self::$wpdb->prepare(\n \"SELECT {$columnsSql}\n FROM \" . self::$table . \"\n ORDER BY id ASC\"\n )\n );\n return $data;\n }", "function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function getServices() {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$services = ServicesOrder::join('user_addresses', 'user_addresses.id', '=', 'services_orders.address')\n\t\t\t\t->where('services_orders.id_client', $user->id)\n\t\t\t\t->where('services_orders.status', '!=', 6)\n\t\t\t\t->get(['services_orders.*', 'user_addresses.address', 'user_addresses.latitude', 'user_addresses.longitude']);\n\n\t\t\tif($services->count()) {\n\t\t\t\tforeach($services as $key => $service) {\n\t\t\t\t\t$documents = ServicesDocuments::join('documents', 'documents.id', '=', 'services2documents.document_id')->where('service_id', $service->id)->get(['documents.id', 'folio', 'location', 'type', 'alias', 'notes', 'subtype', 'picture_path', 'expedition', 'expiration', 'documents.created_at']);\n\t\t\t\t\t$services[$key]->documents = $documents;\n\t\t\t\t}\n\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\"message\" => \"Listado de servicios\",\n\t\t\t\t\t\"response\" => array(\"services\" => $services)\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 202,\n\t\t\t\t\t\"message\" => \"No se encontraron servicios\",\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function getServices(): array;", "public function index()\n {\n $services = Service::\n orderBy('status', 'asc')->\n orderBy('created_at', 'desc')->\n paginate(10);\n\n return view('services.services', compact('services'));\n }", "function getServiceTable() {\n// FROM appointment AS a, service AS s, patient AS p, employee as e, unit AS u\n// WHERE a.ServiceID = s.ServiceID\n// AND p.HospitalCardID IN (SELECT pl.PatientID FROM patient_list as pl WHERE p.HospitalCardID = pl.PatientID AND pl.PatientListID = a.PatientListID)\n// AND e.EmployeeID IN (SELECT el.EmployeeID FROM employee_list as el WHERE e.EmployeeID = el.EmployeeID AND el.EmployeeListID = a.EmployeeListID)\n// AND u.UnitID = a.UnitID\";\n \n $query = \"SELECT a.AppointmentID, s.Name AS SName, CONCAT(p.FirstName,' ',p.LastName) AS PName, CONCAT(e.FirstName,' ',e.LastName) AS EName, a.StartTime, a.EndTime, u.Name AS UName\n FROM appointment AS a JOIN service AS s ON (a.ServiceID = s.ServiceID) JOIN patient AS p ON (p.HospitalCardID = a.PatientID) JOIN employee_appointment AS ea ON (a.AppointmentID = ea.AppointmentID) JOIN employee AS e ON (e.EmployeeID = ea.EmployeeID)\n JOIN unit AS u ON (u.UnitID = a.UnitID)\";\n $result = mysql_query($query);\n \n \n $table = '<div><table border=\"1\" width =\"830px\">';\n $table .= ' <tr> <th class=\"tableHeaders\" width =\"100px\">Service Name</th>';\n $table .= ' <th class=\"tableHeaders\" width =\"105px\">Patient Name</th>';\n $table .= ' <th class=\"tableHeaders\" width =\"120px\">Employee Name</th>';\n $table .= ' <th class=\"tableHeaders\" width =\"125px\">Start Time</th>';\n $table .= ' <th class=\"tableHeaders\" width =\"125px\">End Time</th>';\n $table .= ' <th class=\"tableHeaders\" width =\"175px\">Unit Name</th>'; \n $table .= ' <th class=\"tableHeaders\" width =\"90px\">Delete</th>'; \n $table .= ' </tr>';\n \n while ($row = mysql_fetch_assoc($result)) {\n $sName = $row['SName'];\n $pName = $row['PName'];\n $eName = $row['EName'];\n $sd = $row[\"StartTime\"];\n $ed = $row[\"EndTime\"];\n $unit = $row[\"UName\"];\n \n $table .= ' <tr> <td> '. $sName . ' </td>';\n $table .= ' <td> '. $pName . ' </td>';\n $table .= ' <td> '. $eName . ' </td>';\n $table .= ' <td> '. $sd . ' </td>';\n $table .= ' <td> '. $ed . ' </td>';\n $table .= ' <td> '. $unit . ' </td>';\n if ($_SESSION['JobID'] == 2 || $_SESSION['JobID'] == 3) {\n $table .= ' <td> <a href=\"index.php?delete='.$row[\"AppointmentID\"].'#Services\">Delete Now</a> </td>'; \n } else {\n $table .= ' <td> Not Allowed </td>';\n }\n $table .= ' </tr>';\n }\n $table .= ' </table> </div>'; \n \n return $table; \n }", "function getList($tabName, $filterName, $filterValue) {\n global $mysqli;\n\n $header=getColumns($tabName);\n \n $sql=\"SELECT * FROM $tabName WHERE $filterName='$filterValue'\";\n\t$resultado=doQuery($sql);\n\t$noColumnas = count($header);\n\t$html='<thead>';\n\tfor ($i=0; $i < count($header) ; $i++) { \n\t\t$html.=\"<th>\".$header[$i].\"</th>\";\n\t}\n\n\t$html.='</thead>';\n\t\n\tforeach ($resultado->fetch_all(MYSQLI_BOTH) as $key => $value) {\n\t\t\n\t\t$html.='<tr>';\n\t\tfor ($j=0; $j < $noColumnas ; $j++) { \n\t\t\t\n\t\t\t$html.=\"<td>\".$value[$j].\"</td>\";\n\t\t}\n\t\t$html.='</tr>';\n\t}\t\n\n return \"<table class='analyst-list'>\".$html.\"</table>\";\n}", "public function get_services() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/services.json\");\n }", "public function reporteServicios(){\n $datos=TablaSimulacion::all();\n $serv = Servicio::all();\n $servicios=[];\n $gananciaServicio=0;\n $indice = 0;\n foreach ($serv as $ser) {\n $count = 0;\n foreach ($datos as $dato) {\n if (strpos($dato->servicios,$ser->servicio) !== false ) {\n $count++;\n }\n }\n $gananciaServicio=$count*$ser->costo;\n $servicios[$indice] = [$ser->servicio,$count,$ser->costo,$gananciaServicio];\n $indice++;\n }\n return view('servicio/reporteServicio',compact('servicios'));\n }", "function getServiceListHeading($mode,$uid) {\n\t\tswitch ($mode) {\n\t\t\tcase 'service_list':\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_service_list.service_list','Service list');\n\t\t\t\t#$heading = $this->pi_getLL('tx_civserv_pi1_service_list.overview','Overview');\n\t\t\t\tif(!$this->conf['includeNameInHeading']){\n\t\t\t\t\t// test bk: premature return instruction to prevent that anything is added to the heading\n\t\t\t\t\treturn $heading;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'online_services':\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_service_list.online_service_list','Online Services');\n\t\t\t\tif(!$this->conf['includeNameInHeading']){\n\t\t\t\t\t// test bk: premature return instruction to prevent that anything is added to the heading\n\t\t\t\t\treturn $heading;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'service' :// test bk: make it fitting for ms layout, useless: fct getservicelistheading never called from serviceDetail!!!\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_service_list.overview','Overview');\n\t\t\t\tif(!$this->conf['includeNameInHeading']){\n\t\t\t\t\t// test bk: premature return instruction to prevent that anything is added to the heading\n\t\t\t\t\treturn $heading;\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'circumstance' :\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_service_list.circumstance','Circumstance');\n\t\t\t\t$field = 'nv_name';\n\t\t\t\t$table = 'tx_civserv_navigation';\n\t\t\t\tbreak;\n\t\t\tcase 'usergroup' :\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_service_list.usergroup','Usergroup');\n\t\t\t\t$field = 'nv_name';\n\t\t\t\t$table = 'tx_civserv_navigation';\n\t\t\t\tbreak;\n\t\t\tcase 'organisation' :\n\t\t\t\t$heading = $this->pi_getLL('tx_civserv_pi1_organisation_list.organisation_list','Organisation');\n\t\t\t\t// test bk: make it fitting for ms layout\n\t\t\t\t#$heading = $this->pi_getLL('tx_civserv_pi1_organisation_list.organisation_list.heading','Organisation');\n\t\t\t\tif($this->conf['includeNameInHeading']){\n\t\t\t\t\t$field = 'or_name';\n\t\t\t\t\t$table = 'tx_civserv_organisation';\n\t\t\t\t\tbreak;\n\t\t\t\t}else{\n\t\t\t\t\t// test bk: premature return instruction to prevent that anything is added to the heading\n\t\t\t\t\treturn $heading;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tif ($mode != 'service_list' && $mode != 'online_services') {\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t$field,\n\t\t\t\t\t\t$table,\n\t\t\t\t\t\t'uid = ' . intval($uid));\n\t\t\t$category = $this->sql_fetch_array_r($res);\n\t\t\tif (count($category) == 1) {\n\t\t\t\t$heading .= ': ' . $category[0][$field];\n\t\t\t} else {\n\t\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_error.unknown_category','The given Category (Circumstance, Usergroup or Organisation) is unknown.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\t$heading .= ': ' . $this->pi_getLL('tx_civserv_pi1_service_list.overview','Overview');\n\t\t}\n\t\treturn $heading;\n\t}", "public function getList()\n {\n return $this->call('GET', \"/shipping/services.json\");\n }", "public function index()\n {\n $title = 'Services';\n $modulo = 'services';\n $models = Service::all();\n $total = Service::all()->count();\n $fields = [\n 'id',\n 'name',\n 'description',\n 'created_at',\n 'updated_at'\n ];\n return view('list', compact('title', 'models', 'total', 'fields', 'modulo'));\n }", "function listTables();", "function servicios_List(){\t\t\t\n\t\t\t$userdata = $this->session->userdata('user_data');\n\t\t\t$usrId = $userdata[0]['usrId']; \n\t\t\t$grupoId = $userdata[0][\"grpId\"];\n\t\t\t$empId = $userdata[0]['id_empresa'];\n\t\t\t\n\t\t\t$this->db->select('solicitud_reparacion.*,\n\t\t\t\t\t\t\t\t\t\t\t\tequipos.codigo as equipo, \n\t\t\t\t\t\t\t\t\t\t\t\tsector.descripcion as sector, \n\t\t\t\t\t\t\t\t\t\t\t\tgrupo.descripcion as grupo, \n\t\t\t\t\t\t\t\t\t\t\t\tequipos.ubicacion');\n\t\t\t$this->db->from('solicitud_reparacion');\n\t\t\t$this->db->join('equipos', 'solicitud_reparacion.id_equipo = equipos.id_equipo');\n\t\t\t$this->db->join('sector', 'equipos.id_sector = sector.id_sector');\n\t\t\t$this->db->join('grupo', 'equipos.id_grupo = grupo.id_grupo', 'left');\n\t\t\t$this->db->where('solicitud_reparacion.estado !=', 'AN');\n\t\t\t//$this->db->or_where('solicitud_reparacion.estado', 'S');\n\t\t\t$this->db->where('solicitud_reparacion.id_empresa', $empId);\n\t\t\t$query = $this->db->get();\n\t\t\tif ($query->num_rows()!=0)\n\t\t\t{\n\t\t\t\treturn $query->result_array();\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function services(){\n $results = DB::select('select * from services');\n return view('frontend.services')->with(['results'=>$results]);\n }", "public function getTableList()\n\t{\n\t\t$result = [];\n\t\tforeach ($this->manager->getDataSources($this->languageId) as $tableName => $tableInfo)\n\t\t{\n\t\t\t$result[] = [\n\t\t\t\t$tableName,\n\t\t\t\t$tableInfo['TABLE_DESCRIPTION'],\n\t\t\t];\n\t\t}\n\t\treturn $result;\n\t}", "public function index()\n {\n return $this->service->all();\n }", "function getServicesList()\n {\n//JOIN sub_services_list ON services_categery.services_catagery_id=sub_services_list.services_catagery_id \";\n//\n// $query = $this->db->query($sql);\n// $result = $query->result_array();\n//\n// $serviceArray = [];\n// foreach ($result as $value) {\n// $serviceArray[$value['services_group']] [$value['services_categery_list']][] = [\n// $value['services_list'], $value['service_fee'], $value['convenience_fee']];\n// }\n\n $query = $this->db->get('services_group');\n $serviceArray ['servGroup'] = $query->result();\n\n//$query1 = $this->db->get('services_categery');\n//$serviceArray ['servCategory']= $query1->result() ;\n $this->db->select('*');\n $this->db->join('services_categery', 'sub_services_list.services_catagery_id=services_categery.services_catagery_id');\n $query2 = $this->db->get('sub_services_list');\n $serviceArray ['servList'] = $query2->result();\n\n// echo \"<pre>\";\n// print_r($serviceArray);die;\n return $serviceArray;\n }", "public function index()\n {\t\t\n return ServicesResource::collection(Services::all());\n }", "public function listServiceActv()\n {\n $actvServicio = ActividadServicio::orderBy('fechaFinalizacion', 'asc')\n ->get();\n return response()->json($actvServicio, 200);\n }", "function servicesAfetados($host_id, $db_storage, $serviceOuHost){\n\t//$pai_id = $pai_array[3];\n\t//if ($serviceOuHost == \"Host\"){\n\t\t//sec_to_time((now() - last_hard_state_change)) as last_hard_state_change_duration, \n\t$query = \"SELECT host_id as id, name, state, output, last_hard_state_change, name as host_name,(select GROUP_CONCAT(services.description SEPARATOR '<br/>') as services_afetados from services where services.host_id = hosts.host_id) services_afetados FROM hosts WHERE host_id = \" . $host_id;\n\t//}else{\n\t//\t$query = \"SELECT service_id as id, description as name, state, output, last_hard_state_change, (select hosts.name from hosts where hosts.host_id = services.host_id) as host_name, description as services_afetados FROM services WHERE service_id = \" . $pai_id;\n\t//}\n\t//$res = $this->db->query($query);\n\t$res = $db_storage->query($query);\n\t$tabServicesAfetados = array();\n\twhile ($row = $res->fetch()) {\n\t\t$tabServicesAfetados['id'] = $row['id'];\n\t\t$tabServicesAfetados['name'] = $row['name'];\n\t\t//0 =\"OK\", 1 = \"WARNING\", 2 = \"CRITICAL\", 3 = \"UNKNOWN\"\n\t\t$tabServicesAfetados['state'] = $row['state'];\n\t\t$tabServicesAfetados['ic'] = $pai_array[1];\n\t\t$tabServicesAfetados['last_hard_state_change_duration'] = CentreonDuration::toString(time() - $row['last_hard_state_change']);\n\t\t$tabServicesAfetados['output'] = $row['output'];\n\t\t$tabServicesAfetados['last_hard_state_change'] = $row['last_hard_state_change'];\n\t\t$epoch = $tabServicesAfetados['last_hard_state_change'];\n\t\t$dt = new DateTime(\"@$epoch\");\n\t\t$tabServicesAfetados['last_hard_state_change'] = $dt->format('Y-m-d H:i:s');\n\t\t$tabServicesAfetados['host_name'] = $row['host_name'];\n\t\t$tabServicesAfetados['services_afetados'] = $row['services_afetados'];\n\t\t\n\t}\n\treturn $tabServicesAfetados;\n}", "public function serviceInfo(){\n\n\t\t\t$service_id = $this->input->get('service_id') ;\n\t\t\t$info = $this->mdl_services->get_info($service_id) ;\n\t\t\techo json_encode($info) ;\n\t\t}", "function getServiceDetails(){\n //\n //\n $attraction= $_GET['attraction'];\n $services= $_GET['service'];\n $sql= $this->chk(\n \"select \n json_object('destination', destination.name, 'attraction', attraction.name, 'name',accommodation.name, 'rate',accommodation.rate,'description',accommodation.description) as accommodation,\n json_object('destination', destination.name, 'attraction', attraction.name,'name',activity.name,'rate',activity.rate,'description',activity.description) as activity,\n json_object('destination', destination.name, 'attraction', attraction.name,'name',guide.name,'rate',guide.rate,'description',guide.description) as guide,\n json_object('destination', destination.name, 'attraction', attraction.name,'name',eatery.name,'rate',eatery.rate,'description',eatery.description) as eatery,\n json_object('destination', destination.name, 'attraction', attraction.name,'name',vehicle.model,'rate',vehicle.rate,'description',vehicle.reg_no) as vehicle\n from \n services\n LEFT JOIN accommodation ON accommodation.services= services.services\n LEFT JOIN activity ON services.services = activity.services\n LEFT JOIN guide ON guide.services = services.services\n LEFT JOIN eatery on eatery.services= services.services\n LEFT JOIN vehicle on vehicle.service= services.services\n INNER JOIN atservice on atservice.services= services.services\n INNER JOIN attraction on attraction.attraction=atservice.attraction\n INNER JOIN destination on destination.destination=attraction.destination\n where \n attraction.attraction =$attraction \n AND \n services.services= $services \"\n );\n // \n //filter the result to return what we are after \n $type = $_REQUEST['type'];\n //\n $result = $this->query($sql);\n //\n //\n if (!$result) {\n print \"<p>Could not retrieve data: </p>\";\n }\n $row = $result->fetchAll(PDO::FETCH_ASSOC);\n $res=[];\n foreach ($row as $value) {\n foreach ($value as $key => $data) {\n //\n //return data associated with the type of service clicked\n if($key===$type) {\n $res[]=json_decode($data);\n }\n }\n }\n echo json_encode($res);\n }", "public function &getTables();", "abstract public function getTables();", "static function getServiceList()\n {\n return session::get('ServerService');\n }", "public function waitservicelistAction()\n {\n\n $uid = $this->_USER_ID;\n $floorId = $this->getParam('CF_floorid');\n\n $mbllApi = new Mbll_Tower_ServiceApi($uid);\n $aryRst = $mbllApi->getWaitServiceList($floorId);\n\n if (!$aryRst || !$aryRst['result']) {\n $errParam = '-1';\n if (!empty($aryRst['errno'])) {\n $errParam = $aryRst['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n\n //service list info\n $waitServiceList = $aryRst['result']['list'];\n\n foreach ($waitServiceList as $key => $value) {\n $guest = Mbll_Tower_GuestTpl::getGuestDescription($value['tp']);\n //guest name\n $guestName = explode(\"|\", $guest['des']);\n $waitServiceList[$key]['name'] = $guestName[0];\n //need item\n $needItem = Mbll_Tower_ItemTpl::getItemDescription($value['ac']);\n $waitServiceList[$key]['ac_name'] = $needItem['name'];\n //mood picture\n $waitServiceList[$key]['moodPic'] = round($value['ha']/10)*10;\n\n $waitServiceList[$key]['ha_emoj'] = Mbll_Tower_Common::getMoodDesc($value['ha']);\n //leave time\n $waitServiceList[$key]['remain_hour'] = floor(($value['ot'] - $value['ct'])/3600);\n $waitServiceList[$key]['remain_minute'] = strftime('%M', $value['ot'] - $value['ct']);\n }\n\n $this->view->waitServiceList = $waitServiceList;\n $this->view->countService = count($waitServiceList);\n $this->view->floorid = $floorId;\n $this->render();\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "public function getListEntry()\n {\n $fields = goService::getListEntry();\n $fields['Message'] = _(\"Kopano service\");\n #$fields['AllowEdit'] = false;\n return($fields);\n }", "public function index()\n {\n return $this->service->list();\n }", "function getServices(){\n /*\n This Function for get all service to index.php\n */\n try{\n global $con;\n // query select for get just 6 services from services table\n $query = $con->prepare(\"SELECT * FROM services LIMIT 6\");\n $query->execute();\n // fetch services\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n // initialize variables\n $service_icon = $result[\"service_icon\"];\n $service_title = $result[\"service_title\"];\n $service_desc = $result[\"service_desc\"];\n echo \"\n <div class='service-item col-md-6 col-lg-4'>\n <div class='img-box'>\n <img src='Layout/Images/icons/$service_icon' class='img-responsive' alt='$service_icon'>\n </div>\n <div class='content'>\n <h4>$service_title</h4>\n <p>$service_desc</p>\n </div>\n </div>\n \";\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n \n}", "public function listtabelCSAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('CURRENT SYSTEM');\n }", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "public function ListTable()\n {\n echo $this->ListTableText();\n }" ]
[ "0.6771203", "0.6750676", "0.6702811", "0.66192305", "0.65752494", "0.6499887", "0.6482141", "0.64577", "0.64431477", "0.6420516", "0.64082", "0.63718307", "0.6335283", "0.63264334", "0.62627995", "0.6259936", "0.6259899", "0.6259461", "0.6232256", "0.6204745", "0.6200456", "0.6186085", "0.6149932", "0.6139145", "0.61268634", "0.60970163", "0.6091272", "0.6068823", "0.6062655", "0.60622627", "0.6059308", "0.6056672", "0.60456985", "0.60455656", "0.6038884", "0.60269356", "0.6025203", "0.6013222", "0.6009324", "0.59931976", "0.5974866", "0.5968961", "0.59443027", "0.59381706", "0.59335345", "0.59114677", "0.59114677", "0.59114677", "0.5901571", "0.58953637", "0.58727396", "0.58511806", "0.58506155", "0.58486927", "0.5837535", "0.5830712", "0.58271927", "0.58170915", "0.58162844", "0.58138746", "0.58039826", "0.578962", "0.57764566", "0.57715344", "0.576262", "0.5757638", "0.57516885", "0.5745686", "0.57353824", "0.57299495", "0.57286215", "0.5722567", "0.57133573", "0.5708343", "0.57019436", "0.57005954", "0.569911", "0.5697587", "0.5694634", "0.5690702", "0.5668648", "0.5666012", "0.5663277", "0.5658749", "0.5656044", "0.56517965", "0.5650289", "0.5646928", "0.5646409", "0.56421745", "0.5638797", "0.5631056", "0.5629842", "0.56245095", "0.56231", "0.56205344", "0.5619567", "0.5610823", "0.5610271", "0.56092966" ]
0.59606135
42
Instantiate the envrionment object.
public function __construct( $production_site_url ) { $this->production_site_url = $production_site_url; if($this->is_test_environment()) error_reporting(E_ALL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct () {\n $this->loadEnvironment();\n }", "public function env()\n {\n // TODO: Implement env() method.\n }", "public static function environment() {\n\t\tif (!isset(self::$_environment)) {\n\t\t\tself::$_environment=new \\GO\\Base\\Environment();\n\t\t}\n\t\treturn self::$_environment;\n\t}", "function initializer() {\n init_env();\n }", "public static function setEnvironnement()\n\t{\n\t\tUz_Autoloader::init(array(static::$framework_namespace=>$framework_path, static::$application_namespace=>static::$application_path),static::$framework_namespace,array());\n\t\t//On construit la session\n\t\tUz_Service_HTTP_Session::build();\n\t\t//On recupere la requete dans cet objet\n\t\tUz_Service_HTTP_Request::build();\n\t\tUz_Controller_Dispatcher::init(static::$application_namespace);\n\t\tUz_Mapper_Generic::init(static::configureDb());\n\t\t\n\t}", "public function setEnvironment();", "private function initEnvironment() {\n\t\t$env = getenv('APP_ENV');\n\n\t\t$this->_env = ($env !== FALSE) ? $env : 'development';\n\t}", "private function setupApplicationEnvironment(){\n\n // TODO: MAKE MORE EFFICENT WITH CACHING\n if($this->version == null)\n $this->version = env('PAYPAL_VERSION', 'dev-2.0-beta');\n\n if($this->endpoint == null)\n $this->endpoint = env('PAYPAL_ENDPOINT');\n \n if($this->username == null)\n $this->username = env('PAYPAL_USERNAME');\n\n if($this->password == null)\n $this->password = env('PAYPAL_PASSWORD');\n\n if($this->signature == null)\n $this->signature = env('PAYPAL_SIGNATURE');\n\n if($this->isDirect == null)\n $this->isDirect = env('PAYPAL_DIRECT', true);\n\n if($this->payment_method == null) \n $this->payment_method = ($this->isDirect) ? Objects::CREDIT_CARD : env('PAYMENT_METHOD');\n\n // Set our enviornment based on production or development\n $this->environment = (!$this->isDevelopment) ? new ProductionEnvironment() : new SandboxEnvironment();\n\n $this->client = new PayPalHttpClient($this->environment);\n\n }", "public static function environment()\n {\n $clientId = getenv(\"CLIENT_ID\") ?: warehouse::get_paypal_client_id();\n $clientSecret = getenv(\"CLIENT_SECRET\") ?: warehouse::get_paypal_secret();\n\n if (rex_config::get('warehouse', 'sandboxmode')) {\n return new SandboxEnvironment($clientId, $clientSecret);\n } else {\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n }", "public static function environment()\n {\n $clientId = \"AeJcD0QwLDMAQZH5HHNDfJBKvIxDMd0SWKca3rrX3IdhK62xLu0EInhkOScSskKtxVhNBjroPkIX0Oeu\"; //live;\n// $clientSecret = \"EJs4udErZIsmm1rxvSR_6JIVqojRadq_oDkLLN1nQuqkaq5k8fSKX6CZQvUQzf3dLGdJthYh6xNLgHd3\"; //sandbox;\n $clientSecret = \"EEKCrsLBLWIVx4MTf8Qi1t2uTVNymwpUCxCnhsoZuAFpHPzpqBVliAiIBeSyHoEpeQya8TJdkgrDvXDM\"; //live;\n return new ProductionEnvironment($clientId, $clientSecret);\n }", "public function __construct($environment)\n {\n $this->environment = $environment;\n\n $this->application = $this->getApplicationName();\n $this->cliExecution = false;\n $this->rootDir = $this->guessRootDir();\n\n $this->loadConstants();\n\n $this->eventDispatcher = new EventDispatcher();\n\n Exeption::register();\n\n //$this->loadLogger();\n\n //Logger::info(sprintf('ProjectConfiguration | __construct | inizializzazione applicazione \"%s\"', $application));\n\n //$this->loadPhpConfiguration();\n }", "public function __construct()\n {\n $items = getenv();\n $this->set($items);\n }", "public function openEnvironment() {\n\t\tarray_unshift($this->environments, []);\n\t}", "private function createEnvironment() {\n\t\t$this->cache_folder = dirname(__FILE__) . \"/\" . $this->cache_folder;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($this->cache_folder))\n\t\t\tmkdir($this->cache_folder);\n\n\t\t// Get the index file path\n\t\t$indexFilepath = $this->cache_folder . \"/\" . $this->cache_index;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($indexFilepath))\n\t\t\ttouch($indexFilepath);\n\t}", "public function create(Environment $environment);", "public function init()\n {\n $this->setEnv();\n }", "protected function getEnvironmentService()\n {\n $class = $this->getParameter('environment.class');\n $instance = new $class($this->getParameter('environment.file'));\n\n return $instance;\n }", "public function getEnvironment(): Environment;", "function env();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "private function getEnvironment(): Environment\n {\n if ($this->environment === null) {\n $this->environment = new Environment();\n }\n\n return $this->environment;\n }", "public function init($enviroment=true)\n\t{\n\t\tif($enviroment === true){\n\t\t\t$this->setScriptPath();\n\t\t\t$this->setAllNeedId();\n\t\t\t$this->mkdirIfNotExist(array($this->scriptPath));\n\t\t\tif($this->moduleId != null){\n\t\t\t\t$modulesPath = $this->scriptPath.$this->modulesField;\n\t\t\t\t$modulesItem = $modulesPath.$this->ds.$this->moduleId;\n\t\t\t\t$modulesControllerPath = $modulesItem.$this->ds.$this->controllerId;\n\t\t\t\t$this->mkdirIfNotExist(array($modulesPath,$modulesItem,$modulesControllerPath));\n\t\t\t\t$this->createScript($modulesControllerPath,true);\n\t\t\t}else{\n\t\t\t\t$controllerPath = $this->scriptPath.$this->controllerId;\n\t\t\t\t$this->mkdirIfNotExist(array($controllerPath));\n\t\t\t\t$this->createScript($controllerPath);\n\t\t\t}\n\t\t}\n\t}", "protected function setupEnvironment()\n {\n Dotenv::create(project_root())->load();\n\n if (!in_array($_SERVER['APP_ENV'], [self::ENV_DEV, self::ENV_PRODUCTION, self::ENV_STAGING, self::ENV_TEST])) {\n throw new RuntimeException(\"Unrecognized application environment\");\n }\n\n $this->debug = (bool) (\n $_SERVER['APP_DEBUG']\n ?? $_SERVER['APP_ENV'] == self::ENV_DEV\n );\n }", "public static function instance(): EnvironmentInterface\n {\n static $instance = null;\n if ($instance === null) {\n $instance = new static();\n\n self::$data = container_resolve(\n EnvironmentData::class,\n [ENVIRONMENT_FILE]\n )->load();\n }\n return $instance;\n }", "public function environment($environment) { $this->environment = $environment; }", "public static function start()\n {\n $buffer = File::readFile(\".env\");\n $pairs = explode(\"\\n\", $buffer);\n\n foreach ($pairs as $pair) {\n $keyValuePair = explode(\"=\", $pair);\n\n $key = (isset($keyValuePair[0])) ? $keyValuePair[0] : null;\n $value = (isset($keyValuePair[1])) ? $keyValuePair[1] : null;\n\n self::$environment[$key] = $value;\n }\n }", "public function __construct(Environment $environment)\n {\n $this->environment = $environment;\n $this->loadDotEnv();\n }", "public function initialize() {\n\t\t$this->settings = $this->configurationManager->getConfiguration(\\F3\\FLOW3\\Configuration\\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'FLOW3');\n\n\t\t$environment = new \\F3\\FLOW3\\Utility\\Environment();\n\t\t$environment->setContext($this->context);\n\t\t$environment->setTemporaryDirectoryBase($this->settings['utility']['environment']['temporaryDirectoryBase']);\n\t\t$environment->initializeObject();\n\n\t\t$this->staticObjectContainerPathAndFilename = $environment->getPathToTemporaryDirectory() . 'StaticObjectContainer.php';\n\n\t\tif ($this->settings['monitor']['detectClassChanges'] === FALSE && file_exists($this->staticObjectContainerPathAndFilename)) {\n\t\t\trequire_once($this->staticObjectContainerPathAndFilename);\n\t\t\tif (class_exists($this->staticObjectContainerClassName, FALSE)) {\n\t\t\t\t$this->objectContainer = new $this->staticObjectContainerClassName;\n\t\t\t}\n\t\t}\n\n\t\tif ($this->objectContainer === NULL) {\n\t\t\t$rawFLOW3ObjectConfigurations = $this->configurationManager->getConfiguration(\\F3\\FLOW3\\Configuration\\ConfigurationManager::CONFIGURATION_TYPE_OBJECTS, 'FLOW3');\n\t\t\t$parsedObjectConfigurations = array();\n\t\t\tforeach ($rawFLOW3ObjectConfigurations as $objectName => $rawFLOW3ObjectConfiguration) {\n\t\t\t\t$parsedObjectConfigurations[$objectName] = \\F3\\FLOW3\\Object\\Configuration\\ConfigurationBuilder::buildFromConfigurationArray($objectName, $rawFLOW3ObjectConfiguration, 'FLOW3 Object Manager (pre-initialization)');\n\t\t\t}\n\t\t\t$this->objectContainer = new \\F3\\FLOW3\\Object\\Container\\DynamicObjectContainer();\n\t\t\t$this->objectContainer->setObjectConfigurations($parsedObjectConfigurations);\n\t\t}\n\n\t\t$this->objectContainer->injectSettings($this->configurationManager->getConfiguration(\\F3\\FLOW3\\Configuration\\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS));\n\t\t$this->objectContainer->setInstance('F3\\FLOW3\\Object\\ObjectManagerInterface', $this);\n\t\t$this->objectContainer->setInstance('F3\\FLOW3\\Resource\\ClassLoader', $this->classLoader);\n\t\t$this->objectContainer->setInstance('F3\\FLOW3\\Utility\\Environment', $environment);\n\n\t\t$this->objectContainer->setInstance('F3\\FLOW3\\Configuration\\ConfigurationManager', $this->configurationManager);\n\t\t$this->configurationManager->injectEnvironment($environment);\n\t}", "function init_env() {\n $envs_filename = base_path().DIRECTORY_SEPARATOR.'.env';\n $envs = $envs_array = [];\n \n if ($ressources = fopen($envs_filename, 'r')) {\n while (!feof($ressources)) {\n $element = fgets($ressources);\n\n if (!empty(trim($element))) {\n $element_array = explode('=', $element);\n $envs_array[$element_array[0]] = $element_array[1];\n }\n\n $envs[] = $element;\n }\n\n fclose($ressources);\n }\n\n $_ENV = array_merge($envs_array, $_ENV);\n }", "public static function instance() : Environment\n {\n if (!isset(self::$instance)) {\n throw new EnvironmentNotInitializedException;\n }\n return self::$instance;\n }", "private function _initEnvironment()\n {\n App_Utf8::clean_globals();\n App_Input::instance();\n ini_set('log_errors', true);\n if('development' === APPLICATION_ENV){\n ini_set('display_errors', true);\n error_reporting(E_ALL | E_STRICT);\n }\n else{\n ini_set('display_errors', false);\n error_reporting(E_COMPILE_ERROR | E_RECOVERABLE_ERROR | E_ERROR | E_CORE_ERROR);\n }\n umask(0);\n }", "public function setup_environment() {\n\n define( 'IWJ_TEMPLATE_PATH', $this->template_path() );\n\n //$this->add_thumbnail_support();\n //$this->add_image_sizes();\n }", "public function setUp()\n\t{\n\t\t$environments = $this->getEnvironmentAsArray($this->envFile);\n\n\t\tforeach ($environments as $env) {\n\t\t\tif (!$this->isComment($env) && $this->isEquals($env) !== false){\n\t\t\t\t$part = implode(' ', array_map('nl2br', explode(' ', $env)));\n\t\t\t\t$key = substr($part, 0, -strlen($value = strrchr($part, '=')));\n\t\t\t\t$value = substr($value, 1, strlen($part));\n\t\t\t\t$this->setEnvironmentVariable($key, $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function __construct()\n {\n $this->envPath = base_path('.env');\n $this->envExamplePath = base_path('.env.example');\n }", "protected function setupEnvironmentInDi()\n {\n $diContainer = Application::getInstance()->getDiContainer();\n $diContainer[DependencyInjectionHelper::KEY_ENVIRONMENT] = ENVIRONMENT;\n }", "protected function createEnvironment($basePath)\n {\n $this->container->share('environment', new Environment($basePath, $this->getContainer()));\n }", "public function prepare()\n {\n $this->timeTracker = $this->getInjector()->inject('TimeTracker');\n $this->env = $this->getInjector()->inject('Environment');\n $this->env->parseFile(__DIR__.'/../environment.json');\n $this->toggleShowErrors();\n return $this;\n }", "private function createTwigEnvironment(): Environment\n {\n $twigEnv = new Environment(\n $this->getLoader(),\n $this->getOptions()\n );\n\n if ($this->options['debug']) {\n $twigEnv->addExtension(new DebugExtension());\n }\n\n return $twigEnv;\n }", "public function environment()\n {\n return $this->env;\n }", "protected static function environment() {\n if (app()->environment('production')) {\n $clientId = config('app.paypal_live_client_id');\n $clientSecret = config('app.paypal_live_client_secret');\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n $clientId = config('app.paypal_sandbox_client_id');\n $clientSecret = config('app.paypal_sandbox_client_secret');\n return new SandboxEnvironment($clientId, $clientSecret);\n }", "protected function simulateFrontendEnvironment() {}", "function getEnvironment() {\n return Environment::env();\n}", "public function getEnvironment() { return $this->environment; }", "protected static function simulateFrontendEnvironment() {}", "protected static function simulateFrontendEnvironment() {}", "public function testEnvironmentInfo() {\n $this->assertFalse($this->object->isset_environmentInfo());\n\n $envInfo = new EnvironmentInfo();\n $this->object->set_environmentInfo($envInfo);\n $this->assertTrue($this->object->isset_environmentInfo());\n $this->assertEquals('EnvironmentInfo',\n get_class($this->object->get_environmentInfo()),\n 'Did not created environementInfo');\n }", "public function init()\n {\n// echo APPLICATION_ENV;\n }", "private function __construct()\n\t{\n\t\t// Do not call me\n\n\t\t// Translate Docker environmental variables to $ENV\n\t\texec('env', $output);\n\n\t\tforeach ($output as $var) {\n\t\t\t$tmp = explode('=', $var);\n\t\t\t$this->_env[$tmp[0]] = $tmp[1];\n\t\t}\n\n\t\t// Set the TLD suffix (domain ending) for virtual hosts\n\t\t// Note: If this is changed it currently also needs to be changed\n\t\t// in each webserver's configuration file in .devilbox/<webserver>/02-vhost-mass.conf\n\t\t$this->_tld = $GLOBALS['TLD_SUFFIX'];\n\n\t}", "private function set_environment() {\n $pedestal_env = 'live';\n if ( defined( 'WP_ENV' ) && 'development' == WP_ENV ) {\n $pedestal_env = 'dev';\n } elseif ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {\n $pedestal_env = $_ENV['PANTHEON_ENVIRONMENT'];\n }\n if ( ! defined( 'PEDESTAL_ENV' ) ) {\n define( 'PEDESTAL_ENV', $pedestal_env );\n }\n }", "protected function setUp() {\n $this->object = new \\classes\\System();\n }", "public function __construct($environment) {\n\t\t$this->_environment = $environment;\n\t\t$this->_jsonStructure = new \\stdClass();\n\t}", "public function getEnvironment() {\n return $this->environment; \n }", "private function settingEnvironmentVariables()\r\n {\r\n \t$this->Queue->engineOut(\"Q install directory located at \" . getcwd());\r\n \t$this->Queue->engineOut(\"Q Engine Service starting\");\r\n \t$this->Queue->engineOut(\"Timezone set to $this->tz\");\r\n\r\n putenv(\"VL_ENGINE_SERVICE_PID=$this->pid\");\r\n putenv(\"VL_ENGINE_VERBOSE=\".$this->engineProperties['engineVerbose']);\r\n putenv(\"VL_SESSION_KEY=$this->sessionKey\");\r\n\r\n $this->Queue->engineOut(\"Engine session key: $this->sessionKey\");\r\n $this->Queue->engineOut(\"System configured for \".$this->engineProperties['engineCount'].\" concurrent engine processes.\");\r\n $this->Queue->engineOut(\"Job scan interval configured for \".$this->engineProperties['engineTickSec'].\" seconds.\");\r\n }", "public function getDefaultEnvironment();", "public static function environment() {\n return self::$environment;\n }", "public static function setup()\n {\n try {\n $env = \\Dotenv\\Dotenv::create(__DIR__ . '/../../private/');\n $env->load();\n $env->required([\n 'ENVIRONMENT',\n ]);\n } catch (\\Exception $e) {\n echo $e;\n }\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "public function addEnvironment()\n {\n\n $data['phpVersions'] = $this->getPhpVersions();\n $data['mysqlVersions'] = $this->getMysqlVersions();\n\n $this->load->view('elements/header');\n $this->load->view('environments/create', $data);\n\n }", "public function formEnvironment()\n {\n\n // Todo\n // - add : define params : ports, id, dockerfile, passwords (+ check & error message -> ex : ports)\n // - edit (warning : volumes erased and add copy source if first delete then reconstruct => check commented \"formEnvironment\" method)\n\n if (\n //(!isset($_POST['webserverTrigger']) || empty($_POST['webserverTrigger'])) && // Todo : when webserver not embedded in php\n (!isset($_POST['phpTrigger']) || empty($_POST['phpTrigger'])) &&\n (!isset($_POST['mysqlTrigger']) || empty($_POST['mysqlTrigger'])) &&\n (!isset($_POST['sftp']) || empty($_POST['sftp']))\n ) {\n // Todo : proper error (display error flash ?!)\n exit ('no options choosen');\n }\n\n\n // Todo more params setable\n // Todo Errors\n // Todo Mails (params env.php)\n // Todo Facto\n // Todo : Warning session problem (db empty & exemple : no logout)\n // Todo : Warning ion_auth_users_groups delete cascade (+check all)\n\n\n // Load models\n $this->load->model('Environments_model');\n $this->load->model('Mysqlversions_model');\n $this->load->model('Phpversions_model');\n\n // Load helpers\n $this->load->helpers('Security_helper');\n\n // Load libs\n $this->load->library('zip');\n\n // User id\n $userId = $this->ion_auth->user()->row()->id;\n if (!isset($userId) || empty($userId)) {\n // Todo : proper error (display error flash ?!)\n exit ('no user id');\n }\n\n // 1. Instantiate environment\n $environment = new stdClass();\n\n // 2. Set userId\n $environment->{Environments_model::userId} = $userId;\n\n // 3. Set folder uniqId\n $phpUniqueId = uniqid();\n $environment->{Environments_model::folder} = $phpUniqueId;\n //Custom id management $environment->{Environments_model::folder} = (isset($_POST['customId']) && !empty($_POST['customId'])) ? strtolower(str_replace(' ', '_', trim($_POST['customId']))) : uniqid();\n\n // 4. Get $_POST params\n // Set name\n $environment->{Environments_model::name} = (isset($_POST['name']) && !empty($_POST['name'])) ? trim($_POST['name']) : $phpUniqueId;\n // Set webserver\n // Todo : $_POST['webserverTrigger']\n\n\n // Set php\n $environment->{Environments_model::phpVersionId} = (isset($_POST['phpTrigger']) && !empty($_POST['phpTrigger']) && isset($_POST['phpVersion']) && !empty($_POST['phpVersion']) && $_POST['phpVersion'] != \"--\" && $_POST['phpVersion'] != \"custom\") ? $_POST['phpVersion'] : null;\n if (isset($environment->{Environments_model::phpVersionId}) && !empty($environment->{Environments_model::phpVersionId})) {\n $environment->{Environments_model::phpPort} = (isset($_POST['phpPort']) && !empty($_POST['phpPort'])) ? /*$this->TODOchekAvailablePort($_POST['phpPort'])*/ $_POST['phpPort'] : $this->getAvailablePort();// Todo\n $environment->{Environments_model::phpSSLPort} = (isset($_POST['phpSSLPort']) && !empty($_POST['phpSSLPort'])) ? /*$this->TODOchekAvailablePort($_POST['phpSSLPort'])*/ $_POST['phpSSLPort'] : $this->getAvailablePort();// Todo\n // Todo : $environment->{Environments_model::phpDockerfile} = (isset($_POST['phpDockerfile']) && !empty($_POST['phpDockerfile'])) ? $_POST['phpDockerfile'] : null;\n }\n\n\t\tif (isset($environment->{Environments_model::phpVersionId}) && !empty($environment->{Environments_model::phpVersionId}) && $environment->{Environments_model::phpVersionId} == 1) {\n\t\t\t$environment->{Environments_model::webserver} = \"nginx\";\n\t\t} else {\n\t\t\t$environment->{Environments_model::webserver} = \"apache\";\n\t\t}\n\n // Set mysql\n $environment->{Environments_model::mysqlVersionId} = (isset($_POST['mysqlTrigger']) && !empty($_POST['mysqlTrigger']) && isset($_POST['mysqlVersion']) && !empty($_POST['mysqlVersion']) && $_POST['mysqlVersion'] != \"--\" && $_POST['mysqlVersion'] != \"custom\") ? $_POST['mysqlVersion'] : null;\n if (isset($environment->{Environments_model::mysqlVersionId}) && !empty($environment->{Environments_model::mysqlVersionId})) {\n $environment->{Environments_model::mysqlUser} = (isset($_POST['mysqlUser']) && !empty($_POST['mysqlUser'])) ? $_POST['mysqlUser'] : 'root';// Todo\n $environment->{Environments_model::mysqlPassword} = (isset($_POST['mysqlPassword']) && !empty($_POST['mysqlPassword'])) ? $_POST['mysqlPassword'] : randomPassword();// Todo\n $environment->{Environments_model::mysqlPort} = (isset($_POST['mysqlPort']) && !empty($_POST['mysqlPort'])) ? /*$this->TODOchekAvailablePort($_POST['mysqlPort'])*/ $_POST['mysqlPort'] : $this->getAvailablePort();// Todo\n // Todo : $environment->{Environments_model::mysqlDockerfile} = (isset($_POST['mysqlDockerfile']) && !empty($_POST['mysqlDockerfile'])) ? $_POST['mysqlDockerfile'] : null;\n }\n\n // Set phpmyadmin\n $environment->{Environments_model::hasPma} = (isset($_POST['mysqlTrigger']) && !empty($_POST['mysqlTrigger']) && isset($_POST['mysqlVersion']) && !empty($_POST['mysqlVersion']) && isset($_POST['pma']) && !empty($_POST['pma'])) ? true : false;\n if (isset($environment->{Environments_model::hasPma}) && !empty($environment->{Environments_model::hasPma})) {\n $environment->{Environments_model::pmaPort} = (isset($_POST['pmaPort']) && !empty($_POST['pmaPort'])) ? /*$this->TODOchekAvailablePort($_POST['pmaPort'])*/ $_POST['pmaPort'] : $this->getAvailablePort();// Todo\n }\n\n // Set sftp\n $environment->{Environments_model::hasSftp} = (isset($_POST['sftp']) && !empty($_POST['sftp'])) ? true : false;\n if (isset($environment->{Environments_model::hasSftp}) && !empty($environment->{Environments_model::hasSftp})) {\n //$environment->{Environments_model::sftpUser} = (isset($_POST['sftpUser']) && !empty($_POST['sftpUser'])) ? $_POST['sftpUser'] : $environment->{Environments_model::folder};// Todo\n $environment->{Environments_model::sftpUser} = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n $environment->{Environments_model::sftpPassword} = (isset($_POST['sftpPassword']) && !empty($_POST['sftpPassword'])) ? $_POST['sftpPassword'] : randomPassword();// Todo\n $environment->{Environments_model::sftpPort} = (isset($_POST['sftpPort']) && !empty($_POST['sftpPort'])) ? /*$this->TODOchekAvailablePort($_POST['sftpPort'])*/ $_POST['sftpPort'] : $this->getAvailablePort();// Todo\n }\n\n // Set xDebug\n if ($_POST['xDebugTrigger']) {\n $environment->{Environments_model::xDebugRemoteHost} = (isset($_POST['xDebugRemoteHost']) && !empty($_POST['xDebugRemoteHost'])) ? $_POST['xDebugRemoteHost'] : '0.0.0.0';\n }\n\n // 5. Generate docker compose\n $isProjectDockerFolderCreated = $this->generateProjectDockerFolder($environment);\n\n // Steps 6/7\n if ($isProjectDockerFolderCreated) {\n\n\t\t\t// 6. Check git\n\t\t\tif (isset($_POST['repositoryGit']) && !empty($_POST['repositoryGit'])) {\n\n\t\t\t\t$repositoryGit = $_POST['repositoryGit'];\n\n\t\t\t\t// 1a (optional). Check if repo has credentials (then add it in url)\n\t\t\t\tif (isset($_POST['gitCredentialsUsername']) && !empty($_POST['gitCredentialsUsername'])) {\n\n\t\t\t\t\tif (isset($_POST['gitCredentialsPass']) && !empty($_POST['gitCredentialsPass'])) {\n\n\t\t\t\t\t\t$tagOne = \"https://\";\n\t\t\t\t\t\t$tagTwo = \"@\";\n\n\t\t\t\t\t\t$repositoryGit = preg_replace('#('.preg_quote($tagOne).')(.*?)('.preg_quote($tagTwo).')#si', '$1'. $_POST['gitCredentialsUsername'] . ':' . $_POST['gitCredentialsPass'] .'$3', $repositoryGit);\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// todo error\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\ttry {\n\n\t\t\t\t\trequire(APPPATH . 'third_party/czproject/git-php/src/GitRepository.php');\n\n\t\t\t\t\t$folderName = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n\n\t\t\t\t\tunlink(ABSOLUTE_ENVS_FOLDER . \"/\" . $folderName . \"/src/index.php\");\n\t\t\t\t\t$dockerComposePath = ABSOLUTE_ENVS_FOLDER . \"/\" . $folderName . \"/src\";\n\n\t\t\t\t\t$repo = Cz\\Git\\GitRepository::cloneRepository($repositoryGit, $dockerComposePath);\n\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t// todo error\n\t\t\t\t\t//var_dump($e);\n\t\t\t\t}\n\n\n\t\t\t\t$environment->{Environments_model::repositoryGit} = $repositoryGit;\n\n\t\t\t}\n\n\t\t\t// 7. Add environment\n\t\t\t$environmentId = $this->Environments_model->insertEnvironment($environment);\n\n if (isset($environmentId) && $environmentId != -1) {\n\n // 7. Start docker compose\n $folderName = strtolower(str_replace(' ', '_', trim($environment->{Environments_model::name})));\n $dockerComposePath = INNER_ENVS_FOLDER . \"/\" . $folderName . \"/\";\n $this->startEnvironment($dockerComposePath);\n\n // Todo send admin mail ?!\n redirect('environments');\n\n } else {\n // Todo : proper error (display error flash ?!)\n exit('Error insert env add || update !');\n }\n } else {\n // Todo : proper error (display error flash ?!)\n exit('Error docker compose file !');\n }\n\n }", "public function environment() {\n $this->envPath = base_path('.env');\n $this->envExamplePath = base_path('.env.example');\n \n $envConfig = $this->getEnvContent();\n \n return view('installer::environment', compact('envConfig'));\n }", "public function __construct($env = null)\n {\n $this->env = $env;\n $this->init();\n $this->items = $this->getItems();\n }", "public function __construct()\n {\n $this->envKeys = new StringCollection();\n }", "public static function environment(){\n return \\Illuminate\\Foundation\\Application::environment();\n }", "public function setEnvironment($environmentVars);", "protected function getTemplate_Twig_EnvironmentService()\n {\n $this->services['template.twig.environment'] = $instance = new \\phpbb\\template\\twig\\environment(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['filesystem']) ? $this->services['filesystem'] : ($this->services['filesystem'] = new \\phpbb\\filesystem\\filesystem())) && false ?: '_'}, ${($_ = isset($this->services['path_helper']) ? $this->services['path_helper'] : $this->getPathHelperService()) && false ?: '_'}, './../cache/production/twig/', ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['template.twig.loader']) ? $this->services['template.twig.loader'] : $this->getTemplate_Twig_LoaderService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, []);\n\n $instance->setLexer(${($_ = isset($this->services['template.twig.lexer']) ? $this->services['template.twig.lexer'] : $this->getTemplate_Twig_LexerService()) && false ?: '_'});\n\n return $instance;\n }", "public function init(){\n\n // Setup Application Environment\n if($this->environment != null && $this->client != null)\n $this->setupApplicationEnvironment();\n\n }", "public function __construct()\n {\n $this->app = new Application();\n //Create router\n $this->router = new Router();\n\n //Use URL Env for Netlify or the provided domain from the commandline invocation\n if (getenv('URL')) {\n $siteUrl = getenv('URL');\n } else {\n global $argv;\n if (isset($argv[1]) && filter_var($argv[1], FILTER_VALIDATE_URL)) {\n $siteUrl = $argv[1];\n } else {\n echo 'ERROR: No URL enviroment variable found. Please provide a full URL to the build command. Example; https://mysite.com';\n die;\n }\n }\n $urlInfo = parse_url($siteUrl);\n $_SERVER['SERVER_NAME'] = $urlInfo['host'];\n $_SERVER['HTTPS'] = ($urlInfo['scheme'] === 'https') ? 'on' : 'off';\n }", "function __construct() {\n \n self::setQuantumVars();\n \n self::setAutoLoader();\n \n self::initActiveRecord();\n \n self::initSmarty();\n \n self::launcher();\n \n self::output();\n \n }", "public function __construct()\n {\n parent::__construct();\n\n\n $this->twig = new Environment(new FilesystemLoader('../src/View'), array(\n 'cache' => false,\n 'debug' => true,\n ));\n //permet de Dumper depuis le front\n $this->twig->addExtension(new DebugExtension());\n //création super global session à partir de l'objet user récupérer\n $this->twig->addGlobal('session', $this->session->getUserSession());\n $this->getCommentsDisable();\n }", "public function buildEnvironment(Suite $suite);", "function setEnvironment($value){ $_ENV['CURRENT_ENVIRONMENT'] = $value; }", "public function __construct() {\n\t\t$rootpth = $this->di_registry->get('projectRoot');\n\t\tif ($rootpth === null) {\n\t\t\t//default to var/projects/\n\t\t\t$root = $this->di_context->varPath('projects');\n\t\t\tif (!file_exists($root)) {\n\t\t\t\tmkdir($root, 0755);\n\t\t\t}\n\t\t} else {\n\t\t\t$root = realpath($rootpth);\n\t\t}\n\n\t\tif ($root === false) {\n\t\t\tthrow new BadEnvironmentException(\"Project root directory '{$rootpth}' does not exist\");\n\t\t}\n\t\t$this->projectDir = $root;\n\t}", "public function __construct()\n {\n $dotenv = \\Dotenv\\Dotenv::createImmutable(__DIR__ . '/../../');\n $dotenv->load();\n \n $db_host = $_ENV['DB_HOST'];\n $db_user = $_ENV['DB_USER'];\n $db_pass = $_ENV['DB_PASS'];\n $db_name = $_ENV['DB_NAME'];\n $db_port = $_ENV['DB_PORT'];\n \n $this->db_host = $db_host;\n $this->db_user = $db_user;\n $this->db_pass = $db_pass;\n $this->db_name = $db_name;\n $this->db_port = $db_port;\n\n $this->setConnection();\n\n return $this;\n }", "public function __construct(array $environmentVariables)\n {\n $this->_environmentVariables = $environmentVariables;\n }", "public function environment() {\n\t\t$pageTitle = 'Environment';\n\t\t// $stylesheet = '';\n\n\t\tinclude_once SYSTEM_PATH.'/view/header.php';\n\t\tinclude_once SYSTEM_PATH.'/view/academic-help/environment.php';\n\t\tinclude_once SYSTEM_PATH.'/view/footer.php';\n\t}", "public static function __once() {\n\t\ttry {\n\t\t\tself::$environment = \\Glue\\Component\\Environment::getInstance();\n\t\t\tself::$path = self::$environment->get('path');\n\t\t\tself::$node = '/' . self::$environment->get('node');\n\t\t} catch(\\Exception $exception) {\n\t\t\tthrow new \\RuntimeException(\\Glue\\Helper\\General::replace(array('class' => __CLASS__), GLUE_EXCEPTION_CLASS_INITIALIZE), NULL, $exception);\n\t\t}\n\t}", "public function getEngine()\n {\n return $this->environment;\n }", "public static function environment() {\n\t\treturn env('HORIZON_MODE');\n\t}", "public function getEnvironment()\n\t{\n\t\treturn $this->_environment;\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"EnvName\",$param) and $param[\"EnvName\"] !== null) {\n $this->EnvName = $param[\"EnvName\"];\n }\n\n if (array_key_exists(\"DesiredComputeNodeCount\",$param) and $param[\"DesiredComputeNodeCount\"] !== null) {\n $this->DesiredComputeNodeCount = $param[\"DesiredComputeNodeCount\"];\n }\n\n if (array_key_exists(\"EnvDescription\",$param) and $param[\"EnvDescription\"] !== null) {\n $this->EnvDescription = $param[\"EnvDescription\"];\n }\n\n if (array_key_exists(\"EnvType\",$param) and $param[\"EnvType\"] !== null) {\n $this->EnvType = $param[\"EnvType\"];\n }\n\n if (array_key_exists(\"EnvData\",$param) and $param[\"EnvData\"] !== null) {\n $this->EnvData = new EnvData();\n $this->EnvData->deserialize($param[\"EnvData\"]);\n }\n\n if (array_key_exists(\"MountDataDisks\",$param) and $param[\"MountDataDisks\"] !== null) {\n $this->MountDataDisks = [];\n foreach ($param[\"MountDataDisks\"] as $key => $value){\n $obj = new MountDataDisk();\n $obj->deserialize($value);\n array_push($this->MountDataDisks, $obj);\n }\n }\n\n if (array_key_exists(\"Authentications\",$param) and $param[\"Authentications\"] !== null) {\n $this->Authentications = [];\n foreach ($param[\"Authentications\"] as $key => $value){\n $obj = new Authentication();\n $obj->deserialize($value);\n array_push($this->Authentications, $obj);\n }\n }\n\n if (array_key_exists(\"InputMappings\",$param) and $param[\"InputMappings\"] !== null) {\n $this->InputMappings = [];\n foreach ($param[\"InputMappings\"] as $key => $value){\n $obj = new InputMapping();\n $obj->deserialize($value);\n array_push($this->InputMappings, $obj);\n }\n }\n\n if (array_key_exists(\"AgentRunningMode\",$param) and $param[\"AgentRunningMode\"] !== null) {\n $this->AgentRunningMode = new AgentRunningMode();\n $this->AgentRunningMode->deserialize($param[\"AgentRunningMode\"]);\n }\n\n if (array_key_exists(\"Notifications\",$param) and $param[\"Notifications\"] !== null) {\n $this->Notifications = [];\n foreach ($param[\"Notifications\"] as $key => $value){\n $obj = new Notification();\n $obj->deserialize($value);\n array_push($this->Notifications, $obj);\n }\n }\n\n if (array_key_exists(\"ActionIfComputeNodeInactive\",$param) and $param[\"ActionIfComputeNodeInactive\"] !== null) {\n $this->ActionIfComputeNodeInactive = $param[\"ActionIfComputeNodeInactive\"];\n }\n\n if (array_key_exists(\"ResourceMaxRetryCount\",$param) and $param[\"ResourceMaxRetryCount\"] !== null) {\n $this->ResourceMaxRetryCount = $param[\"ResourceMaxRetryCount\"];\n }\n\n if (array_key_exists(\"Tags\",$param) and $param[\"Tags\"] !== null) {\n $this->Tags = [];\n foreach ($param[\"Tags\"] as $key => $value){\n $obj = new Tag();\n $obj->deserialize($value);\n array_push($this->Tags, $obj);\n }\n }\n\n if (array_key_exists(\"NotificationTarget\",$param) and $param[\"NotificationTarget\"] !== null) {\n $this->NotificationTarget = $param[\"NotificationTarget\"];\n }\n }", "public static function createFromGlobals() {\n throw new Exception(\"Can not generate request from globals in a hprose environment.\");\n }", "public static function getInstance()\n {\n\n if (is_null(self::$_instance)) {\n self::$_instance = new UtilsEnv();\n }\n\n return self::$_instance;\n }", "public static function init()\n {\n self::$browsers = new Browser_Manager();\n self::$users = new User_Manager();\n self::$routes = new Routing_Manager();\n self::$pages = new Page_Manager();\n self::$themes = new Theme_Manager();\n self::$debug = new Debug_Manager();\n\n // disable debugging if we are unit testing\n if (defined('UNIT_TEST') && UNIT_TEST)\n {\n self::$debug->setEnabled(false);\n }\n\n\t\t// with the general environment loaded, we can now load\n\t\t// the modules that are app-specific\n self::$request = new App_Request();\n self::$response = new App_Response();\n self::$conditions = new App_Conditions();\n }", "public static function setEnv()\n {\n // We are on bluemix\n if (self::onBluemix()) {\n // Copy Env values\n self::copyEnv();\n\n // Set services credentials\n self::setServiceCredentials();\n }\n }", "public function __construct()\n\t{\n\t\t$this->system = new System;\n\n\t\t$config = $this->system->getFileContent( \"Config\\\\config.json\" );\n\t\t$config = json_decode( $config, True );\n\n\t\tforeach( $config as $key => $value ) {\n\t\t\t$this->$key = $value;\n\t\t}\n\n\t\tif( $_SERVER['SERVER_NAME'] == \"localhost\" ) {\n\t\t\t$server = \"http://\" . $_SERVER['SERVER_NAME'];\n\t\t} else {\n\t\t\t$server = $_SERVER['SERVER_NAME'];\n\t\t}\n\t\t$this->server = $server . \"/\" . $this->workspace;\n\t\t\n\t\t$this->address = $this->parseAddress( $_SERVER['REQUEST_URI'] );\n\t}", "public function __construct() {\n\t\t$sf = spitfire();\n\t\t$params = func_get_args();\n\n\t\t#Extract the app\n\t\tif (reset($params) instanceof App || $sf->appExists(reset($params))) {\n\t\t\t$app = array_shift($params);\n\t\t}\n\t\telse {\n\t\t\t$app = $sf;\n\t\t}\n\n\t\t#Get the controller, and the action\n\t\t$controller = null;\n\t\t$action = null;\n\t\t$object = Array();\n\n\t\t#Get the object\n\t\twhile(!empty($params) && !is_array(reset($params)) ) {\n\t\t\tif (!$controller) { $controller = array_shift($params); }\n\t\t\telseif (!$action) { $action = array_shift($params); }\n\t\t\telse { $object[] = array_shift($params); }\n\t\t}\n\n\t\t#Get potential environment variables that can be used for additional information\n\t\t#like loccalization\n\t\t$get = array_shift($params);\n\t\t$environment = array_shift($params);\n\n\t\tparent::__construct($app, $controller, $action, $object, 'php', $get, $environment);\n\t}", "protected function setEnv()\n {\n // this function called before ?\n static $called = false;\n\n // prevent for calling multiple times\n if ( $called ) return; $called = true;\n\n // Create a ref. of _SERVER array\n // to simplify coding ^_*\n $s = &$_SERVER;\n\n // Set some environment vars\n $s['DEFAULT_SCHEME'] = empty($s['DEFAULT_SCHEME']) ? 'http' : $s['DEFAULT_SCHEME']; \n $s['DEFAULT_DOMAIN'] = (empty($s['DEFAULT_DOMAIN']) ? $s['SERVER_NAME'] : $s['DEFAULT_DOMAIN']);\n $s['SIMULATOR'] = (empty($s['SIMULATOR']) ? ($s['SIMULATOR'] = 'on') : strtolower($s['SIMULATOR']));\n $s['SIMULATED'] = isset($s['PATH_INFO']);\n $s['URL'] = $s['DEFAULT_SCHEME'] . '://' . $s['DEFAULT_DOMAIN'] . '/' . rtrim(ltrim(dirname($s['SCRIPT_NAME']), '/\\\\'), '\\\\/') . '/';\n $s['ROUTE'] = $s['URL'] . (($s['SIMULATOR'] == 'on') ? 'index.php/' : '');\n $s['QUERY_STRING'] = str_replace(array(\"\\0\", chr(0), '%00'), '', ($s['QUERY_STRING']));\n $s['REQUEST_METHOD'] = strtoupper($s['REQUEST_METHOD']);\n\n // simulator started ?\n if ( $s['SIMULATOR'] == 'on' )\n $s['SIMULATED'] || header(\"Location: {$s['ROUTE']}\", TRUE, 302);\n\n // update the path_info\n $s['PATH_INFO'] = empty($s['PATH_INFO']) ? '/' : preg_replace('/\\/+/', '/', ('/'.(rtrim(ltrim($s['PATH_INFO'], '/'), '/')).'/'));\n $s['PATH_INFO'] = str_replace(array(\"\\0\", chr(0), '%00'), '', ($s['PATH_INFO']));\n\n // disable libxml errors\n libxml_use_internal_errors(TRUE);\n\n // Read header_inputs\n $_INPUT = array();\n $i = str_replace(array(\"\\0\", chr(0), '%00'), '', rawurldecode(file_get_contents('php://input')));\n\n // then parse it and detect whether it is\n // basic_string, json or xml\n if ( is_array($t = json_decode($i, true)) && $t != FALSE )\n $_INPUT = &$t;\n elseif ( ($t = simplexml_load_string($i)) && $t != FALSE )\n $_INPUT = &$t;\n else \n parse_str($i, $_INPUT);\n\n // _POST ?\n $_POST = &$_INPUT;\n\n // Read query_string\n // then parse it and detect whether it is\n // basic_string, json or xml\n $decoded = rawurldecode($s['QUERY_STRING']);\n if (is_array($x = json_decode($decoded, true)) && $x != FALSE )\n $_GET = &$x;\n elseif ( ($x = simplexml_load_string($decoded)) && $x != FALSE )\n $_GET = &$x;\n else \n parse_str($s['QUERY_STRING'], $_GET);\n\n // enable libxml errors again\n libxml_use_internal_errors(FALSE);\n\n // Set the requests arrays [get, post, request]\n $_GET = (array) $_GET;\n $_POST = (array) $_POST;\n $_REQUEST = (array) array_merge($_GET, $_POST, (array) $_INPUT);\n\n // Set environment headers\n header('Content-Type: text/html; charset=UTF-8', TRUE);\n header('X-Powered-By: HORUS/PHP', TRUE);\n\t\theader(\"Cache-Control: no-store, no-cache, must-revalidate, max-age=0\", TRUE);\n\t\theader(\"Cache-Control: post-check=0, pre-check=0\", TRUE);\n\t\theader(\"Pragma: no-cache\", TRUE);\n header(\"X-Frame-Options: SAMEORIGIN\", TRUE);\n header(\"X-XSS-Protection: 1; mode=block\", TRUE);\n header(\"X-Content-Type-Options: nosniff\", TRUE);\n\n // free memory from some vars\n unset($s, $i, $x, $t, $_INPUT, $path);\n\n return $this;\n }", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "public function environment()\n {\n $envConfig = $this->EnvironmentManager->getEnvContent();\n //Sets the default values of the .env file!\n $APP_ENV = 'local';\n $APP_DEBUG = 'true';\n $APP_KEY = '4958763498756837942368weufgsdgw3';\n $DB_HOST = 'localhost';\n $DB_DATABASE = 'database';\n $DB_USERNAME = 'Username';\n $DB_PASSWORD = 'Password';\n \n $CACHE_DRIVER = 'file';\n $SESSION_DRIVER = 'file';\n $QUEUE_DRIVER = 'sync';\n $MAIL_DRIVER = 'smtp';\n $MAIL_HOST = 'mailtrap.io';\n $MAIL_PORT= 2525;\n $MAIL_USERNAME = 'null';\n $MAIL_PASSWORD = 'null';\n $MAIL_ENCRYPTION= 'null';\n return view('vendor.installer.environment', \n [\n 'APP_ENV' => $APP_ENV,\n 'APP_DEBUG' => $APP_DEBUG,\n 'APP_KEY' => $APP_KEY,\n 'DB_HOST' => $DB_HOST,\n 'DB_DATABASE' => $DB_DATABASE,\n 'DB_USERNAME' => $DB_USERNAME,\n 'DB_PASSWORD' => $DB_PASSWORD,\n 'CACHE_DRIVER' => $CACHE_DRIVER,\n 'SESSION_DRIVER' => $SESSION_DRIVER,\n 'QUEUE_DRIVER' => $QUEUE_DRIVER,\n 'MAIL_DRIVER' => $MAIL_DRIVER,\n 'MAIL_HOST' => $MAIL_HOST,\n 'MAIL_PORT' => $MAIL_PORT,\n 'MAIL_USERNAME' => $MAIL_USERNAME,\n 'MAIL_PASSWORD' => $MAIL_PASSWORD,\n 'MAIL_ENCRYPTION' => $MAIL_ENCRYPTION,\n ]\n );\n }", "public function getEnvironment()\n {\n return self::$_environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function __invoke()\n {\n Helpers::step('<options=bold>Setting Build Environment</>');\n\n if (! file_exists($envPath = $this->appPath.'/.env')) {\n $this->files->put($envPath, '');\n }\n\n if (file_exists($this->appPath.'/.env.'.$this->environment)) {\n $this->files->copy(\n $this->appPath.'/.env.'.$this->environment,\n $envPath\n );\n\n $this->files->delete($this->appPath.'/.env.'.$this->environment);\n }\n\n $this->files->prepend(\n $envPath,\n 'APP_ENV='.$this->environment.PHP_EOL\n );\n\n // Mix takes the last environment variable value...\n $this->files->append(\n $envPath,\n PHP_EOL.'APP_ENV='.$this->environment.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'MIX_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n\n $this->files->append(\n $envPath,\n 'VITE_VAPOR_ASSET_URL='.$this->assetUrl.PHP_EOL\n );\n }" ]
[ "0.6989323", "0.69728076", "0.69287914", "0.6877201", "0.6787946", "0.66661406", "0.6609642", "0.64328426", "0.6422504", "0.6346367", "0.6345911", "0.6341614", "0.625561", "0.6244985", "0.6229618", "0.62230146", "0.620282", "0.6199146", "0.6196702", "0.61785835", "0.61785835", "0.61785835", "0.61785835", "0.61785835", "0.61785835", "0.6170267", "0.6166422", "0.6160589", "0.61371964", "0.6060951", "0.6047367", "0.6013108", "0.6010498", "0.59913766", "0.5979402", "0.5956549", "0.5936777", "0.5917818", "0.5909868", "0.5902243", "0.58925253", "0.5892064", "0.58916616", "0.5881336", "0.58681864", "0.5859015", "0.5855048", "0.583736", "0.58316237", "0.58316237", "0.58273715", "0.58157116", "0.58148086", "0.5814028", "0.5800482", "0.5765329", "0.5758765", "0.57436603", "0.57436085", "0.5738038", "0.5734443", "0.57032806", "0.57032806", "0.57032806", "0.5699704", "0.56954277", "0.5694181", "0.568179", "0.5669161", "0.5666553", "0.565929", "0.56519115", "0.5648897", "0.56328744", "0.56313235", "0.56288606", "0.5625963", "0.5608778", "0.5608531", "0.5601581", "0.55946255", "0.55938023", "0.55925727", "0.55806285", "0.55693126", "0.55679226", "0.5559519", "0.55563915", "0.5550451", "0.5550137", "0.5547098", "0.55424386", "0.5532059", "0.55289215", "0.5528743", "0.5518743", "0.5499723", "0.5495313", "0.5484737", "0.5482113", "0.5471444" ]
0.0
-1
Returns whether this plugin is running on a test system or the production system.
public function is_test_environment() { if(empty($this->production_site_url)) return true; else return get_site_url() === $this->production_site_url ? false : true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}", "public function isProd() {\n\t\tif ($this->checkEnv(array('prod', 'product', 'production'))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'prod'));\n }\n\n // Pantheon.\n if (defined('PANTHEON_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'live'));\n }\n\n return FALSE;\n }", "protected function isProduction()\n {\n return $this->getEnvironment()->isProd();\n }", "public static function isProdEnvironment()\r\n {\r\n return in_array($_SERVER['HTTP_HOST'], static::getProdDomains());\r\n }", "function is_production() {\n\treturn ENV == PRODUCTION;\n}", "public static function isProductionMode()\n {\n return (self::getEnvMode() == PaylineSDK::ENV_PROD);\n }", "public function isProduction() {\n return !empty($this->configuration['production']);\n }", "public function IsProduction () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::PRODUCTION];\n\t}", "public function isProduction(): bool\n {\n return $this->env === 'production';\n }", "public function isProduction()\n {\n return $this->transbankConfig->isProduction();\n }", "public function isProduction()\r\n {\r\n return (bool) $this->productionMode;\r\n }", "function is_prod() {\n return env() === 'production';\n}", "public function isTestMode()\n {\n if (strpos($this->adyenMode, Environment::TEST) !== false) {\n return true;\n } else {\n return false;\n }\n }", "public function isProductionMode(): bool;", "public static function isProductive()\n\t{\n\t\treturn (self::getEnvironmentVariable(self::ENV_PRODUCTIVE, true));\n\t}", "public static function isProductionEnv() {\n return getenv('ENVIRONMENT') !== false && strtolower(getenv('ENVIRONMENT')) === \"production\";\n }", "public function isProduction();", "public static function isInTestingEnvironment()\n {\n return !in_array(env('APP_ENV'),['prod','production']);\n }", "public function isProduction() {}", "public static function inProduction(): bool\n {\n $env = env('APP_ENV');\n\n return $env === 'production' || $env === 'prod';\n }", "public function isInProductionMode()\n {\n return $this->_appState->getMode() === \\Magento\\Framework\\App\\State::MODE_PRODUCTION;\n }", "public static function detectProductionMode()\n\t{\n\t\t$addrs = array();\n\t\tif (PHP_SAPI === 'cli') {\n\t\t\t$addrs[] = getHostByName(php_uname('n'));\n\t\t} else {\n\t\t\tif (!isset($_SERVER['SERVER_ADDR']) && !isset($_SERVER['LOCAL_ADDR'])) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { // proxy server detected\n\t\t\t\t$addrs = preg_split('#,\\s*#', $_SERVER['HTTP_X_FORWARDED_FOR']);\n\t\t\t}\n\t\t\tif (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t$addrs[] = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t\t$addrs[] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR'];\n\t\t}\n\n\t\tforeach ($addrs as $addr) {\n\t\t\t$oct = explode('.', $addr);\n\t\t\t// 10.0.0.0/8 Private network\n\t\t\t// 127.0.0.0/8 Loopback\n\t\t\t// 169.254.0.0/16 & ::1 Link-Local\n\t\t\t// 172.16.0.0/12 Private network\n\t\t\t// 192.168.0.0/16 Private network\n\t\t\tif ($addr !== '::1' && (count($oct) !== 4 || ($oct[0] !== '10' && $oct[0] !== '127' && ($oct[0] !== '172' || $oct[1] < 16 || $oct[1] > 31)\n\t\t\t\t&& ($oct[0] !== '169' || $oct[1] !== '254') && ($oct[0] !== '192' || $oct[1] !== '168')))\n\t\t\t) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }", "public function isTestMode() {\n\t\treturn (bool) $this->app->store->get()->params->get('anet.test_mode');\n\t}", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public function getIsSystemOn(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->getIsLive();\n }", "public final function isDebugEnabled()\n {\n return getenv('TEST') === 'true';\n }", "public function isDev()\n {\n return ($this->_environment === 'development');\n }", "public static function isDebug() \n {\n if (array_key_exists(self::APPLICATION_ENV_KEY, $_SERVER))\n {\n return strtolower($_SERVER[self::APPLICATION_ENV_KEY]) == self::DEV_ENV_VALUE;\n }\n }", "function is_production(){\r\n if(ENVIRONMENT == 'production'){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "public static function isProductionModeEnabled(): bool\n {\n return self::PRODUCTION_MODE_ENABLED == Symphony::Configuration()->get('production_mode_enabled', 'saxon');\n }", "private function isDev()\n {\n $is_localhost = (@$_SERVER['HTTP_HOST'] == 'localhost');\n $is_dev_server = (isset($GLOBALS['is_development_server']) && $GLOBALS['is_development_server'] == '1');\n $debug_enabled = $this->getSystemSetting('enable-js-debug-logging');\n $is_dev = ($is_localhost || $is_dev_server || $debug_enabled) ? 1 : 0;\n return $is_dev;\n }", "public function runningUnitTests()\n {\n return $this->environment() == 'testing';\n }", "public function isDevelopmentEnvironment() {\n\t\treturn in_array($this->getKernel()->getEnvironment(), array('test', 'dev'));\n\t}", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "public function isTest() {\n\t\treturn $this->_options['test'];\n\t}", "public function isTestMode()\n {\n return $this->isTestMode;\n }", "public function environmentIsConfigured();", "public function isDeveloperMode()\n {\n $mode = 'default';\n if (isset($this->server[State::PARAM_MODE])) {\n $mode = $this->server[State::PARAM_MODE];\n } else {\n $deploymentConfig = $this->getObjectManager()->get(DeploymentConfig::class);\n $configMode = $deploymentConfig->get(State::PARAM_MODE);\n if ($configMode) {\n $mode = $configMode;\n }\n }\n\n return $mode == State::MODE_DEVELOPER;\n }", "private function isProductionSiteAllowed()\n\t{\n\t\tif (GetConfig('HostingId')) {\n\t\t\tif (GetConfig('AvailableFeatures') & FEATURE_AVAILABLE_LIVE_EBAY_LISTING) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function isDev(): bool;", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "function isNotLive(){ return $_ENV['CURRENT_ENVIRONMENT'] != ENVIRONMENT_LIVE; }", "public function isEnvironmentInFrontendMode() {}", "public function isPackaged()\n {\n return $this->isProduction();\n }", "function is_system_configured() {\n global $CFG;\n return (!empty($CFG->ombielalertsserverendpoint) && \n !empty($CFG->ombielalertsserversserverusername) && \n !empty($CFG->ombielalertsserverpassword) && \n !empty($CFG->ombielalertsorgcode) && \n !empty($CFG->ombielalertsorgpassword)\n );\n }", "function is_dev()\n{\n return env('APP_ENV') === 'local' ? true : false;\n}", "public static function is_development()\n {\n return Kohana::$environment == Kohana::DEVELOPMENT;\n }", "function check_environment_correct()\n {\n $environment_array = explode('|', strtolower($this->EE->TMPL->fetch_param('environment')));\n\n return ( ! empty($environment_array))\n ? (in_array(strtolower($_SERVER['SERVER_NAME']), $environment_array))\n : TRUE;\n }", "public static function getEnvMode()\n {\n return (Configuration::get('PAYLINE_LIVE_MODE') == '1' ? PaylineSDK::ENV_PROD : PaylineSDK::ENV_HOMO);\n }", "private function getServerType()\n\t{\n\t\t$sandbox = $this->params->get('sandbox',0);\n\t\treturn $sandbox ? 'sandbox' : 'production';\n\t}", "public function IsDevelopment () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::DEVELOPMENT];\n\t}", "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "function themeIsDev() {\n if( defined( 'WP_DEV' ) || wp_get_environment_type() === 'development' ) {\n return true;\n } else {\n return false;\n }\n}", "public function isEnabledInSystem()\r\n\t{\r\n\t\t// Get global vars\r\n\t\tglobal $realtime_webservice_global_enabled;\r\n\t\t// If both vars have a value, then it IS enabled\r\n\t\treturn $realtime_webservice_global_enabled;\r\n\t}", "public static function isDev(){\n if (isset($_GET['env']))\n return false;\n return (env('APP_ENV') == 'dev');\n }", "protected function InProduction($ServerName=null)\r\n\t{\r\n\t\tif(!strpos($ServerName,'.com'))\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "public function hasDevEnv()\n {\n // if not set abort\n if (empty($this->objEnvironmentSettings->environment)) {\n return false;\n }\n\n // determine if it's development\n return 'development' == $this->objEnvironmentSettings->environment;\n }", "function isLive(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_LIVE; }", "function is_development(): bool\n{\n return stripos(getenv('HTTP_HOST'), 'sunshine') != 0;\n}", "private function canRun()\n {\n $confEnabled = $this->config()->get('cdn_rewrite');\n $devEnabled = ((!Director::isDev()) || ($this->config()->get('enable_in_dev')));\n return ($confEnabled && $devEnabled);\n }", "public function getTestMode(): bool\n {\n return $this->testMode;\n }", "public function isUnitTests(): bool\n {\n return $this->env === 'testing';\n }", "private static function detect_env()\n {\n if (!defined('POPOPENFW_IS_CLI')) {\n $env = (php_sapi_name() == 'cli') ? (true) : (false);\n define('POPOPENFW_IS_CLI', $env);\n }\n return POPOPENFW_IS_CLI;\n }", "private static function detect_env()\n {\n if (!defined('POPOPENFW_IS_CLI')) {\n $env = (php_sapi_name() == 'cli') ? (true) : (false);\n define('POPOPENFW_IS_CLI', $env);\n }\n return POPOPENFW_IS_CLI;\n }", "protected function getDebugMode(): bool\n {\n return (bool)getenv('STAIRTOWER_TEST_DEBUG_MODE');\n }", "public function isTestMode() :bool\n {\n $config = $this->getConfig();\n\n if ($this->gateway->provider == 'Stripe' && property_exists($config, 'publishableKey') && strpos($config->publishableKey, 'test')) {\n return true;\n }\n\n if ($config && property_exists($config, 'testMode') && $config->testMode) {\n return true;\n }\n\n return false;\n }", "function is_staging() {\n return env() === 'staging';\n}", "public function getIsTestMode()\n {\n return $this->isTestMode;\n }", "function is_pppoe_server_enabled() {\n\t$pppoeenable = false;\n\n\tforeach (config_get_path('pppoes/pppoe', []) as $pppoes) {\n\t\tif ($pppoes['mode'] == 'server') {\n\t\t\t$pppoeenable = true;\n\t\t}\n\t}\n\n\treturn $pppoeenable;\n}", "protected function isSetup(){\n \treturn isset($GLOBALS['setup']);\n }", "function is_test_request() {\n\t$proxied = defined( 'WPORG_PROXIED_REQUEST' ) && WPORG_PROXIED_REQUEST;\n\t$sandbox = defined( 'WPORG_SANDBOXED' ) && WPORG_SANDBOXED;\n\n\treturn $proxied && $sandbox;\n}", "public function isDevEnv()\n {\n // if set to dev stop here\n if ($this->blnIsDev) {\n return true;\n }\n\n if ($this->hasDevEnv()) {\n return true;\n }\n\n return false;\n }", "function isTestMode($context) {\n\t\treturn ($this->getSetting($context->getId(), 'testMode') == 1);\n\t}", "public function isTestMode(): bool;", "function is_dev() {\n return env() === 'development';\n}", "public static function detectProductionMode($list = NULL)\n\t{\n\t\t$list = is_string($list) ? preg_split('#[,\\s]+#', $list) : $list;\n\t\t$list[] = '127.0.0.1';\n\t\t$list[] = '::1';\n\t\treturn !in_array(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : php_uname('n'), $list, TRUE);\n\t}", "public function isAutomation(): bool\n {\n return Helper::isPro() && $this->source_type === AutomationSchedule::class;\n }", "public static function is_pro() \n {\n if($_SESSION['_version'] == '')\n { \n $conf = new Ossim_conf();\n $version = $conf->get_conf('ossim_server_version');\n $_SESSION['_version'] = (preg_match('/pro|demo/i',$version)) ? 'pro' : 'opensource';\n }\n \n return ($_SESSION['_version'] == 'pro') ? TRUE : FALSE; \n }", "public function is_development_environment()\n {\n }", "public function get_test_is_in_debug_mode()\n {\n }", "private function is_safe_environment(): bool {\n\t\treturn in_array( $this->environment(), [ 'development', 'local' ], true );\n\t}", "private function isCurrentEnvironmentDev() {\n return (getenv(\"HOME\") == \"/Users/BB\");\n }", "public function isDemoShop()\n {\n if ($this->_blDemoShop == null) {\n $this->_blDemoShop = $this->getConfig()->isDemoShop();\n }\n\n return $this->_blDemoShop;\n }", "public static function onBluemix()\n {\n // If VCAP_APPLICATION env is there\n // this means we are on Bluemix\n return getenv('VCAP_APPLICATION') !== false;\n }", "public function isSystem()\n {\n return $this->getAttribute('id') == self::SYSTEM_USER_ID;\n }", "public function isForServer()\n {\n return $this->server !== null;\n }", "public function getIsLive(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n if (is_bool($on = $this->getConfig()->getGeneral()->isSystemLive)) {\n return $on;\n }\n\n return (bool)$this->getProjectConfig()->get('system.live');\n }", "protected function is_being_tested()\n {\n return $this->testing;\n }", "function detectEnvironment($env = 'local') {\n\treturn (env('APP_ENV', 'production') == $env) ? true : false;\n}", "public static function isSoftware()\n\t\t{\n\t\t\t$aFiles = array();\n\t\t\t$aFiles[] = SOFTWARE_PATH . DS . 'wp-config.php';\n\t\t\t$aFiles[] = SOFTWARE_PATH . DS . 'wp-admin';\n\t\t\t$aFiles[] = SOFTWARE_PATH . DS . 'wp-content' . DS . 'plugins' . DS . 'woocommerce';\n\n\t\t\tforeach($aFiles as $sFile)\n\t\t\t{\n\t\t\t\tif(!is_file($sFile) && !is_dir($sFile))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "private function is_elementor_dev_installed() {\n\t\treturn in_array( static::PLUGIN_NAME, $this->get_plugins(), true );\n\t}", "function jetpack_is_product() {\n\treturn ( function_exists( 'is_product' ) ) ? is_product() : false;\n}", "public function is_dev_mode()\n\t{\n\t\treturn $this->use_dev_mode == TRUE AND (is_dev_mode());\n\t}", "public static function isDevMode()\n\t{\n\t\treturn self::$app_mode === self::MODE_DEVELOPMENT;\n\t}", "function isBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public function getProduction() {\n return isset($this->configuration['production']) ? $this->configuration['production'] : '';\n }" ]
[ "0.77510166", "0.76399803", "0.7498758", "0.7489189", "0.73803633", "0.7375103", "0.7369261", "0.73560923", "0.73511416", "0.728489", "0.7228609", "0.71942675", "0.7176972", "0.7143329", "0.71116257", "0.7090879", "0.70895076", "0.7072677", "0.7005752", "0.70015776", "0.69697887", "0.6965847", "0.69557995", "0.6929314", "0.6871107", "0.6795872", "0.67524594", "0.6692539", "0.6667458", "0.66615087", "0.66602576", "0.66432554", "0.6640665", "0.66295296", "0.6614537", "0.65880495", "0.65367806", "0.6509607", "0.6495652", "0.6484413", "0.64465326", "0.64353305", "0.6407847", "0.6400646", "0.6390665", "0.6372419", "0.6368776", "0.6368639", "0.63619614", "0.63572526", "0.6353823", "0.6351068", "0.6349237", "0.6336092", "0.6329166", "0.63291556", "0.63097394", "0.6305014", "0.6302927", "0.62911963", "0.6285405", "0.6284221", "0.62821054", "0.62818325", "0.62742984", "0.6267927", "0.6263805", "0.6263805", "0.625799", "0.62430924", "0.62150055", "0.62094235", "0.61955184", "0.6190872", "0.61886376", "0.6188164", "0.61786836", "0.61586165", "0.614446", "0.6122094", "0.6100653", "0.60905033", "0.60795087", "0.6075428", "0.60666406", "0.6053005", "0.60343194", "0.60267574", "0.6015843", "0.60136265", "0.5994383", "0.5994124", "0.598921", "0.597332", "0.59652996", "0.59484804", "0.59478116", "0.5936294", "0.59326696", "0.593189" ]
0.76479644
1
Modify the css if we are in a test environment to make the website look ugly to avoid confusion. To be added to the 'wp_head' and 'admin_head' action.
public function modify_css_if_in_test_environment() { if($this->is_test_environment()) echo '<style>div#wpadminbar {background-color: #49cf44;}</style>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attach_custom_css_filter() {\n\tif ( ! is_admin() && ! is_feed() && ! is_robots() && ! is_trackback() ) {\n\t\tglobal $publishthis;\n\n\t\tif( is_singular() ) echo $publishthis->utils->display_css();\n\t}\n}", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "function harvest_style_override(){\n\t$primary = harvest_option( 'accent', '#006f7c' );\n\t$secondary = harvest_option( 'secondary_accent', '#b4b2b1' );\n\t$logo_css = harvest_option( 'logo_name_css', '');\n\t$style = \".logo_name { $logo_css }\";\n\twp_add_inline_style( 'harvest-stylesheet', $style );\t\n\t\n\t$style = \".accent-background, \n\t\t.r-tabs .r-tabs-state-active {\n\t\t\tbackground: $primary;\n\t\t}\n\t\t.secondary-accent-background,\n\t\t.recent-sermon h2, \n\t\t.weekly-calendar h2 {\n\t\t\tbackground: $secondary;\n\t\t}\n\t\t.r-tabs a,\n\t\t.r-tabs .r-tabs-anchor {\n\t\t\tcolor: $primary;\n\t\t}\n\t\t.r-tabs .r-tabs-tab {\n\t\t\tborder-bottom-color: $secondary;\n\t\t\tborder-top-color: $secondary;\n\t\t}\n\t\t.r-tabs .r-tabs-accordion-title{\n\t\t\tborder-bottom-color: $secondary;\n\t\t}\n\t\t.content a:not(.button),\n\t\t.content a:hover {\n\t\t\tcolor: $primary;\n\t\t}\n\t\t.content a.button:hover {\n\t\t\tcolor: $primary;\n\t\t\tborder-color: $primary;\n\t\t}\";\n\t\twp_add_inline_style( 'harvest-stylesheet', $style );\t\n}", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "public function admin_css() {\n\t\t\treturn '';\n\t\t}", "function enfold_customization_admin_css() {\n\techo \"<style>\n\t\t\t\ta[href='#avia_sc_contact'] { display: none; }\n\t\t\t\ta[href='#avia_sc_tab'] { display: none; }\n\t\t\t\ta[href='#avia_sc_toggle'] { display: none; }\n\t\t\t\ta[href='#avia_sc_comments_list'] { display: none; }\n\t\t\t</style>\";\n}", "public function testInlineCssDevelopment() {\n\t\t$config = $this->Helper->config();\n\t\t$config->paths('css', null, array(\n\t\t\t$this->_testFiles . 'css' . DS\n\t\t));\n\n\t\t$config->addTarget('nav.css', array(\n\t\t\t'files' => array('nav.css')\n\t\t));\n\n\t\tConfigure::write('debug', 1);\n\t\t$results = $this->Helper->inlineCss('nav.css');\n\n\t\t$expected = <<<EOF\n<style type=\"text/css\">@import url(\"reset/reset.css\");\n#nav {\n\twidth:100%;\n}</style>\nEOF;\n\t\t$this->assertEquals($expected, $results);\n\t}", "function do_test_test_css()\n{\n ?>\n<style type=\"text/css\">\n html, body {\n width:100%; \n height:100%; \n } \n\n</style>\n <?php\n}", "public function customizer_styles() {\n\t\tif ( 'version_2' != get_theme_mod( 'demo_setup' ) ) {\n\t\t\t?>\n\t\t\t<style>\n\t\t\t\t#customize-control-demo_setup_extra {\n\t\t\t\t\tdisplay: none !important;\n\t\t\t\t}\n\t\t\t</style><?php\n\t\t}\n\n\t}", "function html5blank_styles() {\n if ( HTML5_DEBUG ) {\n // normalize-css\n // wp_register_style( 'normalize', get_template_directory_uri() . '/bower_components/normalize.css/normalize.css', array(), '3.0.1' );\n\n // Slick\n wp_register_style( 'slick', get_theme_root_uri() . '/REPLACEMEPLEASE/node_modules/slick-carousel/slick/slick.css', array(), '1.8.1' );\n wp_register_style( 'slick-theme', get_theme_root_uri() . '/REPLACEMEPLEASE/node_modules/slick-carousel/slick/slick-theme.css', array(), '1.8.1' );\n\n // Custom CSS\n wp_register_style( 'html5blank', get_template_directory_uri() . '/style.css', array(), THE_VERSION_NUMBER );\n\n // Register CSS\n wp_enqueue_style( 'slick' );\n wp_enqueue_style( 'slick-theme' );\n wp_enqueue_style( 'html5blank' );\n } else {\n\n // Custom CSS\n wp_register_style( 'html5blankcssmin', get_template_directory_uri() . '/style.css', array(), THE_VERSION_NUMBER );\n\n // Register CSS\n wp_enqueue_style( 'html5blankcssmin' );\n }\n}", "function html5blank_styles()\n{\n wp_register_style('normalize', get_template_directory_uri() . '/normalize.css', array(), '1.0', 'all');\n wp_enqueue_style('normalize');\n\t\n\t//wp_enqueue_style( 'fancybox', get_stylesheet_directory_uri() . '/js/lib/jquery.fancybox.min.css' );\n\t\n\t//wp_enqueue_style( 'slick', get_template_directory_uri() . '/js/lib/slick.css' );\n\t\n\twp_enqueue_style( 'font-awesome', 'https://use.fontawesome.com/releases/v5.10.0/css/all.css' );\n\n wp_register_style('html5blank', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');\n wp_enqueue_style('html5blank');\n}", "function setup() {\n\tadd_filter( 'fl_builder_render_css', __NAMESPACE__ . '\\\\styles', 10, 3 );\n}", "public static function setSiteStyling()\n {\n $styling = SiteManagement::getMetaValue('settings');\n if (!empty($styling[0]['enable_theme_color']) && $styling[0]['enable_theme_color'] == 'true') {\n if (!empty($styling[0]['primary_color'])) {\n ob_start(); ?>\n <style>\n /* Theme Text Color */\n a,\n p a,\n p a:hover,\n a:hover,\n a:focus,\n a:active,\n .wt-navigation>ul>li:hover>a,\n .wt-navigation>ul>li.current-menu-item>a,\n .wt-navarticletab li:hover a,\n .wt-navarticletab li a.active,\n .wt-categoriescontent li a:hover,\n .wt-joinsteps li.wt-active a,\n .wt-effectivecontent li:hover a,\n .wt-articlesingle-content .wt-description .wt-blockquotevone q,\n .wt-filtertag li:hover a,\n .wt-userlisting-breadcrumb li .wt-clicksave,\n .wt-clicksave,\n .wt-qrcodefeat h3 span,\n .wt-comfollowers ul li:hover a span,\n .wt-postarticlemeta .wt-following span,\n .tg-qrcodefeat h3 span,\n .active-category {\n color: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* Theme Background Color */\n .wt-btn:hover,\n .wt-dropdowarrow,\n .navbar-toggle,\n .wt-btn,\n .wt-navigationarea .wt-navigation>ul>li>a:after,\n .wt-searchbtn,\n .wt-sectiontitle:after,\n .wt-navarticletab li a:after,\n .wt-pagination ul li a:hover,\n .wt-pagination ul li.wt-active a,\n .wt-widgettag a:hover,\n .wt-articlesingle-content .wt-description blockquote span i,\n .wt-searchgbtn,\n .wt-filtertagclear a,\n .ui-slider-horizontal .ui-slider-range,\n .wt-btnsearch,\n .wt-newnoti a em,\n .wt-notificationicon>a:after,\n .wt-rightarea .wt-nav .navbar-toggler,\n .wt-usersidebaricon span,\n .wt-usersidebaricon span i,\n .wt-filtertag .wt-filtertagclear a,\n .loader:before,\n .wt-offersmessages .wt-ad:after,\n .wt-btnsendmsg,\n .wt-tabstitle li a:before,\n .wt-tabscontenttitle:before,\n .wt-tablecategories thead tr th:first-child:before,\n .wt-tablecategories tbody tr td:first-child:before,\n .wt-slidernav .wt-prev:hover,\n .wt-slidernav .wt-next:hover,\n .vb>.vb-dragger>.vb-dragger-styler,\n .wt-pagination ul li span,\n .la-banner-settings .wt-location h5:after,\n .la-section-settings .wt-location h6:after,\n .wt-forgotpassword-holder .card .card-body form .form-group button[type=submit] {\n background: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* Theme Border Color */\n input:focus,\n .select select:focus,\n .form-control:focus,\n .wt-navigation>ul>li>.sub-menu,\n .wt-pagination ul li a:hover,\n .wt-widgettag a:hover,\n .wt-joinsteps li.wt-active a,\n .wt-filtertag li:hover a,\n .wt-filtertag .wt-filtertagclear a,\n .wt-themerangeslider .ui-slider-handle,\n .wt-clicksavebtn,\n .wt-pagination ul li.wt-active a,\n .wt-usernav>ul,\n .wt-pagination ul li span {\n border-color: <?php echo $styling[0]['primary_color'] ?>;\n }\n\n /* RGBA Background Color */\n .loader{\n background: <?php echo $styling[0]['primary_color'] ?>;\n background: -moz-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -webkit-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -o-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: -ms-linear-gradient(left, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n background: linear-gradient(to right, <?php echo $styling[0]['primary_color'] ?> 10%, rgba(255, 88, 81, 0) 42%);\n }\n </style>\n <?php return ob_get_clean();\n }\n }\n }", "function admin_print_styles() {\r\n global $wpi_settings, $current_screen;\r\n\r\n wp_enqueue_style('wpi-custom-jquery-ui');\r\n wp_enqueue_style('wpi-admin-css');\r\n\r\n //** Prints styles specific for this page */\r\n wp_enqueue_style('wpi-this-page-css');\r\n wp_enqueue_style('wpi-ie7');\r\n }", "public function config_page_styles() {\n\t\twp_enqueue_style( 'yseo-gc-admin-css', HS_DOCS_API_DIR_URL . 'css/dist/admin.css', null, HS_DOCS_API_PLUGIN_VERSION );\n\t}", "function v2_mumm_css_alter(&$css) {\n $path = drupal_get_path('theme', 'v2_mumm');\n if ($_GET['q'] === 'outdated-browser') {\n unset($css[$path . '/css/style.css']);\n }\n else {\n unset($css[$path . '/css/unsupported-browsers.css']);\n }\n}", "function gtpress_overrideCSS(){\r\n\t$GTTabs_options=get_option(\"GTTabs\");\r\n\t?>\r\n\t<style type=\"text/css\">\r\n\t<?php require_once(\"GTPress_css.php\"); ?>\r\n\t</style>\r\n\t<?php\r\n\r\n}", "function add_head() {\r\n\t\tglobal $locale;\r\n\t\t$wpca_settings = get_option('wpcareers');\r\n\t\techo \"<link rel=\\\"stylesheet\\\" href=\\\"\" . $this->plugin_url . \"/themes/default/css/default.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\">\";\r\n\t\tif($wpca_settings['edit_style']==null || $wpca_settings['edit_style']=='plain') {\r\n\t\t\t// nothing\r\n\t\t} elseif($wpca_settings['edit_style']=='tinymce') {\r\n\t\t\t// activate these includes if the user chooses tinyMCE on the settings page\r\n\t\t\t$mce_path = get_option('siteurl');\r\n\t\t\t$mce_path .= '/wp-includes/js/tinymce/tiny_mce.js';\r\n\t\t\techo '<script type=\"text/javascript\" src=\"' . $mce_path . '\"></script>';\r\n\t\t}\r\n\t}", "function scripts_styles() {\n\n\t\t// No need to process if in admin.\n\t\tif ( is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$theme_url = get_template_directory_uri();\n\t\t$main_css_url = $theme_url . '/style.css';\n\t\t$main_css_path = get_template_directory() . '/style.css';\n\t\t$main_css_ver = file_exists( $main_css_path ) ? filemtime( $main_css_path ) : '';\n\n\t\twp_enqueue_style( 'superiocity-style', $main_css_url, null, $main_css_ver );\n\t\twp_deregister_script( 'wp-embed' );\n\t}", "function setupSkinUserCss( OutputPage $out ){\n\t\tparent::setupSkinUserCss( $out );\n\t\t\n\t\t// XXX: Cannot use addModuleStyles because the icons don't work\n\t\t$out->addStyle( 'smoothwiki/css/bootstrap.min.css' );\n\t\t$out->addStyle( 'smoothwiki/css/bootstrap-responsive.min.css' );\n\t\t$out->addStyle( 'smoothwiki/css/smoothwiki.css' );\n\t}", "function alt_admin_styles()\n {\n global $wp_styles;\n\n wp_enqueue_style('alt-admin-footer', get_template_directory_uri() . '/lib/alt-admin/css/admin-footer.css');\n\n $color_scheme = get_user_option('admin_color');\n\n if ( 'alt-design' === $color_scheme || in_array(get_current_screen()->base, array('profile', 'profile-network')) ) {\n $wp_styles->registered['colors']->deps[] = 'colors-fresh';\n }\n }", "public function meta_box_css() {\n\n ?>\n <style type=\"text/css\">.misc-pub-section:not(.misc-pub-post-status) { display: none; }</style>\n <?php\n\n // Fire action for CSS on Envira post type screens.\n do_action( 'envira_gallery_admin_css' );\n\n }", "function habitat_wp_dequeue_cau_css() {\n wp_dequeue_style('civicrm_admin_utilities_admin_tweaks');\n}", "function capstone_frontend_styles() {\n\t\tif ( !is_admin() ) {\n\n\t\t\t// Libraries Styles\n\t\t\twp_enqueue_style('fontawesome', CAPSTONE_CSS_URI . '/lib/font-aswesome.css');\n\t\t\twp_enqueue_style('icheck', CAPSTONE_JS_URI . '/lib/icheck/square/blue.css');\n\t\t\twp_enqueue_style('material-icons', 'https://fonts.googleapis.com/icon?family=Material+Icons');\n\t\t\twp_enqueue_style('flickity', CAPSTONE_CSS_URI . '/lib/flickity.min.css');\n\t\t\twp_enqueue_style('mapbox', 'https://api.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css');\n\t\t\twp_enqueue_style('mapbox-geocoder', 'https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v2.3.0/mapbox-gl-geocoder.css');\n\t\t\t\n\t\t\t// Theme Styles\n\t\t\twp_enqueue_style('capstone-main', CAPSTONE_CSS_URI . '/main.min.css', array('wp-mediaelement'));\n\t\t\t\n\t\t\t// Google Fonts\n\t\t\twp_enqueue_style('capstone-fonts', capstone_fonts_url(), array(), '1.0.0');\n\t\t\t\n\t\t\t// Add Inline Styles (dynamic)\n\t\t\tob_start();\n\t\t\trequire( get_template_directory() .'/styles/dynamic.php' );\n\t\t\t$dynamic_css = ob_get_clean();\n\t wp_add_inline_style('capstone-main', $dynamic_css);\n\t\t}\n\t}", "function ft_hook_add_css() {}", "function ct_include_style () {\n\tif ( !is_admin() ) {\n\t\twp_enqueue_style( 'christatimmer', get_stylesheet_uri() );\n\t}\n}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "function head_css()\n{\n return get_view()->headLink() . get_view()->headStyle();\n}", "protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }", "function kcsite_add_semi_admin_stylesheet() {\n\t echo '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"'.get_bloginfo('stylesheet_directory').'/css/admin/admin-custom-semi-admin.css?4\" />';\n\t}", "function login_style_wp_head() {\n\t// This is ornery, but needs to be to support WordPress *and* WPMU.\n\t$blf = dirname(__FILE__);\n\tif(is_file(\"$blf/login-style.css\")) {\n\t\t$css = trailingslashit(get_option('siteurl')) . trailingslashit(substr($blf, strpos($blf, 'wp-content'))) . 'login-style.css';\n\t\techo '<link rel=\"stylesheet\" href=\"'.$css.'\" type=\"text/css\" media=\"screen\" />';\n\t}\n}", "function admin_custom_style() {\n if ( ! current_user_can( 'manage_options' ) ) {\n echo '<style type=\"text/css\">\n #wp-admin-bar-wp-logo, #wp-admin-bar-updates, #wp-admin-bar-comments, #wp-admin-bar-new-content,\n #dashboard_right_now .b-tags, \n #dashboard_right_now .tags, \n #dashboard_right_now .b-comments, \n #dashboard_right_now .comments,#dashboard_right_now .b-posts, \n #dashboard_right_now .posts,\n #dashboard_right_now .table_discussion, \n #screen-meta-links, \n .plugin-version-author-uri, .plugin-update-tr, .update-plugins, .update-nag, \n #wp-version-message, \n #dashboard_right_now .main p {\n display:none;\n }\n </style>';\n }\n}", "function bulledev_scripts_and_styles() {\n\n // Only on stage\n if( !strpos($_SERVER['SERVER_NAME'], 'bulledev.com') ){\n wp_enqueue_style( 'bulledev-v9-style', get_stylesheet_uri() );\n }\n\t\n // jQuery\n if( is_page(203) || is_page(1485) ){\n wp_enqueue_script( 'jquery' ); \n }\n}", "function bureau_theme_custom_css() {\n $css = get_option('customcss');\n $css = (empty($css) ? '/* Speaker Bureau Theme Custom CSS */' : $css);\n echo '<div id=\"customCss\" >'.$css.'</div>';\n}", "public function admin_head_style() {\n global $post_type;\n\n if ( $post_type === 'portfolio_item' ) { ?>\n <style type=\"text/css\">\n #icon-edit.icon32-posts-portfolio_item {\n background: transparent url( '<?php echo WPZOOM::$assetsPath . '/images/components/portfolio/portfolio-32.png'; ?>' ) no-repeat;\n }\n </style>\n <?php }\n }", "function ru_filter_styles(){\n $this->removestyle(\"bbp-default\");\n\n // download monitor is not used in the front-end.\n $this->removestyle(\"wp_dlmp_styles\");\n\n if( !is_singular( 'docs' ) ){\n // the table of contents plugin is being used on documentation pages only\n $this->removestyle(\"toc-screen\");\n }\n\n if ( !( is_page( 'account' ) || is_page( 'edit-profile' )) ){\n // this should not be like this. Need to look into it.\n $this->removestyle(\"wppb_stylesheet\");\n }\n\n if( !is_singular( array('docs', 'post' ) ) ){\n $this->removestyle(\"codebox\");\n }\n }", "function ra_builder_css()\n\t\t{\n\t\t\t$this->output('<meta name=\"generator\" content=\"rahularyan\">');\n\t\t\tif($this->template == 'user'){\n\t\t\t\tif(defined('QA_WORDPRESS_INTEGRATE_PATH')){\n\t\t\t\t\t$id = $this->content['raw']['userid'];\n\t\t\t\t\t$cover = get_user_meta( $id, 'cover' );\n\t\t\t\t\t$cover = $cover[0];\n\t\t\t\t}else{\n\t\t\t\t\t@$cover = ra_user_profile(@$this->content['raw']['account']['handle'], 'cover');\n\t\t\t\t}\n\t\t\t\tif($cover)\n\t\t\t\t\t$this->output('<style>#user .user-bar{background:url(\"'.qa_opt('site_url').'images/'.$cover.'\") no-repeat scroll 0 0 / cover;}</style>');\n\t\t\t\t\n\t\t\t}\n\t\t\tif(ra_is_home()){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_home').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'questions'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_questions').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'unanswered'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_unanswered').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'tags'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_tags').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'categories'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_categories').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'users'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_users').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'user'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_user').ra_db_builder('css_bottom').'</style>');\n\t\t\t}\n\t\t}", "function wpbm_posttype_admin_css(){\n global $post_type;\n $post_types = array(\n /* set post types */\n 'wpblogmanager'\n );\n if ( in_array( $post_type, $post_types ) )\n echo '<style type=\"text/css\">#view-post-btn, .updated a,#screen-meta-links .screen-meta-toggle\n {display: none;}</style>';\n }", "function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}", "function zilla_custom_css($content) {\n\t\t$zilla_values = get_option( 'zilla_framework_values' );\n\t\tif( array_key_exists( 'style_custom_css', $zilla_values ) && $zilla_values['style_custom_css'] != '' ){\n\t\t\t$content .= '/* Custom CSS */' . \"\\n\";\n\t\t\t\t$content .= stripslashes($zilla_values['style_custom_css']);\n\t\t\t\t$content .= \"\\n\\n\";\n\t\t}\n\t\treturn $content;\n\t\t\n}", "function styles( $debug = false ) {\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_style(\n\t\t'wpd',\n\t\tWPDOC_HLTR_TEMPLATE_URL . \"/assets/css/wp-documenter{$min}.css\",\n\t\tarray(),\n\t\tWPDOC_HLTR_VERSION\n\t);\n\n\twp_enqueue_style( \n\t\t'prism',\n\t\tWPDOC_HLTR_TEMPLATE_URL . \"/assets/css/prism.css\",\n\t\tarray(),\n\t\tWPDOC_HLTR_VERSION\n\t);\n}", "function svs_css_customizer() {\n\t?>\n\t<style type = \"text/css\">\n\t\n\t\tbody { background-color: #<?php echo get_theme_mod('background_color'); ?>;}\n\t\t\n\t\th1,h2,h3,h4,h5,h6,h7,h8 {color: <?php echo get_theme_mod('headers_color'); ?>;}\n\t\t\n\t\ta {\tcolor: <?php echo get_theme_mod('link_color'); ?>;}\n\t\t\n\t\ta:hover, a:focus { color: <?php echo get_theme_mod('link_hover_color'); ?>;}\n\t\n\t<?php\n\t$content_layout = get_theme_mod('content_layout_setting');\n\n\tif ($content_layout == 'compressed') : ?>\n\t\t\n\t\t.the-post {\n\t\t\twidth: 95%;\n\t\t\theight: 100%; <!-- important!!! -->\n\t\t\tmargin: 5px 0 15px 0;\n\t\t\tborder-bottom: 1px solid #eee;\n\t\t}\n\t\t\n\t\t.vid-col {\n\t\t\twidth: 100%;\n\n\t\t}\n\t\t\n\t\t.vid-title {\n\t\t\tmargin-bottom: 5px;\n\t\t}\n\t\t\n\t\t.content-show, .content-hide {\n\t\t\tfont-size: 11px;\n\t\t\tfloat: right;\n\t\t}\n\n\t\t.content-layout{ display: none;}\n\t\t\n\t\n\t<?php endif;?>\n\t\t\n\t</style>\n\t\n\t<?php\n}", "function shoestrap_generateCSS() {\n global $smof_details;\n $old = get_theme_mod( 'shoestrap_customizer_preSave' );\n remove_theme_mod( 'shoestrap_customizer_preSave' ); // Cleanup\n $new = get_theme_mods();\n\n foreach ( $smof_details as $key=>$option ) {\n if ( $option['less'] == true ) {\n if ( $old[$option['id']] != $new[$option['id']] ) {\n shoestrap_makecss();\n break;\n }\n }\n }\n}", "function cpt_webtonio_head(){\t\n\techo \"<link type='text/css' rel='stylesheet' href='\" . get_bloginfo(\"template_url\") . \"/css/cpt-admin.css\".\"' />\";\n\n}", "function TS_VCSC_DisplayCustomCSS() {\r\n\t\t\tif (($this->TS_VCSC_PluginExtended == \"false\") || (($this->TS_VCSC_PluginExtended == \"true\") && ($this->TS_VCSC_UseCodeEditors == \"true\"))) {\r\n\t\t\t\t$ts_vcsc_extend_custom_css = \t\t\t\tget_option('ts_vcsc_extend_custom_css');\r\n\t\t\t\t$ts_vcsc_extend_custom_css_default =\t\tget_option('ts_vcsc_extend_settings_customCSS');\r\n\t\t\t\tif ((!empty($ts_vcsc_extend_custom_css)) && ($ts_vcsc_extend_custom_css != $ts_vcsc_extend_custom_css_default)) {\r\n\t\t\t\t\techo '<style type=\"text/css\" media=\"all\">' . \"\\n\";\r\n\t\t\t\t\t\techo '/* Custom CSS for Composium - WP Bakery Page Builder Extensions Addon */' . \"\\n\";\r\n\t\t\t\t\t\techo TS_VCSC_MinifyCSS($ts_vcsc_extend_custom_css) . \"\\n\";\r\n\t\t\t\t\techo '</style>' . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function rosemary_admin_styles(){\r\n global $typenow;\r\n if( $typenow == 'page' ) {\r\n\t\twp_enqueue_style('rosemary-meta-css', get_template_directory_uri() . '/functions/meta/meta-field-styles.css');\r\n }\r\n}", "function override_styles() {\n\n\twp_dequeue_style( 'login' );\n\twp_enqueue_style(\n\t\t'10up_custom_login',\n\t\tTENUP_LOGIN_URL . 'dist/css/style.min.css',\n\t\t[],\n\t\tTENUP_LOGIN_VERSION\n\t);\n}", "function theme_scripts_and_styles() {\n if (!is_admin()) {\n // Disable gutenberg built-in styles\n// wp_dequeue_style('wp-block-library');\n\n // Styles\n wp_enqueue_style('main', get_template_directory_uri() . '/assets/css/main.css', null, null); // 2rd priority\n wp_enqueue_style('style', get_template_directory_uri() . '/style.css', null, null); // 1st priority\n\n // JavaScripts\n wp_enqueue_script('jquery');\n wp_enqueue_script('main', get_template_directory_uri() . '/assets/js/main.js', null, null, true); // This should go first\n }\n}", "public function formatCSS() {\n echo $this->head;\n echo \"<link rel='stylesheet' href='desktop.css'>\";\n }", "function wpmu_signup_stylesheet()\n {\n }", "public function hookHeader()\n {\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }", "public function add_warning_css() {\n\n\t\t// Bail if current user doesnt have cap or the constant is set.\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Open the style tag.\n\t\techo '<style>';\n\n\t\t// Output the actual CSS item.\n\t\techo 'li#wp-admin-bar-debug-quick-look li.debug-quick-look-missing .ab-item span {';\n\t\t\techo 'color: #ff0000;';\n\t\t\techo 'font-weight: bold;';\n\t\t\techo 'font-family: Consolas, Monaco, monospace;';\n\t\techo '}';\n\n\t\t// Close the style tag.\n\t\techo '</style>';\n\t}", "function admin_enqueue_scripts() {\n\t$screen = get_current_screen();\n\n\twp_enqueue_style( '10up-admin', plugins_url( '/assets/css/admin.css', dirname( __FILE__ ) ) );\n\n\tif ( 0 === strpos( $screen->base, 'admin_page_10up-' ) ) {\n\t\twp_enqueue_style( '10up-about', plugins_url( '/assets/css/tenup-pages.css', dirname( __FILE__ ) ) );\n\t}\n}", "function hatch_customize_css() { ?>\n\n\t<style type=\"text/css\">\n\n\t\t/* Font size. */\n\t\t<?php if ( get_theme_mod( 'hatch_font_size' ) ) { // legacy setting ?>\n\t\t\thtml { font-size: <?php echo get_theme_mod( 'hatch_font_size' ); ?>px; }\n\t\t<?php } elseif ( hybrid_get_setting( 'hatch_font_size' ) ) { ?>\n\t\t\thtml { font-size: <?php echo hybrid_get_setting( 'hatch_font_size' ); ?>px; }\n\t\t<?php } ?>\n\n\t\t/* Font family. */\n\t\t<?php if ( get_theme_mod( 'hatch_font_family' ) ) { // legacy setting ?>\n\t\t\th1, h2, h3, h4, h5, h6, dl dt, blockquote, blockquote blockquote blockquote, #site-title, #menu-primary li a { font-family: '<?php echo get_theme_mod( 'hatch_font_family' ); ?>', serif; }\n\t\t<?php } elseif ( hybrid_get_setting( 'hatch_font_family' ) ) { ?>\n\t\t\th1, h2, h3, h4, h5, h6, dl dt, blockquote, blockquote blockquote blockquote, #site-title, #menu-primary li a { font-family: '<?php echo hybrid_get_setting( 'hatch_font_family' ); ?>', serif; }\n\t\t<?php } ?>\n\n\t\t/* Link color. */\n\t\t<?php if ( get_theme_mod( 'hatch_link_color' ) ) { // legacy setting ?>\n\t\t\ta, a:visited, .page-template-front .hfeed-more .hentry .entry-title a:hover, .entry-title a, .entry-title a:visited { color: <?php echo get_theme_mod( 'hatch_link_color' ); ?>; }\n\t\t\t.read-more, .read-more:visited, .pagination a:hover, .comment-navigation a:hover, #respond #submit, .button, a.button, #subscribe #subbutton, .wpcf7-submit, #loginform .button-primary { background-color: <?php echo get_theme_mod( 'hatch_link_color' ); ?>; }\n\t\t<?php } elseif ( hybrid_get_setting( 'hatch_link_color' ) ) { ?>\n\t\t\ta, a:visited, .page-template-front .hfeed-more .hentry .entry-title a:hover, .entry-title a, .entry-title a:visited { color: <?php echo hybrid_get_setting( 'hatch_link_color' ); ?>; }\n\t\t\t.read-more, .read-more:visited, .pagination a:hover, .comment-navigation a:hover, #respond #submit, .button, a.button, #subscribe #subbutton, .wpcf7-submit, #loginform .button-primary { background-color: <?php echo hybrid_get_setting( 'hatch_link_color' ); ?>; }\n\t\t<?php } ?>\n\t\ta:hover, a:focus { color: #000; }\n\t\t.read-more:hover, #respond #submit:hover, .button:hover, a.button:hover, #subscribe #subbutton:hover, .wpcf7-submit:hover, #loginform .button-primary:hover { background-color: #111; }\n\n\t\t/* Custom CSS. */\n\t\t<?php if ( get_theme_mod( 'hatch_custom_css' ) ) { // legacy setting\n\t\t\techo get_theme_mod( 'hatch_custom_css' ) . \"\\n\"; \n\t\t} else {\n\t\t\techo hybrid_get_setting( 'hatch_custom_css' ) . \"\\n\";\n\t\t} ?>\n\t\n\t</style>\t\n\n<?php }", "public function hookDisplayBackOfficeHeader()\n {\n $this->context->controller->addCSS('modules/backup_pro/views/css/backup_pro.css', true);\n }", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "function disable_shopp_css() {\n\tglobal $Shopp;\n\tremove_action('wp_head',array(&$Shopp,'header'));\n}", "function wpvideocoach_add_custom_css()\r\n{\r\n\tglobal $wpvideocoach_custom_css;\r\n\tif(!empty($wpvideocoach_custom_css)) {\r\n\t\techo \"<style type='text/css'>\\n\\t\\t\\t<!--\\n\\t\\t\\t\\t\" . $wpvideocoach_custom_css . \"\\n\\t\\t\\t-->\\n\\t\\t</style>\\n\\t\";\r\n\t}\r\n\telse {\r\n\t\t// do nothing\r\n\t}\r\n}", "public function hookBackOfficeHeader()\n {\n if (is_dir(_PS_MODULE_DIR_ . $this->name . '/views/fonts/admin/' . $this->context->language->iso_code)) {\n $this->context->controller->addCSS($this->_path . 'views/css/admin.css');\n }\n }", "function ForBlogs_customize_css() {\n\n $css = '';\n\n $settings = array(\n 'header_textcolor',\n 'navbar_website_bg_color',\n 'navbar_website_link_color',\n 'navbar_website_link_hover_color',\n 'navbar_is_display_search_bar',\n 'navbar_searchbar_placeholder_color',\n 'navbar_searchbar_bg_color',\n 'navbar_searchbar_input_text_color',\n 'navbar_searchbar_size',\n 'navbar_searchbar_text_color',\n 'navbar_homepage_bg_color',\n 'navbar_homepage_link_color',\n 'navbar_homepage_link_hover_color',\n 'navbar_homepage_link_hover_color',\n 'navbar_website_menu_toggler_bg_color',\n 'navbar_website_menu_toggler_border_color',\n 'navbar_homepage_menu_toggler_bg_color',\n 'navbar_homepage_menu_toggler_border_color',\n 'progressbar_preferred_color',\n 'navbar_website_bg_color',\n 'navbar_website_link_color',\n 'progressbar_custom_bg_color',\n 'progressbar_custom_text_color',\n 'progressbar_custom_border_color',\n 'progressbar_is_display_bar',\n 'progressbar_is_display_percentage',\n 'layout_post_sidebar_location_home',\n 'layout_post_sidebar_location_archive',\n 'layout_post_sidebar_location_post',\n 'layout_cols_footer_location',\n 'is_scroll_down_button',\n 'is_responsive_website',\n 'post_card_show_border',\n );\n\n foreach ( $settings as $setting_name ) {\n $v[ $setting_name ] = get_theme_mod( $setting_name );\n }\n\n if ( ! empty( $v['header_textcolor'] ) ) {\n $css .= '#header-desc-text { color: ' . esc_attr( $v['header_textcolor'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_website_bg_color'] ) ) {\n $css .= 'body:not(.home) .header { background-color: ' . esc_attr( $v['navbar_website_bg_color'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_website_link_color'] ) ) {\n $css .= 'body:not(.home) .header .navbar li > a { color: ' . esc_attr( $v['navbar_website_link_color'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_website_link_hover_color'] ) ) {\n $css .= 'body:not(.home) .header .navbar li > a:hover { color: ' . esc_attr( $v['navbar_website_link_hover_color'] ) . \" !important; }\\n\";\n }\n\n /* BEGIN - Search bar */\n\n if ( ! ForBlogs_toggle_check( $v['navbar_is_display_search_bar'] ) ) {\n $css .= \".header .search-bar { display: none !important; }\\n\";\n $css .= \"body.home .header .search-bar { display: none !important; }\\n\";\n\n } else {\n\n if ( ! empty( $v['navbar_searchbar_placeholder_color'] ) ) {\n $css .= '.header .search-bar .search-input::-webkit-input-placeholder { color: ' . esc_attr( $v['navbar_searchbar_placeholder_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar .search-input::-moz-placeholder { color: ' . esc_attr( $v['navbar_searchbar_placeholder_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar .search-input:-ms-input-placeholder { color: ' . esc_attr( $v['navbar_searchbar_placeholder_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar .search-input:-moz-placeholder { color: ' . esc_attr( $v['navbar_searchbar_placeholder_color'] ) . \" !important; }\\n\";\n }\n \n if ( ! empty( $v['navbar_searchbar_input_text_color'] ) ) {\n $css .= '.header .search-bar .search-input { color: ' . esc_attr( $v['navbar_searchbar_input_text_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar .search-icon { color: ' . esc_attr( $v['navbar_searchbar_input_text_color'] ) . \" !important; }\\n\";\n }\n \n if ( ! empty( $v['navbar_searchbar_bg_color'] ) ) {\n $css .= '.header .search-bar { background-color: ' . esc_attr( $v['navbar_searchbar_bg_color'] ) . \" !important; }\\n\";\n }\n\n if ( 'big' === $v['navbar_searchbar_size'] ) {\n $css .= '.header .search-bar { min-height: 40px !important; }' . \"\\n\";\n $css .= '.header .search-bar .search-input { min-height: 40px !important; font-size: 15px !important; }' . \"\\n\";\n $css .= '.header .search-bar .search-icon { min-height: 34px !important; line-height: 34px !important; font-size: 15px !important; }' . \"\\n\";\n $css .= '@media (max-width: 991.98px) { .header .search-bar { top: 10px !important; } }' . \"\\n\";\n }\n }\n\n /* END - Search bar */\n\n if ( ! empty( $v['navbar_homepage_bg_color'] ) ) {\n $css .= 'body.home .header { background-color: ' . esc_attr( $v['navbar_homepage_bg_color'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_homepage_link_color'] ) ) {\n $css .= 'body.home .header .navbar li > a { color: ' . esc_attr( $v['navbar_homepage_link_color'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_homepage_link_hover_color'] ) ) {\n $css .= 'body.home .header .navbar li > a:hover { color: ' . esc_attr( $v['navbar_homepage_link_hover_color'] ) . \" !important; }\\n\";\n }\n\n if ( ! empty( $v['navbar_homepage_link_hover_color'] ) ) {\n $css .= '.header .search-bar input::-webkit-input-placeholder { color: ' . esc_attr( $v['navbar_homepage_link_hover_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar input::placeholder { color: ' . esc_attr( $v['navbar_homepage_link_hover_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar input:-ms-input-placeholder { color: ' . esc_attr( $v['navbar_homepage_link_hover_color'] ) . \" !important; }\\n\";\n $css .= '.header .search-bar input::-ms-input-placeholder { color: ' . esc_attr( $v['navbar_homepage_link_hover_color'] ) . \" !important; }\\n\";\n }\n\n // Apply the custon color pattern to the progress bar.\n if ( 'menu' === $v['progressbar_preferred_color'] ) {\n $css .= '.single-post-title-bar { background-color: ' . esc_attr( $v['navbar_website_bg_color'] ) . \" !important; }\\n\";\n $css .= '#progress-title { color: ' . esc_attr( $v['navbar_website_link_color'] ) . \" !important; }\\n\";\n $css .= 'a.go-top { background-color: ' . esc_attr( $v['navbar_website_bg_color'] ) . \" !important; }\\n\";\n $css .= 'a.go-top i { color: ' . esc_attr( $v['navbar_website_link_color'] ) . \" !important; }\\n\";\n } elseif ( 'custom' === $v['progressbar_preferred_color'] ) {\n $css .= '.single-post-title-bar { background-color: ' . esc_attr( $v['progressbar_custom_bg_color'] ) . \" !important; }\\n\";\n $css .= '#progress-title { color: ' . esc_attr( $v['progressbar_custom_text_color'] ) . \" !important; }\\n\";\n $css .= '.progress-wrapper progress::-webkit-progress-value { background-color: ' . esc_attr( $v['progressbar_custom_border_color'] ) . \" !important; }\\n\";\n $css .= '.progress-wrapper progress::-ms-fill { background-color: ' . esc_attr( $v['progressbar_custom_border_color'] ) . \" !important; }\\n\";\n $css .= '.progress-wrapper progress::-moz-progress-bar { background-color: ' . esc_attr( $v['progressbar_custom_border_color'] ) . \" !important; }\\n\";\n $css .= 'a.go-top { background-color: ' . esc_attr( $v['progressbar_custom_bg_color'] ) . \" !important; }\\n\";\n $css .= 'a.go-top i { color: ' . esc_attr( $v['progressbar_custom_text_color'] ) . \" !important; }\\n\";\n }\n\n\n if ( ! ForBlogs_toggle_check( $v['progressbar_is_display_bar'] ) ) {\n $css .= \".single-post-title-bar { display: none !important; }\\n\";\n }\n\n if ( ! ForBlogs_toggle_check( $v['progressbar_is_display_percentage'] ) ) {\n $css .= \".progress-wrapper .progress-label { display: none !important; }\\n\";\n }\n\n if ( 'left' === $v['layout_post_sidebar_location_home'] ) {\n $css .= \".row-layout-choice-home { flex-direction: row-reverse !important; }\\n\";\n }\n\n if ( 'left' === $v['layout_post_sidebar_location_archive'] ) {\n $css .= \".row-layout-choice-archive { flex-direction: row-reverse !important; }\\n\";\n }\n\n if ( 'left' === $v['layout_post_sidebar_location_post'] ) {\n $css .= \".row-layout-choice-post { flex-direction: row-reverse !important; }\\n\";\n }\n\n /* BEGIN - Footer elements locations don't apply to width < 768px */\n\n if ( '2' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns { flex-direction: row-reverse !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { text-align: right !important; }\\n\";\n }\n\n if ( '3' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns .footer-column-left { display: flex !important; flex-direction: column-reverse !important; }\\n\";\n }\n\n if ( '4' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns { flex-direction: row-reverse !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { text-align: right !important; display: flex !important; flex-direction: column-reverse !important; }\\n\";\n }\n\n if ( '5' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns { display: block !important; text-align: center !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { display: flex !important; flex-direction: column-reverse !important; }\\n\";\n }\n\n if ( '6' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns { display: flex !important; text-align: center !important; flex-direction: column-reverse !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { display: flex !important; flex-direction: column !important; }\\n\";\n }\n\n if ( '7' === $v['layout_cols_footer_location'] ) {\n $css .= \".footer-columns { display: flex !important; text-align: center !important; flex-direction: column-reverse !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { display: flex !important; flex-direction: column-reverse !important; }\\n\";\n }\n\n $css .= \"@media (max-width: 768px) {\\n\";\n $css .= \".footer-columns { text-align: center !important; }\\n\";\n $css .= \".footer-columns .footer-column-left { text-align: center !important; }\\n\";\n $css .= \"}\\n\";\n\n /* END - Footer elements locations don't apply to width < 768px */\n\n if ( ForBlogs_toggle_check( $v['is_scroll_down_button'] ) ) {\n $css .= \".scroll-area { display: block !important; }\\n\";\n }\n\n if ( ! ForBlogs_toggle_check( $v['is_responsive_website'] ) ) {\n $css .= \".navbar-expand .navbar-collapse { margin: 0 !important; }\\n\";\n }\n\n if ( ! ForBlogs_toggle_check( $v['post_card_show_border'] ) ) {\n $css .= \".container .card { border: 0px !important; }\\n\";\n $css .= \".container .card-footer { border: 0 !important; background: none !important; padding-top: 0 !important; }\\n\";\n }\n\n /* BEGIN - Adjusting menu toggler color. */\n\n if ( ! empty( $v['navbar_homepage_menu_toggler_bg_color'] ) ) {\n // Button background color.\n $css .= \"body.home .navbar-dark .navbar-toggler { background-color: \" . $v['navbar_homepage_menu_toggler_bg_color']. \"; }\";\n }\n\n if ( ! empty( $v['navbar_website_menu_toggler_bg_color'] ) ) {\n // Button background color.\n $css .= \"body:not(.home) .navbar-dark .navbar-toggler { background-color: \" . $v['navbar_website_menu_toggler_bg_color']. \"; }\";\n }\n\n if ( ! empty( $v['navbar_homepage_menu_toggler_border_color'] ) ) {\n // Toggler bar.\n $css .= \"body.home .navbar-dark .navbar-toggler-icon { background-image:url(\\\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='\" . $v['navbar_homepage_menu_toggler_border_color'] . \"' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\\\") }\";\n // Button border.\n $css .= \"body.home .navbar-dark .navbar-toggler { color: \" . $v['navbar_homepage_menu_toggler_border_color']. \"; border-color: \" . $v['navbar_homepage_menu_toggler_border_color'] . \"; }\";\n }\n\n if ( ! empty( $v['navbar_website_menu_toggler_border_color'] ) ) {\n // Toggler bar.\n $css .= \"body:not(.home) .navbar-dark .navbar-toggler-icon { background-image:url(\\\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='\" . $v['navbar_homepage_menu_toggler_border_color'] . \"' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\\\") }\";\n // Button border.\n $css .= \"body:not(.home) .navbar-dark .navbar-toggler { color: \" . $v['navbar_website_menu_toggler_border_color']. \"; border-color: \" . $v['navbar_website_menu_toggler_border_color'] . \"; }\";\n }\n\n /* END - Adjusting menu toggler color. */\n\n if ( ! empty( $css ) ) {\n //$css .= \"body.menu-is-collapsed .header { background: rgba(20, 25, 29, 1) !important; }\\n\";\n }\n\n echo '<style id=\"ForBlogs-customizer\">' . \"\\n\" . $css . \"\\n\" . '</style>';\n}", "function my_admin_head() {\n echo '<link href=\"'.get_stylesheet_directory_uri().'/user-admin.css\" rel=\"stylesheet\" type=\"text/css\">';\n }", "function cjpopups_frontend_scripts(){\n\t$wp_version = get_bloginfo('version');\n\t$item_version = cjpopups_item_info('item_version');\n\tif(!is_admin()){\n\t\twp_register_style( 'cj-frontend-css', cjpopups_item_path('framework_url').'/assets/frontend/css/cj-global.css', null, $item_version, 'screen' );\n\t\twp_enqueue_style( 'cj-frontend-css' );\n\t}\n}", "public function customize_styles() {\n wp_enqueue_style('admin-theme-css', get_template_directory_uri() . '/css/admin-theme.css', false, CHIANTI_THEME_VERSION, false);\n }", "function load_dev_styles_scripts() {\n // Theme styles\n wp_enqueue_style( 'themename', CHILD_SS_URI . '/assets/dev/style.css', false, null, 'all' );\n\n // Header Scripts\n wp_enqueue_script( 'header_scripts', CHILD_SS_URI . '/assets/dev/header.js', array(), null, false );\n\n // Footer Scripts\n wp_enqueue_script( 'footer_scripts', CHILD_SS_URI . '/assets/dev/footer.js', array( 'jquery' ), null, true );\n\n // Single Scripts\n if ( is_single() ) {\n wp_enqueue_script( 'single_scripts', CHILD_SS_URI . '/assets/dev/single.js', array( 'jquery' ), null, true );\n }\n}", "function mpcth_add_admin_head() {\r\n\tmpcth_admin_alternative_styles();\r\n}", "private function decideIncludeCSS(){\n //if user don´t want to use our css\n $noCSS = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_libconnect.']['settings.']['ezbNoCSS'];\n\n if($noCSS == 1){\n return;\n }\n\n //get UID of PlugIn\n $this->contentObj = $this->configurationManager->getContentObject();\n $uid = $this->contentObj->data['uid'];\n unset($this->contentObj);\n\n //only the first PlugIn needs to include the css\n if(IsfirstPlugInUserFunction('ezb', $uid)){\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"' . t3lib_extMgm::siteRelPath('libconnect') . 'Resources/Public/Styles/ezb.css\" />'); \n }\n }", "function remove_admin_bar_style_frontend() {\n echo '<style type=\"text/css\" media=\"screen\">\n html { margin-top: 0px !important; }\n * html body { margin-top: 0px !important; }\n </style>';\n }", "public function maybe_disable_style_notice() {\n\n\t\tif ( get_option( 'yourfitness_compile_all_styles' ) && yourfitness_tt_is_compiler_dev_mode() )\n\t\t\techo '<br /><span>' . esc_html__( 'Styles are not compiled in development mode.', 'your-fitness' ) . '</span>';\n\n\t}", "function fsnat_settings_page() {\n\trequire_once( get_template_directory() . '/inc/templates/fsnat-custom-css.php');\n}", "function city_admin_css() {\n\t$template_url = get_bloginfo('template_url');\n\techo '<link rel=\"stylesheet\" href=\"'.$template_url.'/css/admin-style.css\" />';\n}", "function woo_load_site_width_css_nomedia() {}", "public function bootstrap()\n {\n add_theme_support('avia_template_builder_custom_css');\n parent::bootstrap();\n }", "protected function generateCSS() {}", "function laurel_customizer_css() {\r\n ?>\r\n <style type=\"text/css\">\r\n\t\r\n\t\t<?php if(get_theme_mod('laurel_logo_width')) : ?>#logo img, #logo-secondary img { max-width:<?php echo get_theme_mod('laurel_logo_width'); ?>%; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod('laurel_secondary_header_top')) : ?>#logo-secondary { padding-top:<?php echo get_theme_mod('laurel_secondary_header_top'); ?>px; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod('laurel_secondary_header_bottom')) : ?>#logo-secondary { padding-bottom:<?php echo get_theme_mod('laurel_secondary_header_bottom'); ?>px; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod('laurel_text_logo_size')) : ?>.text-logo { font-size:<?php echo get_theme_mod('laurel_text_logo_size'); ?>px; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod('laurel_text_logo_weight')) : ?>.text-logo { font-weight:<?php echo get_theme_mod('laurel_text_logo_weight'); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod('laurel_text_logo_color')) : ?>.text-logo a{ color:<?php echo get_theme_mod('laurel_text_logo_color'); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_color' )) : ?>body { background-color:<?php echo get_theme_mod( 'laurel_bg_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_image' )) : ?>body { background-image:url(<?php echo get_theme_mod( 'laurel_bg_image' ); ?>); }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_repeat' )) : ?>body { background-repeat:<?php echo get_theme_mod( 'laurel_bg_repeat' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_size' )) : ?>body { background-size:<?php echo get_theme_mod( 'laurel_bg_size' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_position' )) : ?>body { background-position:<?php echo get_theme_mod( 'laurel_bg_position' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_bg_attachment' )) : ?>body { background-attachment:<?php echo get_theme_mod( 'laurel_bg_attachment' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_color' )) : ?>#logo-secondary { background-color:<?php echo get_theme_mod( 'laurel_2header_bg_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_image' )) : ?>#logo-secondary { background-image:url(<?php echo get_theme_mod( 'laurel_2header_bg_image' ); ?>); }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_repeat' )) : ?>#logo-secondary { background-repeat:<?php echo get_theme_mod( 'laurel_2header_bg_repeat' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_size' )) : ?>#logo-secondary { background-size:<?php echo get_theme_mod( 'laurel_2header_bg_size' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_position' )) : ?>#logo-secondary { background-position:<?php echo get_theme_mod( 'laurel_2header_bg_position' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_2header_bg_attachment' )) : ?>#logo-secondary { background-attachment:<?php echo get_theme_mod( 'laurel_2header_bg_attachment' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_wrapper_color' )) : ?>#wrapper { box-shadow:0 0 15px 15px rgba(<?php laurel_hex2rgb(get_theme_mod( 'laurel_wrapper_color' ), get_theme_mod( 'laurel_wrapper_opacity', '0.14' )) ?>); } <?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_header_bg_color' )) : ?>#top-bar { background-color:<?php echo get_theme_mod( 'laurel_header_bg_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_color' )) : ?>#nav-wrapper .menu li a { color:<?php echo get_theme_mod( 'laurel_menu_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_color_hover' )) : ?>#nav-wrapper .menu li a:hover { color:<?php echo get_theme_mod( 'laurel_menu_color_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_arrow' )) : ?>#nav-wrapper .menu > li.menu-item-has-children > a:after { color:<?php echo get_theme_mod( 'laurel_menu_dropdown_arrow' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_bg' )) : ?>#nav-wrapper .menu .sub-menu, #nav-wrapper .menu .children { background-color:<?php echo get_theme_mod( 'laurel_menu_dropdown_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_border' )) : ?>#top-bar #navigation #nav-wrapper ul.menu ul a, #top-bar #navigation #nav-wrapper .menu ul ul a { border-color:<?php echo get_theme_mod( 'laurel_menu_dropdown_border' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_text_color' )) : ?>#top-bar #navigation #nav-wrapper ul.menu ul a, #top-bar #navigation #nav-wrapper .menu ul ul a { color:<?php echo get_theme_mod( 'laurel_menu_dropdown_text_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_text_hover_bg' )) : ?>#nav-wrapper ul.menu ul a:hover, #nav-wrapper .menu ul ul a:hover { background-color:<?php echo get_theme_mod( 'laurel_menu_dropdown_text_hover_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_menu_dropdown_text_hover_color' )) : ?>#top-bar #navigation #nav-wrapper ul.menu ul a:hover, #top-bar #navigation #nav-wrapper .menu ul ul a:hover { color:<?php echo get_theme_mod( 'laurel_menu_dropdown_text_hover_color' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_header_social_color' )) : ?>#top-social a { color:<?php echo get_theme_mod( 'laurel_header_social_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_social_color_hover' )) : ?>#top-social a:hover { color:<?php echo get_theme_mod( 'laurel_header_social_color_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_icon' )) : ?>#top-search a { color:<?php echo get_theme_mod( 'laurel_header_search_icon' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_icon_hover' )) : ?>#top-search a:hover { color:<?php echo get_theme_mod( 'laurel_header_search_icon_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_input_bg' )) : ?>#show-search input { background-color:<?php echo get_theme_mod( 'laurel_header_search_input_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_input_text' )) : ?>#show-search input, #show-search ::-webkit-input-placeholder, #show-search i.search-icon { color:<?php echo get_theme_mod( 'laurel_header_search_input_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_input_close' )) : ?>#show-search .close-search { color:<?php echo get_theme_mod( 'laurel_header_search_input_close' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_header_search_input_close_hover' )) : ?>#show-search a.close-search:hover { color:<?php echo get_theme_mod( 'laurel_header_search_input_close_hover' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_show' )) : ?>.slicknav_menu .slicknav_menutxt { color:<?php echo get_theme_mod( 'laurel_mobile_show' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_show_hover' )) : ?>.slicknav_menu .slicknav_menutxt:hover { color:<?php echo get_theme_mod( 'laurel_mobile_show_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_burger' )) : ?>.slicknav_menu .slicknav_icon-bar { background-color:<?php echo get_theme_mod( 'laurel_mobile_burger' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_dropdown_bg' )) : ?>.slicknav_nav, .slicknav_nav ul { background-color:<?php echo get_theme_mod( 'laurel_mobile_dropdown_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_dropdown_border' )) : ?>.slicknav_nav a { border-color:<?php echo get_theme_mod( 'laurel_mobile_dropdown_border' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_dropdown_text' )) : ?>.slicknav_nav a { color:<?php echo get_theme_mod( 'laurel_mobile_dropdown_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_dropdown_text_hover' )) : ?>.slicknav_nav a:hover { color:<?php echo get_theme_mod( 'laurel_mobile_dropdown_text_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_mobile_dropdown_text_bg_hover' )) : ?>.slicknav_nav a:hover, .slicknav_nav .slicknav_item:hover { background-color:<?php echo get_theme_mod( 'laurel_mobile_dropdown_text_bg_hover' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_promo_color_bg' )) : ?>#promo-area { background:<?php echo get_theme_mod( 'laurel_promo_color_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_promo_color_overlay_bg' )) : ?>.promo-overlay h4 { background:<?php echo get_theme_mod( 'laurel_promo_color_overlay_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_promo_color_overlay_text' )) : ?>.promo-overlay h4 { color:<?php echo get_theme_mod( 'laurel_promo_color_overlay_text' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_sidebar_color_border' )) : ?>.widget { border-color:<?php echo get_theme_mod( 'laurel_sidebar_color_border' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_sidebar_color_title' )) : ?>.widget-title { color:<?php echo get_theme_mod( 'laurel_sidebar_color_title' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_sidebar_social_color' )) : ?>.social-widget a { color:<?php echo get_theme_mod( 'laurel_sidebar_social_color' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_sidebar_social_color_hover' )) : ?>.social-widget a:hover { color:<?php echo get_theme_mod( 'laurel_sidebar_social_color_hover' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_footer_color_social_bg' )) : ?>#footer { background:<?php echo get_theme_mod( 'laurel_footer_color_social_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_footer_color_social_text' )) : ?>#footer-social a { color:<?php echo get_theme_mod( 'laurel_footer_color_social_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_footer_color_social_text_hover' )) : ?>#footer-social a:hover { color:<?php echo get_theme_mod( 'laurel_footer_color_social_text_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_footer_color_copy_bg' )) : ?>#footer-bottom { background:<?php echo get_theme_mod( 'laurel_footer_color_copy_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_footer_color_copy_text' )) : ?>#footer-bottom { color:<?php echo get_theme_mod( 'laurel_footer_color_copy_text' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_title' )) : ?>.post-header h2 a, .post-header h1, .feat-overlay h2, .feat-overlay h2 a { color:<?php echo get_theme_mod( 'laurel_post_color_title' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_cat' )) : ?>.feat-overlay .cat a, .post-header .cat a { color:<?php echo get_theme_mod( 'laurel_post_color_cat' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_text' )) : ?>.post-entry, .post-entry p { color:<?php echo get_theme_mod( 'laurel_post_color_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_text_heading' )) : ?>.post-entry h1, .post-entry h2, .post-entry h3, .post-entry h4, .post-entry h5, .post-entry h6 { color:<?php echo get_theme_mod( 'laurel_post_color_text_heading' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_more_bg' )) : ?>.post-entry .read-more, .read-more { background:<?php echo get_theme_mod( 'laurel_post_color_more_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_color_more_text' )) : ?>.post-entry .read-more, .read-more { color:<?php echo get_theme_mod( 'laurel_post_color_more_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_tag_bg' )) : ?>.widget .tagcloud a, .post-tags a { background:<?php echo get_theme_mod( 'laurel_post_tag_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_tag_text' )) : ?>.widget .tagcloud a, .post-tags a { color:<?php echo get_theme_mod( 'laurel_post_tag_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_tag_bg_hover' )) : ?>.widget .tagcloud a:hover, .post-tags a:hover { background:<?php echo get_theme_mod( 'laurel_post_tag_bg_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_tag_text_hover' )) : ?>.widget .tagcloud a:hover, .post-tags a:hover { color:<?php echo get_theme_mod( 'laurel_post_tag_text_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_quote_border' )) : ?>.post-entry blockquote, .entry-content blockquote { border-color:<?php echo get_theme_mod( 'laurel_post_quote_border' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_quote_text' )) : ?>.post-entry blockquote p, .entry-content blockquote p { color:<?php echo get_theme_mod( 'laurel_post_quote_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_post_share_color' )) : ?>.share a { color:<?php echo get_theme_mod( 'laurel_post_share_color' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_bg' )) : ?>.subscribe-box { background:<?php echo get_theme_mod( 'laurel_newsletter_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_title' )) : ?>.subscribe-box h4 { color:<?php echo get_theme_mod( 'laurel_newsletter_title' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_text' )) : ?>.subscribe-box p { color:<?php echo get_theme_mod( 'laurel_newsletter_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_input_bg' )) : ?>.subscribe-box input { background:<?php echo get_theme_mod( 'laurel_newsletter_input_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_input_text' )) : ?>.subscribe-box ::-webkit-input-placeholder, .subscribe-box input { color:<?php echo get_theme_mod( 'laurel_newsletter_input_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_submit_bg' )) : ?>.subscribe-box input[type=submit] { background:<?php echo get_theme_mod( 'laurel_newsletter_submit_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_submit_text' )) : ?>.subscribe-box input[type=submit] { color:<?php echo get_theme_mod( 'laurel_newsletter_submit_text' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_submit_bg_hover' )) : ?>.subscribe-box input[type=submit]:hover { background:<?php echo get_theme_mod( 'laurel_newsletter_submit_bg_hover' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_newsletter_submit_text_hover' )) : ?>.subscribe-box input[type=submit]:hover { color:<?php echo get_theme_mod( 'laurel_newsletter_submit_text_hover' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_accent' )) : ?>a, .woocommerce .star-rating{ color:<?php echo get_theme_mod( 'laurel_misc_color_accent' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_accent' )) : ?>.cart-contents .sp-count { background:<?php echo get_theme_mod( 'laurel_misc_color_accent' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_archive_bg' )) : ?>.archive-box-wrapper, .archive-box { background:<?php echo get_theme_mod( 'laurel_misc_color_archive_bg' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_archive_border' )) : ?>.archive-box { border-color:<?php echo get_theme_mod( 'laurel_misc_color_archive_border' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_archive_browsing' )) : ?>.archive-box span{ color:<?php echo get_theme_mod( 'laurel_misc_color_archive_browsing' ); ?>; }<?php endif; ?>\r\n\t\t<?php if(get_theme_mod( 'laurel_misc_color_archive_title' )) : ?>.archive-box h1{ color:<?php echo get_theme_mod( 'laurel_misc_color_archive_title' ); ?>; }<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(is_single() && laurel_get_post_layout() == 'default-fullimage' || is_single() && laurel_get_post_layout() == 'fullwidth-fullimage' || is_page() && is_page_template('page-fullwidth-fullimage.php') || is_page() && is_page_template('page-default-fullimage.php') ) : ?>\r\n\t\t\r\n\t\t<?php if(rwmb_meta( 'laurel_meta_post_layout' ) == 'default-fullimage' || rwmb_meta( 'laurel_meta_post_layout' ) == 'fullwidth-fullimage') { $feat_height = rwmb_meta( 'laurel_meta_fullimage_height' ); } elseif(get_theme_mod('laurel_truefull_height')) { $feat_height = get_theme_mod('laurel_truefull_height'); } else { $feat_height = 660; } ?>\r\n\t\t\r\n\t\t.post-img-full {\r\n\t\t\theight:<?php echo $feat_height; ?>px;\r\n\t\t}\r\n\t\t@media only screen and (max-width : 1400px) {\r\n\t\t\t.post-img-full {\r\n\t\t\t\theight:<?php $get_ratio1 = $feat_height / 1500; $new_height1 = 1280 * $get_ratio1; echo $new_height1 . 'px'; ?>\r\n\t\t\t}\r\n\t\t}\r\n\t\t@media only screen and (min-width: 942px) and (max-width: 1170px) {\r\n\t\t\t.post-img-full {\r\n\t\t\t\theight:<?php $get_ratio2 = $new_height1 / 1280; $new_height2 = 940 * $get_ratio2; echo $new_height2 . 'px'; ?>\r\n\t\t\t}\r\n\t\t}\r\n\t\t@media only screen and (min-width: 768px) and (max-width: 960px) {\r\n\t\t\t.post-img-full {\r\n\t\t\t\theight:<?php $get_ratio3 = $new_height2 / 940; $new_height3 = 726 * $get_ratio3; echo $new_height3 . 'px'; ?>\r\n\t\t\t}\r\n\t\t}\r\n\t\t@media only screen and (min-width: 480px) and (max-width: 768px) {\r\n\t\t\t.post-img-full {\r\n\t\t\t\theight:<?php $get_ratio4 = $new_height3 / 726; $new_height4 = 480 * $get_ratio4; if($new_height4 < 250) : $new_height4 = 250; endif; echo $new_height4 . 'px'; ?>\r\n\t\t\t}\r\n\t\t}\r\n\t\t@media only screen and (min-width: 100px) and (max-width: 479px) {\r\n\t\t\t.post-img-full {\r\n\t\t\t\theight:<?php $get_ratio5 = $new_height4 / 480; $new_height5 = 300 * $get_ratio5; if($new_height5 < 220) : $new_height5 = 220; endif; echo $new_height5 . 'px'; ?>\r\n\t\t\t}\r\n\t\t}\r\n\t\t<?php endif; ?>\r\n\t\t\r\n\t\t<?php if(get_theme_mod( 'laurel_custom_css' )) : ?>\r\n\t\t<?php echo get_theme_mod( 'laurel_custom_css' ); ?>\r\n\t\t<?php endif; ?>\r\n\t\t\r\n </style>\r\n <?php\r\n}", "public function mm_default_css() {\n $default_css = CSS_DIR . DEFAULT_CSS;\n $new_css = CSS_DIR . CUSTOM_CSS;\n ob_start();\n @include( $default_css );\n $css = ob_get_contents();\n ob_end_clean();\n \n $css = stripslashes ( $css );\n \n update_option('mm_gallery_css', $css);\n file_put_contents($new_css, $css); \n }", "function wp_register_styles() {\n // Developer Tier Admin Stylesheet\n wp_register_style( \"{$this->namespace}-admin\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/admin.css\", array(), '2.1', 'screen' );\n // CodeMirror Library\n wp_register_style( \"codemirror\", SLIDEDECK2_DEVELOPER_URLPATH . \"/css/codemirror.css\", array(), '2.25', 'screen' );\n }", "function first_edition_customize_css() {\n\t$selected_fonts = first_edition_font_list();\n\t$color = get_option( 'first_edition_colors' );\n\t$bgcolor = get_theme_mod( 'background_color' );\n\t$customized_css = '.custom-background { background-color: #' . esc_attr( $bgcolor ) . '; }'\n\t\t. \"\\n\" . 'a { color: #' . $color['link'] . '; }'\n\t\t. \"\\n\" . 'body, a:hover, a:focus, a:active, .main-navigation ul .current_page_item > a { color: #' . esc_attr( $color['text'] ) . '; }'\n\t\t. \"\\n\" . '.comment-form input[type=\"submit\"]:hover { background: #' . esc_attr( $color['text'] ) . '; color: #' . esc_attr( $bgcolor) . '; }';\n\t$font = get_option( 'first_edition_font_pair' );\n\tif ( '' != $font ) {\n\tswitch ( $font ) {\n\t\tcase 'pair1':\n\t\t\twp_enqueue_style( 'lustria', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['lustria'] ) );\n\t\t\twp_enqueue_style( 'lato', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['lato'] ) );\n\t\t\t$customized_css .= \"\\nh1,h2,h3,h4,h5,h6 { font-family: 'Lustria', serif; }\";\n\t\t\t$customized_css .= \"\\nbody { font-family: 'Lato', 'Open Sans', sans-serif; font-weight: 300; }\";\n\t\t\tbreak;\n\n\t\tcase 'pair2':\n\t\t\twp_enqueue_style( 'ubutnu', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['ubutnu'] ) );\n\t\t\twp_enqueue_style( 'lora', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['lora'] ) );\n\t\t\t$customized_css .= \"\\nh1,h2,h3,h4,h5,h6 { font-family: 'Ubuntu', serif; }\";\n\t\t\t$customized_css .= \"\\nbody { font-family: 'Lora', 'Open Sans', sans-serif; }\";\n\t\t\tbreak;\n\n\t\tcase 'pair3':\n\t\t\twp_enqueue_style( 'raleway', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['raleway'] ) );\n\t\t\twp_enqueue_style( 'merriweather', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['merriweather'] ) );\n\t\t\t$customized_css .= \"\\nh1,h2,h3,h4,h5,h6 { font-family: 'Raleway', serif; } \";\n\t\t\t$customized_css .= \"\\nbody { font-family: 'Merriweather', 'Open Sans', sans-serif; font-weight: 300; }\";\n\t\t\tbreak;\n\n\t\tcase 'pair4':\n\t\t\twp_enqueue_style( 'roboto-slab', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['roboto-slab'] ) );\n\t\t\twp_enqueue_style( 'roboto', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['roboto'] ) );\n\t\t\t$customized_css .= \"\\nh1,h2,h3,h4,h5,h6 { font-family: 'Roboto Slab', serif; }\";\n\t\t\t$customized_css .= \"\\nbody { font-family: 'Roboto', 'Open Sans', sans-serif; font-weight: 300; }\";\n\t\t\tbreak;\n\n\t\tcase 'pair5':\n\t\t\twp_enqueue_style( 'quattrocento', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['quattrocento'] ) );\n\t\t\twp_enqueue_style( 'quattrocento-sans', \"//fonts.googleapis.com/css?family=\" . esc_url( $selected_fonts['quattrocento-sans'] ) );\n\t\t\t$customized_css .= \"\\nh1,h2,h3,h4,h5,h6 { font-family: 'Quattrocento', serif; }\";\n\t\t\t$customized_css .= \"\\nbody { font-family: 'Quattrocento Sans', 'Open Sans', sans-serif; font-weight: 300; }\";\n\t\t\tbreak;\n\t} }\n\twp_add_inline_style( 'first-edition-style', $customized_css );\n}", "public static function add_admin_css() {\n\t\tif ( ! self::should_include_photo_column() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( 'admin_enqueue_scripts', [ __CLASS__, 'admin_enqueue_scripts_and_styles' ] );\n\t}", "private function load_admin_styles() {\n\n\t}", "function learn_customize_css() { ?>\n\t\t<style type=\"text/css\">\n\t\t\t\n\t\t\ta:link,\n\t\t\ta:visited {\n\t\t\t\tcolor: <?php echo get_theme_mod('lw_link_colors') ?> ;\n\t\t\t}\n\n\t\t\t.site-header nav ul li.current-menu-item a:link,\n\t\t\t.site-header nav ul li.current-menu-item a:visited,\n\t\t\t.site-header nav ul li.current-page-ancestor a:link,\n\t\t\t.site-header nav ul li.current-page-ancestor a:visited {\n\t\t\t\tbackground-color: <?php echo get_theme_mod('lw_link_colors') ?> ;\n\t\t\t}\n\t\t\t.hd-search #searchsubmit {\n\t\t\t\tbackground-color: <?php echo get_theme_mod('lw_button_colors') ?> ;\n\t\t\t}\n\n\t\t</style>\n<?php }", "public function enqueue_before_elementor() {\n\t\tif ( class_exists( 'Elementor\\Frontend', false ) ) {\n\t\t\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/bootstrap/css/bootstrap.min.css', array(), HESTIA_VENDOR_VERSION );\n\t\t\twp_style_add_data( 'bootstrap', 'rtl', 'replace' );\n\t\t\twp_style_add_data( 'bootstrap', 'suffix', '.min' );\n\t\t\twp_enqueue_style( 'hestia-font-sizes', get_template_directory_uri() . '/assets/css/font-sizes' . ( ( HESTIA_DEBUG ) ? '' : '.min' ) . '.css', array(), HESTIA_VERSION );\n\t\t}\n\t}", "function plugin_admin_styles() {\r\n\t\t\t// used by media upload\r\n\t\t\twp_enqueue_style('thickbox');\r\n\t\t\t// Register & enqueue our admin.css file \r\n\t\t\twp_register_style('framework', $this->framework_url .'framework.css');\r\n\t\t\twp_enqueue_style('framework');\r\n\t\t\t// color picker\r\n\t\t\twp_enqueue_style( 'farbtastic' );\r\n\t\t\r\n\t\t}", "public function styles(){\n\n\t\t//wp_enqueue_style('component-header_fixed-style', $this->directory_uri . '/assets/dist/css/headerFixed.css');\n\t}", "function admin_css() {\n?>\n<style type=\"text/css\">\n\t.plugin-update-tr .update-message-ignore {\n\t\tmargin: 5px;\n\t\tpadding: 3px 5px;\n\t\tborder-width: 1px;\n\t\tborder-style: solid;\n\t\t-moz-border-radius: 5px;\n\t\t-khtml-border-radius: 5px;\n\t\t-webkit-border-radius: 5px;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #ffebe8;\n\t\tborder-color: #c00;\n\t\tfont-weight: bold;\n\t}\n\t.error a {\n\t\tcolor: #c00;\n\t}\n</style>\n<?php\n\t}", "function gre_search_styles()\n{\n\t// page it will not load the css script\n\tif(!is_admin())\n\t{\n\t\twp_enqueue_style('jquery-ui-css','/wp-content/plugins/gre-search/css-includes/jquery-ui-1.7.2.custom.css');\n\t\twp_enqueue_style('search-form','/wp-content/plugins/gre-search/css-includes/search-form.css');\n\t}\n}", "function load_tna_page_status_admin_style() {\n\twp_register_style( 'custom_wp_admin_css', plugin_dir_url(__FILE__) . '/style.css', false, '0.1' );\n\twp_enqueue_style( 'custom_wp_admin_css' );\n}", "public function enqueue_elementor_styles() {\n\t\t$disabled_color_schemes = get_option( 'elementor_disable_color_schemes' );\n\t\t$disabled_typography_schemes = get_option( 'elementor_disable_typography_schemes' );\n\n\t\tif ( $disabled_color_schemes === 'yes' && $disabled_typography_schemes === 'yes' ) {\n\t\t\twp_enqueue_style( 'hestia-elementor-style', get_template_directory_uri() . '/assets/css/page-builder-style.css', array(), HESTIA_VERSION );\n\t\t}\n\t}", "public function testThemeAssetsInMainWebrootPath() {\n\t\tApp::build(array(\n\t\t\t'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)\n\t\t));\n\t\t$webRoot = Configure::read('App.www_root');\n\t\tConfigure::write('App.www_root', CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS);\n\n\t\t$this->Html->theme = 'test_theme';\n\t\t$result = $this->Html->css('webroot_test');\n\t\t$expected = array(\n\t\t\t'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\\/test_theme\\/css\\/webroot_test\\.css/')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->theme = 'test_theme';\n\t\t$result = $this->Html->css('theme_webroot');\n\t\t$expected = array(\n\t\t\t'link' => array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'preg:/.*theme\\/test_theme\\/css\\/theme_webroot\\.css/')\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\tConfigure::write('App.www_root', $webRoot);\n\t}", "function styles() {\n\twp_enqueue_style(\n\t\t'deadpoo-main',\n\t\tDIE_URL . '/assets/css/dist/main.css',\n\t\t[],\n\t\tfalse\n\t);\n}", "function Of_Metabox_admin_styles() {\n wp_enqueue_style( 'easyMetabox_Stylesheet' );\n}", "function addLittleShopCSS(){\n if(littleShopTakeEffect() === TRUE){\n\t echo '<link media=\"screen\" type=\"text/css\" href=\"'.myOwnLittleEbayShopPluginURL().'/my-own-little-ebay-shop-css.css\" rel=\"stylesheet\"/>';\n\t\n\t}\n}", "public function adminHead()\n\t{\n\t\tIF (!in_array($GLOBALS['ADMIN_CONTROLLER'], $this->loadOnController) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Include plugin's CSS files\n\t\t$html = $this->includeCSS('style.css');\n\t\t$html .= $this->includeCSS('BookingForm.css');\n\n\t\treturn $html;\n\t}", "function ninja_forms_admin_css(){\n\t$plugin_settings = nf_get_settings();\n\n\twp_enqueue_style( 'jquery-smoothness', NINJA_FORMS_URL .'css/smoothness/jquery-smoothness.css' );\n\twp_enqueue_style( 'ninja-forms-admin', NINJA_FORMS_URL .'css/ninja-forms-admin.css?nf_ver=' . NF_PLUGIN_VERSION );\n\twp_enqueue_style( 'nf-admin-modal', NINJA_FORMS_URL .'assets/css/admin-modal.css?nf_ver=' . NF_PLUGIN_VERSION );\n\n\tadd_filter('admin_body_class', 'ninja_forms_add_class');\n\n}", "function remove_pending_css_admin() { \n\t?>\n\n\t<link rel=\"stylesheet\" href=\"<?php echo get_bloginfo( 'home' ) . '/' . PLUGINDIR . '/remove-pending-comments/css/admin.css' ?>\" type=\"text/css\" media=\"all\" /> \n\n\t<?php\n}", "function wpfme_adminCSS() {\n\techo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.get_bloginfo('template_directory').'/wp-admin.css\"/>';\n}", "function styles() {\n\n\twp_enqueue_style(\n\t\t'styles',\n\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/style.css',\n\t\t[],\n\t\tERI_SCAFFOLD_VERSION\n\t);\n\n\tif ( is_page_template( 'templates/page-styleguide.php' ) ) {\n\t\twp_enqueue_style(\n\t\t\t'styleguide',\n\t\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/css/styleguide-style.css',\n\t\t\t[],\n\t\t\tERI_SCAFFOLD_VERSION\n\t\t);\n\t}\n}", "function propanel_of_style_only() {\n\twp_enqueue_style('admin-style', get_stylesheet_directory_uri().'/admin/admin-style.css');\n\twp_enqueue_style('color-picker', get_stylesheet_directory_uri().'/admin/colorpicker.css');\n}", "function cg_framework_admin_styles($hook)\n{\n // LOADING BOOTSTRAP 4 ON THE WP ADMIN SIDE\n // wp_register_style(\n // 'wpplugin-admin-bootstrap',\n // 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css',\n // [],\n // time()\n // );\n\n // wp_enqueue_style('wpplugin-admin-bootstrap');\n\n // LOADING MAIN PLUGIN ADMIN SIDE STYLES\n wp_register_style(\n 'cg-framework-admin',\n CG_FRAMEWORK_URL . 'admin/assets/dist/css/admin.min.css',\n [],\n time()\n );\n\n wp_enqueue_style('cg-framework-admin');\n}", "function css_files() {\n\t\twp_enqueue_style('escalate_network-admin-global', $this->plugin_url .'/css/styles-admin-global.css');\n\t}", "public function load_additional_styles() {\n\n // Grab current screen\n $screen = get_current_screen();\n\n // Make sure we're on the correct screen\n if ( ! in_array( $screen->id, $this->screens ) ) {\n return;\n }\n\n do_action( 'cv_builder_inline_styles' );\n\n }" ]
[ "0.64123803", "0.6364427", "0.634668", "0.6344194", "0.6244267", "0.62112933", "0.6184165", "0.617153", "0.6154084", "0.61347914", "0.6115918", "0.61113024", "0.6109064", "0.6083221", "0.6071445", "0.60558105", "0.6034255", "0.60268146", "0.6019083", "0.6017077", "0.5979238", "0.5970835", "0.595425", "0.5940803", "0.59394914", "0.59315497", "0.59286255", "0.59079945", "0.5900163", "0.58738935", "0.5870881", "0.586937", "0.5865664", "0.5852611", "0.58440924", "0.58418924", "0.58358765", "0.5835438", "0.5830368", "0.5830053", "0.58245224", "0.58147734", "0.57902515", "0.57869893", "0.5779738", "0.5771116", "0.5770299", "0.57699054", "0.57673544", "0.5766918", "0.57622", "0.5746238", "0.574336", "0.5741682", "0.57296085", "0.5729108", "0.57289696", "0.5725926", "0.572055", "0.5719994", "0.5717127", "0.5714336", "0.5714032", "0.57077265", "0.5702781", "0.5701972", "0.5698351", "0.56962407", "0.5694903", "0.56945133", "0.56885767", "0.56874627", "0.5685991", "0.5683568", "0.56786835", "0.56772226", "0.5673015", "0.56693304", "0.56643754", "0.5660712", "0.56593305", "0.56565195", "0.565122", "0.56466836", "0.5639816", "0.56381845", "0.5637744", "0.5635546", "0.5634085", "0.5633304", "0.5630359", "0.56278896", "0.5624664", "0.56220514", "0.5621669", "0.56188995", "0.5616894", "0.5616762", "0.5616625", "0.5615336" ]
0.826032
0
Returns a filename that is unique in the given directory. This fuction is based on wp_unique_filename() from but it treats .tar.gz as a single extension.
public function unique_filename_callback( $dir, $filename, $ext ) { $ext = mb_strtolower($ext); if($ext === '.gz' && mb_substr($filename, -7) === '.tar.gz' ) $ext = '.tar.gz'; $number = ''; while ( file_exists( $dir . "/$filename" ) ) { $new_number = (int) $number + 1; if ( '' === "$number$ext" ) { $filename = "$filename-" . $new_number; } else { $filename = str_replace( array( "-$number$ext", "$number$ext" ), "-" . $new_number . $ext, $filename ); } $number = $new_number; } return $filename; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate_unique_file_name($dir, $filename)\n{\n if (!$filename)\n return;\n \n $extension = pathinfo($filename, PATHINFO_EXTENSION);\n\n $new_filename = '';\n for (;;)\n {\n $new_filename = get_random_string(8, 8) . '.' . $extension;\n if (!file_exists($dir . '/' . $new_filename))\n break;\n }\n\n return $new_filename;\n}", "function wp_unique_filename($dir, $filename, $unique_filename_callback = null) {\n\t\t$filename = sanitize_file_name($filename);\n\n\t\t// Separate the filename into a name and extension.\n\t\t$info = pathinfo($filename);\n\t\t$ext = !empty($info['extension']) ? '.' . $info['extension'] : '';\n\t\t$name = basename($filename, $ext);\n\n\t\t// Edge case: if file is named '.ext', treat as an empty name.\n\t\tif ($name === $ext) {\n\t\t\t$name = '';\n\t\t}\n\n\t\t/*\n\t\t\t * Increment the file number until we have a unique file to save in $dir.\n\t\t\t * Use callback if supplied.\n\t\t*/\n\t\tif ($unique_filename_callback && is_callable($unique_filename_callback)) {\n\t\t\t$filename = call_user_func($unique_filename_callback, $dir, $name, $ext);\n\t\t} else {\n\t\t\t$number = '';\n\n\t\t\t// Change '.ext' to lower case.\n\t\t\tif ($ext && strtolower($ext) != $ext) {\n\t\t\t\t$ext2 = strtolower($ext);\n\t\t\t\t$filename2 = preg_replace('|' . preg_quote($ext) . '$|', $ext2, $filename);\n\n\t\t\t\t// Check for both lower and upper case extension or image sub-sizes may be overwritten.\n\t\t\t\twhile (file_exists($dir . \"/$filename\") || file_exists($dir . \"/$filename2\")) {\n\t\t\t\t\t$new_number = $number + 1;\n\t\t\t\t\t$filename = str_replace(\"$number$ext\", \"$new_number$ext\", $filename);\n\t\t\t\t\t$filename2 = str_replace(\"$number$ext2\", \"$new_number$ext2\", $filename2);\n\t\t\t\t\t$number = $new_number;\n\t\t\t\t}\n\t\t\t\treturn $filename2;\n\t\t\t}\n\n\t\t\twhile (file_exists($dir . \"/$filename\")) {\n\t\t\t\tif ('' == \"$number$ext\") {\n\t\t\t\t\t$filename = $filename . ++$number . $ext;\n\t\t\t\t} else {\n\t\t\t\t\t$filename = str_replace(\"$number$ext\", ++$number . $ext, $filename);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn $filename;\n\t}", "function wp_unique_filename($dir, $filename, $unique_filename_callback = \\null)\n {\n }", "public static function uniqueFilename($directory)\n\t{\n\t\t$ds = DIRECTORY_SEPARATOR;\n\t\t$i = 0;\n\t\tdo{\n\t\t\t$filename = uniqid($i++);\n\t\t} while (file_exists($directory . $ds . $filename));\n\t\t\n\t\treturn $filename;\n\t}", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName()\n {\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "private function generateUniqueFileName() {\r\n \r\n return md5(uniqid());\r\n }", "private function createUniqueZipFilename()\n {\n $directory = storage_path() . '/elvis/';\n\n if (!file_exists($directory)) {\n mkdir($directory);\n }\n\n return $directory . Str::random(40) . '.zip';\n }", "private function generateUniqueFileName()\n {\n return md5(base64_encode(pack('N6', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), uniqid())));\n }", "private function generateUniqueFileName() :string\n {\n // md5() reduces the similarity of the file names generated by\n // uniqid(), which is based on timestamps\n return md5(uniqid());\n }", "function unique_name($folder, $name, $extension)\n{\n $result = \"$folder/$name.$extension\";\n\n $i = 2;\n while (file_exists($result))\n {\n $result = \"$folder/$name-$i.$extension\";\n $i++;\n }\n\n return $result;\n}", "protected function randomFileName($directory, $prefix = '', $extension = '.txt')\n {\n do {\n $file = uniqid($prefix).$extension;\n }\n while (file_exists($directory.'/'.$file));\n return $file;\n }", "function generateNewFileName(string $directory, string $extension) : string {\n\n\t//First, check if folder exists\n\tif(!file_exists($directory))\n\t\treturn false;\n\t\n\t//Generate a random filename\n\tdo {\n\t\t//Generate a new filename\n\t\t$fileName = random_str(25).\".\".$extension;\t\n\t}\n\twhile(file_exists($directory.$fileName));\n\n\t//Return the generated filename\n\treturn $fileName;\n}", "public function makeFilename()\n {\n return getcwd().'/package'.md5(time().uniqid()).'.zip';\n }", "public static function MakeFilenameUnique($dir, $filename)\n\t{\n\t $dir = self::NormalizeDirPath($dir);\n\t\t$i = 0;\n\t while ($i < 1000)\n\t {\n\t if ($i == 0)\n\t {\n\t $newFilename = $filename;\n\t }\n\t else\n\t {\n\t \t$reg = array();\n\t if (preg_match('/(.*)\\.([^\\.]*)$/', $filename, $reg))\n\t {\n\t $newFilename = $reg[1].\"[$i].\".$reg[2];\n\t }\n\t else\n\t {\n\t $newFilename = $filename.\"[$i]\";\n\t }\n\t }\n\n\t if (!file_exists($dir.$newFilename)) break;\n\t $i++;\n\t }\n\t return $newFilename;\n\t}", "protected function makeFilename()\n {\n return getcwd().'/october_installer_'.md5(time().uniqid()).'.zip';\n }", "protected function makeFilename()\n {\n return getcwd().'/bolt_'.md5(time().uniqid()).'.zip';\n }", "function getUnique($fileName,$path)\n{\n $baseName = preg_replace('/^(.*)\\.[^.]+$/', '\\\\1', $fileName);\n $extension = preg_replace('/^.*(\\.[^.]+$)/', '\\\\1', $fileName);\n $i = 1;\n \n while (file_exists($path.$fileName)) {\n $fileName = $baseName . '_' . $i . $extension;\n $i++;\n }\n \n return $fileName;\n}", "protected function getUniqueTargetPath($uploadDirectory, $filename)\n\t{\n\t\t// Allow only one process at the time to get a unique file name, otherwise\n\t\t// if multiple people would upload a file with the same name at the same time\n\t\t// only the latest would be saved.\n\n\t\tif (function_exists('sem_acquire')){\n\t\t\t$lock = sem_get(ftok(__FILE__, 'u'));\n\t\t\tsem_acquire($lock);\n\t\t}\n\n\t\t$pathinfo = pathinfo($filename);\n\t\t$base = $pathinfo['filename'];\n// Clean the fileName for security reasons\n$base = preg_replace('/[^\\w\\._]+/', '_', $base);\n\t\t$ext = isset($pathinfo['extension']) ? $pathinfo['extension'] : '';\n\t\t$ext = $ext == '' ? $ext : '.' . $ext;\n\n\t\t$unique = $base;\n\t\t$suffix = 0;\n\n\t\t// Get unique file name for the file, by appending suffix.\n\t\twhile (file_exists($uploadDirectory . DIRECTORY_SEPARATOR . $unique . $ext)){\n//\t\t\t$suffix += rand(1, 999);\t// random\n\t\t\t$suffix++;\t// consecutive\n\t\t\t$unique = $base.'-'.$suffix;\n\t\t}\n\n\t\t$result = $uploadDirectory . DIRECTORY_SEPARATOR . $unique . $ext;\n\n\t\t// Create an empty target file\n\t\tif (!touch($result)){\n\t\t\t// Failed\n\t\t\t$result = false;\n\t\t}\n\n\t\tif (function_exists('sem_acquire')){\n\t\t\tsem_release($lock);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getUniqFilename()\n\t{\n\t\tif (empty($this->_uniqFilename)) {\n\t\t\t$this->_uniqFilename = sprintf('%s_%s', uniqid(), $this->_uploadedFile->getClientFilename());\n\t\t}\n\n\t\treturn $this->_uniqFilename;\n\t}", "private function genereteFilename(){\n return strtolower(md5(uniqid($this->document->baseName)) . '.' . $this->document->extension);\n }", "public static function getRandomFileName()\r\n\t{\r\n\t\treturn uniqid(rand(), true);\r\n\t}", "public function unique_filename_callback($dir, $name, $ext) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found -- Filter use\n\t\treturn $name.$ext;\n\t}", "private function returnUniqueFileName($name) {\n\t\t\t\twhile(file_exists($this->dir.'/'.$name) == true) {\n\t\t\t\t\t$name = rand(1000).$name;\n\t\t\t\t}\n\t\t\t\treturn $name;\n\t\t\t}", "function tempfile_unique($dir, $prefix, $postfix){\n \n if ($dir[strlen($dir) - 1] == '/') {\n $trailing_slash = \"\";\n } else {\n $trailing_slash = \"/\";\n }\n /*The PHP function is_dir returns true on files that have no extension.\n The filetype function will tell you correctly what the file is */\n if (!is_dir(realpath($dir)) || filetype(realpath($dir)) != \"dir\") {\n // The specified dir is not actualy a dir\n return false;\n }\n if (!is_writable($dir)){\n // The directory will not let us create a file there\n return false;\n }\n \n do{ \n \t$seed = substr(md5(microtime()), 0, 8);\n $filename = $dir . $trailing_slash . $prefix . $seed . $postfix;\n } while (file_exists($filename));\n $fp = fopen($filename, \"w\");\n fclose($fp);\n return $filename;\n}", "private function generateUniqueFileName(UploadedFile $file): string\n {\n $originFileName = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);\n $originFileNameSlugged = $this->slugger->slug(strtolower($originFileName));\n $randomId = uniqid();\n return \"{$originFileNameSlugged}-{$randomId}.{$file->guessExtension()}\";\n }", "public function generateFilename()\n {\n $filename = str_replace(\" \", \"_\", strtolower($this->getOriginalName()));\n\n if(!file_exists(\"http://\".$_SERVER['HTTP_HOST'].\"/uploads/docs/\".$filename))\n {\n return $filename;\n }\n else\n {\n $extension = $this->getExtension($this->getOriginalExtension());\n $filename = str_replace($extension, '', $filename) . '_';\n\n $i = 2;\n\n while(true)\n {\n if(file_exists($this->getPath().$filename.$i.$extension))\n {\n $i++;\n continue;\n }\n break;\n }\n\n return $filename.$i.$extension;\n }\n }", "function randomFileNameGenerator($prefix){\n\t$r=substr(str_replace(\".\",\"\",uniqid($prefix,true)),0,20);\n\tif(file_exists(\"../uploads/$r\")) randomFileNameGenerator($prefix);\n\telse return $r;\n}", "function randomFileNameGenerator($prefix){\n\t$r=substr(str_replace(\".\",\"\",uniqid($prefix,true)),0,20);\n\tif(file_exists(\"../uploads/$r\")) randomFileNameGenerator($prefix);\n\telse return $r;\n}", "private function getUniqueFilePath($fileName, $directory) {\n return FileService::getInstance()->getUniqueFilePath(\n $fileName . '.' . $this->getExtension(),\n $directory,\n $this->getLocalPath()\n );\n }", "private function getUniqueFileName(Image $image)\n {\n $extension = $this->getExtension($image);\n\n do {\n $path = $this->getFullFileName(uniqid('', true) . '.' . $extension);\n } while (file_exists($path));\n\n return $path;\n }", "public function filename(): string\n {\n return Str::random(6) . '_' . $this->type . $this->fileExtension();\n }", "function findUniqueFilename($existing_files = null) {\r\n\t\t// append a digit to the end of the name\r\n\t\t$filenumber = 0;\r\n\t\t$filesuffix = '';\r\n\t\t$fileparts = explode('.', $this->filename);\r\n\t\t$fileext = '.' . array_pop($fileparts);\r\n\t\t$filebase = implode('.', $fileparts);\r\n\r\n\t\tif( !eregi(\"jpeg|jpg|png|gif\",$fileext) ){\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext.'_';\r\n\t\t}else{\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext;\r\n\t\t}\r\n\r\n\r\n\t\tif (is_array($existing_files)) {\r\n\t\t\tdo {\r\n\t\t\t\t$newfile = $filebase . $filesuffix . $fileext;\r\n\t\t\t\t$filenumber++;\r\n\t\t\t\t$filesuffix = '(' . $filenumber . ')';\r\n\t\t\t} while (in_array($newfile, $existing_files));\r\n\t\t}\r\n\t\t\r\n\t\treturn $newfile;\r\n\t}", "function file_name ($url) {\n $filename = md5( $url );\n return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );\n }", "protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }", "protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }", "protected function getUniqueFileName($file)\n {\n if ($this->fileStorageDb->checkDbUsage()) {\n $destFile = $this->fileStorageDb->getUniqueFilename(\n $this->mediaConfig->getBaseMediaUrlAddition(),\n $file\n );\n } else {\n $destFile = dirname($file) . '/' . \\Magento\\MediaStorage\\Model\\File\\Uploader::getNewFileName(\n $this->mediaDirectory->getAbsolutePath($this->getAttributeSwatchPath($file))\n );\n }\n\n return $destFile;\n }", "public static function getTemporaryFilename($prefix = 'tmpFile_', $extension = '', $dir = TMP_DIR) {\n\t\t$dir = self::addTrailingSlash($dir);\n\t\tdo {\n\t\t\t$tmpFile = $dir.$prefix.StringUtil::getRandomID().$extension;\n\t\t}\n\t\twhile (file_exists($tmpFile));\t\n\t\t\n\t\treturn $tmpFile;\n\t}", "protected function _makeFileName($ext) {\n if (true == $this->_encryptFileName) {\n return (uniqid() .$ext);\n }\n\n if (null != $this->_newName) {\n $name = Folder::cleanFileName($this->_newName);\n $name = str_replace($ext, '', $name);\n } else {\n $name = Folder::cleanFileName($this->_data['file_origin_name']);\n $name = str_replace($ext, '', $name);\n }\n\n if (false !== $this->_ansiName) {\n $name = preg_replace('/[^A-Za-z0-9_\\-]/', '', $name);\n }\n\n if (false !== $this->_removeSpaceName) {\n $name = preg_replace('/\\s+/', '-', $name);\n }\n\n if (true !== $this->_overwrite\n && (file_exists($this->_dir .$name .$ext))) {\n $i = 1;\n do {\n $_t = $name .'(' .$i .')';\n ++$i;\n } while (file_exists($this->_dir .$_t .$ext));\n $name = $_t;\n }\n\n return $name .$ext;\n }", "public static function randomFilename() {\n $name = self::randomString();\n return substr($name, 0, 2) . '/' . substr($name, 2, 2)\n . '/' . substr($name, 4, 2) . '/' . substr($name, 6);\n }", "public static function generateFileName($fileName)\n {\n return substr(md5(time()), 0, 10) . '.' . pathinfo($fileName, PATHINFO_EXTENSION);\n }", "protected function generateUniqueName(UploadedFile $file)\n {\n return md5(uniqid()).'.'.$file->getClientOriginalExtension();\n }", "static function generateFileName($file)\n {\n $file_name = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);\n return \\Str::slug(rand() . $file_name) . '.' . $file->getClientOriginalExtension();\n }", "public function getFilename() {\n\t\t\n\t\t$filename = $this->filename;\n\t\t\n\t\tif(file_exists($this->path . $filename) && $this->rename_if_exists === true) {\n\t\t\n\t\t\t//Explode the filename, pop off the extension and put it back together\n\t\t\t$parts = explode('.', $filename);\n\n\t\t\t$extension = array_pop($parts);\n\n\t\t\t$base_filename = implode('.', $parts);\n\t\t\t\n\t\t\t$count = 1;\n\t\t\t\n\t\t\tdo {\n\t\t\t\t$count++;\n\t\t\t} while(file_exists($this->path . $base_filename . '_' . $count . '.' . $extension));\n\t\t\t\n\t\t\t$filename = $base_filename . '_' . $count . '.' . $extension;\n\t\t\n\t\t}\n\t\t\n\t\treturn $filename;\n\t\t\n\t}", "protected function makeUniqueFileNme(\n Filesystem $storage,\n string $path,\n string $ext\n ) {\n do {\n $name = bin2hex(openssl_random_pseudo_bytes(64 / 2));\n } while($storage->exists(sprintf('%s/%s.%s', $path, $name, $ext)));\n\n return $name;\n }", "public function getUniqueName($theFile, $theDest, $dontCheckForUnique = false)\n {\n // @todo: should go into the LocalDriver in a protected way (not important to the outside world)\n $theDest = $this->is_directory($theDest);\n // $theDest is cleaned up\n $origFileInfo = GeneralUtility::split_fileref($theFile);\n // Fetches info about path, name, extension of $theFile\n if ($theDest) {\n // Check if the file exists and if not - return the filename...\n $fileInfo = $origFileInfo;\n $theDestFile = $theDest . '/' . $fileInfo['file'];\n // The destinations file\n if (!file_exists($theDestFile) || $dontCheckForUnique) {\n // If the file does NOT exist we return this filename\n return $theDestFile;\n }\n // Well the filename in its pure form existed. Now we try to append numbers / unique-strings and see if we can find an available filename...\n $theTempFileBody = preg_replace('/_[0-9][0-9]$/', '', $origFileInfo['filebody']);\n // This removes _xx if appended to the file\n $theOrigExt = $origFileInfo['realFileext'] ? '.' . $origFileInfo['realFileext'] : '';\n for ($a = 1; $a < $this->maxNumber; $a++) {\n if ($a <= $this->maxNumber) {\n // First we try to append numbers\n $insert = '_' . sprintf('%02d', $a);\n } else {\n // .. then we try unique-strings...\n $insert = '_' . substr(md5(uniqid('', true)), 0, $this->uniquePrecision);\n }\n $theTestFile = $theTempFileBody . $insert . $theOrigExt;\n $theDestFile = $theDest . '/' . $theTestFile;\n // The destinations file\n if (!file_exists($theDestFile)) {\n // If the file does NOT exist we return this filename\n return $theDestFile;\n }\n }\n }\n }", "private function getFileName($raw = false){\n $raw_string = $this->surah . '|' . $this->verses . '|' . $this->translation;\n return $raw ? $raw_string : md5($raw_string).'.png';\n }", "function slug_filename($filename,$name,$random) {\n $data = pathinfo($filename);\n $result = $this->slug($name).$this->slug_random($random).'.'.$data['extension'];\n return strtolower($result);\n\t}", "public function getRandomFileName($fileType) \n {\n return md5($fileType . Auth::id()) . md5(uniqid('', true));\n }", "function clean_filename($filename, $dir_id, $parameters = array())\n\t{\n\t\t// at one time the third parameter was (bool) $dupe_check\n\t\tif ( ! is_array($parameters))\n\t\t{\n\t\t\t$parameters = array('ignore_dupes' => ! $parameters);\n\t\t}\n\n\t\t// Establish the default parameters\n\t\t$default_parameters = array(\n\t\t\t'convert_spaces' => TRUE,\n\t\t\t'ignore_dupes' => TRUE\n\t\t);\n\n\t\t// Get the actual set of parameters and go\n\t\t$parameters = array_merge($default_parameters, $parameters);\n\n\t\t$prefs = $this->fetch_upload_dir_prefs($dir_id);\n\n\t\t$i = 1;\n\t\t$ext = '';\n\t\t$path = $prefs['server_path'];\n\n\t\t// clean up the filename\n\t\tif ($parameters['convert_spaces'] === TRUE)\n\t\t{\n\t\t\t$filename = preg_replace(\"/\\s+/\", \"_\", $filename);\n\t\t}\n\n\t\t$filename = ee()->security->sanitize_filename($filename);\n\n\t\tif (strpos($filename, '.') !== FALSE)\n\t\t{\n\t\t\t$parts\t\t= explode('.', $filename);\n\t\t\t$ext\t\t= array_pop($parts);\n\n\t\t\t// @todo prevent security issues with multiple extensions\n\t\t\t// http://httpd.apache.org/docs/1.3/mod/mod_mime.html#multipleext\n\t\t\t$filename\t= implode('.', $parts);\n\t\t}\n\n\t\t$ext = '.'.$ext;\n\n\t\t// Figure out a unique filename\n\t\tif ($parameters['ignore_dupes'] === FALSE)\n\t\t{\n\t\t\t$basename = $filename;\n\n\t\t\twhile (file_exists($path.$filename.$ext))\n\t\t\t{\n\t\t\t\t$filename = $basename.'_'.$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $path.$filename.$ext;\n\t}", "private function get_file_name( $entry_id ) {\n\t\treturn 'signature-' . $this->field->id . '-' . $entry_id . '.png';\n\t}", "protected function setFileName($unique)\n {\n return substr(hash('md5', \"_bingo_{$unique}\"), 0, 16);\n }", "function uniqFile($id,$filename,$ext) {\n $file = md5($filename).\"\".uniqid($filename, true);\n return \"pro\".$id.\"\".md5($file).\"le.\".$ext ;\n }", "private function getThumbFilename() {\n\t\t$info = pathInfo( $this->filename );\n\n\t\t// add dirname as postfix (if exists)\n\t\t$postfix = '';\n\n\t\t$dirname = UniteFunctionsRev::getVal( $info, 'dirname' );\n\t\tif ( ! empty( $dirname ) ) {\n\t\t\t$postfix = str_replace( '/', '-', $dirname );\n\t\t}\n\n\t\t$ext = $info['extension'];\n\t\t$name = $info['filename'];\n\t\t$width = ceil( $this->maxWidth );\n\t\t$height = ceil( $this->maxHeight );\n\t\t$thumbFilename = $name . '_' . $width . 'x' . $height;\n\n\t\tif ( ! empty( $this->type ) ) {\n\t\t\t$thumbFilename .= '_' . $this->type; }\n\n\t\tif ( ! empty( $this->effect ) ) {\n\t\t\t$thumbFilename .= '_e' . $this->effect;\n\t\t\tif ( ! empty( $this->effect_arg1 ) ) {\n\t\t\t\t$thumbFilename .= 'x' . $this->effect_arg1;\n\t\t\t}\n\t\t}\n\n\t\t// add postfix\n\t\tif ( ! empty( $postfix ) ) {\n\t\t\t$thumbFilename .= '_' . $postfix; }\n\n\t\t$thumbFilename .= '.' . $ext;\n\n\t\treturn($thumbFilename);\n\t}", "protected function getFilename($id)\n {\n return $this->cacheDir . DIRECTORY_SEPARATOR . md5($id) . $this->extension;\n }", "public function generateFileName()\n {\n $d = new \\DateTime();\n\n return strtoupper($this->fileName).\"_\" . $d->format(\"Y-m-d\");\n }", "public function new_filename($name)\n\t{\n $name = preg_replace(\"/[^a-zA-Z0-9._]/\", \"_\", $name);\n\n // First make sure that we have a directory to put it in, make a new directory for each month\n // Using base64_encode to get more interesting results than an md5 hash\n $dir = date(\"Ym\");\n $file_split = explode(\".\", $name);\n $extension = $file_split[count($file_split) - 1];\n $s3 = AWS::createClient('s3');\n do {\n $filename = substr(base64_encode(md5(uniqid(rand()))), 0, 8) . \".\" . $extension;\n } while ($s3->doesObjectExist($this->bucket, $dir . '/' . $filename));\n $this->dir = $dir;\n return $filename;\n\t}", "private function getFilename($i)\n {\n return md5(time() . str_random()) .'.'. $i->getClientOriginalExtension();\n }", "public function generateProcessedFileNameWithoutExtension() {}", "protected static function generateArchiveName(): string\n {\n $archiveName = sprintf(\n '%s_%s_%s.zip',\n strtoupper(env('APP_NAME', 'default')),\n env('APP_VERSION', '0.0.1'),\n Carbon::now(env('APP_TIMEZONE', 'UTC'))->format('Y-m-d-H-i-s-u')\n );\n\n return storage_path($archiveName);\n }", "private function getFilename(string $name): string\n {\n return \\sprintf('%s/../../../var/%s.hash', __DIR__, $name);\n }", "public function encrypt_name(){\n $filename = md5(uniqid(mt_rand()));\n return $filename;\n }", "public function genFilename()\n {\n $filename = $this->getAssetableType().$this->assetable_id.'_';\n $filename .= uniqid();\n if(!empty($this->getThumbnailType())) $filename .= '_'.$this->getThumbnailType();\n $filename .= '.'.$this->uploadedFile->extension;\n $this->filename = $filename;\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "private function pathFilename() {\n return $this->directory . \"/\" . $this->formatFilename();\n }", "protected function getFilename(string $key): string\n {\n return \\hash('sha256', $key) . '.cache';\n }", "public function addTmpSuffix($dir_file)\n {\n $dir_file = (string) $dir_file;\n $dir_file = rtrim($dir_file, DIRECTORY_SEPARATOR.'\\\\/');\n\n return $dir_file.'-'.str_replace('.', '', uniqid('', true)).'-tmp';\n }", "public function makeName($file = null, $url = null)\n {\n\n //Returns file name with extension if method contains a file in parameters\n if (!($file == null)) {\n return md5(date('yyyy-mm-dd hh:ss') . rand(0, 999)) . '.' . $file->getClientOriginalExtension();\n }\n\n //Returns file name with extension if method contains a url in parameters\n if (!($url == null)) {\n return md5(date('yyyy-mm-dd hh:ss') . $file . rand(0, 999)) . '.' . $this->getExt($url);\n }\n\n //Returns file name without extension if the $file parameter is null\n return md5(date('yyyy-mm-dd hh:ss') . $file . rand(0, 999));\n }", "public function getFileNameFromUrl($url, $unique = null)\n {\n // Get filename extension and set to lowercase\n $file_ext = strtolower(pathinfo($url, PATHINFO_EXTENSION));\n\n // Change jpeg to jpg\n $file_ext = $file_ext == 'jpeg' ? 'jpg' : $file_ext;\n\n // Return file name with chosen hash algo function\n return hash($this->hash_algo, $unique . hash_file($this->hash_algo, $url)) . '.' . $file_ext;\n }", "function random_file_name($keyname = '')\n{\n // config generate auto uniq\n /* A uniqid, like: 4b3403665fea6 */\n\n // nama file\n $getNama = $keyname;\n\n // delete space\n $removeSpace = preg_replace('/\\s+/', '', $getNama);\n\n // pisahkan dgn extentionnya\n $explodeFile = explode('.', $removeSpace);\n\n $namaFiles = $explodeFile[0];\n $extFiles = end($explodeFile);\n\n // buat nama baru \n $file = md5(uniqid($namaFiles));\n\n // gabung kembali menjadi file baru\n $new_file = $file . '.' . $extFiles;\n return $new_file;\n}", "public function getNameFile($image): string\n {\n \t$image_name = uniqid(time()) . '.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n \treturn $image_name;\n }", "public static function getTempFileName()\r\n\t{\r\n\t\treturn self::_normalizeDirectorySeparators(tempnam(self::getTempDirectory(), self::getRandomFileName()));\r\n\t}", "protected function getThumbDirectoryName()\n {\n return Base::suffix($this->dirName);\n }", "public static function generateRandomFilename($postfix = \"\") {\n\t\treturn sha1(uniqid(\"\", true)).$postfix;\n\t}", "public function upFile($file, $dir)\n {\n $name = rand() . '.' . $file->getClientOriginalExtension();\n $file->move($dir, $name);\n return $name;\n }", "private function getThumbName() {\n $thumbName = $this->randomize();\n while (file_exists($this->thumbPath.$thumbName)) {\n $thumbName = $this->randomize($thumbName);\n }\n return $thumbName;\n }", "protected function createRandomFilename($prefix, $extension)\n\t{\n\t\treturn \"{$this->storageDirectory}/{$prefix}.{$this->randomString()}.{$extension}\";\n\t}", "public function formatFilename($filename)\n {\n $extension = $this->getExtension($filename);\n\n $baseName = substr($filename, 0, strlen($filename) - strlen($extension));\n $str = strtolower($this->removeAccents($baseName));\n $str = preg_replace('/ {1,}/', ' ', $str);\n $stripBaseName = preg_replace('/[^a-zA-Z0-9-]{1,}/', '-', trim($str));\n $stripBaseName = preg_replace('/[-]{1,}$/', '', trim($stripBaseName));\n\n $finalFilename = uniqid($stripBaseName . '-') . $extension;\n\n return $finalFilename;\n }", "protected function generateFilesFromFilename()\n {\n $this->log(sprintf('%s', __METHOD__), 'debug');\n\n return ROOT . DS . Security::hash($this->filesToString(), 'md5') . '.txt';\n }", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "protected function getFileName($prefix = '', $suffix = 'log')\n {\n $prefix = ($prefix) ? $prefix . '_' : '';\n $suffix = ($suffix) ? $suffix : 'log';\n\n return uniqid($prefix, true) . '.' . $suffix;\n }", "public function generateFileName() {\n $this->filename = ($this->getName(TRUE, TRUE, TRUE, \".\").\".xml\");\n\n return $this->filename;\n }", "private function getFilename(string $key)\n {\n return str_replace('//', '/', $this->dir . '/' . str_replace('_', '/', $key));\n }", "private function getFileName(){\n $name = $this->pluginName;\n $text = \"\";\n $lastCapital = true;\n for($i = 0; $i < strlen($name); $i++){\n if($name[$i] !== strtolower($name[$i])){\n if(!$lastCapital){\n $text .= \"_\";\n }\n $lastCapital = true;\n } else {\n $lastCapital = false;\n }\n $text .= strtolower($name[$i]);\n }\n return str_replace(\"nfx\", \"nfx_\", $text);\n }", "public function new_local_file_name()\n\t{\n\t\t$name = sys_get_temp_dir().'/'.str_random(32);\n\t\treturn $name;\n\t}", "protected function get_unique_filename($file_path, $name, $size, $type, $error,\n $index, $content_range)\n {\n $parts = explode('.', $name);\n $extIndex = count($parts) - 1;\n $ext = strtolower(@$parts[$extIndex]);\n $name='original.'.$ext;\n\n return $name;\n }", "private function generateFileUID( $table ) {\n $today = date( 'Ymd' );\n $array = glob( $this->path . trim( $table, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . $today . ( $this->gzip ? '*.dat.gz' : '*.dat' ) );\n\n if( !empty( $array ) ) {\n natsort( $array );\n\n $last = basename( end( $array ), ( $this->gzip ? '.dat.gz' : '.dat' ) );\n $date = substr( $last, 0, 8 );\n $dec = base_convert( substr( $last, 8 ), 36, 10 );\n\n // Overflow\n if( $dec >= 2821109907455 )\n throw new \\OverflowException( \"File UID ($last) overflow\" );\n\n $id = sprintf( \"%8s%08s\", $today, base_convert( ( $dec + 1 ), 10, 36 ) );\n }\n else {\n $id = sprintf( \"%8s%08s\", $today, base_convert( 1, 10, 36 ) );\n }\n\n return $id;\n }", "private function generateFileName(){\n $letter = array_merge(range('a', 'z'), range('A', 'Z'), range(0,9));\n shuffle($letter);\n $word = substr(implode($letter), 0, 15);\n return date('Ymd_His') . $word;\n }", "protected function createFilename(UploadedFile $file)\n {\n $extension = $file->getClientOriginalExtension();\n $filename = str_replace(\".\".$extension, \"\", $file->getClientOriginalName()); // Filename without extension\n // Add timestamp hash to name of the file\n $filename .= \"_\" . md5(time()) . \".\" . $extension;\n return $filename;\n }", "public function geraNomeArquivo()\n {\n return sha1(uniqid(mt_rand(), true));\n }", "public function generateName($file): string\n {\n $fileName = $file->getClientOriginalName();\n\n $name = pathinfo($fileName, PATHINFO_FILENAME);\n $extension = pathinfo($fileName, PATHINFO_EXTENSION);\n\n $counter = 1;\n while (Storage::exists($this->generatePath($fileName))) {\n $fileName = $name . '-' . $counter . '.' . $extension;\n $counter++;\n }\n\n return $fileName;\n }", "function generateFileName(){\n\t$assembledname = \"\";\n\t$chars = \"abcdefghijklmnopqrstuvwxyz1234567890\";\n\t\n\tfor($i=0;$i<20;$i++){\n\t\t$randomChar = rand(0,strlen($chars)-1);\n\t\t$assembledname .= substr($chars,$randomChar,1);\n\t}\n\n\treturn $assembledname;\n}", "function createFileName()\n\t{\n\t $sid = 'abcdefghiklmnopqstvxuyz0123456789ABCDEFGHIKLMNOPQSTVXUYZ';\n\t $max = strlen($sid) - 1;\n\t $res = \"\";\n\t for($i = 0; $i<16; ++$i)\n\t {\n\t $res .= $sid[mt_rand(0, $max)];\n\t } \n\t return $res;\n\t}", "public function filename()\n {\n $processor = Hash::get($this->settings, 'nameCallback', null);\n $extension = Hash::get($this->settings, 'base64_extension', '.png');\n if (is_callable($processor)) {\n $numberOfParameters = (new \\ReflectionFunction($processor))->getNumberOfParameters();\n if ($numberOfParameters == 2) {\n return $processor($this->data, $this->settings);\n }\n\n return $processor($this->table, $this->entity, $this->data, $this->field, $this->settings);\n }\n\n return Text::uuid() . \"$extension\";\n }" ]
[ "0.77655303", "0.767303", "0.7602459", "0.75815725", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.74350446", "0.73986477", "0.7397706", "0.7242553", "0.72255135", "0.71434987", "0.70677674", "0.7001081", "0.6945939", "0.6924418", "0.6850468", "0.6801426", "0.67566496", "0.6752559", "0.67253417", "0.66985434", "0.6686271", "0.6621189", "0.6573536", "0.6565372", "0.656363", "0.65588146", "0.64816606", "0.64491546", "0.6437913", "0.6437913", "0.64321107", "0.6372314", "0.63573855", "0.6352496", "0.63085043", "0.6262337", "0.6262337", "0.6242253", "0.6211874", "0.6195015", "0.61934286", "0.61742944", "0.61342", "0.61278063", "0.61118263", "0.6107774", "0.608716", "0.607462", "0.6071615", "0.606282", "0.6021495", "0.6006807", "0.6005863", "0.5993866", "0.59832245", "0.59771305", "0.5975634", "0.59735924", "0.5971397", "0.590757", "0.58983964", "0.5898041", "0.5881459", "0.5874289", "0.5869176", "0.5861984", "0.5859622", "0.58450073", "0.5839915", "0.5834994", "0.5831399", "0.5814925", "0.5808473", "0.58080816", "0.58033395", "0.58007604", "0.57805955", "0.5779308", "0.57759446", "0.5772382", "0.5750762", "0.5748759", "0.57180774", "0.571474", "0.5709095", "0.57077515", "0.56935716", "0.5691482", "0.56903505", "0.5684743", "0.56766886", "0.56757516", "0.5666359", "0.56580025", "0.5650352" ]
0.7734731
1
Adds additional mime types to the given array. Enables the upload of such file types to the media library.
public function custom_upload_mimes( $mime_types=array() ) { if(!array_key_exists('pdf', $mime_types)) $mime_types['pdf'] = 'application/pdf'; if(!array_key_exists('tex', $mime_types)) $mime_types['tex'] = 'text/x-tex'; if(!array_key_exists('gz', $mime_types)) $mime_types['gz'] = 'application/gzip'; if(!array_key_exists('tar.gz', $mime_types)) $mime_types['tar.gz'] = 'application/gzip'; #just to be sure we also add this return $mime_types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function net_liggitt_add_mime_types($mimes) {\n $mimes = array_merge($mimes, array(\n 'epub|mobi' => 'application/octet-stream'\n ));\n return $mimes;\n}", "function add_mime_types( $mime_types ) {\n\n\t\t$mime_types['json'] = 'application/json';\n\n\t\treturn $mime_types;\n\n\t}", "function extend_mime_types( $existing_mimes=array() ) {\n $existing_mimes['webm'] = 'video/webm';\n $existing_mimes['mp4'] = 'video/mp4';\n $existing_mimes['ogg'] = 'video/ogg';\n $existing_mimes['svg'] = 'image/svg+xml';\n\n // Return an array now including our added mime types\n return $existing_mimes;\n}", "function custom_mime_types($existing_mimes = array()) {\n\n //For example, the following line allows PDF uploads\n //$existing_mimes['pdf'] = 'application/pdf';\n \n return $existing_mimes;\n}", "function add_file_types_to_uploads($file_types){\n $new_filetypes = array();\n $new_filetypes['svg'] = 'image/svg+xml';\n $file_types = array_merge($file_types, $new_filetypes );\n return $file_types;\n}", "function add_file_types_to_uploads($file_types)\n{\n\n $new_filetypes = array();\n $new_filetypes['svg'] = 'image/svg+xml';\n $file_types = array_merge($file_types, $new_filetypes);\n\n return $file_types;\n}", "function add_upload_types( $existing_mimes ) {\n\t\t$existing_mimes['ico'] = 'image/vnd.microsoft.icon';\n\t\t$existing_mimes['eot'] = 'application/vnd.ms-fontobject';\n\t\t$existing_mimes['woff2'] = 'application/x-woff';\n\t\t$existing_mimes['woff'] = 'application/x-woff';\n\t\t$existing_mimes['ttf'] = 'application/octet-stream';\n\t\t$existing_mimes['svg'] = 'image/svg+xml';\n\t\t$existing_mimes['mp4'] = 'video/mp4';\n\t\t$existing_mimes['ogv'] = 'video/ogg';\n\t\t$existing_mimes['webm'] = 'video/webm';\n\t\treturn $existing_mimes;\n\t}", "function add_file_types_to_uploads($file_types){\n $new_filetypes = array();\n $new_filetypes['svg'] = 'image/svg+xml';\n $file_types = array_merge($file_types, $new_filetypes );\n\n return $file_types;\n}", "function add_file_types_to_uploads($file_types){\n$new_filetypes = array();\n$new_filetypes['svg'] = 'image/svg+xml';\n$file_types = array_merge($file_types, $new_filetypes );\nreturn $file_types;\n}", "function custom_upload_mimes ( $existing_mimes=array() ) {\r\n $existing_mimes['zip'] = 'application/zip';\r\n $existing_mimes['gz'] = 'application/x-gzip';\r\n return $existing_mimes;\r\n }", "function custom_upload_mimes ( $existing_mimes=array() ) {\n $existing_mimes['zip'] = 'application/zip';\n $existing_mimes['gz'] = 'application/x-gzip';\n return $existing_mimes;\n}", "public function add_mime_types( $mimes ) {\n\t\t\t$mimes['svg'] = 'image/svg+xml';\n\n\t\t\treturn $mimes;\n\t\t}", "function addFileTypes($fileTypes) {\r\n $fileTypes['svg'] = 'image/svg+xml';\r\n return $fileTypes;\r\n}", "function enable_extended_upload ( $mime_types =array() ) {\n // You can add as many MIME types as you want.\n $mime_types['exe'] = 'application/exe'; \n\n return $mime_types;\n}", "function custom_upload_mimes ( $existing_mimes=array() ) {\r\n\t$existing_mimes['eps'] = 'application/eps';\r\n // call the modified list of extensions\r\n\treturn $existing_mimes;\r\n}", "public static function _mime_types($ext = '')\n {\n }", "function allowed_media_upload_mimetypes( $mimes ){\n\t$allowed_mimes = array(\n\t 'jpg|jpeg|jpe' => 'image/jpeg',\n\t 'gif' => 'image/gif',\n\t 'png' => 'image/png',\n\t 'bmp' => 'image/bmp',\n\t 'tif|tiff' => 'image/tiff'\n\t);\n\treturn $allowed_mimes;\n}", "function custom_upload_mimes( $existing_mimes = array() ) {\n\t$existing_mimes['svg'] = 'image/svg+xml';\n\treturn $existing_mimes;\n}", "private function loadMimeTypes ()\n\t\t{\n\t\t\tif ($this->mimeTypes === null)\n\t\t\t{\n\t\t\t\t$this->mimeTypes = [];\n\n\t\t\t\t$lines = file($this->mimeFile);\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\t// skip comments\n\t\t\t\t\t$line = preg_replace('/#.*$/', '', $line);\n\t\t\t\t\t$line = trim($line);\n\t\t\t\t\tif($line === '') continue;\n\n\t\t\t\t\t$exts = preg_split('/\\s+/', $line);\n\t\t\t\t\t$mime = array_shift($exts);\n\t\t\t\t\tif(!$exts) continue;\n\t\t\t\t\tforeach($exts as $ext) {\n\t\t\t\t\t\tif(empty($ext)) continue;\n\t\t\t\t\t\tif(strlen($ext) > 4) continue; // we only handle 4 chars or less\n\t\t\t\t\t\t$this->mimeTypes[$ext] = $mime;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function my_custom_mime_types( $mimes ) {\n\t$mimes['svg'] = 'image/svg+xml';\n\t$mimes['svgz'] = 'image/svg+xml';\n\t$mimes['doc'] = 'application/msword';\n\t \n\t// Optional. Remove a mime type.\n\tunset( $mimes['exe'] );\n\t \n\treturn $mimes;\n\t}", "public static function upload_mimes( $mime_types = array() ) {\r\n\t\tif ( ! isset( $mime_types['tar.bz2'] ) ) {\r\n\t\t\t$mime_types['tar.bz2'] = 'application/x-tar';\r\n\t\t}\r\n\r\n\t\treturn $mime_types;\r\n\t}", "function custom_upload_mimes($existing_mimes = array()) {\n $existing_mimes['svg'] = 'image/svg+xml';\n $existing_mimes['svgz'] = 'image/svg+xml';\n return $existing_mimes;\n}", "function custom_mimes( $mimes ) {\n\t$mimes['svg'] = 'image/svg+xml';\n\t$mimes['json'] = 'application/json';\n\n\treturn $mimes;\n}", "function webp_upload_mimes( $existing_mimes ) {\n\t$existing_mimes['webp'] = 'image/webp';\n\n\t// return the array back to the function with our added mime type\n\treturn $existing_mimes;\n}", "function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}", "public function mimeTypes(array $mimeTypes): self\n {\n $this->config->set('mime_types', implode(',', $mimeTypes));\n\n return $this;\n }", "public function mimetypes(array $mimetypes)\n {\n $this->mimetypes = $mimetypes;\n\n return $this;\n }", "function custom_upload_mimes ( $existing_mimes=array() ) {\n $existing_mimes['vcf'] = 'text/x-vcard';\n return $existing_mimes;\n}", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "public function uploadTypes(array $types): void;", "protected function upload_mimes( $mime_types, $user ) {\n\n\t\t\tforeach( $this->mime_types as $ext => $mime_type ) {\n\t\t\t\tif ( ! isset( $mime_types[$ext] ) ) {\n\t\t\t\t\t$mime_types[$ext] = $mime_type;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $mime_types;\n\t\t}", "function custom_upload_mimes( $existing_mimes=array() ) {\n \t$existing_mimes['vcf'] = 'text/x-vcard';\n\treturn $existing_mimes; \n}", "function add_custom_mime_types ( $mimes ) {\r\n\t$mimes['hwp'] = 'application/hangul';\r\n\treturn $mimes;\r\n}", "function custom_upload_mimes ( $existing_mimes=array() ) {\n\t$existing_mimes['vcf'] = 'text/x-vcard';\n\treturn $existing_mimes;\n}", "function x_custom_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "function setFileType($type) {\n // Covert args to array\n $type = func_get_args();\n $type = implode(',',$type);\n\n $this->field['mime_types'] = $type;\n return $this;\n }", "public function allow_setup_uploads( $mime_types ){\n\t\t$mime_types['sto'] = 'application/octet-stream';\n\n\t\treturn $mime_types;\n\t}", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function cc_mime_types( $mimes ) {\n\t\t$mimes['svg'] = 'image/svg+xml';\n\t\treturn $mimes;\n\t}", "function cc_mime_types($mimes) {\n\t$mimes['svg'] = 'image/svg+xml';\n\treturn $mimes;\n}", "function cc_mime_types($mimes) {\n\t$mimes['svg'] = 'image/svg+xml';\n\treturn $mimes;\n}", "function cc_mime_types($mimes) {\n\t$mimes['svg'] = 'image/svg+xml';\n\treturn $mimes;\n}", "public function aws_allowed_mime_types( $types ) {\n\t\t\t// we only want...\n\t\t\treturn array(\n\t\t\t\t// Audio formats.\n\t\t\t\t'mp3|m4a|m4b' => 'audio/mpeg',\n\t\t\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t\t\t'wav' => 'audio/wav',\n\t\t\t\t'ogg|oga' => 'audio/ogg',\n\t\t\t\t'mid|midi' => 'audio/midi',\n\t\t\t\t'wma' => 'audio/x-ms-wma',\n\t\t\t\t'wax' => 'audio/x-ms-wax',\n\t\t\t\t'mka' => 'audio/x-matroska',\n\t\t\t\t// Video formats.\n\t\t\t\t'asf|asx' => 'video/x-ms-asf',\n\t\t\t\t'wmv' => 'video/x-ms-wmv',\n\t\t\t\t'wmx' => 'video/x-ms-wmx',\n\t\t\t\t'wm' => 'video/x-ms-wm',\n\t\t\t\t'avi' => 'video/avi',\n\t\t\t\t'divx' => 'video/divx',\n\t\t\t\t'flv' => 'video/x-flv',\n\t\t\t\t'mov|qt' => 'video/quicktime',\n\t\t\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t\t\t'mp4|m4v' => 'video/mp4',\n\t\t\t\t'ogv' => 'video/ogg',\n\t\t\t\t'webm' => 'video/webm',\n\t\t\t\t'mkv' => 'video/x-matroska',\n\t\t\t\t'3gp|3gpp' => 'video/3gpp', // Can also be audio\n\t\t\t\t'3g2|3gp2' => 'video/3gpp2', // Can also be audio\n\t\t\t);\n\t\t}", "public function more_mimes( $mimes ) {\n\t\t$mimes['eot'] = 'font/eot';\n\t\t$mimes['woff'] = 'font/woff';\n\t\t$mimes['ttf'] = 'font/truetype';\n\t\t$mimes['svg'] = 'font/svg';\n\t\treturn $mimes;\n\t}", "function hankart_cc_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "function humcore_deposit_upload_mimes( $existing_mimes ) {\n\n\t$existing_mimes['dng'] = 'image/x-adobe-dng';\n\n\t$existing_mimes['cr2'] = 'image/x-dcraw';\n\t$existing_mimes['crw'] = 'image/x-dcraw';\n\t$existing_mimes['nef'] = 'image/x-dcraw';\n\n\treturn $existing_mimes;\n}", "public function mime_types( $mimes ) {\n\n\t\t$mimes['woff2'] = 'font/woff2';\n\t\t$mimes['woff'] = $this->get_mime( 'woff' ); \n\t\t$mimes['ttf'] = $this->get_mime( 'ttf' );\n\t\t$mimes['eot'] = $this->get_mime( 'eot' ); \n\t\t$mimes['svg'] = $this->get_mime( 'svg' );\n\n\t\treturn $mimes;\n\n\t}", "function cc_mime_types( $mimes ) {\n\n\t$mimes['svg'] = 'image/svg+xml';\n\n\treturn $mimes;\n\n}", "public function mime_types( $mimes ) {\r\n\r\n\t\t$mimes['ttf'] = 'font/ttf';\r\n\t\t$mimes['woff'] = 'font/woff';\r\n\t\t$mimes['svg'] = 'font/svg';\r\n\t\t$mimes['eot'] = 'font/eot';\r\n\r\n\t\treturn $mimes;\r\n\r\n\t}", "private function installMultipleCustomPostTypes()\n {\n if (! file_exists($this->rootPath.'/config/types/')) {\n return;\n }\n\n $files = glob($this->rootPath.'/config/types/*.json');\n foreach ($files as $file) {\n $type = JSONParser::parse(file_get_contents($file));\n $name = (isset($type['name'])) ? $type['name'] : null;\n register_post_type($name, $type);\n }\n\n $files = glob($this->rootPath.'/config/types/*.php');\n foreach ($files as $file) {\n $type = include $file;\n $name = (isset($type['name'])) ? $type['name'] : null;\n register_post_type($name, $type);\n }\n }", "function webp_upload_mimes($existing_mimes) {\n $existing_mimes['webp'] = 'image/webp';\n return $existing_mimes;\n}", "function webp_upload_mimes($existing_mimes) {\n $existing_mimes['webp'] = 'image/webp';\n return $existing_mimes;\n}", "public function mimeTypes(string $mimeTypes)\n {\n return $this->set('mime_types', $mimeTypes);\n }", "public static function getAllMimeTypes():array;", "function cc_mime_types( $mimes ){\n\t$mimes['svg'] = 'image/svg+xml';\n\treturn $mimes;\n}", "function nylon_mime_types($mimes) {\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "public function cc_mime_types($mimes) {\n $mimes['avi'] = 'video/avi';\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n }", "function webp_upload_mimes($existing_mimes) {\r\n $existing_mimes['webp'] = 'image/webp';\r\n return $existing_mimes;\r\n}", "public function testAddMimeType()\n {\n $validator = new File\\MimeType('image/gif');\n $validator->addMimeType('text');\n $this->assertEquals('image/gif,text', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text'], $validator->getMimeType(true));\n\n $validator->addMimeType('jpg, to');\n $this->assertEquals('image/gif,text,jpg,to', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to'], $validator->getMimeType(true));\n\n $validator->addMimeType(['zip', 'ti']);\n $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to', 'zip', 'ti'], $validator->getMimeType(true));\n\n $validator->addMimeType('');\n $this->assertEquals('image/gif,text,jpg,to,zip,ti', $validator->getMimeType());\n $this->assertEquals(['image/gif', 'text', 'jpg', 'to', 'zip', 'ti'], $validator->getMimeType(true));\n }", "public function testSetAllowedMimeTypesIllegal() {\n // list is only checked against during upload, so expect success here.\n $mytype = array('application/x-perl' => 'pl');\n $this->up->setAllowedMimeTypes($mytype);\n $this->assertEquals($mytype, $this->up->getAllowedMimeTypes());\n }", "public static function cc_mime_types($mimes) {\n $mimes['mp4'] = 'video/mp4';\n $mimes['avi'] = 'video/avi';\n $mimes['svg'] = 'image/svg+xml';\n $mimes['webp'] = 'image/webp';\n return $mimes;\n }", "function wp_match_mime_types($wildcard_mime_types, $real_mime_types)\n {\n }", "function hook_file_default_types_alter(&$types) {\n $types['image']->mimetypes[] = 'image/svg+xml';\n}", "private function configureMime(array &$options)\n {\n if (isset($options['attachment_type']) && Helper::ATTACHMENTS_TYPE_BASE64 !== $options['attachment_type']) {\n // register mime filter in SoapKernel\n $mimeFilter = new MimeFilter($options['attachment_type']);\n $this->soapKernel->registerFilter($mimeFilter);\n // configure type converter\n if (Helper::ATTACHMENTS_TYPE_SWA === $options['attachment_type']) {\n $converter = new SwaTypeConverter();\n $converter->setKernel($this->soapKernel);\n } elseif (Helper::ATTACHMENTS_TYPE_MTOM === $options['attachment_type']) {\n $xmlMimeFilter = new XmlMimeFilter($options['attachment_type']);\n $this->soapKernel->registerFilter($xmlMimeFilter);\n $converter = new MtomTypeConverter();\n $converter->setKernel($this->soapKernel);\n }\n // configure typemap\n if (!isset($options['typemap'])) {\n $options['typemap'] = array();\n }\n $options['typemap'][] = array(\n 'type_name' => $converter->getTypeName(),\n 'type_ns' => $converter->getTypeNamespace(),\n 'from_xml' => function($input) use ($converter) {\n return $converter->convertXmlToPhp($input);\n },\n 'to_xml' => function($input) use ($converter) {\n return $converter->convertPhpToXml($input);\n },\n );\n }\n }", "public function supported_filetypes() {\n return '*';\n }", "protected function addFileFieldArray(&$metadata)\n {\n if($metadata['type']==\"text\"){\n $metadata['data']['file'] = [];\n }\n }", "public function setAllowedFileTypes( $types ) {\r\n\t\t\tif ( $types === false ) {\r\n\t\t\t\t// allow all filetypes\r\n\t\t\t\t$this->AllowedFileTypes = null;\r\n\t\t\t} else {\r\n\t\t\t\t$types = (array)$types;\r\n\t\t\t\tfor( $i = 0, $count = count( $types ); $i < $count; $i++ ) {\r\n\t\t\t\t\t$types[$i] = (string)$types[$i];\r\n\t\t\t\t}\r\n\t\t\t\t$this->AllowedFileTypes = $types;\r\n\t\t\t}\r\n\t\t}", "function floox_mime_types( $mimes ){\n $mimes['svg'] = 'image/svg+xml';\n $mimes['svgz'] = 'image/svg+xml';\n return $mimes;\n}", "function add_svg_to_upload_mimes($upload_mimes)\n{\n\t$upload_mimes['svg'] = 'image/svg+xml';\n\t$upload_mimes['svgz'] = 'image/svg+xml';\n\treturn $upload_mimes;\n}", "public function getAudioMimeTypes()\n {\n return array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio',\n 'audio/mp4a-latm',\n 'audio/ogg',\n 'application/ogg',\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav',\n 'audio/x-ms-wma'\n );\n }", "public static function mimeTypeExtensions ()\r\n\t{\r\n\t\t# Define the MIME Types; list taken from www.mimetype.org\r\n\t\t$mimeTypes = '\r\n\t\tapplication/SLA\tstl\r\n\t\tapplication/STEP\tstep\r\n\t\tapplication/STEP\tstp\r\n\t\tapplication/acad\tdwg\r\n\t\tapplication/andrew-inset\tez\r\n\t\tapplication/clariscad\tccad\r\n\t\tapplication/drafting\tdrw\r\n\t\tapplication/dsptype\ttsp\r\n\t\tapplication/dxf\tdxf\r\n\t\tapplication/excel\txls\r\n\t\tapplication/i-deas\tunv\r\n\t\tapplication/java-archive\tjar\r\n\t\tapplication/mac-binhex40\thqx\r\n\t\tapplication/mac-compactpro\tcpt\r\n\t\tapplication/vnd.ms-powerpoint\tpot\r\n\t\tapplication/vnd.ms-powerpoint\tpps\r\n\t\tapplication/vnd.ms-powerpoint\tppt\r\n\t\tapplication/vnd.ms-powerpoint\tppz\r\n\t\tapplication/msword\tdoc\r\n\t\tapplication/octet-stream\tbin\r\n\t\tapplication/octet-stream\tclass\r\n\t\tapplication/octet-stream\tdms\r\n\t\tapplication/octet-stream\texe\r\n\t\tapplication/octet-stream\tlha\r\n\t\tapplication/octet-stream\tlzh\r\n\t\tapplication/oda\toda\r\n\t\tapplication/ogg\togg\r\n\t\tapplication/ogg\togm\r\n\t\tapplication/pdf\tpdf\r\n\t\tapplication/pgp\tpgp\r\n\t\tapplication/postscript\tai\r\n\t\tapplication/postscript\teps\r\n\t\tapplication/postscript\tps\r\n\t\tapplication/pro_eng\tprt\r\n\t\tapplication/rtf\trtf\r\n\t\tapplication/set\tset\r\n\t\tapplication/smil\tsmi\r\n\t\tapplication/smil\tsmil\r\n\t\tapplication/solids\tsol\r\n\t\tapplication/vda\tvda\r\n\t\tapplication/vnd.mif\tmif\r\n\t\tapplication/vnd.ms-excel\txlc\r\n\t\tapplication/vnd.ms-excel\txll\r\n\t\tapplication/vnd.ms-excel\txlm\r\n\t\tapplication/vnd.ms-excel\txls\r\n\t\tapplication/vnd.ms-excel\txlw\r\n\t\tapplication/vnd.rim.cod\tcod\r\n\t\tapplication/x-arj-compressed\tarj\r\n\t\tapplication/x-bcpio\tbcpio\r\n\t\tapplication/x-cdlink\tvcd\r\n\t\tapplication/x-chess-pgn\tpgn\r\n\t\tapplication/x-cpio\tcpio\r\n\t\tapplication/x-csh\tcsh\r\n\t\tapplication/x-debian-package\tdeb\r\n\t\tapplication/x-director\tdcr\r\n\t\tapplication/x-director\tdir\r\n\t\tapplication/x-director\tdxr\r\n\t\tapplication/x-dvi\tdvi\r\n\t\tapplication/x-freelance\tpre\r\n\t\tapplication/x-futuresplash\tspl\r\n\t\tapplication/x-gtar\tgtar\r\n\t\tapplication/x-gunzip\tgz\r\n\t\tapplication/x-gzip\tgz\r\n\t\tapplication/x-hdf\thdf\r\n\t\tapplication/x-ipix\tipx\r\n\t\tapplication/x-ipscript\tips\r\n\t\tapplication/x-javascript\tjs\r\n\t\tapplication/x-koan\tskd\r\n\t\tapplication/x-koan\tskm\r\n\t\tapplication/x-koan\tskp\r\n\t\tapplication/x-koan\tskt\r\n\t\tapplication/x-latex\tlatex\r\n\t\tapplication/x-lisp\tlsp\r\n\t\tapplication/x-lotusscreencam\tscm\r\n\t\tapplication/x-mif\tmif\r\n\t\tapplication/x-msdos-program\tbat\r\n\t\tapplication/x-msdos-program\tcom\r\n\t\tapplication/x-msdos-program\texe\r\n\t\tapplication/x-netcdf\tcdf\r\n\t\tapplication/x-netcdf\tnc\r\n\t\tapplication/x-perl\tpl\r\n\t\tapplication/x-perl\tpm\r\n\t\tapplication/x-rar-compressed\trar\r\n\t\tapplication/x-sh\tsh\r\n\t\tapplication/x-shar\tshar\r\n\t\tapplication/x-shockwave-flash\tswf\r\n\t\tapplication/x-stuffit\tsit\r\n\t\tapplication/x-sv4cpio\tsv4cpio\r\n\t\tapplication/x-sv4crc\tsv4crc\r\n\t\tapplication/x-tar-gz\ttar.gz\r\n\t\tapplication/x-tar-gz\ttgz\r\n\t\tapplication/x-tar\ttar\r\n\t\tapplication/x-tcl\ttcl\r\n\t\tapplication/x-tex\ttex\r\n\t\tapplication/x-texinfo\ttexi\r\n\t\tapplication/x-texinfo\ttexinfo\r\n\t\tapplication/x-troff-man\tman\r\n\t\tapplication/x-troff-me\tme\r\n\t\tapplication/x-troff-ms\tms\r\n\t\tapplication/x-troff\troff\r\n\t\tapplication/x-troff\tt\r\n\t\tapplication/x-troff\ttr\r\n\t\tapplication/x-ustar\tustar\r\n\t\tapplication/x-wais-source\tsrc\r\n\t\tapplication/x-zip-compressed\tzip\r\n\t\tapplication/zip\tzip\r\n\t\taudio/TSP-audio\ttsi\r\n\t\taudio/basic\tau\r\n\t\taudio/basic\tsnd\r\n\t\taudio/midi\tkar\r\n\t\taudio/midi\tmid\r\n\t\taudio/midi\tmidi\r\n\t\taudio/mpeg\tmp2\r\n\t\taudio/mpeg\tmp3\r\n\t\taudio/mpeg\tmpga\r\n\t\taudio/ulaw\tau\r\n\t\taudio/x-aiff\taif\r\n\t\taudio/x-aiff\taifc\r\n\t\taudio/x-aiff\taiff\r\n\t\taudio/x-mpegurl\tm3u\r\n\t\taudio/x-ms-wax\twax\r\n\t\taudio/x-ms-wma\twma\r\n\t\taudio/x-pn-realaudio-plugin\trpm\r\n\t\taudio/x-pn-realaudio\tram\r\n\t\taudio/x-pn-realaudio\trm\r\n\t\taudio/x-realaudio\tra\r\n\t\taudio/x-wav\twav\r\n\t\tchemical/x-pdb\tpdb\r\n\t\tchemical/x-pdb\txyz\r\n\t\timage/cmu-raster\tras\r\n\t\timage/gif\tgif\r\n\t\timage/ief\tief\r\n\t\timage/jpeg\tjpe\r\n\t\timage/jpeg\tjpeg\r\n\t\timage/jpeg\tjpg\r\n\t\timage/png\tpng\r\n\t\timage/tiff\ttif tiff\r\n\t\timage/tiff\ttif\r\n\t\timage/tiff\ttiff\r\n\t\timage/x-cmu-raster\tras\r\n\t\timage/x-portable-anymap\tpnm\r\n\t\timage/x-portable-bitmap\tpbm\r\n\t\timage/x-portable-graymap\tpgm\r\n\t\timage/x-portable-pixmap\tppm\r\n\t\timage/x-rgb\trgb\r\n\t\timage/x-xbitmap\txbm\r\n\t\timage/x-xpixmap\txpm\r\n\t\timage/x-xwindowdump\txwd\r\n\t\tmodel/iges\tiges\r\n\t\tmodel/iges\tigs\r\n\t\tmodel/mesh\tmesh\r\n\t\tmodel/mesh\tmsh\r\n\t\tmodel/mesh\tsilo\r\n\t\tmodel/vrml\tvrml\r\n\t\tmodel/vrml\twrl\r\n\t\ttext/css\tcss\r\n\t\ttext/html\thtm\r\n\t\ttext/html\thtml htm\r\n\t\ttext/html\thtml\r\n\t\ttext/plain\tasc txt\r\n\t\ttext/plain\tasc\r\n\t\ttext/plain\tc\r\n\t\ttext/plain\tcc\r\n\t\ttext/plain\tf90\r\n\t\ttext/plain\tf\r\n\t\ttext/plain\th\r\n\t\ttext/plain\thh\r\n\t\ttext/plain\tm\r\n\t\ttext/plain\ttxt\r\n\t\ttext/richtext\trtx\r\n\t\ttext/rtf\trtf\r\n\t\ttext/sgml\tsgm\r\n\t\ttext/sgml\tsgml\r\n\t\ttext/tab-separated-values\ttsv\r\n\t\ttext/vnd.sun.j2me.app-descriptor\tjad\r\n\t\ttext/x-setext\tetx\r\n\t\ttext/xml\txml// This is disabled because XML has several different MIME Types\r\n\t\tvideo/dl\tdl\r\n\t\tvideo/fli\tfli\r\n\t\tvideo/flv\tflv\r\n\t\tvideo/gl\tgl\r\n\t\tvideo/mpeg\tmp2\r\n\t\tvideo/mpeg\tmpe\r\n\t\tvideo/mpeg\tmpeg\r\n\t\tvideo/mpeg\tmpg\r\n\t\tvideo/quicktime\tmov\r\n\t\tvideo/quicktime\tqt\r\n\t\tvideo/vnd.vivo\tviv\r\n\t\tvideo/vnd.vivo\tvivo\r\n\t\tvideo/x-fli\tfli\r\n\t\tvideo/x-ms-asf\tasf\r\n\t\tvideo/x-ms-asx\tasx\r\n\t\tvideo/x-ms-wmv\twmv\r\n\t\tvideo/x-ms-wmx\twmx\r\n\t\tvideo/x-ms-wvx\twvx\r\n\t\tvideo/x-msvideo\tavi\r\n\t\tvideo/x-sgi-movie\tmovie\r\n\t\twww/mime\tmime\r\n\t\tx-conference/x-cooltalk\tice\r\n\t\tx-world/x-vrml\tvrm\r\n\t\tx-world/x-vrml\tvrml';\r\n\t\t\r\n\t\t# Parse the list as array ($extension => $mimeType, ... )\r\n\t\t$list = array ();\r\n\t\t$mimeTypes = explode (\"\\n\", trim ($mimeTypes));\r\n\t\tforeach ($mimeTypes as $index => $line) {\r\n\t\t\tlist ($mimeType, $extension) = explode (\"\\t\", trim ($line), 2);\r\n\t\t\tif (substr_count ($extension, ' ')) {continue;}\t// Limit of 2 for some extensions in the source listing have two listed, e.g. \"asc txt\"\r\n\t\t\t$list[$extension] = $mimeType;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the list\r\n\t\treturn $list;\r\n\t}", "static function loadMimeTypes() {\n\t\tif(@file_exists('/etc/mime.types')) {\n\t\t\t$mimeTypes = file('/etc/mime.types');\n\t\t\tforeach($mimeTypes as $typeSpec) {\n\t\t\t\tif(($typeSpec = trim($typeSpec)) && substr($typeSpec,0,1) != \"#\") {\n\t\t\t\t\t$parts = split(\"[ \\t\\r\\n]+\", $typeSpec);\n\t\t\t\t\tif(sizeof($parts) > 1) {\n\t\t\t\t\t\t$mimeType = array_shift($parts);\n\t\t\t\t\t\tforeach($parts as $ext) {\n\t\t\t\t\t\t\t$ext = strtolower($ext);\n\t\t\t\t\t\t\t$mimeData[$ext] = $mimeType;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Fail-over for if people don't have /etc/mime.types on their server. it's unclear how important this actually is\n\t\t} else {\n\t\t\t$mimeData = array(\n\t\t\t\t\"doc\" => \"application/msword\",\n\t\t\t\t\"xls\" => \"application/vnd.ms-excel\",\n\t\t\t\t\"rtf\" => \"application/rtf\",\n\t\t\t);\n\t\t}\n\n\t\tglobal $global_mimetypes;\n\t\t$global_mimetypes = $mimeData;\n\t\treturn $mimeData;\n\t}", "public function getAllowedUploadMimes($existing = array())\n {\n // we get mime types and saved file types\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n if(is_array($this->settings))\n foreach($this->settings as $key ){\n // list thru them and if it's allowed and not in list, we added there,\n // in reality, I'm thinking about removing the wp ones, and all mines,\n // since wordpress mime types are very limited, we can do better guys\n // cuase it sucks, and doesn't have enough mime types, actually let's\n // just do it ...\n if(array_key_exists($key, $pluginFileTypes)){\n $keyCheck = strtolower($key);\n // here we would have checked, if mime type is already there,\n // but we want strong list of mime types, so we just add it all.\n if(is_array($pluginFileTypes[$key])){\n foreach($pluginFileTypes[$key] as $fileType){\n $keyHacked = preg_replace(\"/[^0-9a-zA-Z ]/\", \"\", $fileType);\n $return[$keyCheck . '|' . $keyCheck . '_' . $keyHacked] = $fileType;\n }\n } else {\n $return[$keyCheck] = $pluginFileTypes[$key];\n }\n }\n }\n return array_merge($return, $existing);\n }", "function check_upload_mimes($mimes)\n {\n }", "public static function supports_mime_type($mime_type)\n {\n }", "public static function supports_mime_type($mime_type)\n {\n }", "public static function supports_mime_type($mime_type)\n {\n }", "function cc_mime_types($mimes) {\n$mimes['svg'] = 'image/svg+xml';\nreturn $mimes;\n}", "public function accept(array|string $mimetypes = ''): self\n {\n $this->accept = $mimetypes;\n\n $this->rules[] = 'mimetypes:' . (is_array($mimetypes) ? implode(',', $mimetypes) : $mimetypes);\n\n return $this;\n }", "function wps_mime_types( $mimes ){\n $mimes['svg'] = 'image/svg+xml';\n return $mimes;\n}", "function add_svg_to_upload_mimes( $upload_mimes ) {\n\t$upload_mimes['svg'] = 'image/svg+xml';\n\t$upload_mimes['svgz'] = 'image/svg+xml';\n\treturn $upload_mimes;\n}", "function add_svg_to_upload_mimes( $upload_mimes ) {\n\t$upload_mimes['svg'] = 'image/svg+xml';\n\t$upload_mimes['svgz'] = 'image/svg+xml';\n\treturn $upload_mimes;\n}", "function hook_file_type_alter(&$types, $file) {\n // Choose a specific, non-first, file type.\n $types = array($types[4]);\n}", "function register_content_types() {\n\n}", "function modify_post_mime_types( $post_mime_types ) {\n\n\t// select the mime type, here: 'application/pdf'\n\t// then we define an array with the label values\n\n\t$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF <span class=\"count\">(%s)</span>', 'PDFs <span class=\"count\">(%s)</span>' ) );\n\n\t// then we return the $post_mime_types variable\n\treturn $post_mime_types;\n\n}", "function wp_get_mime_types()\n {\n }", "public function addMatchTypes($matchTypes)\n {\n $this->matchTypes = Arrayify::merge($this->matchTypes,$matchTypes);\n }" ]
[ "0.7620388", "0.75872487", "0.7376024", "0.7366959", "0.7314314", "0.72676235", "0.72510463", "0.7247649", "0.7186652", "0.71384186", "0.709408", "0.7072178", "0.68753594", "0.68578106", "0.6849705", "0.6815624", "0.6741629", "0.6707991", "0.66988546", "0.665497", "0.6630249", "0.6581742", "0.6576436", "0.65739536", "0.65517324", "0.6508484", "0.64957047", "0.6471601", "0.64663225", "0.6440987", "0.6427686", "0.6418563", "0.6395829", "0.6381462", "0.6356717", "0.63513345", "0.6299232", "0.62805456", "0.62783533", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6259789", "0.6253663", "0.62524045", "0.62524045", "0.62524045", "0.6249294", "0.6245176", "0.62271273", "0.62174827", "0.6212961", "0.62104416", "0.6200571", "0.6186713", "0.6122317", "0.6122317", "0.6112509", "0.610464", "0.60992295", "0.60961", "0.6087351", "0.60612303", "0.60473", "0.600467", "0.60045457", "0.5997261", "0.59814036", "0.5976308", "0.59745055", "0.58956444", "0.58899647", "0.58761084", "0.58741415", "0.58683276", "0.5839858", "0.58388144", "0.5834999", "0.58293307", "0.58149034", "0.5813939", "0.58128357", "0.5812775", "0.57936335", "0.5785217", "0.5779572", "0.5769576", "0.5769576", "0.576562", "0.5752268", "0.5746177", "0.57428306", "0.5733386" ]
0.7112968
10
Works around a bug in WP that disallows upload of files to the media library even if they are marked as allowed via the 'upload_mimes' filter. To be added to the 'wp_check_filetype_and_ext' filter.
public function disable_real_mime_check_for_selected_extensions( $data, $file, $filename, $mimes ) { $wp_filetype = wp_check_filetype($filename, $mimes); $ext = $wp_filetype['ext']; $type = $wp_filetype['type']; $proper_filename = $data['proper_filename']; # If the filename is gz (or tar.gz, although WP 5.0.1 treats tar.gz as gz) # we return the original file data, thereby reversing the change of $ext # and $type to false, that is done by WP during wp_check_filetype_and_ext() # for file types that WP "doesn't like" even though we explicitly allowed # them via custom_upload_mimes(). if($ext === "gz" or $ext === "tar.gz") return compact( 'ext', 'type', 'proper_filename' ); else return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\t\t'asf|asx|wax|wmv|wmx' => 'video/asf',\n\t\t'avi' => 'video/avi',\n\t\t'mov|qt' => 'video/quicktime',\n\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t'txt|c|cc|h' => 'text/plain',\n\t\t'rtx' => 'text/richtext',\n\t\t'css' => 'text/css',\n\t\t'htm|html' => 'text/html',\n\t\t'php|php3|' => 'application/php',\n\t\t'mp3|mp4' => 'audio/mpeg',\n\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t'wav' => 'audio/wav',\n\t\t'ogg' => 'audio/ogg',\n\t\t'mid|midi' => 'audio/midi',\n\t\t'wma' => 'audio/wma',\n\t\t'rtf' => 'application/rtf',\n\t\t'js' => 'application/javascript',\n\t\t'pdf' => 'application/pdf',\n\t\t'doc' => 'application/msword',\n\t\t'pot|pps|ppt' => 'application/vnd.ms-powerpoint',\n\t\t'wri' => 'application/vnd.ms-write',\n\t\t'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',\n\t\t'mdb' => 'application/vnd.ms-access',\n\t\t'mpp' => 'application/vnd.ms-project',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'class' => 'application/java',\n\t\t'tar' => 'application/x-tar',\n\t\t'zip' => 'application/zip',\n\t\t'gz|gzip' => 'application/x-gzip',\n\t\t'exe' => 'application/x-msdownload',\n\t\t// openoffice formats\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'odp' => 'application/vnd.oasis.opendocument.presentation',\n\t\t'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t'odg' => 'application/vnd.oasis.opendocument.graphics',\n\t\t'odc' => 'application/vnd.oasis.opendocument.chart',\n\t\t'odb' => 'application/vnd.oasis.opendocument.database',\n\t\t'odf' => 'application/vnd.oasis.opendocument.formula',\n\n\t));\n\n\t$type = false;\n\t$ext = false;\n\n\tforeach ($mimes as $ext_preg => $mime_match) {\n\t\t$ext_preg = '!\\.(' . $ext_preg . ')$!i';\n\t\tif (preg_match($ext_preg, $filename, $ext_matches)) {\n\t\t\t$type = $mime_match;\n\t\t\t$ext = $ext_matches[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn compact('ext', 'type');\n}", "function allowed_media_upload_mimetypes( $mimes ){\n\t$allowed_mimes = array(\n\t 'jpg|jpeg|jpe' => 'image/jpeg',\n\t 'gif' => 'image/gif',\n\t 'png' => 'image/png',\n\t 'bmp' => 'image/bmp',\n\t 'tif|tiff' => 'image/tiff'\n\t);\n\treturn $allowed_mimes;\n}", "private function getAllowedFileTypes()\n {\n return str_replace('.', '', config('media.allowed', ''));\n }", "function check_upload_mimes($mimes)\n {\n }", "public function testIgnoreCheckMimeType() {\n // the check can be disabled\n $up2 = new upload();\n $up2->setIgnoreMimeCheck(true);\n $this->assertTrue($up2->checkMimeType());\n }", "function custom_mime_types($existing_mimes = array()) {\n\n //For example, the following line allows PDF uploads\n //$existing_mimes['pdf'] = 'application/pdf';\n \n return $existing_mimes;\n}", "public function testSetAllowedMimeTypesIllegal() {\n // list is only checked against during upload, so expect success here.\n $mytype = array('application/x-perl' => 'pl');\n $this->up->setAllowedMimeTypes($mytype);\n $this->assertEquals($mytype, $this->up->getAllowedMimeTypes());\n }", "function validateFileMime(&$model, $fieldData, $fieldName, $allowedMimes = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $availableMimes = assetMimes();\n \n foreach (!empty($allowedMimes) ? $allowedMimes : array() as $type) {\n if ($type == '*') return true;\n \n # check fileinfo first\n $fileinfo = assetMimeType($fieldData[$fieldName]['tmp_name']);\n if ((!$fileinfo) && (in_array($fileinfo, $availableMimes[$type]))) return true; \n \n # check browser provided mime-type second\n if (in_array($fieldData[$fieldName]['type'], $availableMimes[$type])) return true;\n }\n \n return false;\n }", "function ignore_upload_ext( $checked, $file, $filename, $mimes ) {\n\t\tif(!$checked['type']){\n\t\t\t//rebuild the type info\n\t\t\t$wp_filetype = wp_check_filetype( $filename, $mimes );\n\t\t\t$ext = $wp_filetype['ext'];\n\t\t\t$type = $wp_filetype['type'];\n\t\t\t$proper_filename = $filename;\n\n\t\t\t//preserve failure for non-svg images\n\t\t\tif($type && 0 === strpos($type, 'image/') && $ext !== 'svg'){\n\t\t\t\t$ext = $type = false;\n\t\t\t}\n\n\t\t\t//everything else gets an OK, so e.g. we've disabled the error-prone finfo-related checks WP just went through. whether or not the upload will be allowed depends on the <code>upload_mimes</code>, etc.\n\n\t\t\t$checked = compact('ext','type','proper_filename');\n\t\t}\n\n\t\treturn $checked;\n\n\t}", "function sanitize_mime_type($mime_type)\n {\n }", "function hook_file_type($file) {\n // Assign all files uploaded by anonymous users to a special file type.\n if (user_is_anonymous()) {\n return array('untrusted_files');\n }\n}", "function enable_extended_upload ( $mime_types =array() ) {\n // You can add as many MIME types as you want.\n $mime_types['exe'] = 'application/exe'; \n\n return $mime_types;\n}", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "function custom_upload_mimes ( $existing_mimes=array() ) {\n $existing_mimes['zip'] = 'application/zip';\n $existing_mimes['gz'] = 'application/x-gzip';\n return $existing_mimes;\n}", "public function supported_filetypes() {\n return '*';\n }", "function get_allowed_mime_types($user = \\null)\n {\n }", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "public function allow_setup_uploads( $mime_types ){\n\t\t$mime_types['sto'] = 'application/octet-stream';\n\n\t\treturn $mime_types;\n\t}", "function getFileTypeRestrictions() ;", "public function getFileTypeRestrictions() {}", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "function wp_match_mime_types($wildcard_mime_types, $real_mime_types)\n {\n }", "function wp_media_upload_handler()\n {\n }", "function wp_get_mime_types()\n {\n }", "public function get_allowed_content_object_types()\n {\n return array(File::class);\n }", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "function fn_filter_instant_upload($filter_by_ext = array())\n{\n if (!empty($_FILES['upload'])) {\n $_FILES['upload']['path'] = $_FILES['upload']['tmp_name'];\n $uploaded_data = fn_get_local_data(Bootstrap::stripSlashes($_FILES['upload']));\n if (fn_check_uploaded_data($uploaded_data, $filter_by_ext)) {\n return $uploaded_data;\n }\n }\n\n return false;\n}", "function custom_upload_mimes ( $existing_mimes=array() ) {\r\n $existing_mimes['zip'] = 'application/zip';\r\n $existing_mimes['gz'] = 'application/x-gzip';\r\n return $existing_mimes;\r\n }", "public function checkMimeType()\n {\n if (empty($this->mediaRealType) && empty($this->allowUnknownTypes)) {\n $this->setErrors(\\XoopsLocale::E_FILE_TYPE_REJECTED);\n return false;\n }\n\n if ((!empty($this->allowedMimeTypes)\n && !in_array($this->mediaRealType, $this->allowedMimeTypes))\n || (!empty($this->deniedMimeTypes)\n && in_array($this->mediaRealType, $this->deniedMimeTypes))\n ) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_MIME_TYPE_NOT_ALLOWED, $this->mediaType));\n return false;\n }\n return true;\n }", "function fn_check_uploaded_data($uploaded_data, $filter_by_ext)\n{\n $result = true;\n $processed = false;\n\n /**\n * Actions before check uploaded data\n *\n * @param array $uploaded_data Uploaded data\n * @param array $filter_by_ext Allowed file extensions\n * @param bool $result Result status\n * @param bool $processed Processed flag\n */\n fn_set_hook('check_uploaded_data_pre', $uploaded_data, $filter_by_ext, $result, $processed);\n\n if ($processed) {\n return $result;\n }\n\n if (!empty($uploaded_data) && is_array($uploaded_data) && !empty($uploaded_data['name'])) {\n $ext = fn_get_file_ext($uploaded_data['name']);\n\n if (empty($ext)) {\n $types = fn_get_ext_mime_types('mime');\n $mime = fn_get_mime_content_type($uploaded_data['path']);\n\n $ext = isset($types[$mime]) ? $types[$mime] : '';\n }\n\n if (!$processed && !empty($filter_by_ext) && !in_array(fn_strtolower($ext), $filter_by_ext)) {\n fn_set_notification('E', __('error'), __('text_not_allowed_to_upload_file_extension', array(\n '[ext]' => $ext\n )));\n\n $result = false;\n $processed = true;\n }\n\n if (!$processed && in_array(fn_strtolower($ext), Registry::get('config.forbidden_file_extensions'))) {\n fn_set_notification('E', __('error'), __('text_forbidden_file_extension', array(\n '[ext]' => $ext\n )));\n\n $result = false;\n $processed = true;\n }\n\n $mime_type = fn_get_mime_content_type($uploaded_data['path'], true, 'text/plain');\n if (\n !$processed\n && !empty($uploaded_data['path'])\n && in_array($mime_type, Registry::get('config.forbidden_mime_types'))\n ) {\n fn_set_notification('E', __('error'), __('text_forbidden_file_mime', array(\n '[mime]' => $mime_type\n )));\n\n $result = false;\n $processed = true;\n }\n }\n\n /**\n * Actions after check uploaded data\n *\n * @param array $uploaded_data Uploaded data\n * @param array $filter_by_ext Allowed file extensions\n * @param bool $result Result status\n * @param bool $processed Processed flag\n */\n fn_set_hook('check_uploaded_data_post', $uploaded_data, $filter_by_ext, $result, $processed);\n\n return $result;\n}", "public static function _mime_types($ext = '')\n {\n }", "function custom_upload_mimes ( $existing_mimes=array() ) {\r\n\t$existing_mimes['eps'] = 'application/eps';\r\n // call the modified list of extensions\r\n\treturn $existing_mimes;\r\n}", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "protected function checkFileUploadEnabled() {}", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "function webp_upload_mimes($existing_mimes) {\r\n $existing_mimes['webp'] = 'image/webp';\r\n return $existing_mimes;\r\n}", "function webp_upload_mimes($existing_mimes) {\n $existing_mimes['webp'] = 'image/webp';\n return $existing_mimes;\n}", "function webp_upload_mimes($existing_mimes) {\n $existing_mimes['webp'] = 'image/webp';\n return $existing_mimes;\n}", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "public function allow_media_upload() {\n wp_enqueue_script( 'media-upload' );\n wp_enqueue_media();\n wp_enqueue_style( 'wp-color-picker' ); // color picker\n wp_enqueue_script( 'wp-color-picker' );\n wp_enqueue_script('catlinks-media-upload', plugin_dir_url(__FILE__) . 'js/catlinks.js', array( 'jquery' )) ;\n }", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "public function aws_allowed_mime_types( $types ) {\n\t\t\t// we only want...\n\t\t\treturn array(\n\t\t\t\t// Audio formats.\n\t\t\t\t'mp3|m4a|m4b' => 'audio/mpeg',\n\t\t\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t\t\t'wav' => 'audio/wav',\n\t\t\t\t'ogg|oga' => 'audio/ogg',\n\t\t\t\t'mid|midi' => 'audio/midi',\n\t\t\t\t'wma' => 'audio/x-ms-wma',\n\t\t\t\t'wax' => 'audio/x-ms-wax',\n\t\t\t\t'mka' => 'audio/x-matroska',\n\t\t\t\t// Video formats.\n\t\t\t\t'asf|asx' => 'video/x-ms-asf',\n\t\t\t\t'wmv' => 'video/x-ms-wmv',\n\t\t\t\t'wmx' => 'video/x-ms-wmx',\n\t\t\t\t'wm' => 'video/x-ms-wm',\n\t\t\t\t'avi' => 'video/avi',\n\t\t\t\t'divx' => 'video/divx',\n\t\t\t\t'flv' => 'video/x-flv',\n\t\t\t\t'mov|qt' => 'video/quicktime',\n\t\t\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t\t\t'mp4|m4v' => 'video/mp4',\n\t\t\t\t'ogv' => 'video/ogg',\n\t\t\t\t'webm' => 'video/webm',\n\t\t\t\t'mkv' => 'video/x-matroska',\n\t\t\t\t'3gp|3gpp' => 'video/3gpp', // Can also be audio\n\t\t\t\t'3g2|3gp2' => 'video/3gpp2', // Can also be audio\n\t\t\t);\n\t\t}", "public function getAllowedMimeTypes($post_id=null)\n { \n if(empty($post_id)){\n global $post;\n $post_id = $post->ID;\n }\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n $ext=$this->getAllowedFileExtensions($post_id);\n foreach($ext as $key){\n if(array_key_exists($key, $pluginFileTypes)){\n if(!function_exists('finfo_file') || !function_exists('mime_content_type')){\n if(($key == 'DOCX') || ($key == 'DOC') || ($key == 'PDF') ||\n ($key == 'ZIP') || ($key == 'RAR')){\n $return[] = 'application/octet-stream';\n }\n }\n if(is_array($pluginFileTypes[$key])){\n foreach($pluginFileTypes[$key] as $fileType){\n $return[] = $fileType;\n }\n } else {\n $return[] = $pluginFileTypes[$key];\n }\n }\n }\n return $return;\n }", "function wp_is_file_mod_allowed($context)\n {\n }", "function security_check($file_path, $prefs)\n\t{\n\n\t\tee()->load->helper(array('file', 'xss'));\n\t\tee()->load->library('mime_type');\n\n\t\t$is_image = FALSE;\n\t\t$allowed = $prefs['allowed_types'];\n\t\t$mime = ee()->mime_type->ofFile($file_path);\n\n\t\tif ($allowed == 'all' OR $allowed == '*')\n\t\t{\n\t\t\tif (ee()->mime_type->isSafeForUpload($mime))\n\t\t\t{\n\t\t\t\treturn $mime;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif ($allowed == 'img')\n\t\t{\n\t\t\tif ( ! ee()->mime_type->isImage($mime))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$is_image = TRUE;\n\t\t}\n\n\t\t// We need to be able to turn this off!\n\n\t\t//Apply XSS Filtering to uploaded files?\n\t\tif ($this->_xss_on AND\n\t\t\txss_check() AND\n\t\t\t! ee('Security/XSS')->clean($file_path, $is_image))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $mime;\n\t}", "function _webform_edit_file_filtering_validate($form_element, &$form_state) {\r\n // Predefined types.\r\n $extensions = array();\r\n foreach (element_children($form_element['types']) as $category) {\r\n foreach (array_keys($form_element['types'][$category]['#value']) as $extension) {\r\n if ($form_element['types'][$category][$extension]['#value']) {\r\n $extensions[] = $extension;\r\n }\r\n }\r\n }\r\n\r\n // Additional types.\r\n $additional_extensions = explode(',', $form_element['addextensions']['#value']);\r\n foreach ($additional_extensions as $extension) {\r\n $clean_extension = drupal_strtolower(trim($extension));\r\n if (!empty($clean_extension) && !in_array($clean_extension, $extensions)) {\r\n $extensions[] = $clean_extension;\r\n }\r\n }\r\n\r\n form_set_value($form_element['types'], $extensions, $form_state);\r\n}", "function salient_customizer_sanitize_upload( $upload, $setting ) {\n /*\n * Array of valid upload file types.\n *\n * The array includes upload mime types that are included in wp_get_mime_types()\n */\n $mimes = wp_get_mime_types();\n // Return an array with file extension and mime_type.\n $file = wp_check_filetype( $upload, $mimes );\n // If $upload has a valid mime_type, return it; otherwise, return the default.\n return ( $file['ext'] ? $upload : $setting->default );\n }", "function allow_my_post_types($allowed_post_types) {\n $allowed_post_types[] = 'video';\n return $allowed_post_types;\n}", "function check_file_is_audio( $tmp ) \n{\n $allowed = array(\n 'audio/mpeg', 'audio/x-mpeg', 'audio/mpeg3', 'audio/x-mpeg-3', 'audio/aiff', \n 'audio/mid', 'audio/x-aiff', 'audio/x-mpequrl','audio/midi', 'audio/x-mid', \n 'audio/x-midi','audio/wav','audio/x-wav','audio/xm','audio/x-aac','audio/basic',\n 'audio/flac','audio/mp4','audio/x-matroska','audio/ogg','audio/s3m','audio/x-ms-wax',\n 'audio/xm'\n );\n \n // check REAL MIME type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $tmp );\n finfo_close($finfo);\n \n // check to see if REAL MIME type is inside $allowed array\n if( in_array($type, $allowed) ) {\n return $type;\n } else {\n return false;\n }\n}", "function filteringExtension($post)\r\n\t{\r\n\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\tif (!empty($this->arr_extension_filter))\r\n\t\t{\r\n\t\t\t$name = ( !$this->isArrayPostName ) ? $post['name'] : $post['name'][$this->arrayPostName];\r\n\t\t\t$ext = $this->getFileExtension( $name );\r\n\t\t\tif (in_array($ext, $this->arr_extension_filter))\r\n\t\t\t\treturn true;\r\n\t\t\telse return false;\r\n\t\t}else return true;\r\n\t}", "public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function getExtensionAllowed()\n {\n return array_merge($this->imageTypes, $this->videoTypes, $this->documentTypes);\n }", "function media_upload_html_bypass()\n {\n }", "function testFileTypes()\n {\n $bulletproof = $this->bulletproof->uploadDir('/tmp');\n $image = array('name' => $this->testingImage,\n 'type' => 'image/jpeg',\n 'size' => 542,\n 'tmp_name' => $this->testingImage,\n 'error' => 0\n );\n\n /* should not accept gif*/\n $bulletproof->fileTypes(array('gif'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( gif ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n\n /* should not accept png*/\n $bulletproof->fileTypes(array('png'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( png ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* shouldn't accept this file */\n $bulletproof->fileTypes(array('exe'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( exe ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* example file is actually jpeg, not jpg */\n $bulletproof->fileTypes(array('png', 'jpeg'));\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n $this->assertEquals('uploads/bulletproof_test_image.jpeg',$upload);\n }", "public function getAllowedUploadMimes($existing = array())\n {\n // we get mime types and saved file types\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n if(is_array($this->settings))\n foreach($this->settings as $key ){\n // list thru them and if it's allowed and not in list, we added there,\n // in reality, I'm thinking about removing the wp ones, and all mines,\n // since wordpress mime types are very limited, we can do better guys\n // cuase it sucks, and doesn't have enough mime types, actually let's\n // just do it ...\n if(array_key_exists($key, $pluginFileTypes)){\n $keyCheck = strtolower($key);\n // here we would have checked, if mime type is already there,\n // but we want strong list of mime types, so we just add it all.\n if(is_array($pluginFileTypes[$key])){\n foreach($pluginFileTypes[$key] as $fileType){\n $keyHacked = preg_replace(\"/[^0-9a-zA-Z ]/\", \"\", $fileType);\n $return[$keyCheck . '|' . $keyCheck . '_' . $keyHacked] = $fileType;\n }\n } else {\n $return[$keyCheck] = $pluginFileTypes[$key];\n }\n }\n }\n return array_merge($return, $existing);\n }", "function custom_upload_mimes( $existing_mimes=array() ) {\n \t$existing_mimes['vcf'] = 'text/x-vcard';\n\treturn $existing_mimes; \n}", "protected function _getAllowedExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png', 'svg'];\n }", "public function test_listUnsupportedFileTypes() {\n\n }", "function get_post_mime_types()\n {\n }", "function custom_upload_mimes( $existing_mimes = array() ) {\n\t$existing_mimes['svg'] = 'image/svg+xml';\n\treturn $existing_mimes;\n}", "public function custom_upload_mimes( $mime_types=array() ) {\n\n if(!array_key_exists('pdf', $mime_types)) $mime_types['pdf'] = 'application/pdf';\n if(!array_key_exists('tex', $mime_types)) $mime_types['tex'] = 'text/x-tex';\n if(!array_key_exists('gz', $mime_types)) $mime_types['gz'] = 'application/gzip';\n if(!array_key_exists('tar.gz', $mime_types)) $mime_types['tar.gz'] = 'application/gzip'; #just to be sure we also add this\n\n return $mime_types;\n }", "function theme_slug_sanitize_file( $file, $setting ) {\n\n //allowed file types\n $mimes = array(\n 'jpg|jpeg|jpe' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'png' => 'image/png'\n );\n\n //check file type from file name\n $file_ext = wp_check_filetype( $file, $mimes );\n\n //if file has a valid mime type return it, otherwise return default\n return ( $file_ext['ext'] ? $file : $setting->default );\n}", "function custom_upload_mimes ( $existing_mimes=array() ) {\n $existing_mimes['vcf'] = 'text/x-vcard';\n return $existing_mimes;\n}", "public function getAllowedFileExtensions($post_id=null){\n if(empty($post_id) && !isset($_POST['comment_post_ID'])){\n global $post;\n if(isset($post) && is_object($post)){\n $post_id = $post->ID; \n }else{\n return;\n }\n }\n\n $return = array();\n $pluginFileTypes = $this->getMimeTypes();\n\n if(isset($_POST['comment_post_ID'])){\n $assignment_id = $_POST['comment_post_ID'];\n }\n \n if(empty($assignment_id)){\n $assignment_id = $post_id;\n }\n $attachment_type=get_post_meta($assignment_id,'vibe_attachment_type',true);\n if(is_array($attachment_type) && in_array('JPG',$attachment_type)){\n $attachment_type[]='JPEG';\n }\n if(empty($attachment_type)){\n $attachment_type=array('JPEG');\n }\n return $attachment_type;\n }", "function custom_upload_mimes ( $existing_mimes=array() ) {\n\t$existing_mimes['vcf'] = 'text/x-vcard';\n\treturn $existing_mimes;\n}", "public function testGetIgnoreMimeCheckDefault() {\n $up2 = new upload();\n $this->assertFalse($up2->_ignoreMimeTest);\n }", "public function checkInlineFileTypeAccessForFieldFiletypesSetRecordTypeNotInListReturnsFalse() {}", "function bootstrap_blog_sanitize_file( $file, $setting ) {\n \n //allowed file types\n $mimes = array(\n 'jpg|jpeg|jpe' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'png' => 'image/png'\n );\n \n //check file type from file name\n $file_ext = wp_check_filetype( $file, $mimes );\n \n //if file has a valid mime type return it, otherwise return default\n return ( $file_ext['ext'] ? $file : $setting->default );\n}", "function wpdev_make_file_upload( &$file, $dir , $url ) {\r\n\r\n // The default error handler.\r\n if (! function_exists( 'wp_handle_upload_error' ) ) { function wp_handle_upload_error( &$file, $message ) { return array( 'error'=>$message ); } }\r\n\r\n // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].\r\n $upload_error_strings = array( false,\r\n __( \"The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>.\" ),\r\n __( \"The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form.\" ),\r\n __( \"The uploaded file was only partially uploaded.\" ),\r\n __( \"No file was uploaded.\" ),\r\n '',\r\n __( \"Missing a temporary folder.\" ),\r\n __( \"Failed to write file to disk.\" ),\r\n __( \"File upload stopped by extension.\" ));\r\n\r\n // A successful upload will pass this test. It makes no sense to override this one.\r\n if ( $file['error'] > 0 ) return wp_handle_upload_error( $file, $upload_error_strings[$file['error']] );\r\n\r\n // A non-empty file will pass this test.\r\n if ( !($file['size'] > 0 ) ) return wp_handle_upload_error( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));\r\n\r\n // A properly uploaded file will pass this test. There should be no reason to override this one.\r\n if (! @ is_uploaded_file( $file['tmp_name'] ) ) return wp_handle_upload_error( $file, __( 'Specified file failed upload test.' ));\r\n\r\n // If you override this, you must provide $ext and $type!!!!\r\n $test_type = true;\r\n $mimes = false;\r\n\r\n // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.\r\n $wp_filetype = wp_check_filetype( $file['name'], $mimes );\r\n extract( $wp_filetype );\r\n if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) return wp_handle_upload_error( $file, __( 'File type does not meet security guidelines. Try another.' ));\r\n if ( !$ext ) $ext = ltrim(strrchr($file['name'], '.'), '.');\r\n if ( !$type ) $type = $file['type'];\r\n\r\n // A writable uploads dir will pass this test. Again, there's no point overriding this one.\r\n if ( ! isset( $dir) ) return wp_handle_upload_error( $file, __('Source upload directory is not set') );\r\n\r\n $filename = wp_unique_filename( $dir, $file['name'], null );\r\n\r\n // Move the file to the uploads dir\r\n $new_file = $dir . \"/$filename\";\r\n if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) return wp_handle_upload_error( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $dir ) );\r\n\r\n // Set correct file permissions\r\n $stat = stat( dirname( $new_file ));\r\n $perms = $stat['mode'] & 0000666;\r\n @ chmod( $new_file, 0766 /*$perms */);\r\n\r\n // Compute the URL\r\n $url = $url . \"/$filename\";\r\n\r\n return array( 'file' => $new_file, 'url' => $url, 'type' => $type ) ;\r\n }", "function webp_upload_mimes( $existing_mimes ) {\n\t$existing_mimes['webp'] = 'image/webp';\n\n\t// return the array back to the function with our added mime type\n\treturn $existing_mimes;\n}", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "static public function getAllowedMimeTypes()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('content_type')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->content_type;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getAllowFileExtensions()\n\t{\n\t\treturn implode(',', array_merge($this->videoExtensions, $this->imageExtensions, $this->audioExtensions, $this->docExtensions ));\n\t\t//return Yii::app()->params['fileExtensions'];\n\t}", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }", "function media_upload_file()\n {\n }", "function add_upload_types( $existing_mimes ) {\n\t\t$existing_mimes['ico'] = 'image/vnd.microsoft.icon';\n\t\t$existing_mimes['eot'] = 'application/vnd.ms-fontobject';\n\t\t$existing_mimes['woff2'] = 'application/x-woff';\n\t\t$existing_mimes['woff'] = 'application/x-woff';\n\t\t$existing_mimes['ttf'] = 'application/octet-stream';\n\t\t$existing_mimes['svg'] = 'image/svg+xml';\n\t\t$existing_mimes['mp4'] = 'video/mp4';\n\t\t$existing_mimes['ogv'] = 'video/ogg';\n\t\t$existing_mimes['webm'] = 'video/webm';\n\t\treturn $existing_mimes;\n\t}", "public static function mimeTypeExtensions ()\r\n\t{\r\n\t\t# Define the MIME Types; list taken from www.mimetype.org\r\n\t\t$mimeTypes = '\r\n\t\tapplication/SLA\tstl\r\n\t\tapplication/STEP\tstep\r\n\t\tapplication/STEP\tstp\r\n\t\tapplication/acad\tdwg\r\n\t\tapplication/andrew-inset\tez\r\n\t\tapplication/clariscad\tccad\r\n\t\tapplication/drafting\tdrw\r\n\t\tapplication/dsptype\ttsp\r\n\t\tapplication/dxf\tdxf\r\n\t\tapplication/excel\txls\r\n\t\tapplication/i-deas\tunv\r\n\t\tapplication/java-archive\tjar\r\n\t\tapplication/mac-binhex40\thqx\r\n\t\tapplication/mac-compactpro\tcpt\r\n\t\tapplication/vnd.ms-powerpoint\tpot\r\n\t\tapplication/vnd.ms-powerpoint\tpps\r\n\t\tapplication/vnd.ms-powerpoint\tppt\r\n\t\tapplication/vnd.ms-powerpoint\tppz\r\n\t\tapplication/msword\tdoc\r\n\t\tapplication/octet-stream\tbin\r\n\t\tapplication/octet-stream\tclass\r\n\t\tapplication/octet-stream\tdms\r\n\t\tapplication/octet-stream\texe\r\n\t\tapplication/octet-stream\tlha\r\n\t\tapplication/octet-stream\tlzh\r\n\t\tapplication/oda\toda\r\n\t\tapplication/ogg\togg\r\n\t\tapplication/ogg\togm\r\n\t\tapplication/pdf\tpdf\r\n\t\tapplication/pgp\tpgp\r\n\t\tapplication/postscript\tai\r\n\t\tapplication/postscript\teps\r\n\t\tapplication/postscript\tps\r\n\t\tapplication/pro_eng\tprt\r\n\t\tapplication/rtf\trtf\r\n\t\tapplication/set\tset\r\n\t\tapplication/smil\tsmi\r\n\t\tapplication/smil\tsmil\r\n\t\tapplication/solids\tsol\r\n\t\tapplication/vda\tvda\r\n\t\tapplication/vnd.mif\tmif\r\n\t\tapplication/vnd.ms-excel\txlc\r\n\t\tapplication/vnd.ms-excel\txll\r\n\t\tapplication/vnd.ms-excel\txlm\r\n\t\tapplication/vnd.ms-excel\txls\r\n\t\tapplication/vnd.ms-excel\txlw\r\n\t\tapplication/vnd.rim.cod\tcod\r\n\t\tapplication/x-arj-compressed\tarj\r\n\t\tapplication/x-bcpio\tbcpio\r\n\t\tapplication/x-cdlink\tvcd\r\n\t\tapplication/x-chess-pgn\tpgn\r\n\t\tapplication/x-cpio\tcpio\r\n\t\tapplication/x-csh\tcsh\r\n\t\tapplication/x-debian-package\tdeb\r\n\t\tapplication/x-director\tdcr\r\n\t\tapplication/x-director\tdir\r\n\t\tapplication/x-director\tdxr\r\n\t\tapplication/x-dvi\tdvi\r\n\t\tapplication/x-freelance\tpre\r\n\t\tapplication/x-futuresplash\tspl\r\n\t\tapplication/x-gtar\tgtar\r\n\t\tapplication/x-gunzip\tgz\r\n\t\tapplication/x-gzip\tgz\r\n\t\tapplication/x-hdf\thdf\r\n\t\tapplication/x-ipix\tipx\r\n\t\tapplication/x-ipscript\tips\r\n\t\tapplication/x-javascript\tjs\r\n\t\tapplication/x-koan\tskd\r\n\t\tapplication/x-koan\tskm\r\n\t\tapplication/x-koan\tskp\r\n\t\tapplication/x-koan\tskt\r\n\t\tapplication/x-latex\tlatex\r\n\t\tapplication/x-lisp\tlsp\r\n\t\tapplication/x-lotusscreencam\tscm\r\n\t\tapplication/x-mif\tmif\r\n\t\tapplication/x-msdos-program\tbat\r\n\t\tapplication/x-msdos-program\tcom\r\n\t\tapplication/x-msdos-program\texe\r\n\t\tapplication/x-netcdf\tcdf\r\n\t\tapplication/x-netcdf\tnc\r\n\t\tapplication/x-perl\tpl\r\n\t\tapplication/x-perl\tpm\r\n\t\tapplication/x-rar-compressed\trar\r\n\t\tapplication/x-sh\tsh\r\n\t\tapplication/x-shar\tshar\r\n\t\tapplication/x-shockwave-flash\tswf\r\n\t\tapplication/x-stuffit\tsit\r\n\t\tapplication/x-sv4cpio\tsv4cpio\r\n\t\tapplication/x-sv4crc\tsv4crc\r\n\t\tapplication/x-tar-gz\ttar.gz\r\n\t\tapplication/x-tar-gz\ttgz\r\n\t\tapplication/x-tar\ttar\r\n\t\tapplication/x-tcl\ttcl\r\n\t\tapplication/x-tex\ttex\r\n\t\tapplication/x-texinfo\ttexi\r\n\t\tapplication/x-texinfo\ttexinfo\r\n\t\tapplication/x-troff-man\tman\r\n\t\tapplication/x-troff-me\tme\r\n\t\tapplication/x-troff-ms\tms\r\n\t\tapplication/x-troff\troff\r\n\t\tapplication/x-troff\tt\r\n\t\tapplication/x-troff\ttr\r\n\t\tapplication/x-ustar\tustar\r\n\t\tapplication/x-wais-source\tsrc\r\n\t\tapplication/x-zip-compressed\tzip\r\n\t\tapplication/zip\tzip\r\n\t\taudio/TSP-audio\ttsi\r\n\t\taudio/basic\tau\r\n\t\taudio/basic\tsnd\r\n\t\taudio/midi\tkar\r\n\t\taudio/midi\tmid\r\n\t\taudio/midi\tmidi\r\n\t\taudio/mpeg\tmp2\r\n\t\taudio/mpeg\tmp3\r\n\t\taudio/mpeg\tmpga\r\n\t\taudio/ulaw\tau\r\n\t\taudio/x-aiff\taif\r\n\t\taudio/x-aiff\taifc\r\n\t\taudio/x-aiff\taiff\r\n\t\taudio/x-mpegurl\tm3u\r\n\t\taudio/x-ms-wax\twax\r\n\t\taudio/x-ms-wma\twma\r\n\t\taudio/x-pn-realaudio-plugin\trpm\r\n\t\taudio/x-pn-realaudio\tram\r\n\t\taudio/x-pn-realaudio\trm\r\n\t\taudio/x-realaudio\tra\r\n\t\taudio/x-wav\twav\r\n\t\tchemical/x-pdb\tpdb\r\n\t\tchemical/x-pdb\txyz\r\n\t\timage/cmu-raster\tras\r\n\t\timage/gif\tgif\r\n\t\timage/ief\tief\r\n\t\timage/jpeg\tjpe\r\n\t\timage/jpeg\tjpeg\r\n\t\timage/jpeg\tjpg\r\n\t\timage/png\tpng\r\n\t\timage/tiff\ttif tiff\r\n\t\timage/tiff\ttif\r\n\t\timage/tiff\ttiff\r\n\t\timage/x-cmu-raster\tras\r\n\t\timage/x-portable-anymap\tpnm\r\n\t\timage/x-portable-bitmap\tpbm\r\n\t\timage/x-portable-graymap\tpgm\r\n\t\timage/x-portable-pixmap\tppm\r\n\t\timage/x-rgb\trgb\r\n\t\timage/x-xbitmap\txbm\r\n\t\timage/x-xpixmap\txpm\r\n\t\timage/x-xwindowdump\txwd\r\n\t\tmodel/iges\tiges\r\n\t\tmodel/iges\tigs\r\n\t\tmodel/mesh\tmesh\r\n\t\tmodel/mesh\tmsh\r\n\t\tmodel/mesh\tsilo\r\n\t\tmodel/vrml\tvrml\r\n\t\tmodel/vrml\twrl\r\n\t\ttext/css\tcss\r\n\t\ttext/html\thtm\r\n\t\ttext/html\thtml htm\r\n\t\ttext/html\thtml\r\n\t\ttext/plain\tasc txt\r\n\t\ttext/plain\tasc\r\n\t\ttext/plain\tc\r\n\t\ttext/plain\tcc\r\n\t\ttext/plain\tf90\r\n\t\ttext/plain\tf\r\n\t\ttext/plain\th\r\n\t\ttext/plain\thh\r\n\t\ttext/plain\tm\r\n\t\ttext/plain\ttxt\r\n\t\ttext/richtext\trtx\r\n\t\ttext/rtf\trtf\r\n\t\ttext/sgml\tsgm\r\n\t\ttext/sgml\tsgml\r\n\t\ttext/tab-separated-values\ttsv\r\n\t\ttext/vnd.sun.j2me.app-descriptor\tjad\r\n\t\ttext/x-setext\tetx\r\n\t\ttext/xml\txml// This is disabled because XML has several different MIME Types\r\n\t\tvideo/dl\tdl\r\n\t\tvideo/fli\tfli\r\n\t\tvideo/flv\tflv\r\n\t\tvideo/gl\tgl\r\n\t\tvideo/mpeg\tmp2\r\n\t\tvideo/mpeg\tmpe\r\n\t\tvideo/mpeg\tmpeg\r\n\t\tvideo/mpeg\tmpg\r\n\t\tvideo/quicktime\tmov\r\n\t\tvideo/quicktime\tqt\r\n\t\tvideo/vnd.vivo\tviv\r\n\t\tvideo/vnd.vivo\tvivo\r\n\t\tvideo/x-fli\tfli\r\n\t\tvideo/x-ms-asf\tasf\r\n\t\tvideo/x-ms-asx\tasx\r\n\t\tvideo/x-ms-wmv\twmv\r\n\t\tvideo/x-ms-wmx\twmx\r\n\t\tvideo/x-ms-wvx\twvx\r\n\t\tvideo/x-msvideo\tavi\r\n\t\tvideo/x-sgi-movie\tmovie\r\n\t\twww/mime\tmime\r\n\t\tx-conference/x-cooltalk\tice\r\n\t\tx-world/x-vrml\tvrm\r\n\t\tx-world/x-vrml\tvrml';\r\n\t\t\r\n\t\t# Parse the list as array ($extension => $mimeType, ... )\r\n\t\t$list = array ();\r\n\t\t$mimeTypes = explode (\"\\n\", trim ($mimeTypes));\r\n\t\tforeach ($mimeTypes as $index => $line) {\r\n\t\t\tlist ($mimeType, $extension) = explode (\"\\t\", trim ($line), 2);\r\n\t\t\tif (substr_count ($extension, ' ')) {continue;}\t// Limit of 2 for some extensions in the source listing have two listed, e.g. \"asc txt\"\r\n\t\t\t$list[$extension] = $mimeType;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the list\r\n\t\treturn $list;\r\n\t}", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function custom_upload_mimes($existing_mimes = array()) {\n $existing_mimes['svg'] = 'image/svg+xml';\n $existing_mimes['svgz'] = 'image/svg+xml';\n return $existing_mimes;\n}", "function media_upload_form_handler()\n {\n }", "public function checkInlineFileTypeAccessForFieldFiletypesSetRecordTypeInListReturnsTrue() {}", "public function isMimeSupported($mimeType = '*');", "function extend_mime_types( $existing_mimes=array() ) {\n $existing_mimes['webm'] = 'video/webm';\n $existing_mimes['mp4'] = 'video/mp4';\n $existing_mimes['ogg'] = 'video/ogg';\n $existing_mimes['svg'] = 'image/svg+xml';\n\n // Return an array now including our added mime types\n return $existing_mimes;\n}", "function canUpload($file, &$err, &$params)\r\n\t{\r\n\t\tif (empty($file['name'])) {\r\n\t\t\t$err = 'Please input a file for upload';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!is_uploaded_file($file['tmp_name'])) {\r\n\t //handle potential malicous attack\r\n\t $err = JText::_('File has not been uploaded');\r\n\t\t\treturn false;;\r\n\t\t}\r\n\r\n\t\tjimport('joomla.filesystem.file');\r\n\t\t$format = strtolower(JFile::getExt($file['name']));\r\n\r\n\t\t$allowable = explode(',', strtolower($params->get('ul_file_types')));\r\n\r\n\t\t$format = FabrikString::ltrimword($format, '.');\r\n\t\t$format2 = \".$format\";\r\n\t\tif (!in_array($format, $allowable) && !in_array($format2, $allowable))\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETYPE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$maxSize = (int)$params->get('upload_maxsize', 0);\r\n\t\tif ($maxSize > 0 && (int)$file['size'] > $maxSize)\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETOOLARGE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ignored = array();\r\n\t\t$user = JFactory::getUser();\r\n\t\t$imginfo = null;\r\n\t\tif ($params->get('restrict_uploads',1)) {\r\n\t\t\t$images = explode(',', $params->get('image_extensions'));\r\n\t\t\tif (in_array($format, $images)) { // if its an image run it through getimagesize\r\n\t\t\t\tif (($imginfo = getimagesize($file['tmp_name'])) === FALSE) {\r\n\t\t\t\t\t$err = 'WARNINVALIDIMG';\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (!in_array($format, $ignored)) {\r\n\t\t\t\t// if its not an image...and we're not ignoring it\r\n\t\t\t\t/*$allowed_mime = explode(',', $upload_mime);\r\n\t\t\t\t$illegal_mime = explode(',', $upload_mime_illegal);\r\n\t\t\t\tif (function_exists('finfo_open') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// We have fileinfo\r\n\t\t\t\t\t$finfo = finfo_open(FILEINFO_MIME);\r\n\t\t\t\t\t$type = finfo_file($finfo, $file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfinfo_close($finfo);\r\n\t\t\t\t} else if (function_exists('mime_content_type') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// we have mime magic\r\n\t\t\t\t\t$type = mime_content_type($file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$xss_check = JFile::read($file['tmp_name'], false, 256);\r\n\t\t$html_tags = array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE', '!--');\r\n\t\tforeach ($html_tags as $tag) {\r\n\t\t\t// A tag is '<tagname ', so we need to add < and a space or '<tagname>'\r\n\t\t\tif (JString::stristr($xss_check, '<'.$tag.' ') || JString::stristr($xss_check, '<'.$tag.'>')) {\r\n\t\t\t\t$err = 'WARNIEXSS';\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function getAllowedFileExtensions()\n {\n return ['jpg', 'jpeg', 'gif', 'png'];\n }", "public function checkMineType(array $file_data) {\n if (null != $this->_filterType) { //defined filter by Type\n $ext = explode(',', $this->_filterType);\n $mime = array();\n $mime = array();\n for ($i = 0; $i < sizeof($ext); ++$i) {\n $ext[$i] = strtolower(ltrim(trim($ext[$i]), '.'));\n $mime[$ext[$i]] = $this->_allowedMimeType[$ext[$i]];\n }\n } else {\n $mime = $this->_allowedMimeType;\n }\n $ext = $this->getExtension($file_data['name'], false);\n $expectMimeType = $this->getMimeTypeByExtension($ext, $mime);\n\n $fileMimeType = $this->_getUploadedFileMimeType($file_data);\n\n if (is_array($expectMimeType)) {\n if (!in_array($fileMimeType, $expectMimeType)) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (is_string($expectMimeType)) {\n if ($expectMimeType != $fileMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (false == $expectMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n\n return true;\n }", "public function getAllowedExtensions()\n {\n return $this->allowedFiles;\n }", "public static function supports_mime_type($mime_type)\n {\n }", "public static function supports_mime_type($mime_type)\n {\n }", "function testFileTypes()\r\n {\r\n $nautilus = $this->nautilus->uploadDir('/tmp');\r\n $image = array('name' => $this->testingImage,\r\n 'type' => 'image/jpeg',\r\n 'size' => 542,\r\n 'tmp_name' => $this->testingImage,\r\n 'error' => 0\r\n );\r\n\r\n /* should not accept gif*/\r\n $nautilus->fileTypes(array('gif'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( gif ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n\r\n /* should not accept png*/\r\n $nautilus->fileTypes(array('png'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( png ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* shouldn't accept this file */\r\n $nautilus->fileTypes(array('exe'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( exe ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* example file is actually jpeg, not jpg */\r\n $nautilus->fileTypes(array('png', 'jpeg'));\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n $this->assertEquals('uploads/nautilus_test_image.jpeg',$upload);\r\n }", "public static function supports_mime_type($mime_type)\n {\n }", "public function getFileTypeRestrictions(): array\n {\n return $this->supportedFileTypes;\n }", "function add_custom_mime_types ( $mimes ) {\r\n\t$mimes['hwp'] = 'application/hangul';\r\n\treturn $mimes;\r\n}", "function loadMimeTypes() {\n\t\tif( empty( $this->mMimeTypes )) {\n\t\t\t// use bitweavers mime.types file to ensure everyone has our set unless user forces his own.\n\t\t\tif( defined( 'MIME_TYPES' ) && is_file( MIME_TYPES )) {\n\t\t\t\t$mimeFile = MIME_TYPES;\n\t\t\t} else {\n\t\t\t\t$mimeFile = KERNEL_PKG_PATH.'admin/mime.types';\n\t\t\t}\n\n\t\t\t$this->mMimeTypes = array();\n\t\t\tif( $fp = fopen( $mimeFile,\"r\" ) ) {\n\t\t\t\twhile( FALSE != ( $line = fgets( $fp, 4096 ) ) ) {\n\t\t\t\t\tif( !preg_match( \"/^\\s*(?!#)\\s*(\\S+)\\s+(?=\\S)(.+)/\", $line, $match ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$tmp = preg_split( \"/\\s/\",trim( $match[2] ) );\n\t\t\t\t\tforeach( $tmp as $type ) {\n\t\t\t\t\t\t$this->mMimeTypes[strtolower( $type )] = $match[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose( $fp );\n\t\t\t}\n\t\t}\n\t}", "function media_upload_flash_bypass()\n {\n }", "public function isFileUploadsSupported()\n {\n $checking_result = (Bootstrap::getIniParam('file_uploads') == true) ? true : false;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_file_uploads_notice'), true, 'valiator');\n }\n\n return $checking_result;\n }", "public function can_manage_files() {\n return true;\n }", "public function getSupportedFileExtensions() {}" ]
[ "0.7577301", "0.74262846", "0.73595816", "0.7156631", "0.7107665", "0.7098097", "0.7095395", "0.7056228", "0.7011466", "0.6888636", "0.6875221", "0.6810395", "0.674863", "0.671076", "0.67067516", "0.6702787", "0.66957545", "0.6681378", "0.6671993", "0.66663975", "0.6665773", "0.66486406", "0.6612641", "0.6568191", "0.65540355", "0.6537587", "0.6536181", "0.6529284", "0.65213376", "0.6517279", "0.6515189", "0.649852", "0.6483452", "0.6451641", "0.6439531", "0.64373255", "0.64349586", "0.6414143", "0.63997513", "0.63997513", "0.639954", "0.63776374", "0.63751113", "0.63626295", "0.63546735", "0.6348028", "0.6343664", "0.6342425", "0.63361293", "0.6330328", "0.6285692", "0.62854266", "0.62689495", "0.62685287", "0.6256132", "0.6254973", "0.62538785", "0.6238181", "0.62344605", "0.6225968", "0.62145877", "0.62144685", "0.620733", "0.6200741", "0.6191898", "0.6179655", "0.6170613", "0.6141882", "0.6141784", "0.6140297", "0.6118738", "0.6109888", "0.6103493", "0.6096214", "0.60946715", "0.6077009", "0.60482657", "0.60468155", "0.6036485", "0.6030474", "0.60240126", "0.60213923", "0.6001749", "0.5994506", "0.5992374", "0.5991947", "0.5978624", "0.59778893", "0.59769475", "0.59347963", "0.5924098", "0.59239376", "0.59229034", "0.5922198", "0.59152263", "0.59093136", "0.59075695", "0.5897098", "0.58965206", "0.5893701", "0.5888143" ]
0.0
-1
Download a file to the WordPress media library. $mime_type and $extension are optional, if set to something empty() they are guessed form the download file, where the extension is guessed based on the mime type. If the mime type is provided and the downloaded file does not actually have that mime type, an error is returned.
public function download_to_media_library( $url, $filename, $extension, $mime_type, $parent_post_id ) { $extension = ltrim($extension, '.'); // Gives us access to the download_url() and wp_handle_sideload() functions require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . 'wp-admin/includes/image.php' ); $timeout_seconds = 20; // Download file to temp dir $temp_file = download_url( $url, $timeout_seconds ); if ( !is_wp_error( $temp_file ) ) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $actual_mime_type = finfo_file($finfo, $temp_file); finfo_close($finfo); if( empty($mime_type) ) { $mime_type = $actual_mime_type; } elseif($mime_type !== $actual_mime_type) return array( 'error' => "Instead of the mime type " . $mime_type . " we were expecting, the remote server provided a file of mime type " . $actual_mime_type ); if (empty($extension)) { if( preg_match('#text/.*tex#u', $mime_type) ) $extension = 'tex'; else if( preg_match('#application/.*(tar|gz|gzip)#u', $mime_type) ) $extension = 'tar.gz'; else if( preg_match('#application/.*pdf#u', $mime_type) ) $extension = 'pdf'; else $extension = 'unknown'; } $filename = $filename . '.' . $extension; // Array based on $_FILE as seen in PHP file uploads $file = array( 'name' => $filename, 'type' => $mime_type, 'tmp_name' => $temp_file, 'error' => 0, 'size' => filesize($temp_file), ); $overrides = array( // Tells WordPress to not look for the POST form // fields that would normally be present as // we downloaded the file from a remote server, so there // will be no form fields // Default is true 'test_form' => false, // Setting this to false lets WordPress allow empty files, not recommended // Default is true 'test_size' => true, // for .tar.gz files normally only .gz is treated as the extension, so that // when file.tar.gz already exists the file is uploaded as file.tar-1.gz but // we want the propper file-1.tar.gz 'unique_filename_callback' => array($this, 'unique_filename_callback'), ); // Move the temporary file into the uploads directory $results = wp_handle_sideload( $file, $overrides ); if ( !empty( $results['error'] ) ) { return array( 'error' => "Failed to put file " . $file['name'] . " of mime type " . $file['type'] . " into uploads directory because Wordpress said: " . $results['error'] ); } else { $filepath = $results['file']; // Full path to the file // Prepare an array of post data for the attachment. $attachment = array( 'guid' => $filepath, 'post_mime_type' => $mime_type, 'post_title' => $filename, 'post_content' => '', 'post_status' => 'inherit' ); // Insert the attachment. $attach_id = wp_insert_attachment( $attachment, $filepath, $parent_post_id ); // Generate the metadata for the attachment, and update the database record. $attach_data = wp_generate_attachment_metadata( $attach_id, $filename ); wp_update_attachment_metadata( $attach_id, $attach_data ); $results['mime_type'] = $mime_type; $results['attach_id'] = $attach_id; return $results; } } else return array( 'error' => "Failed to download file of mime type " . $mime_type . ": " . $temp_file->get_error_message()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function download($type)\n {\n $model = Student::whereUser_id(auth()->user()->id)->first();\n if (!is_null($model)) {\n if ($model->user_id == auth()->user()->id) {\n $document = $model->getFirstMedia($type);\n if (!is_null($document))\n return response()->download($document->getPath(), $document->file_name);\n }\n }\n toast('Document not found', 'warning')->autoClose(5000)->timerProgressBar();\n return redirect()->back();\n }", "private function sendDownload($content, $name = null, $type = 1)\n {\n // Backward compatibilty for ob_list_handlers\n if (!function_exists('ob_list_handlers')) {\n function ob_list_handlers()\n {\n $res = array();\n if (ini_get('output_buffering')) {\n $res[] = 'default output handler';\n }\n return $res;\n }\n }\n \n \n require_once 'Download.php';\n $dl = &new HTTP_Download();\n \n switch ($type) {\n case 1:\n if (is_file($content)) {\n $dl->setFile($content);\n } else {\n die('Download File/Path Not Found: ' . $content);\n return false;\n }\n break;\n \n case 2:\n $dl->setData($content);\n break;\n \n case 3:\n $dl->setResource($content);\n break;\n \n default:\n return false;\n break;\n }\n\n $dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, $name);\n \n // Set content type \n if (preg_match('#Opera(/| )([0-9].[0-9]{1,2})#', getenv('HTTP_USER_AGENT')) or \n preg_match('#MSIE ([0-9].[0-9]{1,2})#', getenv('HTTP_USER_AGENT'))) {\n \n $content_type = 'application/octetstream';\n } else {\n $content_type = 'application/octet-stream';\n }\n $dl->setContentType($content_type);\n $res = $dl->send();\n \n if (PEAR::isError($res)) {\n die('Send Download Failed: ' . $res->message);\n } else {\n exit;\n }\n }", "public function download($entity_type, $entity_id) {\n try {\n $media_links = $this->getFiles($entity_id);\n\n if (count($media_links) === 0) {\n $this->messenger()->addError($this->t('No files found for this entity to be downloaded'));\n\n return new RedirectResponse(\"$entity_type/$entity_id\");\n }\n\n $filename = \"$entity_type-$entity_id.zip\";\n\n ob_clean();\n\n $zip = new ZipStream($filename);\n foreach ($media_links as $media_link) {\n if (!$media_link->url) {\n continue;\n }\n\n $zip->addFileFromPath($media_link->file_name, $media_link->url);\n }\n\n $zip->finish();\n\n ob_end_flush();\n exit();\n\n } catch (StorageException $e) {\n $this->messenger()->addError($this->t('There were issues generating the package of media downloads.'));\n\n return new RedirectResponse(\"$entity_type/$entity_id\");\n }\n }", "public function downloadFile();", "public function getFile($ext, $type)\n {\n\t $dao = $this->getDAO();\n\n $resume = $dao->findByExt($ext);\n\n if ( !$resume ) { return $this->error($ext); }\n\n $response = new StreamedResponse();\n $d = $response->headers\n ->makeDisposition(ResponseHeaderBag::DISPOSITION_INLINE,\n $this->buildFileName(). $ext);\n $response->headers->set('Content-Disposition', $d);\n $response->headers->set('Content-Type', $type);\n \n //$response->setContent($resume->getFile());\n \n //there has to be more elegant way to do this // brute force\n switch($ext)\n {\n case 'docx';\n $response->setCallback(function()\n {\n echo $this->getDAO()->findByExt('docx')\n ->getFile();\n flush();\n });\n break;\n\n case 'html':\n $response->setCallback(function()\n {\n echo $this->getDAO()->findByExt('html')\n ->getFile();\n flush();\n });\n break;\n\n case 'txt':\n $response->setCallback(function()\n {\n echo $this->getDAO()->findByExt('txt')\n ->getFile();\n flush();\n });\n break;\n\n case 'pdf':\n $response->setCallback(function()\n {\n echo $this->getDAO()->findByExt('pdf')\n ->getFile();\n flush();\n });\n break;\n\n default:\n return $this->error($ext);\n }\n \n $response->send();\n }", "public function send_file($filename, $download = NULL, array $options = NULL)\n\t{\n\t\tif ( ! empty($options['mime_type']))\n\t\t{\n\t\t\t// The mime-type has been manually set\n\t\t\t$mime = $options['mime_type'];\n\t\t}\n\n\t\tif ($filename === TRUE)\n\t\t{\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Download name must be provided for streaming files');\n\t\t\t}\n\n\t\t\t// Temporary files will automatically be deleted\n\t\t\t$options['delete'] = FALSE;\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Guess the mime using the file extension\n\t\t\t\t$mime = File::mime_by_ext(strtolower(pathinfo($download, PATHINFO_EXTENSION)));\n\t\t\t}\n\n\t\t\t// Force the data to be rendered if\n\t\t\t$file_data = (string) $this->response;\n\n\t\t\t// Get the content size\n\t\t\t$size = strlen($file_data);\n\n\t\t\t// Create a temporary file to hold the current response\n\t\t\t$file = tmpfile();\n\n\t\t\t// Write the current response into the file\n\t\t\tfwrite($file, $file_data);\n\n\t\t\t// File data is no longer needed\n\t\t\tunset($file_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the complete file path\n\t\t\t$filename = realpath($filename);\n\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\t// Use the file name as the download file name\n\t\t\t\t$download = pathinfo($filename, PATHINFO_BASENAME);\n\t\t\t}\n\n\t\t\t// Get the file size\n\t\t\t$size = filesize($filename);\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Get the mime type\n\t\t\t\t$mime = File::mime($filename);\n\t\t\t}\n\n\t\t\t// Open the file for reading\n\t\t\t$file = fopen($filename, 'rb');\n\t\t}\n\n\t\tif ( ! is_resource($file))\n\t\t{\n\t\t\tthrow new Kohana_Exception('Could not read file to send: :file', array(\n\t\t\t\t':file' => $download,\n\t\t\t));\n\t\t}\n\n\t\t// Inline or download?\n\t\t$disposition = empty($options['inline']) ? 'attachment' : 'inline';\n\n\t\t// Calculate byte range to download.\n\t\tlist($start, $end) = $this->_calculate_byte_range($size);\n\n\t\tif ( ! empty($options['resumable']))\n\t\t{\n\t\t\tif ($start > 0 OR $end < ($size - 1))\n\t\t\t{\n\t\t\t\t// Partial Content\n\t\t\t\t$this->status = 206;\n\t\t\t}\n\n\t\t\t// Range of bytes being sent\n\t\t\t$this->headers['Content-Range'] = 'bytes '.$start.'-'.$end.'/'.$size;\n\t\t\t$this->headers['Accept-Ranges'] = 'bytes';\n\t\t}\n\n\t\t// Set the headers for a download\n\t\t$this->headers['Content-Disposition'] = $disposition.'; filename=\"'.$download.'\"';\n\t\t$this->headers['Content-Type'] = $mime;\n\t\t$this->headers['Content-Length'] = ($end - $start) + 1;\n\n\t\tif (Request::user_agent('browser') === 'Internet Explorer')\n\t\t{\n\t\t\t// Naturally, IE does not act like a real browser...\n\t\t\tif (Request::$protocol === 'https')\n\t\t\t{\n\t\t\t\t// http://support.microsoft.com/kb/316431\n\t\t\t\t$this->headers['Pragma'] = $this->headers['Cache-Control'] = 'public';\n\t\t\t}\n\n\t\t\tif (version_compare(Request::user_agent('version'), '8.0', '>='))\n\t\t\t{\n\t\t\t\t// http://ajaxian.com/archives/ie-8-security\n\t\t\t\t$this->headers['X-Content-Type-Options'] = 'nosniff';\n\t\t\t}\n\t\t}\n\n\t\t// Send all headers now\n\t\t$this->send_headers();\n\n\t\twhile (ob_get_level())\n\t\t{\n\t\t\t// Flush all output buffers\n\t\t\tob_end_flush();\n\t\t}\n\n\t\t// Manually stop execution\n\t\tignore_user_abort(TRUE);\n\n\t\tif ( ! Kohana::$safe_mode)\n\t\t{\n\t\t\t// Keep the script running forever\n\t\t\tset_time_limit(0);\n\t\t}\n\n\t\t// Send data in 16kb blocks\n\t\t$block = 1024 * 16;\n\n\t\tfseek($file, $start);\n\n\t\twhile ( ! feof($file) AND ($pos = ftell($file)) <= $end)\n\t\t{\n\t\t\tif (connection_aborted())\n\t\t\t\tbreak;\n\n\t\t\tif ($pos + $block > $end)\n\t\t\t{\n\t\t\t\t// Don't read past the buffer.\n\t\t\t\t$block = $end - $pos + 1;\n\t\t\t}\n\n\t\t\t// Output a block of the file\n\t\t\techo fread($file, $block);\n\n\t\t\t// Send the data now\n\t\t\tflush();\n\t\t}\n\n\t\t// Close the file\n\t\tfclose($file);\n\n\t\tif ( ! empty($options['delete']))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Attempt to remove the file\n\t\t\t\tunlink($filename);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Create a text version of the exception\n\t\t\t\t$error = Kohana::exception_text($e);\n\n\t\t\t\tif (is_object(Kohana::$log))\n\t\t\t\t{\n\t\t\t\t\t// Add this exception to the log\n\t\t\t\t\tKohana::$log->add(Kohana::ERROR, $error);\n\n\t\t\t\t\t// Make sure the logs are written\n\t\t\t\t\tKohana::$log->write();\n\t\t\t\t}\n\n\t\t\t\t// Do NOT display the exception, it will corrupt the output!\n\t\t\t}\n\t\t}\n\n\t\t// Stop execution\n\t\texit;\n\t}", "public function download(): void\n\t{\n\t\t/** @var ExtensionModel $model */\n\t\t$model = $this->getModel();\n\t\t$id = $this->input->getInt('id');\n\t\t$fileDetails = $model->getFilename($id);\n\n\t\tif (!file_exists($fileDetails->file))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(Text::sprintf('COM_JED_EXTENSIONS_DOWNLOAD_NOT_FOUND',\n\t\t\t\t$fileDetails->file));\n\t\t}\n\n\t\theader('Content-type: application/zip');\n\t\theader('Content-Disposition: attachment; filename=' . $fileDetails->originalFile);\n\t\theader('Content-length: ' . filesize($fileDetails->file));\n\t\theader('Pragma: no-cache');\n\t\theader('Expires: 0');\n\t\treadfile($fileDetails->file);\n\n\t\tFactory::getApplication()->close();\n\t}", "public static function downloadContent(&$contents, $filename = null, $inline = false, $mime_type = null)\n\t{\n\n\t\t$is_file = is_file($contents);\n\n\t\tif(is_null($mime_type)) // Test if MIME type forced.\n\t\t{\n\t\t\t$mime_type = self::detectMimeType($contents);\n\t\t} // Test if MIME type forced.\n\n\t\tif(is_null($filename)) // Test if custom filename is to be used.\n\t\t{\n\n\t\t\tif($is_file) // Test if content is a file.\n\t\t\t{\n\t\t\t\t$filename = basename($contents);\n\t\t\t}\n\t\t\telse // Test if content is a file.\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t} // Test if content is a file.\n\n\t\t} // Test if custom filename is to be used.\n\n\t\t// We clean up the output buffer.\n\t\terror_reporting(E_ALL ^ E_NOTICE);\n\t\tob_end_clean();\n\n\t\tif($mime_type == 'application/pdf') // Test if content is PDF.\n\t\t{\n\t\t\theader('Cache-Control: public');\n\t\t\theader('Pragma: ');\n\t\t\theader('Expires: 0');\n\t\t}\n\t\telse // Test if content is PDF.\n\t\t{\n\t\t\theader('Pragma: no-cache');\n\t\t\theader('Cache-Control: no-store, no-cache, must-revalidate');\n\t\t} // Test if content is PDF.\n\n\t\t// Content is always modified.\n\t\theader(sprintf(\"Last-Modified: %s GMT\", gmdate(\"D, d M Y H:i:s\")));\n\t\theader(sprintf('Content-Type: %s', $mime_type));\n\t\theader(sprintf('Content-Disposition: %s; filename=\"%s\"', $inline ? 'inline' : 'attachment', $filename));\n\n\t\tif(self::isBinaryContent($mime_type)) // Test if content should be presented as binary.\n\t\t{\n\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t} // Test if content should be presented as binary.\n\n\t\tif($is_file) // Test if content is a file.\n\t\t{\n\t\t\theader(sprintf('Content-Length: %d', filesize($contents)));\n\n\t\t\t// Unlock session in order to prevent php session warnings\n\t\t\tsession_write_close();\n\n\t\t\tif(self::detectServerSoftware() == self::LIGHTTPD && defined('XSENDFILE_ENABLED'))\n\t\t\t{\n\t\t\t\tif(XSENDFILE_ENABLED) // Test if X-Sendfile can be used.\n\t\t\t\t{\n\t\t\t\t\theader(sprintf('X-Sendfile: %s', $contents));\n\n\t\t\t\t\t// Send http headers to user client\n\t\t\t\t\texit(0);\n\t\t\t\t} // Test if X-Sendfile can be used.\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Send http headers to user client\n\t\t\t\treadfile($contents);\n\t\t\t\texit(0);\n\t\t\t}\n\t\t}\n\t\telse // Test if content is a file.\n\t\t{\n\t\t\theader(sprintf('Content-Length: %d', strlen($contents)));\n\n\t\t\t// Unlock session in order to prevent php session warnings\n\t\t\tsession_write_close();\n\n\t\t\t// Send http headers to user client\n\t\t\techo $contents;\n\t\t\texit(0);\n\t\t} // Test if content is a file.\n\n\t\treturn false;\n\t}", "function returnMimeThumb($file_ext, $url = false)\n{\n\tglobal $settings;\n\n\t// These are not meant to be exhaustive, just some of the most common attached on a forum\n\t$generics = array(\n\t\t'arc' => array('tgz', 'zip', 'rar', '7z', 'gz'),\n\t\t'doc' => array('doc', 'docx', 'wpd', 'odt'),\n\t\t'sound' => array('wav', 'mp3', 'pcm', 'aiff', 'wma', 'm4a', 'flac'),\n\t\t'video' => array('mp4', 'mgp', 'mpeg', 'mp4', 'wmv', 'mkv', 'flv', 'aiv', 'mov', 'swf'),\n\t\t'txt' => array('rtf', 'txt', 'log'),\n\t\t'presentation' => array('ppt', 'pps', 'odp'),\n\t\t'spreadsheet' => array('xls', 'xlr', 'ods'),\n\t\t'web' => array('html', 'htm')\n\t);\n\tforeach ($generics as $generic_extension => $generic_types)\n\t{\n\t\tif (in_array($file_ext, $generic_types))\n\t\t{\n\t\t\t$file_ext = $generic_extension;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tstatic $distinct = array('arc', 'doc', 'sound', 'video', 'txt', 'presentation', 'spreadsheet', 'web',\n\t\t\t\t\t\t\t 'c', 'cpp', 'css', 'csv', 'java', 'js', 'pdf', 'php', 'sql', 'xml');\n\n\tif (empty($settings))\n\t{\n\t\tThemeLoader::loadEssentialThemeData();\n\t}\n\n\t// Return the mine thumbnail if it exists or just the default\n\tif (!in_array($file_ext, $distinct) || !file_exists($settings['theme_dir'] . '/images/mime_images/' . $file_ext . '.png'))\n\t{\n\t\t$file_ext = 'default';\n\t}\n\n\t$location = $url ? $settings['theme_url'] : $settings['theme_dir'];\n\n\treturn $location . '/images/mime_images/' . $file_ext . '.png';\n}", "public function downloadFile($id, $type)\n {\n $model = Student::whereUser_id($id)->first();\n if (!is_null($model)) {\n $document = $model->getFirstMedia($type);\n if (!is_null($document))\n return response()->download($document->getPath(), $document->file_name);\n }\n toast('Document not found', 'warning')->autoClose(5000)->timerProgressBar();\n return redirect()->back();\n }", "public function downloadFile($file, $name, $mime_type='') {\n if(!is_readable($file)) throw new Exception('File not found or inaccessible! ['.$file.']');\n\n $size = filesize($file);\n $name = rawurldecode($name);\n\n /* Figure out the MIME type (if not specified) */\n $known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n );\n\n if($mime_type==''){\n $file_extension = strtolower(substr(strrchr($name,\".\"),1));\n if (array_key_exists($file_extension, $known_mime_types)) {\n $mime_type=$known_mime_types[$file_extension];\n }\n else {\n $mime_type=\"application/force-download\";\n };\n };\n\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n\n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n\n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n\n /* The three lines below basically make the\n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE'])) {\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if (!$range_end) {\n $range_end=$size-1;\n }\n else {\n $range_end=intval($range_end);\n }\n\n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n }\n else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n }\n\n /* output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r')) {\n if(isset($_SERVER['HTTP_RANGE'])) fseek($file, $range);\n\n while(!feof($file) && (!connection_aborted()) && ($bytes_send<$new_length)) {\n $buffer = fread($file, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\n fclose($file);\n }\n else die('Error - can not open file.');\n\n die();\n }", "function download_file($path, $type = 'application/octet-stream', $name = '', $force_download = false) {\n if(!is_readable($path)) {\n return false;\n } // if\n \n $filename = trim($name) == '' ? basename($path) : trim($name);\n return download_contents(file_get_contents($path), $type, $filename, filesize($path), $force_download);\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "private function sendFile($filename, $content, $type) {\n\t\tif ($type === 'unknown') {\n\t\t\treturn;\n\t\t}\n\n\t\t$content_type = '';\n\t\tif ($type === 'opml') {\n\t\t\t$content_type = 'application/xml';\n\t\t} elseif ($type === 'json_feed' || $type === 'json_starred') {\n\t\t\t$content_type = 'application/json';\n\t\t}\n\n\t\theader('Content-Type: ' . $content_type . '; charset=utf-8');\n\t\theader('Content-disposition: attachment; filename=' . $filename);\n\t\tprint($content);\n\t}", "function downloadFile($file, $name, $mime_type='')\n{\n /*\n This function takes a path to a file to output ($file), the filename that the browser will see ($name) and the MIME type of the file ($mime_type, optional).\n */\n \n //Check the file premission\n if(!is_readable($file)) die('File not found or inaccessible!');\n \n $size = filesize($file);\n $name = rawurldecode($name);\n \n /* Figure out the MIME type | Check in array */\n $known_mime_types=array(\n \t\"pdf\" => \"application/pdf\",\n \t\"txt\" => \"text/plain\",\n \t\"html\" => \"text/html\",\n \t\"htm\" => \"text/html\",\n\t\"exe\" => \"application/octet-stream\",\n\t\"zip\" => \"application/zip\",\n\t\"doc\" => \"application/msword\",\n\t\"xls\" => \"application/vnd.ms-excel\",\n\t\"ppt\" => \"application/vnd.ms-powerpoint\",\n\t\"gif\" => \"image/gif\",\n\t\"png\" => \"image/png\",\n\t\"jpeg\"=> \"image/jpg\",\n\t\"jpg\" => \"image/jpg\",\n\t\"php\" => \"text/plain\"\n );\n \n if($mime_type==''){\n\t $file_extension = strtolower(substr(strrchr($file,\".\"),1));\n\t if(array_key_exists($file_extension, $known_mime_types)){\n\t\t$mime_type=$known_mime_types[$file_extension];\n\t } else {\n\t\t$mime_type=\"application/force-download\";\n\t }\n }\n \n //turn off output buffering to decrease cpu usage\n @ob_end_clean(); \n \n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n \n /* The three lines below basically make the \n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n \n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE']))\n {\n\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n\tlist($range) = explode(\",\",$range,2);\n\tlist($range, $range_end) = explode(\"-\", $range);\n\t$range=intval($range);\n\tif(!$range_end) {\n\t\t$range_end=$size-1;\n\t} else {\n\t\t$range_end=intval($range_end);\n\t}\n\t/*\n\t------------------------------------------------------------------------------------------------------\n\t//This application is developed by www.webinfopedia.com\n\t//visit www.webinfopedia.com for PHP,Mysql,html5 and Designing tutorials for FREE!!!\n\t------------------------------------------------------------------------------------------------------\n \t*/\n\t$new_length = $range_end-$range+1;\n\theader(\"HTTP/1.1 206 Partial Content\");\n\theader(\"Content-Length: $new_length\");\n\theader(\"Content-Range: bytes $range-$range_end/$size\");\n } else {\n\t$new_length=$size;\n\theader(\"Content-Length: \".$size);\n }\n \n /* Will output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r'))\n {\n\tif(isset($_SERVER['HTTP_RANGE']))\n\tfseek($file, $range);\n \n\twhile(!feof($file) && \n\t\t(!connection_aborted()) && \n\t\t($bytes_send<$new_length)\n\t )\n\t{\n\t\t$buffer = fread($file, $chunksize);\n\t\tprint($buffer); //echo($buffer); // can also possible\n\t\tflush();\n\t\t$bytes_send += strlen($buffer);\n\t}\n fclose($file);\n } else\n //If no permissiion\n die('Error - can not open file.');\n //die\ndie();\n}", "protected static function get_mime_type($extension = \\null)\n {\n }", "function output_file($Source_File, $Download_Name, $mime_type='')\n{\nif(!is_readable($Source_File)) die('File not found or inaccessible!');\n \n$size = filesize($Source_File);\n$Download_Name = rawurldecode($Download_Name);\n \n/* Figure out the MIME type (if not specified) */\n$known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"csv\" => \"application/csv\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n);\n \nif($mime_type==''){\n $file_extension = strtolower(substr(strrchr($Source_File,\".\"),1));\n if(array_key_exists($file_extension, $known_mime_types)){\n $mime_type=$known_mime_types[$file_extension];\n } else {\n $mime_type=\"application/force-download\";\n };\n};\n \n@ob_end_clean(); //off output buffering to decrease Server usage\n \n// if IE, otherwise Content-Disposition ignored\nif(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \nheader('Content-Type: ' . $mime_type);\nheader('Content-Disposition: attachment; filename=\"'.$Download_Name.'\"');\nheader(\"Content-Transfer-Encoding: binary\");\nheader('Accept-Ranges: bytes');\n \nheader(\"Cache-control: private\");\nheader('Pragma: private');\nheader(\"Expires: Thu, 26 Jul 2012 05:00:00 GMT\");\n \n// multipart-download and download resuming support\nif(isset($_SERVER['HTTP_RANGE']))\n{\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if(!$range_end) {\n $range_end=$size-1;\n } else {\n $range_end=intval($range_end);\n }\n \n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n} else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n}\n \n/* output the file itself */\n$chunksize = 1*(1024*1024); //you may want to change this\n$bytes_send = 0;\nif ($Source_File = fopen($Source_File, 'r'))\n{\n if(isset($_SERVER['HTTP_RANGE']))\n fseek($Source_File, $range);\n \n while(!feof($Source_File) &&\n (!connection_aborted()) &&\n ($bytes_send<$new_length)\n )\n {\n $buffer = fread($Source_File, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\nfclose($Source_File);\n} else die('Error - can not open file.');\n \ndie();\n}", "public function download_file($path){\t\n\t\t// Must be fresh start\n\t\tif( headers_sent() )\n\t\tdie('Headers Sent');\n\t\t// Required for some browsers\n\t\tif(ini_get('zlib.output_compression'))\n\t\tini_set('zlib.output_compression', 'Off');\n\t\t// File Exists?\n\t\tif(file_exists($path)){\n\t\t\t// Parse Info / Get Extension\n\t\t\t$fsize = filesize($path);\n\t\t\t$path_parts = pathinfo($path);\n\t\t\t$ext = strtolower($path_parts[\"extension\"]);\n\t\t\t// Determine Content Type\n\t\t\tswitch($ext){\t\t\t \n\t\t\t case \"zip\": $ctype=\"application/zip\"; break;\n\t\t\t case \"doc\": $ctype=\"application/msword\"; break;\n\t\t\t case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\t\t \n\t\t\t case \"gif\": $ctype=\"image/gif\"; break;\n\t\t\t case \"png\": $ctype=\"image/png\"; break;\n\t\t\t case \"jpeg\":\n\t\t\t case \"jpg\": $ctype=\"image/jpg\"; break;\n\t\t\t default: $ctype=\"application/force-download\";\n\t\t\t}\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: $ctype\");\n\t\t\t$file_name = basename($path);\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".$file_name.\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$fsize);\n\t\t\tob_clean();\n\t\t\tflush();\n\t\t\treadfile( $path );\n\t\t}else{\n\t\t\tdie('File Not Found');\n\t\t}\n\t}", "public function download_file($path){\t\n\t\t// Must be fresh start\n\t\tif( headers_sent() )\n\t\tdie('Headers Sent');\n\t\t// Required for some browsers\n\t\tif(ini_get('zlib.output_compression'))\n\t\tini_set('zlib.output_compression', 'Off');\n\t\t// File Exists?\n\t\tif(file_exists($path)){\n\t\t\t// Parse Info / Get Extension\n\t\t\t$fsize = filesize($path);\n\t\t\t$path_parts = pathinfo($path);\n\t\t\t$ext = strtolower($path_parts[\"extension\"]);\n\t\t\t// Determine Content Type\n\t\t\tswitch($ext){\t\t\t \n\t\t\t case \"zip\": $ctype=\"application/zip\"; break;\n\t\t\t case \"doc\": $ctype=\"application/msword\"; break;\n\t\t\t case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\t\t \n\t\t\t case \"gif\": $ctype=\"image/gif\"; break;\n\t\t\t case \"png\": $ctype=\"image/png\"; break;\n\t\t\t case \"jpeg\":\n\t\t\t case \"jpg\": $ctype=\"image/jpg\"; break;\n\t\t\t default: $ctype=\"application/force-download\";\n\t\t\t}\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: $ctype\");\n\t\t\t$file_name = basename($path);\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".$file_name.\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$fsize);\n\t\t\tob_clean();\n\t\t\tflush();\n\t\t\treadfile( $path );\n\t\t}else{\n\t\t\tdie('File Not Found');\n\t\t}\n\t}", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "function output_file($file, $name, $mime_type = '') {\r\n if (!is_readable($file))\r\n die('File not found or inaccessible!');\r\n\r\n $size = filesize($file);\r\n $name = rawurldecode($name);\r\n\r\n /* Figure out the MIME type (if not specified) */\r\n $known_mime_types = array(\r\n \"pdf\" => \"application/pdf\",\r\n \"txt\" => \"text/plain\",\r\n \"html\" => \"text/html\",\r\n \"htm\" => \"text/html\",\r\n \"exe\" => \"application/octet-stream\",\r\n \"zip\" => \"application/zip\",\r\n \"doc\" => \"application/msword\",\r\n \"xls\" => \"application/vnd.ms-excel\",\r\n \"ppt\" => \"application/vnd.ms-powerpoint\",\r\n \"gif\" => \"image/gif\",\r\n \"png\" => \"image/png\",\r\n \"jpeg\" => \"image/jpg\",\r\n \"jpg\" => \"image/jpg\",\r\n \"php\" => \"text/plain\"\r\n );\r\n\r\n if ($mime_type == '') {\r\n $file_extension = strtolower(substr(strrchr($file, \".\"), 1));\r\n if (array_key_exists($file_extension, $known_mime_types)) {\r\n $mime_type = $known_mime_types[$file_extension];\r\n } else {\r\n $mime_type = \"application/force-download\";\r\n };\r\n };\r\n\r\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\r\n // required for IE, otherwise Content-Disposition may be ignored\r\n if (ini_get('zlib.output_compression'))\r\n ini_set('zlib.output_compression', 'Off');\r\n\r\n header('Content-Type: ' . $mime_type);\r\n header('Content-Disposition: attachment; filename=\"' . $name . '\"');\r\n header(\"Content-Transfer-Encoding: binary\");\r\n header('Accept-Ranges: bytes');\r\n\r\n /* The three lines below basically make the \r\n download non-cacheable */\r\n header(\"Cache-control: private\");\r\n header('Pragma: private');\r\n\r\n // multipart-download and download resuming support\r\n if (isset($_SERVER['HTTP_RANGE'])) {\r\n list($a, $range) = explode(\"=\", $_SERVER['HTTP_RANGE'], 2);\r\n list($range) = explode(\",\", $range, 2);\r\n list($range, $range_end) = explode(\"-\", $range);\r\n $range = intval($range);\r\n if (!$range_end) {\r\n $range_end = $size - 1;\r\n } else {\r\n $range_end = intval($range_end);\r\n }\r\n\r\n $new_length = $range_end - $range + 1;\r\n header(\"HTTP/1.1 206 Partial Content\");\r\n header(\"Content-Length: $new_length\");\r\n header(\"Content-Range: bytes $range-$range_end/$size\");\r\n } else {\r\n $new_length = $size;\r\n header(\"Content-Length: \" . $size);\r\n }\r\n\r\n /* output the file itself */\r\n $chunksize = 1 * (1024 * 1024); //you may want to change this\r\n $bytes_send = 0;\r\n if ($file = fopen($file, 'r')) {\r\n if (isset($_SERVER['HTTP_RANGE']))\r\n fseek($file, $range);\r\n\r\n while (!feof($file) &&\r\n (!connection_aborted()) &&\r\n ($bytes_send < $new_length)\r\n ) {\r\n $buffer = fread($file, $chunksize);\r\n print($buffer); //echo($buffer); // is also possible\r\n flush();\r\n $bytes_send += strlen($buffer);\r\n }\r\n fclose($file);\r\n unlink($file);\r\n } else\r\n die('Error - can not open file.');\r\n\r\n die();\r\n }", "public function download_file($path = '', $filename = '')\n {\n if ($path != '' && $filename != '')\n {\n $file = $path . '/' . $filename;\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $file_mime_type = finfo_file($finfo, $file);\n $len = filesize($file); // Calculate File Size \n ob_clean();\n ob_start();\n if (headers_sent())\n {\n echo 'HTTP header already sent';\n }\n else if (!is_readable($file))\n {\n header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');\n echo 'File not readable';\n }\n else\n {\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Type:pplication/octet-stream\"); // Send type of file\n $header = \"Content-Disposition: attachment; filename=$filename;\"; // Send File Name\n header($header);\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Length: \" . $len); // Send File Size \n readfile($file);\n }\n }\n }", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "function downloadPhoto()\n{\n if (!empty($_FILES['file-photo']['name']) || !empty($_POST['post-photo-link'])) {\n if (!empty($_FILES['file-photo']['name'])) {\n $file_name = $_FILES['file-photo']['name'];\n $file_path = __DIR__ . '/uploads/';\n move_uploaded_file($_FILES['file-photo']['tmp_name'], $file_path . $file_name);\n return $file_name;\n } else {\n $url = $_POST['post-photo-link'];\n $file_name = basename($url);\n $file = file_get_contents($url);\n $ext = pathinfo($url, PATHINFO_EXTENSION);\n file_put_contents(__DIR__ . '/uploads/' . $file_name . '.' . $ext, $file);\n return $file_name;\n }\n }\n}", "public function file($file_path = null, $content_type = null, $cache_type = null, $cache_control = null)\n {\n // If null is passed then return the current file value\n // otherwise if a blank string then clear the current file\n // and return this Response object.\n if ($file_path === null) {\n return $this->response_file;\n } elseif ($file_path === '') {\n $this->response_file = null;\n return $this;\n }\n\n // Validate that the file exists\n if (!is_file($file_path)) {\n throw new \\Exception(sprintf('[%s->%s()] was called for a file that does not exist: %s', __CLASS__, __FUNCTION__, $file_path));\n }\n\n // Determine the Mime-type to send if not specified as a parameter\n if ($content_type === null) {\n $content_type = $this->fileTypeToMimeType($file_path);\n }\n\n // Set the 'Content-Type' Responder Header or if a 'Download' file is\n // specified then set Responder Headers so that the browswer will prompt\n // to download the file.\n if ($content_type === 'download' || $content_type === 'application/octet-stream') {\n // Get the file name and replace any double-quotes.\n // Note - [basename()] is not used because it doesn't always\n // work in some environments (often Linux or Unix) for Unicode\n // Characters unless calling [setlocale()]. Since the Locale\n // is not known this method is more reliable.\n // $file_name = str_replace('\"', '', basename($file_path));\n $data = explode(DIRECTORY_SEPARATOR, realpath($file_path));\n $file_name = $data[count($data)-1];\n\n // Headers [ 'Content-Description', 'Content-Type', 'Content-Disposition' ]\n // are related to the download while headers [ 'Cache-Control', 'Pragma', 'Expires' ]\n // are related to caching. These caching headers are similar to what is sent\n // from noCache() but vary slightly for 'Cache-Control'.\n $this\n ->header('Content-Description', 'File Transfer')\n ->header('Content-Type', 'application/octet-stream')\n ->header('Content-Disposition', 'attachment; filename=\"' . $file_name . '\"')\n ->header('Cache-Control', 'must-revalidate')\n ->header('Pragma', 'no-cache')\n ->header('Expires', '-1');\n } else {\n $this->contentType($content_type);\n }\n\n // If a cache type is specified then calculate either a\n // hash or last modified date from the file.\n if ($cache_type !== null) {\n switch (strtolower($cache_type)) {\n case 'etag:md5':\n $this->etag(md5_file($file_path));\n break;\n case 'etag:sha1':\n $this->etag(sha1_file($file_path));\n break;\n case 'last-modified':\n $this->lastModified(filemtime($file_path));\n break;\n default:\n throw new \\Exception('Invalid parameter for option $cache_type: ' . $cache_type);\n }\n }\n\n // Set a 'Cache-Control' header if one is defined from this function\n if ($cache_control !== null) {\n $this->cacheControl($cache_control);\n }\n\n // Set a private property to the file path and return the Response Object\n $this->response_file = $file_path;\n return $this;\n }", "function instant_download($product_id, $ftype=null) {\n \n if (!$filetype = GetReq('filetype'))\n $filetype = $ftype ? $ftype : $this->ftype;\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if ((GetSessionParam('FORMSUBMITED')) || GetSessionParam(\"CODESUBMITED\")) {\t \n \n $file = $this->wherethefileis . $product_id . $this->file_epithema . $filetype;\t \n\t //$file = \"c:\\\\php\\\\webos2\\\\projects\\\\re-coding-official\\\\demo\\\\delphi2java_shareware.zip\";\n\t //echo \"DOWNLOAD:\",$file;\n\t //die();\n $downloadfile = new DOWNLOADFILE($file);\n\t \n /*$this->tell_by_mail(\"demo file downloaded\",\n\t '[email protected]',\n\t\t '[email protected]',\n\t\t\t\t\t\t $file);\t\n\t\t\t\t\t\t \n $this->tell_by_sms(\"$product_id demo file downloaded.\");*/\t\n\t\t \n\t //inform bt mail and sms\n\t $this->send_downloaded_mail($product_id);\t\t\t\t\t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n\t\t$m = paramload('RCDOWNLOAD','error');\t\n\t\t$ff = $this->prpath.$m;\n\t\tif (is_file($ff)) {\n\t\t $ret = file_get_contents($ff);\n\t\t}\n\t\telse\n\t\t $ret = $m; //plain text\t\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t }\n\t else\n\t $ret = \"Prohibited area!\"; \n\t\t \t \n\t return ($ret);\n\t \n\t \n\t //use download2.lib\n\t //$dFile = new Download_file($this->prpath . paramload('RCDOWNLOAD','dirsource') , $product_id . $this->ftype);\n }", "function provide_file($filename) {\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n $MODE = 'txt';\n $attachment = \"attachment; \";\n if ($ext != '') {\n $MODE = $ext;\n }\n switch ($MODE) {\n case \"bz2\": $ctype=\"application/x-bzip2\"; break;\n case \"css\": $ctype=\"text/css\"; break;\n case \"gz\": $ctype=\"application/x-gzip\"; break;\n case \"gzip\": $ctype=\"application/x-gzip\"; break;\n case \"java\": $ctype=\"text/x-java-source\"; $attachment=\"\"; break;\n case \"tgz\": $ctype=\"application/x-compressed\"; break;\n case \"pdf\": $ctype=\"application/pdf\"; $attachment=\"\"; break;\n case \"zip\": $ctype=\"application/zip\"; break;\n case \"doc\": $ctype=\"application/msword\"; break;\n case \"docx\": $ctype=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"; break;\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\n case \"xlsx\": $ctype=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break;\n case \"pptx\": $ctype=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"; break;\n case \"svg\": $ctype=\"image/svg+xml\"; $attachment=\"\"; break;\n case \"gif\": $ctype=\"image/gif\"; $attachment=\"\"; break;\n case \"png\": $ctype=\"image/png\"; $attachment=\"\"; break;\n case \"jpe\": case \"jpeg\":\n case \"jpg\": $ctype=\"image/jpg\"; $attachment=\"\"; break;\n case \"sql\":\n case \"txt\": $ctype=\"text/plain\"; $attachment=\"\"; break;\n case \"htm\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"html\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"htmls\": $ctype=\"text/html\"; $attachment=\"\"; break;\n default: $ctype=\"application/octet-stream\";\n }\n\n header(\"Content-Type: $ctype\");\n header('Content-Disposition: '.$attachment.'filename=\"'.basename($filename).'\"');\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\n echo file_get_contents($filename);\n\n }", "function get_mime($file) {\n\t// Since in php 5.3 this is a mess...\n\t/*if(function_exists('finfo_open')) {\n\t\treturn finfo_file(finfo_open(FILEINFO_MIME_TYPE), $file); \n\t} else {\n\t\tif(function_exists('mime_content_type')) {\n\t\t\treturn mime_content_type($file);\n\t\t} else {\n\t\t\treturn \"application/force-download\";\n\t\t}\n\t}*/\n\t$mimetypes = array(\n\t\t\"php\"\t=> \"application/x-php\",\n\t\t\"js\"\t=> \"application/x-javascript\",\n\t\t\n\t\t\"css\"\t=> \"text/css\",\n\t\t\"html\"\t=> \"text/html\",\n\t\t\"htm\"\t=> \"text/html\",\n\t\t\"txt\"\t=> \"text/plain\",\n\t\t\"xml\"\t=> \"text/xml\",\n\t\t\n\t\t\"bmp\"\t=> \"image/bmp\",\n\t\t\"gif\"\t=> \"image/gif\",\n\t\t\"jpg\"\t=> \"image/jpeg\",\n\t\t\"png\"\t=> \"image/png\",\n\t\t\"tiff\"\t=> \"image/tiff\",\n\t\t\"tif\"\t=> \"image/tif\",\n\t);\n\t$file_mime = $mimetypes[pathinfo($file, PATHINFO_EXTENSION)];\n\tif(check_value($file_mime)) {\n\t\treturn $file_mime;\n\t} else {\n\t\treturn \"application/force-download\";\n\t}\n}", "function dahz_attachment() {\n\n\t$file = wp_get_attachment_url();\n\t$mime = get_post_mime_type();\n\t$attachment = '';\n\n\t$mime_type = false !== strpos( $mime, '/' ) ? explode( '/', $mime ) : array( $mime, '' );\n\n\t/* Loop through each mime type. If a function exists for it, call it. Allow users to filter the display. */\n\tforeach ( $mime_type as $type ) {\n\t\tif ( function_exists( \"dahz_{$type}_attachment\" ) )\n\t\t\t$attachment = call_user_func( \"dahz_{$type}_attachment\", $mime, $file );\n\n\t\t$attachment = apply_filters( \"dahz_{$type}_attachment\", $attachment );\n\t}\n\n\techo apply_filters( 'dahz_attachment', $attachment );\n}", "public function stream( $mime_type = null ) {\n\t\tlist( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type );\n\n\t\tswitch ( $mime_type ) {\n\t\t\tcase 'image/png':\n\t\t\t\theader( 'Content-Type: image/png' );\n\t\t\t\treturn imagepng( $this->image );\n\t\t\tcase 'image/gif':\n\t\t\t\theader( 'Content-Type: image/gif' );\n\t\t\t\treturn imagegif( $this->image );\n\t\t\tdefault:\n\t\t\t\theader( 'Content-Type: image/jpeg' );\n\t\t\t\treturn imagejpeg( $this->image, null, $this->get_quality() );\n\t\t}\n\t}", "function output_file($file, $name, $mime_type='')\n{\n if(!is_readable($file)) die('File not found or inaccessible!');\n \n $size = filesize($file);\n $name = rawurldecode($name);\n \n /* Figure out the MIME type (if not specified) */\n $known_mime_types=array(\n \t\"pdf\" => \"application/pdf\",\n \t\"txt\" => \"text/plain\",\n \t\"html\" => \"text/html\",\n \t\"htm\" => \"text/html\",\n\t\"exe\" => \"application/octet-stream\",\n\t\"zip\" => \"application/zip\",\n\t\"doc\" => \"application/msword\",\n\t\"xls\" => \"application/vnd.ms-excel\",\n\t\"ppt\" => \"application/vnd.ms-powerpoint\",\n\t\"gif\" => \"image/gif\",\n\t\"png\" => \"image/png\",\n\t\"jpeg\"=> \"image/jpg\",\n\t\"jpg\" => \"image/jpg\",\n\t\"php\" => \"text/plain\",\n \"xml\" => \"text/xml\",\n \"csv\" => \"text/csv\"\n );\n \n if($mime_type==''){\n\t $file_extension = strtolower(substr(strrchr($file,\".\"),1));\n\t if(array_key_exists($file_extension, $known_mime_types)){\n\t\t$mime_type=$known_mime_types[$file_extension];\n\t } else {\n\t\t$mime_type=\"application/force-download\";\n\t };\n };\n \n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n \n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n \n /* The three lines below basically make the \n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n \n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE']))\n {\n\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n\tlist($range) = explode(\",\",$range,2);\n\tlist($range, $range_end) = explode(\"-\", $range);\n\t$range=intval($range);\n\tif(!$range_end) {\n\t\t$range_end=$size-1;\n\t} else {\n\t\t$range_end=intval($range_end);\n\t}\n \n\t$new_length = $range_end-$range+1;\n\theader(\"HTTP/1.1 206 Partial Content\");\n\theader(\"Content-Length: $new_length\");\n\theader(\"Content-Range: bytes $range-$range_end/$size\");\n } else {\n\t$new_length=$size;\n\theader(\"Content-Length: \".$size);\n }\n \n /* output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r'))\n {\n\tif(isset($_SERVER['HTTP_RANGE']))\n\tfseek($file, $range);\n \n\twhile(!feof($file) && \n\t\t(!connection_aborted()) && \n\t\t($bytes_send<$new_length)\n\t )\n\t{\n\t\t$buffer = fread($file, $chunksize);\n\t\tprint($buffer); ////echo($buffer); // is also possible\n\t\tflush();\n\t\t$bytes_send += strlen($buffer);\n\t}\n fclose($file);\n } else die('Error - can not open file.');\n \ndie();\n}", "function mimeType ($s_extension) {\n\t//you can pass a full filename if you want to be lazy (saves extra code elsewhere)\n\tswitch (pathinfo (strtolower ($s_extension), PATHINFO_EXTENSION)) {\n\t\t//images\n\t\tcase 'gif':\t\t\t\treturn 'image/gif';\t\t\tbreak;\n\t\tcase 'jpg': case 'jpeg': \t\treturn 'image/jpeg';\t\t\tbreak;\n\t\tcase 'png':\t\t\t\treturn 'image/png';\t\t\tbreak;\n\t\t//code\n\t\tcase 'asp':\t\t\t\treturn 'text/asp';\t\t\tbreak;\n\t\tcase 'css':\t\t\t\treturn 'text/css';\t\t\tbreak;\n\t\tcase 'html':\t\t\t\treturn 'text/html';\t\t\tbreak;\n\t\tcase 'js':\t\t\t\treturn 'application/javascript';\tbreak;\n\t\tcase 'php':\t\t\t\treturn 'application/x-httpd-php';\tbreak;\n\t\t//documents\n\t\tcase 'pdf':\t\t\t\treturn 'application/pdf';\t\tbreak;\n\t\tcase 'txt': case 'do': case 'log':\treturn 'text/plain';\t\t\tbreak;\n\t\tcase 'rem':\t\t\t\treturn 'text/remarkable';\t\tbreak;\n\t\t//downloads\n\t\tcase 'exe': case 'dmg':\t\t\treturn 'application/octet-stream';\tbreak;\n\t\tcase 'sh':\t\t\t\treturn 'application/x-sh';\t\tbreak;\n\t\tcase 'zip':\t\t\t\treturn 'application/zip';\t\tbreak;\n\t\t//media\n\t\tcase 'mp3':\t\t\t\treturn 'audio/mpeg';\t\t\tbreak;\n\t\tcase 'oga':\t\t\t\treturn 'audio/ogg';\t\t\tbreak;\n\t\tcase 'ogv':\t\t\t\treturn 'video/ogg';\t\t\tbreak;\n\t\t//fonts\n\t\tcase 'ttf':\t\t\t\treturn 'font/ttf';\t\t\tbreak;\n\t\tcase 'otf':\t\t\t\treturn 'font/otf';\t\t\tbreak;\n\t\tcase 'woff':\t\t\t\treturn 'font/x-woff';\t\t\tbreak;\n\t\tdefault:\t\t\t\treturn 'application/octet-stream';\tbreak;\n\t}\n}", "function send_user_download($type, $content, $userfilename = \"\", $contenttype = \"application/octet-stream\") {\n\t/* If the type is 'file', then use the file size, otherwise use the size of the data to send */\n\t$size = ($type == 'file') ? filesize($content) : strlen($content);\n\n\t/* If the filename to pass to the user is empty, assume it to be the filename being read. */\n\t$name = basename((($type == 'file') && empty($userfilename)) ? $content : $userfilename);\n\n\t/* Cannot determine the filename, so bail. */\n\tif (empty($name)) {\n\t\texit;\n\t}\n\n\t/* Send basic download headers */\n\theader(\"Content-Type: {$contenttype}\");\n\theader(\"Content-Length: {$size}\");\n\theader(\"Content-Disposition: attachment; filename=\" . urlencode($name));\n\n\t/* Send cache headers */\n\tif (isset($_SERVER['HTTPS'])) {\n\t\theader('Pragma: ');\n\t\theader('Cache-Control: ');\n\t} else {\n\t\theader(\"Pragma: private\");\n\t\theader(\"Cache-Control: private, must-revalidate\");\n\t}\n\n\t/* Ensure output buffering is off so PHP does not consume\n\t * memory in readfile(). https://redmine.pfsense.org/issues/9239 */\n\twhile (ob_get_level()) {\n\t\t@ob_end_clean();\n\t}\n\n\t/* Send the data to the user */\n\tif ($type == 'file') {\n\t\treadfile($content);\n\t} else {\n\t\techo $content;\n\t}\n\n\t/* Flush any remaining output buffer */\n\t@ob_end_flush();\n\texit;\n}", "function downloadFile( $fullPath ){\r\n if( headers_sent() ) \r\n die('Headers Sent'); \r\n\r\n // Required for some browsers \r\n if(ini_get('zlib.output_compression')) \r\n ini_set('zlib.output_compression', 'Off'); \r\n\r\n // File Exists? \r\n if( file_exists($fullPath) ){ \r\n \r\n // Parse Info / Get Extension \r\n $fsize = filesize($fullPath); \r\n $path_parts = pathinfo($fullPath); \r\n $ext = strtolower($path_parts[\"extension\"]); \r\n \r\n // Determine Content Type \r\n switch ($ext) { \r\n case \"pdf\": $ctype=\"application/pdf\"; break; \r\n case \"exe\": $ctype=\"application/octet-stream\"; break; \r\n case \"zip\": $ctype=\"application/zip\"; break; \r\n case \"doc\": $ctype=\"application/msword\"; break; \r\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break; \r\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break; \r\n case \"gif\": $ctype=\"image/gif\"; break; \r\n case \"png\": $ctype=\"image/png\"; break; \r\n case \"jpeg\": \r\n case \"jpg\": $ctype=\"image/jpg\"; break; \r\n default: $ctype=\"application/force-download\"; \r\n } \r\n\r\n header(\"Pragma: public\"); // required \r\n header(\"Expires: 0\"); \r\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\"); \r\n header(\"Cache-Control: private\",false); // required for certain browsers \r\n header(\"Content-Type: $ctype\"); \r\n header(\"Content-Disposition: attachment; filename=\\\"\".basename($fullPath).\"\\\";\" ); \r\n header(\"Content-Transfer-Encoding: binary\"); \r\n header(\"Content-Length: \".$fsize); \r\n ob_clean(); \r\n flush(); \r\n readfile( $fullPath ); \r\n\r\n } else \r\n die('File Not Found'); \r\n\r\n}", "function send_file_to_browser($download_name, $file_name) {\r\n\r\n // must be fresh start\r\n if(headers_sent())\r\n die('Headers Sent'); \r\n\t\r\n // file must exist\r\n if (!file_exists($file_name)) {\r\n die('file does not exist!');\r\n }\r\n\r\n $path_info = pathinfo($file_name);\r\n\r\n // check that extension key exists in array\r\n if (!array_key_exists('extension', $path_info)) {\r\n $path_info['extension'] = '';\r\n }\r\n \r\n // http://en.wikipedia.org/wiki/Mime_type#List_of_common_media_types\r\n switch (strtolower($path_info['extension'])) {\r\n\tcase 'exe':\r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n case 'doc':\r\n\t $mime_type = \"application/msword\";\r\n break;\r\n case 'docx':\r\n $mime_type = \"application/msword\";\r\n break;\r\n case 'gif':\r\n $mime_type = \"image/gif\";\r\n break;\r\n case 'jpg':\r\n $mime_type = \"image/jpg\";\r\n break;\r\n case 'jpeg':\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n case 'png':\r\n $mime_type = \"image/png\";\r\n break;\r\n case 'tiff':\r\n $mime_type = \"image/tiff\";\r\n break;\r\n case 'txt':\r\n $mime_type = \"text/plain\";\r\n break;\r\n case 'csv':\r\n $mime_type = \"text/csv\";\r\n break;\r\n case 'zip':\r\n $mime_type = \"application/zip\";\r\n break;\r\n case 'pdf':\r\n $mime_type = \"application/pdf\";\r\n break;\r\n case 'xls': \r\n\t $mime_type = \"application/vnd.ms-excel\";\r\n break;\r\n case 'ppt': \r\n\t $mime_type = \"application/vnd.ms-powerpoint\";\r\n break;\r\n case 'wav': \r\n\t $mime_type = \"audio/vnd.wave\";\r\n break;\r\n case 'mp3': \r\n\t $mime_type = \"audio/mpeg\";\r\n break;\t\t\t\t\t\r\n case 'mpeg': \r\n\t $mime_type = \"video/mpeg\";\r\n break; \r\n case 'mp4': \r\n\t $mime_type = \"video/mp4\";\r\n break; \r\n case 'ogg': \r\n\t $mime_type = \"video/ogg\";\r\n break; \r\n case 'mov': \r\n\t $mime_type = \"video/quicktime\";\r\n break; \r\n case 'webm': \r\n\t $mime_type = \"video/webm\";\r\n break; \r\n case 'mkv': \r\n\t $mime_type = \"video/x-matroska\";\r\n break; \r\n case 'wmv': \r\n\t $mime_type = \"video/x-ms-wmv\";\r\n break; \r\n case 'flv': \r\n\t $mime_type = \"video/x-flv\";\r\n break; \r\n default: \r\n $mime_type = \"application/force-download\";\r\n break;\r\n }\r\n\r\n header('Content-Description: File Transfer');\r\n header('Content-Type: '.$mime_type);\r\n header('Content-Disposition: attachment;filename=\"'.urlencode($download_name).'\"');\r\n header('Content-Transfer-Encoding: binary');\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Content-Length: '.filesize($file_name));\r\n \r\n @ob_clean();\r\n flush();\r\n readfile($file_name);\r\n exit;\r\n}", "function downloadMessageAsFile($storeid, $entryid, $fileType) {\n\t\t// Open the store\n\t\t$store = $GLOBALS[\"mapisession\"]->openMessageStore(hex2bin($storeid));\n\n\t\tif($store) {\n\t\t\t// Open the message\n\t\t\t$message = mapi_msgstore_openentry($store, hex2bin($entryid));\n\n\t\t\t// Decode smime signed messages on this message\n\t\t\tparse_smime($store, $message);\n\n\t\t\tif($message) {\n\t\t\t\t// get message properties.\n\t\t\t\t$messageProps = mapi_getprops($message, array(PR_SUBJECT));\n\n\t\t\t\tswitch($fileType){\n\t\t\t\t\tcase \"eml\":\n\t\t\t\t\t\t// Save e-mail message as .eml format\n\t\t\t\t\t\t$addrBook = $GLOBALS[\"mapisession\"]->getAddressbook();\n\t\t\t\t\t\t// Read the message as RFC822-formatted e-mail stream.\n\t\t\t\t\t\t$stream = mapi_inetmapi_imtoinet($GLOBALS[\"mapisession\"]->getSession(), $addrBook, $message, array());\n\t\t\t\t\t\t$extension = \".eml\";\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn _(\"Can't save this message as a file\") . \".\"; // return error message\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif(mapi_last_hresult() == NOERROR) {\n\t\t\t\t\t// Set filename for saving email.\n\t\t\t\t\tif($messageProps[PR_SUBJECT] && $messageProps[PR_SUBJECT] != \"\") {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Maximum no of filename characters allowed by Firefox is 206.\n\t\t\t\t\t\t * Firefox wil show an error \"The file name is invalid.\",\n\t\t\t\t\t\t * while saving a file having filename greater than on 206 characters.\n\t\t\t\t\t\t * So here I set limit of maximum 200 characters.\n\t\t\t\t\t\t */\n\t\t\t\t\t\t$filename = substr($messageProps[PR_SUBJECT], 0, 200) . $extension;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filename = _(\"Untitled\") . $extension;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the headers\n\t\t\t\t\theader(\"Pragma: public\");\n\t\t\t\t\theader(\"Expires: 0\"); // set expiration time\n\t\t\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\" . browserDependingHTTPHeaderEncode($filename) . \"\\\"\");\n\t\t\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\n\t\t\t\t\t// Set content type header\n\t\t\t\t\theader(\"Content-Type: \" . \"application/octet-stream\");\n\n\t\t\t\t\t$stat = mapi_stream_stat($stream);\n\n\t\t\t\t\t// Set the file length\n\t\t\t\t\theader(\"Content-Length: \" . $stat[\"cb\"]);\n\n\t\t\t\t\t// Read whole message and echo it.\n\t\t\t\t\tfor($i = 0; $i < $stat[\"cb\"]; $i += BLOCK_SIZE) {\n\t\t\t\t\t\t// Print stream\n\t\t\t\t\t\techo mapi_stream_read($stream, BLOCK_SIZE);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\t\t// NO Error\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn _(\"Unable to Save the Message\") . \".\";\t\t// return error\n\t}", "public function url($file, $type = NULL);", "private function get_file(&$remote_file, &$post_name, &$mime_type) {\r\n\t\t$tmp_name = $tmp_type = null;\r\n\t\t$tmp_file = tempnam(\"temp\", \"lc_\");\r\n\t\t$tmp_fp = fopen($tmp_file, \"w\");\r\n\t\t$mem_fp = fopen(\"php://temp\", \"w+\");\r\n\t\t$this->tmp_files[] = $tmp_file;\r\n\t\t$tmp_options = array(\r\n\t\t\t\"CURLOPT_SSL_VERIFYPEER\" => true,\t\t\t\t\t\t\t\t\t\t\t# (ssl) enable ca root certificate checking\r\n\t\t\t\"CURLOPT_SSL_VERIFYHOST\" => 2,\t\t\t\t\t\t\t\t\t\t\t\t# (ssl) enable hostname checking in ssl certification\r\n\t\t\t\"CURLOPT_SSLVERSION\" => 6,\t\t\t\t\t\t\t\t\t\t\t\t\t# (ssl) default using tlsv1_2 instead of sslv2 and sslv3 for better security\r\n\t\t\t\"CURLOPT_CAINFO\" => __DIR__.DIRECTORY_SEPARATOR.\"cacert.pem\",\t\t\t\t# (ssl) updated ca root certificate (revision 2017-01-18 downloaded from https://curl.haxx.se/docs/caextract.html)\r\n\t\t\t\"CURLOPT_PROTOCOLS\" => CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP,\t# (request) allow specified protocols only\r\n\t\t\t\"CURLOPT_ENCODING\" => \"\",\t\t\t\t\t\t\t\t\t\t\t\t\t# (response) enable all supported compression\r\n\t\t\t\"CURLOPT_FAILONERROR\" => false,\t\t\t\t\t\t\t\t\t\t\t\t# (response) always returns response even if response is http 4xx-5xx error\r\n\t\t\t\"CURLOPT_RETURNTRANSFER\" => true,\t\t\t\t\t\t\t\t\t\t\t# (response) always returns response as string instead of direct output\r\n\t\t\t\"CURLOPT_FOLLOWLOCATION\" => true,\t\t\t\t\t\t\t\t\t\t\t# (redirect) enable http 3xx redirection\r\n\t\t\t\"CURLOPT_MAXREDIRS\" => 5,\t\t\t\t\t\t\t\t\t\t\t\t\t# (redirect) maximum number of http 3xx redirection\r\n\t\t\t\"CURLOPT_AUTOREFERER\" => true,\t\t\t\t\t\t\t\t\t\t\t\t# (redirect) automatically set referer in case of redirection\r\n\t\t\t\"CURLOPT_CONNECTTIMEOUT\" => 30,\t\t\t\t\t\t\t\t\t\t\t\t# (timeout) connection timeout\r\n\t\t\t\"CURLOPT_TIMEOUT\" => 600,\t\t\t\t\t\t\t\t\t\t\t\t\t# (timeout) request timeout\r\n\t\t\t\"CURLOPT_FILE\" => $tmp_fp,\t\t\t\t\t\t\t\t\t\t\t\t\t# (i/o) redirect body output to temp file\r\n\t\t\t\"CURLOPT_WRITEHEADER\" => $mem_fp,\t\t\t\t\t\t\t\t\t\t\t# (i/o) redirect header output to memory file\r\n\t\t);\r\n\t\t# disable ca root certificate checking in curl library before v7.24.0 (bundled openssl version is too old to check or load latest certificate)\r\n\t\t$curl_version = curl_version();\r\n\t\tif (version_compare($curl_version[\"version\"], \"7.24.0\", \"<\")) {\r\n\t\t\t$tmp_options[\"CURLOPT_SSL_VERIFYPEER\"] = false;\r\n\t\t\tunset($tmp_options[\"CURLOPT_CAINFO\"]);\r\n\t\t}\r\n\t\telseif (!file_exists($tmp_options[\"CURLOPT_CAINFO\"])) { unset($tmp_options[\"CURLOPT_CAINFO\"]); }\t\t\t\t\t\t# rename or delete the ca root certificate file in order to use system default\r\n\t\t# downgrade to tlsv1 instead of default action in curl library before v7.34.0 (the default behaviour will use sslv2 or sslv3 even if connection is normally rejected by target nowadays)\r\n\t\tif (version_compare($curl_version[\"version\"], \"7.34.0\", \"<\")) { $tmp_options[\"CURLOPT_SSLVERSION\"] = 1; }\r\n\t\t# begin download\r\n\t\t$tmp_ch = curl_init();\r\n\t\tforeach ($tmp_options as $key => $value) {\r\n\t\t\tif (defined($key)) { curl_setopt($tmp_ch, constant($key), $value); }\r\n\t\t}\r\n\t\tcurl_setopt($tmp_ch, CURLOPT_URL, $remote_file);\r\n\t\tcurl_exec($tmp_ch);\r\n\t\t$http_code = curl_getinfo($tmp_ch, CURLINFO_HTTP_CODE);\r\n\t\t$tmp_type = curl_getinfo($tmp_ch, CURLINFO_CONTENT_TYPE);\r\n\t\tcurl_setopt($tmp_ch, CURLOPT_FILE, fopen(\"php://stdout\", \"w\"));\r\n\t\tcurl_close($tmp_ch);\r\n\t\t# store headers to variable\r\n\t\tfseek($mem_fp, 0);\r\n\t\t$tmp_headers = stream_get_contents($mem_fp);\r\n\t\tfclose($mem_fp);\r\n\t\tfclose($tmp_fp);\r\n\t\tif ($http_code >= 400) { trigger_error(\"server response {$http_code} when trying to access '\".$this->hide_credential($remote_file).\"'\", E_USER_WARNING); }\r\n\t\telse {\r\n\t\t\t# find the best matching file name for downloaded file\r\n\t\t\tif (empty($post_name)) {\r\n\t\t\t\tpreg_match_all(\"/^content-disposition:\\s*[^;]+;.*filename\\s*=\\s*([^;]+)[;\\s]/imsU\", $tmp_headers, $matches);\r\n\t\t\t\tif (!empty($matches[1])) { $tmp_name = trim($matches[1][count($matches[1]) - 1], \" '\\\"\"); }\t\t\t\t\t\t# (name + ext) first priority in http header\r\n\t\t\t\tif (empty($tmp_name)) {\r\n\t\t\t\t\t$pathinfo = pathinfo(parse_url($remote_file, PHP_URL_PATH));\r\n\t\t\t\t\tif (!empty($pathinfo[\"filename\"])) { $tmp_name = $pathinfo[\"filename\"]; }\t\t\t\t\t\t\t\t\t# (name) failover to file name in target url\r\n\t\t\t\t\telse { $tmp_name = pathinfo($tmp_file, PATHINFO_FILENAME); }\t\t\t\t\t\t\t\t\t\t\t\t# (name) lastly use temp file name\r\n\t\t\t\t\tif (!empty($pathinfo[\"extension\"])) { $tmp_name .= \".\".$pathinfo[\"extension\"]; }\t\t\t\t\t\t\t# (ext) find file extension in target url\r\n\t\t\t\t\telseif (!empty($mime_type)) { $tmp_name .= \".\".str_replace(\"/\", \".\", $mime_type); }\t\t\t\t\t\t\t# (ext) failover to specified mime type as extension\r\n\t\t\t\t\telseif (!empty($tmp_type)) { $tmp_name .= \".\".str_replace(\"/\", \".\", $tmp_type); }\t\t\t\t\t\t\t# (ext) failover to content type in http header as descriptive extension\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t# update parameters that are passed by reference only if file has content\r\n\t\t\tif (filesize($tmp_file) > 0) {\r\n\t\t\t\t$remote_file = $tmp_file;\r\n\t\t\t\tif (empty($post_name) && !empty($tmp_name)) { $post_name = $tmp_name; }\r\n\t\t\t\tif (empty($mime_type) && !empty($tmp_type)) { $mime_type = $tmp_type; }\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected static function get_extension($mime_type = \\null)\n {\n }", "public function download(string $url);", "abstract public function getMimeType();", "public function stream($mime_type = \\null)\n {\n }", "function exportFile($file, $filename,$mimetype=\"\", $detectmime=true)\n{\n\tinclude_once(atkconfig(\"atkroot\").\"atk/atkbrowsertools.inc\");\n\t$browser = getBrowserInfo();\n\tif (preg_match(\"/ie/i\", $browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'attachment';\n\t}\n\telse if (preg_match(\"/opera/i\",$browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'inline';\n\t}\n\telse\n\t{\n\t\t$mime = \"application/octet-stream\";\n\t\t$disp = 'attachment';\n\t}\n\tif($mimetype!=\"\") $mime=$mimetype;\n\telse if ($mimetype==\"\" && $detectmime && function_exists('mime_content_type'))\n\t$mime = mime_content_type($file);\n\n\t$fp = @fopen($file,\"rb\");\n\tif ($fp!=NULL)\n\t{\n\t\theader('Content-Type: '. $mime);\n\t\theader(\"Content-Length: \".filesize($file));\n\t\theader('Content-Disposition: '.$disp.'; filename=\"'.$filename.'\"');\n\t\tif(preg_match(\"/ie/i\", $browser[\"browser\"])) header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\tif (($_SERVER[\"SERVER_PORT\"] == \"443\" || $_SERVER['HTTP_X_FORWARDED_PROTO' ]==='https') && preg_match(\"/msie/i\", $_SERVER[\"HTTP_USER_AGENT\"]))\n\t\t{\n\t\t\theader('Pragma: public');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Pragma: no-cache');\n\t\t}\n\t\theader('Expires: 0');\n\n\t\theader(\"Content-Description: File Transfer\");\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\n\t\tfpassthru($fp);\n\t\treturn true;\n\t}\n\treturn false;\n}", "function get_file(){\n extract($this->_url_params);\n /**\n * @var string $file_name\n * @var int $project_id\n */\n $this->load_view(false);\n if(!isset($file_name, $project_id)) goto redirect;\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in AND $project->verify($project_id)){\n $file_type = null;\n switch($file_name){\n case 'SpeciesRelation.txt': $file_type = Constants::EXPORT_SPECIES_RELATION; break;\n case 'DistantMatrix.txt' : $file_type = Constants::EXPORT_DISTANT_MATRIX; break;\n case 'NeighbourTree.jpg' : $file_type = Constants::EXPORT_NEIGHBOUR_TREE; break;\n case 'UPGMATree.jpg' : $file_type = Constants::EXPORT_UPGMA_TREE;\n }\n if($file_type == null) goto redirect;\n $file = $project->export($project_id, $file_type);\n if($file == null){\n redirect:\n $this->redirect(isset($_SERVER['HTTP_REFERER']) ?\n $_SERVER['HTTP_REFERER'] :\n Config::WEB_DIRECTORY . 'projects');\n exit();\n }\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n exit();\n }\n goto redirect;\n }", "function download($filename) {\n if (ini_get('zlib.output_compression')) {\n ini_set('zlib.output_compression', 'Off');\n }\n\n // addition by Jorg Weske\n $file_extension = strtolower(substr(strrchr($filename, \".\"), 1));\n\n if ($filename == \"\") {\n echo \"<html><title>MéxicoX</title><body>ERROR: descarga de archivo NO ESPECIFICADA.</body></html>\";\n exit;\n } elseif (!file_exists($filename)) {\n echo \"<html><title>MéxicoX</title><body>ERROR: Archivo no encontrado.</body></html>\";\n exit;\n }\n $ctype = getContentType($file_extension);\n// print $filename;\n// print '<br>';\n// print $file_extension;\n// print '<br>';\n// print $ctype;\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers \n header(\"Content-Type: $ctype\");\n // change, added quotes to allow spaces in filenames, by Rajkumar Singh\n header(\"Content-Disposition: attachment; filename=\\\"\" . basename($filename) . \"\\\";\");\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Length: \" . filesize($filename));\n readfile(\"$filename\");\n exit();\n}", "function sideload( $url, $post ) {\n\t\tglobal $options;\n\n\t\t$basename = wp_basename( $url );\n\n\t\t/** Code adapted from media_sideload_image {{{ **/\n\t\tif( empty( $url ) )\n\t\t\treturn new WP_Error( array( 'empty-url', \"Empty URL\" ) );\n\n\t\t// Set variables for storage\n\t\t// fix file filename for query strings\n\t\tif( !preg_match( '/[^\\?]+\\.(jpg|jpe|jpeg|gif|png)/i', $url, $matches ) )\n\t\t\treturn new WP_Error( array( 'wrong-extension', \"Not an image file extension\" ) );\n\n\t\t// Download file to temp location\n\t\t$tmp = download_url( $url );\n\n\t\tif ( is_wp_error( $tmp ) ) \n\t\t\treturn $tmp;\n\n\t\t$file_array = array(\n\t\t\t'name' => wp_basename( $matches[0] ),\n\t\t\t'tmp_name' => $tmp\n\t\t);\n\n\t\t// do the validation and storage stuff\n\t\t$attachment_id = media_handle_sideload( $file_array, $post->ID );\n\n\t\t// If error storing permanently, unlink\n\t\tif ( is_wp_error( $attachment_id ) ) {\n\t\t\tunlink( $file_array['tmp_name'] );\n\t\t\treturn $attachment_id;\n\t\t}\n\t\telseif( !$attachment_id ) {\n\t\t\treturn new WP_Error( 'media-handle-sideload-failed', \"media_handle_sideload failed\" );\n\t\t}\n\t\t// }}} end adapted code\n\n\t\treturn $attachment_id;\n\t}", "abstract public function downloadFile(FileData $fileData);", "function emc_download() {\r\n\r\n\tif ( ! class_exists( 'Acf', false ) ) return false;\r\n\r\n\t$html = '';\r\n\tif ( get_field( 'download_files' ) ) {\r\n\r\n\t\twhile ( has_sub_field( 'download_files' ) ) {\r\n\r\n\t\t\t$download = get_sub_field( 'download_file' );\r\n\r\n\t\t\t// Determine icon\r\n\t\t\t$mime = get_post_mime_type( $download[ 'id' ] );\r\n\t\t\tswitch ( $mime ) {\r\n\t\t\t\tcase 'application/pdf':\r\n\t\t\t\t\t$icon = get_stylesheet_directory_uri() . '/img/' . 'pdf.png';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'application/msword':\r\n\t\t\t\t\t$icon = get_stylesheet_directory_uri() . '/img/' . 'word.png';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'application/vnd.ms-excel':\r\n\t\t\t\t\t$icon = get_stylesheet_directory_uri() . '/img/' . 'excel.png';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'application/vnd.ms-powerpoint':\r\n\t\t\t\t\t$icon = get_stylesheet_directory_uri() . '/img/' . 'powerpoint.png';\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$icon = get_stylesheet_directory_uri() . '/img/' . 'download.png';\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$html .= sprintf( '<a href=\"%1$s\" title=\"%2$s\">',\r\n\t\t\t\tesc_url( $download[ 'url' ] ),\r\n\t\t\t\t__( 'Download this file', 'emc' )\r\n\t\t\t);\r\n\t\t\t$html .= '<div class=\"emc-download emc-button\">';\r\n\t\t\t$html .= '<img class=\"emc-download-icon\" src=\"' . $icon . '\"/>';\r\n\t\t\t$html .= esc_html( $download[ 'title' ] );\r\n\t\t\t$html .= '</div></a>';\r\n\r\n\r\n\t\t\t}\r\n\r\n\t}\r\n\r\n\techo $html;\r\n\r\n}", "function downloadFile($args) {\n\t\t$monographId = isset($args[0]) ? $args[0] : 0;\n\t\t$fileId = isset($args[1]) ? $args[1] : 0;\n\t\t$revision = isset($args[2]) ? $args[2] : null;\n\n\t\t$this->validate($monographId);\n\t\t$submission =& $this->submission;\n\t\tif (!CopyeditorAction::downloadCopyeditorFile($submission, $fileId, $revision)) {\n\t\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t\t}\n\t}", "public function download( $fileID, $setOriginalMimeType = false ) \n {//--------------->> download()\n \n $file = $this->retrieve( $fileID );\n \n header( 'Content-Description: File Transfer' );\n \n if ( $setOriginalMimeType === true ) {//---------->> if $setOriginalMimeType == true\n header( \"Content-type: {$file->getType()}\" );\n } else {//---------->> else\n header( 'Content-type: application/octet-stream' );\n }//---------->> End else\n \n header( \"Content-disposition: attachment; filename={$file->getName()}\" );\n header( 'Content-Transfer-Encoding: binary' );\n header( 'Expires: 0' );\n header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );\n header( 'Pragma: public' );\n header( \"Content-Length: {$file->getSize()}\" );\n \n echo $file->getContent();\n \n }", "abstract function download($rempath, $locpath, $mode = 'auto');", "function getMimeForSubtype($subType,$ext='') {\n\t\tif ($ext == 'jpeg' || $ext == 'pjpeg' || $ext == 'jpg') {\n\t\t\t$ext = 'jpeg';\n\t\t}\n\n\t\tswitch($subType) {\n\t\t\tcase 'text':\n\t\t\t\treturn 'text/plain';\n\t\t\tcase 'wiki':\n\t\t\t\treturn 'text/wiki';\n\t\t\tcase 'html':\n\t\t\t\treturn 'text/html';\n\t\t\tcase 'image':\n\t\t\t\treturn 'image/'.$ext;\n\t\t}\n\n\t\tif ($subtype == 'document' || $subtype == 'doc') {\n\t\t\tswitch($ext) {\n\t\t\t\tcase 'pdf':\n\t\t\t\treturn 'application/pdf';\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'sxw':\n\t\t\t\treturn 'application/vnd.sun.xml.writer';\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'sxc':\n\t\t\t\treturn 'application/vnd.sun.xml.calc';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($subtype == 'audio') {\n\t\t\tswitch($ext) {\n\t\t\t\tcase 'mp3':\n\t\t\t\treturn 'audio/mpeg';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"application/octet-stream\";\n\t}", "public function downloadMediaFile($m){\n $file_path = null;\n $response = [];\n $media = Media::load($m->mid);\n if(empty($media)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t load media.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $fid = null;\n $file_uri = null;\n $type = $media->bundle();\n // image\n if(($type == 'image') && !empty($media->field_media_image->entity)) {\n $fid = $media->field_media_image->target_id;\n $file_uri = $media->field_media_image->entity->getFileUri();\n }\n // video\n if(($type == 'video') && !empty($media->field_media_video_file->entity)) {\n $fid = $media->field_media_video_file->target_id;\n $file_uri = $media->field_media_video_file->entity->getFileUri();\n }\n // audio\n if(($type == 'audio') && !empty($media->field_media_audio_file->entity)) {\n $fid = $media->field_media_audio_file->target_id;\n $file_uri = $media->field_media_audio_file->entity->getFileUri();\n }\n \n if(empty($fid)){\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'File doesn\\'t exists.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }else{\n $file = File::load($fid);\n $file_name = $file->getFilename();\n $destination = $this->createTmpDir($m->video_id) . '/' . $file_name;\n if($file = file_copy($file, $destination, FILE_EXISTS_REPLACE)) {\n // update media table\n \\Drupal::database()->update('vmt_media')\n ->condition('id', $m->id)\n ->condition('video_id', $m->video_id)\n ->fields(['fid' => $fid, 'type' => $type, 'file_uri' => $file_uri])\n ->execute();\n $file_path = drupal_realpath($destination);\n }else {\n $response = ['vid' => $m->video_id, 'cmd' => 'Copy media file to temporary directory!', 'output_file' => null, 'output_value' => 'Couldn\\'t copy the file into temporary directory.', 'return_value' => 1];\n $this->trackProcessingStage($response, 'Copy-to-temp-directory');\n }\n }\n }\n \n return $file_path;\n }", "function outputDownload(&$data, $filename, $filesize, $mimetype)\n {\n if (empty($mimetype)) {\n $mimetype = \"application/octet-stream\";\n }\n if (empty($filename)) {\n $filename = ev_gettext(\"Untitled\");\n }\n $disposition = self::displayInline($mimetype) ? 'inline' : 'attachment';\n $filename = rawurlencode($filename);\n header(\"Content-Type: \" . $mimetype);\n header(\"Content-Disposition: {$disposition}; filename=\\\"{$filename}\\\"; filename*=\".APP_CHARSET.\"''{$filename}\");\n header(\"Content-Length: {$filesize}\");\n echo $data;\n exit;\n }", "function download_attachment($key, $filename)\n {\n global $standard_headers;\n global $cookie;\n\n $fp = fopen($filename, 'w');\n\n $ch = curl_init('https://www.tadpoles.com/remote/v1/attachment?key=' . $key);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $standard_headers);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n $response = curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }", "function downloadFile($url, $output)\n{\n $readableStream = fopen($url, 'rb');\n if ($readableStream === false) {\n throw new Exception(\"Something went wrong while fetching \" . $url);\n }\n $writableStream = fopen($output, 'wb');\n\n stream_copy_to_stream($readableStream, $writableStream);\n\n fclose($writableStream);\n}", "protected function mimeType($extension) {\n\t\t$extension = strtolower($extension);\n\t\t$mimeTypes = array(\n\t\t\t'ez'\t\t=> 'application/andrew-inset',\n\t\t\t'hqx'\t\t=> 'application/mac-binhex40',\n\t\t\t'cpt'\t\t=> 'application/mac-compactpro',\n\t\t\t'doc'\t\t=> 'application/msword',\n\t\t\t'bin'\t\t=> 'application/octet-stream',\n\t\t\t'dms'\t\t=> 'application/octet-stream',\n\t\t\t'lha'\t\t=> 'application/octet-stream',\n\t\t\t'lzh'\t\t=> 'application/octet-stream',\n\t\t\t'exe'\t\t=> 'application/octet-stream',\n\t\t\t'class'\t\t=> 'application/octet-stream',\n\t\t\t'so'\t\t=> 'application/octet-stream',\n\t\t\t'dll'\t\t=> 'application/octet-stream',\n\t\t\t'oda'\t\t=> 'application/oda',\n\t\t\t'odc'\t\t=> 'application/vnd.oasis.opendocument.chart',\n\t\t\t'odf'\t\t=> 'application/vnd.oasis.opendocument.formula',\n\t\t\t'odg'\t\t=> 'application/vnd.oasis.opendocument.graphics',\n\t\t\t'odi'\t\t=> 'application/vnd.oasis.opendocument.image',\n\t\t\t'odm'\t\t=> 'application/vnd.oasis.opendocument.text-master',\n\t\t\t'odp'\t\t=> 'application/vnd.oasis.opendocument.presentation',\n\t\t\t'ods'\t\t=> 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t\t'odt'\t\t=> 'application/vnd.oasis.opendocument.text',\t\t\t\n\t\t\t'pdf'\t\t=> 'application/pdf',\n\t\t\t'ai'\t\t=> 'application/postscript',\n\t\t\t'eps'\t\t=> 'application/postscript',\n\t\t\t'ps'\t\t=> 'application/postscript',\n\t\t\t'smi'\t\t=> 'application/smil',\n\t\t\t'smil'\t\t=> 'application/smil',\n\t\t\t'mif'\t\t=> 'application/vnd.mif',\n\t\t\t'xls'\t\t=> 'application/vnd.ms-excel',\n\t\t\t'ppt'\t\t=> 'application/vnd.ms-powerpoint',\n\t\t\t'wbxml'\t\t=> 'application/vnd.wap.wbxml',\n\t\t\t'wmlc'\t\t=> 'application/vnd.wap.wmlc',\n\t\t\t'wmlsc'\t\t=> 'application/vnd.wap.wmlscriptc',\n\t\t\t'bcpio'\t\t=> 'application/x-bcpio',\n\t\t\t'vcd'\t\t=> 'application/x-cdlink',\n\t\t\t'pgn'\t\t=> 'application/x-chess-pgn',\n\t\t\t'cpio'\t\t=> 'application/x-cpio',\n\t\t\t'csh'\t\t=> 'application/x-csh',\n\t\t\t'dcr'\t\t=> 'application/x-director',\n\t\t\t'dir'\t\t=> 'application/x-director',\n\t\t\t'dxr'\t\t=> 'application/x-director',\n\t\t\t'dvi'\t\t=> 'application/x-dvi',\n\t\t\t'spl'\t\t=> 'application/x-futuresplash',\n\t\t\t'gtar'\t\t=> 'application/x-gtar',\n\t\t\t'hdf'\t\t=> 'application/x-hdf',\n\t\t\t'js'\t\t=> 'application/x-javascript',\n\t\t\t'skp'\t\t=> 'application/x-koan',\n\t\t\t'skd'\t\t=> 'application/x-koan',\n\t\t\t'skt'\t\t=> 'application/x-koan',\n\t\t\t'skm'\t\t=> 'application/x-koan',\n\t\t\t'latex'\t\t=> 'application/x-latex',\n\t\t\t'nc'\t\t=> 'application/x-netcdf',\n\t\t\t'cdf'\t\t=> 'application/x-netcdf',\n\t\t\t'sh'\t\t=> 'application/x-sh',\n\t\t\t'shar'\t\t=> 'application/x-shar',\n\t\t\t'swf'\t\t=> 'application/x-shockwave-flash',\n\t\t\t'sit'\t\t=> 'application/x-stuffit',\n\t\t\t'sv4cpio'\t=> 'application/x-sv4cpio',\n\t\t\t'sv4crc'\t=> 'application/x-sv4crc',\n\t\t\t'tar'\t\t=> 'application/x-tar',\n\t\t\t'tcl'\t\t=> 'application/x-tcl',\n\t\t\t'tex'\t\t=> 'application/x-tex',\n\t\t\t'texinfo'\t=> 'application/x-texinfo',\n\t\t\t'texi'\t\t=> 'application/x-texinfo',\n\t\t\t't'\t\t\t=> 'application/x-troff',\n\t\t\t'tr'\t\t=> 'application/x-troff',\n\t\t\t'roff'\t\t=> 'application/x-troff',\n\t\t\t'man'\t\t=> 'application/x-troff-man',\n\t\t\t'me'\t\t=> 'application/x-troff-me',\n\t\t\t'ms'\t\t=> 'application/x-troff-ms',\n\t\t\t'ustar'\t\t=> 'application/x-ustar',\n\t\t\t'src'\t\t=> 'application/x-wais-source',\n\t\t\t'xhtml'\t\t=> 'application/xhtml+xml',\n\t\t\t'xht'\t\t=> 'application/xhtml+xml',\n\t\t\t'zip'\t\t=> 'application/zip',\n\t\t\t'au'\t\t=> 'audio/basic',\n\t\t\t'snd'\t\t=> 'audio/basic',\n\t\t\t'mid'\t\t=> 'audio/midi',\n\t\t\t'midi'\t\t=> 'audio/midi',\n\t\t\t'kar'\t\t=> 'audio/midi',\n\t\t\t'mpga'\t\t=> 'audio/mpeg',\n\t\t\t'mp2'\t\t=> 'audio/mpeg',\n\t\t\t'mp3'\t\t=> 'audio/mpeg',\n\t\t\t'aif'\t\t=> 'audio/x-aiff',\n\t\t\t'aiff'\t\t=> 'audio/x-aiff',\n\t\t\t'aifc'\t\t=> 'audio/x-aiff',\n\t\t\t'm3u'\t\t=> 'audio/x-mpegurl',\n\t\t\t'ram'\t\t=> 'audio/x-pn-realaudio',\n\t\t\t'rm'\t\t=> 'audio/x-pn-realaudio',\n\t\t\t'rpm'\t\t=> 'audio/x-pn-realaudio-plugin',\n\t\t\t'ra'\t\t=> 'audio/x-realaudio',\n\t\t\t'wav'\t\t=> 'audio/x-wav',\n\t\t\t'pdb'\t\t=> 'chemical/x-pdb',\n\t\t\t'xyz'\t\t=> 'chemical/x-xyz',\n\t\t\t'bmp'\t\t=> 'image/bmp',\n\t\t\t'gif'\t\t=> 'image/gif',\n\t\t\t'ief'\t\t=> 'image/ief',\n\t\t\t'jpeg'\t\t=> 'image/jpeg',\n\t\t\t'jpg'\t\t=> 'image/jpeg',\n\t\t\t'jpe'\t\t=> 'image/jpeg',\n\t\t\t'png'\t\t=> 'image/png',\n\t\t\t'tiff'\t\t=> 'image/tiff',\n\t\t\t'tif'\t\t=> 'image/tiff',\n\t\t\t'djvu'\t\t=> 'image/vnd.djvu',\n\t\t\t'djv'\t\t=> 'image/vnd.djvu',\n\t\t\t'wbmp'\t\t=> 'image/vnd.wap.wbmp',\n\t\t\t'ras'\t\t=> 'image/x-cmu-raster',\n\t\t\t'pnm'\t\t=> 'image/x-portable-anymap',\n\t\t\t'pbm'\t\t=> 'image/x-portable-bitmap',\n\t\t\t'pgm'\t\t=> 'image/x-portable-graymap',\n\t\t\t'ppm'\t\t=> 'image/x-portable-pixmap',\n\t\t\t'rgb'\t\t=> 'image/x-rgb',\n\t\t\t'xbm'\t\t=> 'image/x-xbitmap',\n\t\t\t'xpm'\t\t=> 'image/x-xpixmap',\n\t\t\t'xwd'\t\t=> 'image/x-xwindowdump',\n\t\t\t'igs'\t\t=> 'model/iges',\n\t\t\t'iges'\t\t=> 'model/iges',\n\t\t\t'msh'\t\t=> 'model/mesh',\n\t\t\t'mesh'\t\t=> 'model/mesh',\n\t\t\t'silo'\t\t=> 'model/mesh',\n\t\t\t'wrl'\t\t=> 'model/vrml',\n\t\t\t'vrml'\t\t=> 'model/vrml',\n\t\t\t'css'\t\t=> 'text/css',\n\t\t\t'html'\t\t=> 'text/html',\n\t\t\t'htm'\t\t=> 'text/html',\n\t\t\t'asc'\t\t=> 'text/plain',\n\t\t\t'txt'\t\t=> 'text/plain',\n\t\t\t'rtx'\t\t=> 'text/richtext',\n\t\t\t'rtf'\t\t=> 'text/rtf',\n\t\t\t'sgml'\t\t=> 'text/sgml',\n\t\t\t'sgm'\t\t=> 'text/sgml',\n\t\t\t'tsv'\t\t=> 'text/tab-separated-values',\n\t\t\t'wml'\t\t=> 'text/vnd.wap.wml',\n\t\t\t'wmls'\t\t=> 'text/vnd.wap.wmlscript',\n\t\t\t'etx'\t\t=> 'text/x-setext',\n\t\t\t'xsl'\t\t=> 'text/xml',\n\t\t\t'xml'\t\t=> 'text/xml',\n\t\t\t'mpeg'\t\t=> 'video/mpeg',\n\t\t\t'mpg'\t\t=> 'video/mpeg',\n\t\t\t'mpe'\t\t=> 'video/mpeg',\n\t\t\t'qt'\t\t=> 'video/quicktime',\n\t\t\t'mov'\t\t=> 'video/quicktime',\n\t\t\t'mxu'\t\t=> 'video/vnd.mpegurl',\n\t\t\t'avi'\t\t=> 'video/x-msvideo',\n\t\t\t'movie'\t\t=> 'video/x-sgi-movie',\n\t\t\t'ice'\t\t=> 'x-conference/x-cooltalk',\n\t\t);\n\t\tif(isset($mimeTypes[$extension])) {\n\t\t\treturn $mimeTypes[$extension];\n\t\t}\n\t\telse {\n\t\t\treturn $this->_mailMimeFileTypeDefault;\n\t\t}\n\t}", "public function download($hash, $type);", "public function _curl_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\t\t$url = $this->dsn.$url;\n\t\t$http = curl_init($url);\n\t\t$http_headers = array('Accept: application/json,text/html,text/plain,*/*','Content-Type: '.$content_type,'Expect: ','Content-Length: '.strlen($data)) ;\n\t\tcurl_setopt($http, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tcurl_setopt($http, CURLOPT_HTTPHEADER,$http_headers);\n\t\tcurl_setopt($http, CURLOPT_HEADER, true);\n\t\tcurl_setopt($http, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($http, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($http, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($http);\n\t\tcurl_close($http);\n\t\treturn $response;\n\t}", "public function download($id = null)\n {\n if (preg_match('/^[0-9a-f]{8,8}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{12,12}$/', $id)) {\n $result = $this->Upload->find('first', array('conditions' => array('id' => $id)));\n\n if (!$result) {\n $this->Session->setFlash(__('Invalid Upload', true), 'alert');\n $this->redirect(array('action' => 'index'));\n }\n list($name, $extension) = explode('.', basename($result['Upload']['path']));\n $path = dirname($result['Upload']['fullpath']).DS;\n $file = basename($result['Upload']['fullpath']);\n $type = $result['Upload']['type'];\n } else {\n $file = $id;\n $path = Configure::read('Uploads.private');\n list($name, $extension) = explode('.', $id);\n $id3 = new FiId3($path);\n $info = $id3->info();\n unset($id3);\n $type = $info['type'];\n }\n\n $this->view = 'Media';\n\n $params = array(\n 'id' => $file,\n 'name' => $name,\n 'download' => true,\n 'extension' => strtolower($extension),\n 'mimeType' => array(strtolower($extension) => $type),\n 'path' => $path,\n );\n $this->set($params);\n }", "public function getXsiTypeName() {\n return \"DownloadFormat\";\n }", "public function setContentType(string $contentType): Attachment;", "protected function getfile($file, $file_path){\n //Parse information\n $pathinfo = pathinfo($file);\n $extension = strtolower($pathinfo['extension']);\n \n $mimetype = null;\n \n $path_to_file = $file_path.'/'.$file;\n $path_to_file = str_replace('//','/',$path_to_file);\n \n //Check if file exists\n if (!file_exists($path_to_file)) {\n throw new Exception(\"The file you are looking for does not exist or has been moved.\");\n }\n\n //Check if file is readable\n if (!is_readable($path_to_file)) {\n throw new Exception(\"An error occurred while trying to get your file.\");\n }\n \n //Get mimetype for extension\n //This list can be extended as you need it.\n //A good start to find mimetypes is the apache mime.types list\n // http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\n switch ($extension) {\n case 'avi': $mimetype = \"video/x-msvideo\"; break;\n case 'doc': $mimetype = \"application/msword\"; break;\n case 'exe': $mimetype = \"application/octet-stream\"; break;\n case 'flac': $mimetype = \"audio/flac\"; break;\n case 'gif': $mimetype = \"image/gif\"; break;\n case 'jpeg':\n case 'jpg': $mimetype = \"image/jpg\"; break;\n case 'json': $mimetype = \"application/json\"; break;\n case 'mp3': $mimetype = \"audio/mpeg\"; break;\n case 'mp4': $mimetype = \"application/mp4\"; break;\n case 'ogg': $mimetype = \"audio/ogg\"; break;\n case 'pdf': $mimetype = \"application/pdf\"; break;\n case 'png': $mimetype = \"image/png\"; break;\n case 'ppt': $mimetype = \"application/vnd.ms-powerpoint\"; break;\n case 'rtf': $mimetype = \"application/rtf\"; break;\n case 'sql': $mimetype = \"application/sql\"; break;\n case 'xls': $mimetype = \"application/vnd.ms-excel\"; break;\n case 'xlsx': $mimetype = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case 'xml': $mimetype = \"application/xml\"; break;\n case 'zip': $mimetype = \"application/zip\"; break;\n default: $mimetype = \"application/force-download\";\n }\n \n \n //Set header\n header('Pragma: public');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Cache-Control: private', false); // required for some browsers\n header('Content-Type: '.$mimetype);\n header('Content-Disposition: attachment; filename=\"'.basename($path_to_file).'\";');\n header('Content-Transfer-Encoding: binary');\n header('Content-Length: '.filesize($path_to_file));\n ob_clean();\n flush();\n readfile($path_to_file);\n }", "public function mime($filePath);", "public function forceDownload($filename, $mime = 'application/octet-stream')\n {\n header('Content-Description: File Transfer');\n header('Content-Type: '.$mime);\n header('Content-Disposition: attachment; filename='.basename($filename));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: '.filesize(APP_PATH.$filename));\n \n readfile(APP_PATH.$filename);\n \n $this->completeRequest();\n }", "public function download() {\t\t}", "function wp_get_default_extension_for_mime_type($mime_type)\n {\n }", "public function download(string $fileName, string $extension = 'png') {\n\t\t$image = $this->getImage();\n\n\t\tif(!$image->send($this->generateValidFileName($fileName, $extension))) {\n\t\t\t$this->handleError($image);\n\t\t}\n\t}", "public function file( $path, $filename = null, $mimetype = null ) {\n\t\t$this->discard();\n\t\t$this->noCache();\n\t\tset_time_limit( 1200 );\n\t\tif ( null === $filename ) {\n\t\t\t$filename = basename( $path );\n\t\t}\n\t\tif ( null === $mimetype ) {\n\t\t\t$mimetype = finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $path );\n\t\t}\n\t\t$this->header( 'Content-type: ' . $mimetype );\n\t\t$this->header( 'Content-length: ' . filesize( $path ) );\n\t\t$this->header( 'Content-Disposition: attachment; filename=\"' . $filename . '\"' );\n\t\treadfile( $path );\n\t}", "function get_content_type($url){\n\t\t\t\t\t\t$mime_types = array(\n\t\t\t\t\t\t\t\"pdf\"=>\"application/pdf\"\n\t\t\t\t\t\t\t,\"exe\"=>\"application/octet-stream\"\n\t\t\t\t\t\t\t,\"zip\"=>\"application/zip\"\n\t\t\t\t\t\t\t,\"docx\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"doc\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"xls\"=>\"application/vnd.ms-excel\"\n\t\t\t\t\t\t\t,\"ppt\"=>\"application/vnd.ms-powerpoint\"\n\t\t\t\t\t\t\t,\"gif\"=>\"image/gif\"\n\t\t\t\t\t\t\t,\"png\"=>\"image/png\"\n\t\t\t\t\t\t ,\"ico\"=>\"image/ico\"\n\t\t\t\t\t\t ,\"jpeg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"jpg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"mp3\"=>\"audio/mpeg\"\n\t\t\t\t\t\t ,\"wav\"=>\"audio/x-wav\"\n\t\t\t\t\t\t ,\"mpeg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpe\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mov\"=>\"video/quicktime\"\n\t\t\t\t\t\t ,\"avi\"=>\"video/x-msvideo\"\n\t\t\t\t\t\t ,\"3gp\"=>\"video/3gpp\"\n\t\t\t\t\t\t ,\"css\"=>\"text/css\"\n\t\t\t\t\t\t ,\"jsc\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"js\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"php\"=>\"text/html\"\n\t\t\t\t\t\t ,\"htm\"=>\"text/html\"\n\t\t\t\t\t\t ,\"html\"=>\"text/html\"\n\t\t\t\t\t\t ,\"xml\"=>\"application/xml\"\n\t\t\t\t\t\t \n\t\t\t\t\t\t);\n\t\t\t\t\t\t$var = explode('.', $url);\n\t\t\t\t\t\t$extension = strtolower(end($var));\n\t\t\t\t\t\tif(isset($mime_types[$extension])){\n\t\t\t\t\t\t return $mime_types[$extension];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 'other';\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function fromExt($ext) \n {\n $mtl = $GLOBALS['File_MimeType'];\n $ext = strtolower($ext);\n foreach($mtl as $mtd) {\n if (in_array($ext, $mtd[1])) {\n return $mtd[0];\n }\n }\n return 'application/octet-stream';\n }", "protected function getDownloadFile() {\n return null;\n }", "public function _socket_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\n\t\t$req = $this->_socket_startRequestHeaders('PUT',$url);\n\t\t$req .= 'Content-Length: '.strlen($data).\"\\r\\n\"\n\t\t\t\t.'Content-Type: '.$content_type.\"\\r\\n\\r\\n\";\n\t\t$this->_connect();\n\t\tfwrite($this->socket, $req);\n\t\tfwrite($this->socket, $data);\n\t\t$response = '';\n\t\twhile(!feof($this->socket))\n\t\t\t$response .= fgets($this->socket);\n\t\t$this->_disconnect();\n\t\treturn $response;\n }", "public function storeAsFile($url,$data,$content_type) {\n\t\tif ( $this->curl )\treturn $this->_curl_storeAsFile($url,$data,$content_type);\n\t\telse\t\t\t\treturn $this->_socket_storeAsFile($url,$data,$content_type);\n\n\t}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "protected function downloadFileRequest(Requests\\DownloadFileRequest $request)\n {\n\n $resourcePath = '/slides/storage/file/{path}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->storageName !== null) {\n $queryParams['storageName'] = ObjectSerializer::toQueryValue($request->storageName);\n }\n // query params\n if ($request->versionId !== null) {\n $queryParams['versionId'] = ObjectSerializer::toQueryValue($request->versionId);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"path\", $request->path);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['multipart/form-data'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'GET');\n }", "function catpdf_post_download() {\n $post_type = get_post_type(get_the_ID());\n $link = '';\n if ($post_type == 'post') {\n $url = add_query_arg('catpdf_dl', get_the_ID());\n $link = '<a href=\"' . $url . '\"><img src=\"' . CATPDF_URL . 'images/download-icon.png\"></a>';\n }\n return $link;\n}", "function download($file = \"\") {\n\t\t// Set maximum execution time in seconds (0 means no limit).\n\n\t\tset_time_limit(0);\n\t\t\n\t\t// Check downloader is admin or manager\n\t\tif(!empty($file)) {\n\t\t\t$file = SITE_DIR.\"public\".base64_decode($file);\n\n\t\t\t$this->output_file($file);\n\t\t} else\n\t\t\t$this->download_forbidden();\n\t\texit;\n\t}", "public static function getExtension(string $mime_type):string;", "public function run()\r\r\n\t{\r\r\n\t\t// Make sure there are no attempts to hack the file system\r\r\n\t\tif (preg_match('@^\\.+@i', $this->strFile) || preg_match('@\\.+/@i', $this->strFile) || preg_match('@(://)+@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid file name');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Limit downloads to the tl_files directory\r\r\n\t\tif (!preg_match('@^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '@') . '@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid path');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check whether the file exists\r\r\n\t\tif (!file_exists(TL_ROOT . '/' . $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('File not found');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if there is no token or if the tokens do not match\r\r\n\t\tif (!strlen($this->Input->get('token')) || !is_array($_SESSION['downloadToken']) || !in_array($this->Input->get('token'), $_SESSION['downloadToken']))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie('Invalid download token');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if the file is not allowed\r\r\n\t\tif (!is_array($_SESSION['downloadFiles']) || !in_array($this->strFile, $_SESSION['downloadFiles']) || !preg_match('/^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '/') . '\\//i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('Download of file \"%s\" is not allowed', $this->strFile));\r\r\n\t\t}\r\r\n\r\r\n\t\t$objFile = new File($this->strFile);\r\r\n\t\t$arrAllowedTypes = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\r\r\n\r\r\n\t\tif (!in_array($objFile->extension, $arrAllowedTypes))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('File type \"%s\" is not allowed', $objFile->extension));\r\r\n\t\t}\r\r\n\r\r\n\t\t// Open the \"save as...\" dialogue\r\r\n\t\theader('Content-Type: ' . $objFile->mime);\r\r\n\t\theader('Content-Transfer-Encoding: binary');\r\r\n\t\theader('Content-Disposition: attachment; filename=\"'.$objFile->basename.'\"');\r\r\n\t\theader('Content-Length: '.$objFile->filesize);\r\r\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0'); \r\r\n\t\theader('Pragma: public');\r\r\n\t\theader('Expires: 0');\r\r\n\r\r\n\t\t$resFile = fopen(TL_ROOT . '/' . $this->strFile, 'rb');\r\r\n\t\tfpassthru($resFile);\r\r\n\t\tfclose($resFile);\r\r\n\r\r\n\t\t// HOOK: post download callback\r\r\n\t\tif (array_key_exists('postDownload', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['postDownload']))\r\r\n\t\t{\r\r\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['postDownload'] as $callback)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t$this->$callback[0]->$callback[1]($this->strFile);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "public static function getHttpFile($file, $pr_transfer = null) {\n\t\ttry{\n\t \tif(!self::remoteFileExists($file)) {\n\t \t\treturn 'The file does not exists ...';\n\t \t}\n\n\t\t\tif(!isset($pr_transfer)) {\n\t\t\t\t$fileinfo = pathinfo($file);\n\t\t\t}else{\n\t\t\t\t$fileinfo = pathinfo($pr_transfer);\n\t\t\t}\n\t\t\t$filename = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\\./', '%2e', $fileinfo['basename'], substr_count($fileinfo['basename'], '.') - 1) : $fileinfo['basename'];\n\n\t\t\tif(strpos($filename, 'rsapi.cgi')) {\n\t\t\t\t$filename = substr($filename, 0, strpos($filename, '&'));\n\t\t\t}\n\n\t\t\tif(OC_Filesystem::file_exists('/Downloads/' . $filename)) {\n\t\t\t\t$filename = md5(rand()) . '_' . $filename;\n\t\t\t}\n\t\t\t$fs = OC_Filesystem::fopen('/Downloads/' . $filename, 'w');\n\n\t\t\t$size = self::getRemoteFileSize($file);\n\t\t\tif($size == 0) {\n\t\t\t\treturn 'Error ! Null file size.';\n\t\t\t}\n\n\t\t switch(strtolower($fileinfo['extension'])) {\n\t\t case 'exe': $ctype = 'application/octet-stream'; break;\n\t\t case 'zip': $ctype = 'application/zip'; break;\n\t\t case 'mp3': $ctype = 'audio/mpeg'; break;\n\t\t case 'mpg': $ctype = 'video/mpeg'; break;\n\t\t case 'avi': $ctype = 'video/x-msvideo'; break;\n\t\t\t\tcase 'png': $ctype = 'image/png'; break;\n\t\t default: $ctype = 'application/force-download';\n\t\t }\n\n\t\t $seek_end = (empty($seek_end)) ? ($size - 1) : min(abs(intval($seek_end)),($size - 1));\n\t\t $seek_start = (empty($seek_start) || $seek_end < abs(intval($seek_start))) ? 0 : max(abs(intval($seek_start)),0);\n\n\t\t /*header(\"Cache-Control: cache, must-revalidate\");\n\t\t header(\"Pragma: public\");\n\t\t header('Content-Type: ' . $ctype);\n\t\t header('Content-Disposition: attachment; filename=\"' . $filename . '\"');\n\t\t header('Content-Length: ' . ($seek_end - $seek_start + 1));*/\n\n\t\t $fp = fopen($file, 'rb');\n\t\t\tset_time_limit(0);\n\t\t while(!feof($fp)) {\n\t\t $data = fread($fp, 1024*8);\n\t\t if($data == '') {\n\t\t \tbreak;\n\t\t }\n\t\t\t\tfwrite($fs, $data);\n\t\t }\n\n\t\t fclose($fp);\n\t\t\tfclose($fs);\n\n\t\t\treturn Array('ok' => 'Transfer completed successfully. The file has been moved in your Downloads folder.');\n\t\t}catch(exception $e) {\n\t\t\treturn Array('error' => $e->getMessage());\n\t\t}\n\t}", "public function set_content_type($mime);", "public function set_content_type($mime);", "function download_file(string $filename, string $root_path = '/cloud'): void {\n\tif (!file_exists($filename))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" does not exist.');\n\tif (!Common::isAuthorizedPath($filename, $root_path))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" is invalid.');\n\n\t// get file info\n\t$content_type = mime_content_type($filename);\n\t$basename = basename($filename);\n\t$content_length = filesize($filename);\n\n\t// set headers\n\theader(\"Content-Type: $content_type\");\n\theader(\"Content-Disposition: attachment; filename=\\\"$basename\\\"\");\n\theader(\"Content-Length: $content_length\");\n\n\t// clear buffer and flush headers\n\tob_clean();\n\tflush();\n\n\t// output file contents\n\treadfile($filename);\n}", "function extension2fileType( $extension )\n{\n $file_types = '' ; # initialize\n switch ( strtolower( $extension ) )\n {\n case '.jpg':\n case '.jpeg':\n $file_types = 'image/pjpeg,image/jpeg' ;\n break ;\n case '.gif':\n $file_types = 'image/gif' ;\n break ;\n case '.png':\n $file_types = 'image/x-png' ;\n break ;\n case '.doc':\n $file_types = 'application/msword' ;\n break ;\n case '.zip':\n $file_types = 'application/x-zip-compressed' ;\n break ;\n case '.pdf':\n $file_types = 'application/pdf' ;\n break ;\n case '.xls':\n $file_types = 'application/vnd.ms-excel' ;\n break ;\n case '.mp3':\n $file_types = 'audio/mpeg' ;\n break ;\n case '.txt':\n $file_types = 'text/plain' ;\n break ;\n case '.htm':\n case '.html':\n $file_types = 'text/html' ;\n break ;\n case '.wma':\n $file_types = 'audio/x-ms-wma' ;\n break ;\n default:\n $file_types = 'image/pjpeg,image/jpeg' ; # default to .jpg\n }\n return $file_types ; # return matching file type!\n}", "function get_attached_media($type, $post = 0)\n {\n }", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function download()\n {\n $streams = $this->getStream();\n $streams = explode(',', $streams);\n $title = $this->getTitle();\n\n\n if (file_exists('videos/' . $title . '.mp4')) {\n return \"{$this->url}/videos/\" . $title . '.mp4';\n }\n\n foreach ($streams as $stream) {\n parse_str($stream, $data); //decode the stream\n if (stripos($data['type'], $this->format) !== false) { //We've found the right stream with the correct format\n $video = fopen($data['url'] . '&amp;signature=' . $data['sig'], 'r'); //the video\n $file = fopen('videos/' . $title . '.mp4', 'w');\n stream_copy_to_stream($video, $file); //copy it to the file\n fclose($video);\n fclose($file);\n $msg = \"{$this->url}/videos/{$title}.mp4\";\n break;\n }\n }\n\n return $msg;\n\n }", "public function wp_download_zip(){\n\n\t\t// Get WordPress data\n\t\t$wp = json_decode( file_get_contents( $this->_wp_api ) )->offers[0];\n\n\t\tfile_put_contents( 'wordpress-' . $wp->version . '-' . $this->_wp_lang . '.zip', file_get_contents( $wp->download ) );\n\n\t\treturn TRUE;\n\t}", "public function _curl_storeFile ( $url, $file, $content_type ) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($file) OR !is_file($file) OR !is_readable($file) )\tthrow new InvalidArgumentException(\"Attachment file does not exist or is not readable\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\t\t$url = $this->dsn.$url;\n\t\t$http = curl_init($url);\n\t\t$http_headers = array('Accept: application/json,text/html,text/plain,*/*','Content-Type: '.$content_type,'Expect: ') ;\n\t\tcurl_setopt($http, CURLOPT_PUT, 1);\n\t\tcurl_setopt($http, CURLOPT_HTTPHEADER,$http_headers);\n\t\tcurl_setopt($http, CURLOPT_UPLOAD, true);\n\t\tcurl_setopt($http, CURLOPT_HEADER, true);\n\t\tcurl_setopt($http, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($http, CURLOPT_FOLLOWLOCATION, true);\n\t\t$fstream=fopen($file,'r');\n\t\tcurl_setopt($http, CURLOPT_INFILE, $fstream);\n\t\tcurl_setopt($http, CURLOPT_INFILESIZE, filesize($file));\n\t\t$response = curl_exec($http);\n\t\tfclose($fstream);\n\t\tcurl_close($http);\n\t\treturn $response;\n\t}", "function download($type, $post = array()) {\n set_time_limit( 1800 );\n ini_set('memory_limit', '512M');\n\n // create a new workbook\n $workbook = new \\PhpOffice\\PhpSpreadsheet\\Spreadsheet();\n\n // set default font name and size\n $workbook->getDefaultStyle()->getFont()->setName('Arial');\n $workbook->getDefaultStyle()->getFont()->setSize(10);\n $workbook->getDefaultStyle()->getAlignment()->setIndent(1);\n\n if (isset($this->request->post['exportway'])) {\n if ($this->request->post['exportway'] == 'pid') {\n $this->min_product_id = $this->request->post['min'];\n $this->max_product_id = $this->request->post['max'];\n $this->exportway = $this->request->post['exportway'];\n } else if ($this->request->post['exportway'] == 'page') {\n $this->count_prepage = $this->request->post['min'];\n $this->page = $this->request->post['max'];\n $this->exportway = $this->request->post['exportway'];\n } else {\n echo \"exportway error!\";\n }\n }\n\n // creating the worksheet\n $i = 0;\n foreach ($this->template[$type] as $key => $value) {\n if ($i > 0) {\n $workbook->createSheet();\n }\n $workbook->setActiveSheetIndex($i++);\n $worksheet = $workbook->getActiveSheet();\n $worksheet->setTitle($key);\n $func = $this->convertUnderline('get_' . $key);\n $this->populateWorksheet($worksheet, $this->{$func}(), $value);\n $worksheet->freezePaneByColumnAndRow( 1, 2 );\n }\n\n $workbook->setActiveSheetIndex(0);\n\n $datetime = date('Y-m-d');\n //header('Content-Type: application/vnd.ms-excel');\n //header('Content-Disposition: attachment;filename=\"GDExportImport_products_'.$datetime.'.xls\"');\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename=\"GDExportImport_'.$type.'_'.$datetime.'.xlsx\"');\n header('Cache-Control: max-age=0');\n\n // If you're serving to IE over SSL, then the following may be needed\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past\n header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified\n header('Cache-Control: cache, must-revalidate'); // HTTP/1.1\n header('Pragma: public'); // HTTP/1.0\n\n //$writer = PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($workbook, 'Xls');\n $writer = \\PhpOffice\\PhpSpreadsheet\\IOFactory::createWriter($workbook, 'Xlsx');\n if(ob_get_length()){\n ob_clean();\n }\n\n $writer->save('php://output');\n }", "public function download()\n {\n return Storage::download(request('path'));\n }", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }" ]
[ "0.5585438", "0.5543451", "0.5510361", "0.5502444", "0.54925233", "0.5442962", "0.5389697", "0.53632355", "0.5334549", "0.5286034", "0.5261409", "0.5223991", "0.5199559", "0.51602364", "0.514058", "0.51262844", "0.5090899", "0.50513715", "0.50513715", "0.5029837", "0.50279915", "0.50137264", "0.501037", "0.49977586", "0.49809703", "0.49782625", "0.49614578", "0.49470013", "0.4946638", "0.49308285", "0.4914946", "0.49045157", "0.4900522", "0.48857328", "0.48845124", "0.48816088", "0.4870056", "0.48671535", "0.4844738", "0.48324236", "0.48226088", "0.48130116", "0.4803924", "0.48023626", "0.47949353", "0.47883618", "0.4766207", "0.47659445", "0.47651747", "0.4763338", "0.47607398", "0.47581023", "0.4735856", "0.47007832", "0.46846867", "0.46778902", "0.46710533", "0.467037", "0.46683344", "0.46678418", "0.46671104", "0.46647924", "0.46617317", "0.4646013", "0.4635606", "0.46350163", "0.46336618", "0.46283528", "0.46261126", "0.4614957", "0.4610588", "0.46010342", "0.46009102", "0.45819697", "0.45784017", "0.45784017", "0.45784017", "0.45784017", "0.4577752", "0.45657104", "0.45626473", "0.456018", "0.45429063", "0.4541273", "0.45410126", "0.45410126", "0.45381194", "0.45356357", "0.45356116", "0.45301244", "0.45301244", "0.45301244", "0.45301244", "0.45301244", "0.45280877", "0.4522149", "0.4517259", "0.451227", "0.45088124", "0.45041952" ]
0.68361455
0
Recursively remove a directory. PHP itself does not offer a reasonable way to recursively remove directories. This is a subtle issue as links and nasty file names can be inlolved. We don't want to be hackble by uploading a malicious manuscript source to the arXiv, don't we? This is the best I could come up with after looking at many different implementations that can be found on the internet.
public static function save_recursive_remove_dir( $path, $root ) { $path = rtrim($path, '/').'/'; $root = rtrim($root, '/').'/'; if ($root === '/' || $path === '/' || $root !== mb_substr($path, 0, mb_strlen($root)) ) return false; foreach(new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST) as $entry ) { if($entry->isDir() && !$entry->isLink()) rmdir($entry->getPathname()); else unlink($entry->getPathname()); } rmdir($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rm_recursive($dir) {\n\t$dir = rtrim($dir, '\\\\/');\n\tif (is_dir($dir)) { \n\t\t$objects = scandir($dir); \n\t\tforeach ($objects as $object) { \n\t\t\tif ($object != \".\" && $object != \"..\") { \n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rm_recursive($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n\t\t\t} \n\t\t} \n\t\treset($objects); \n\t\trmdir($dir); \n\t} \t\n}", "function recurse_remove_dir($dir) {\n\tforeach(glob($dir . '/*') as $file) {\n\t\tif(is_dir($file))\n\t\t\trecurse_remove_dir($file);\n\t\telse\n\t\t\tunlink($file);\n\t}\n\trmdir($dir);\n}", "function recursive_rmdir($dir) {\n $handle = opendir($dir);\n while ($file = readdir($handle)) {\n if (is_file(\"$dir/$file\")) {\n unlink(\"$dir/$file\");\n } elseif (is_dir(\"$dir/$file\") && $file != '.' && $file != '..') {\n recursive_rmdir(\"$dir/$file\");\n }\n }\n closedir($handle);\n return rmdir($dir);\n}", "function rmdir_recurse($path) {\n $path = rtrim($path, '/').'/';\n $handle = opendir($path);\n while(false !== ($file = readdir($handle))) {\n if($file != '.' and $file != '..' ) {\n $fullpath = $path.$file;\n if(is_dir($fullpath)) rmdir_recurse($fullpath); else unlink($fullpath);\n }\n }\n closedir($handle);\n rmdir($path);\n}", "function remove_dir_rec($dirtodelete)\n{\n if ( strpos($dirtodelete,\"../\") !== false )\n die(_NONPUOI);\n if ( false !== ($objs = glob($dirtodelete . \"/*\")) )\n {\n foreach ( $objs as $obj )\n {\n is_dir($obj) ? remove_dir_rec($obj) : unlink($obj);\n }\n }\n rmdir($dirtodelete);\n}", "function remove_dir($dir = null) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") remove_dir($dir.\"/\".$object);\n else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n}", "function UnlinkRecursive($dir, $deleteRootToo = true) \n{ \n if(!$dh = @opendir($dir)) \n { \n return false; \n } \n while (false !== ($obj = readdir($dh))) \n { \n if($obj == '.' || $obj == '..') \n { \n continue; \n } \n\n if (!@unlink($dir . '/' . $obj)) \n { \n UnlinkRecursive($dir.'/'.$obj, true); \n } \n } \n\n closedir($dh); \n \n if ($deleteRootToo) \n { \n @rmdir($dir); \n } \n \n return true; \n}", "function l10n_drupal_rmdir_recursive($directory) {\n if (!is_dir($directory)) {\n return;\n }\n if (substr($directory, -1) != '/') {\n $directory .= '/';\n }\n if ($handle = opendir($directory)) {\n while ($file = readdir($handle)) {\n if ($file == '.' or $file == '..') {\n continue;\n }\n $path = $directory . '/' . $file;\n if (is_dir($path)) {\n l10n_drupal_rmdir_recursive($path);\n }\n else {\n unlink($path);\n }\n }\n rmdir($directory);\n closedir($handle);\n }\n}", "function rrmdir($dir) {\n if (!file_exists($dir))\n return;\n if (!is_dir($dir)) {\n unlink($dir);\n return;\n }\n $files = array_diff(scandir($dir), array('.','..'));\n foreach ($files as $file) {\n $path = \"$dir/$file\";\n (is_dir($path) && !is_link($path)) ? rrmdir($path) : unlink($path);\n }\n return rmdir($dir);\n}", "function remove_directory($src)\n{\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) )\n\t{\n if (( $file != '.' ) && ( $file != '..' ))\n\t\t{\n $full = $src . '/' . $file;\n\t\t\t\n if ( is_dir($full) )\n\t\t\t{\n remove_directory($full);\n }\n else\n\t\t\t{\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "public function isDirectoryRemoveRecursivelyAllowed() {}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else \\\nunlink($dir.\"/\".$object); \n } \n } \n reset($objects); \n rmdir($dir); \n } \n}", "function recursive_deletion($baseDir)\n{\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink($baseDir . $file);\n\t\t}\n\t}\n\trmdir($baseDir);\n}", "function rmdir_r($dir)\n{\n\tif(is_dir($dir)) {\n\t\t$objs = scandir($dir);\n\t\tforeach($objs as $o) {\n\t\t\tif($o != '.' && $o != '..') {\n\t\t\t\tif(is_dir($dir.'/'.$o)) {\n\t\t\t\t\trmdir_r($dir.'/'.$o);\n\t\t\t\t} else unlink($dir.'/'.$o);\n\t\t\t}\n\t\t}\n\t\treset($objs);\n\t\treturn rmdir($dir);\n\t}\n}", "function removeRecursive($dir)\n{\n $files = array_diff(scandir($dir), array('.','..'));\n\n // Delete all files one by one\n foreach ($files as $file) {\n // If current file is directory then recurse it\n (is_dir(\"$dir/$file\")) ? $this->removeRecursive(\"$dir/$file\") : unlink(\"$dir/$file\");\n }\n\n // Remove blank directory after deleting all files\n return rmdir($dir);\n}", "function rrmdir($path) {\n // Open the source directory to read in files\n $i = new DirectoryIterator($path);\n foreach($i as $f) {\n if($f->isFile()) {\n unlink($f->getRealPath());\n } else if(!$f->isDot() && $f->isDir()) {\n rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n}", "function delTree($dir) \r\n{\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n foreach( $files as $file )\r\n {\r\n if( substr( $file, -1 ) == '/' )\r\n delTree( $file );\r\n else\r\n unlink( $file );\r\n }\r\n \r\n if( is_dir($dir) ) \r\n rmdir( $dir );\r\n \r\n}", "function RemoveDirectory($dir)\n{\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( is_file(\"$dir/$file\") )\n unlink(\"$dir/$file\");\n elseif( $file != '.' && $file != '..' )\n RemoveDirectory(\"$dir/$file\");\n }\n unset($f);\n \n rmdir($dir);\n}", "function rm_dir($dir)\n{\n\t$iter = new RecursiveDirectoryIterator($dir);\n\tforeach (new RecursiveIteratorIterator( $iter,\n\t\t\t\t\t\tRecursiveIteratorIterator::CHILD_FIRST) as $f)\n\t{\n\t\t$filename = $f->getFilename();\n\t\tif ($filename === '.' || $filename === '..')\n\t\t\tcontinue;\n\t\tif ($f->isDir())\n\t\t\trmdir($f->getPathname());\n\t\telse\n\t\t\tunlink($f->getPathname());\n\t}\n\trmdir($dir);\n}", "function rrmdir($dir) {\nif (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n}\n}", "function rmdirr($dirname){ \r\n\t// Simple delete for a file \r\n\tif (is_file($dirname)) \r\n\t{ \r\n\t\treturn unlink($dirname); \r\n\t} \r\n\t// Loop through the folder \r\n\t$dir = dir($dirname); \r\n\twhile (false !== $entry = $dir->read()) { \r\n\t\t// Skip pointers \r\n\t\tif ($entry == '.' || $entry == '..') \r\n\t\t{ continue; } \r\n\t\t// Deep delete directories \r\n\t\tif (is_dir(\"$dirname/$entry\")) { \r\n\t\t\trmdirr(\"$dirname/$entry\"); \r\n\t\t} else { \r\n\t\t\tunlink(\"$dirname/$entry\"); \r\n\t\t} \r\n\t} \r\n\t// Clean up \r\n\t$dir->close(); \r\n\treturn rmdir($dirname);\r\n}", "function rmdir_recursive($dir) {\n\n\t\t$basicPath = ROOT.DS.\"app\".DS.\"webroot\".DS.\"contents\".DS;\n\t\tif(is_dir($basicPath.$dir)){\n\t\t$files = scandir($basicPath.$dir);\n\t\tarray_shift($files); // remove '.' from array\n\t\tarray_shift($files); // remove '..' from array\n\n\t\tforeach ($files as $file) {\n\t\t$file = $basicPath.$dir .DS. $file;\n\t\tif (is_dir($file)) {\n\t\trmdir_recursive($file);\n\t\trmdir($file);\n\t\t} else {\n\n\t\tunlink($file);\n\t\t }\n\t\t}\n\t\trmdir($basicPath.$dir);\n\t\t}\n\t}", "function recursive_remove_directory($directory, $empty=FALSE)\n{\n if(substr($directory,-1) == '/')\n {\n $directory = substr($directory,0,-1);\n }\n\n // if the path is not valid or is not a directory ...\n if(!file_exists($directory) || !is_dir($directory))\n {\n // ... we return false and exit the function\n return FALSE;\n\n // ... if the path is not readable\n }elseif(!is_readable($directory))\n {\n // ... we return false and exit the function\n return FALSE;\n\n // ... else if the path is readable\n }else{\n\n // we open the directory\n $handle = opendir($directory);\n\n // and scan through the items inside\n while (FALSE !== ($item = readdir($handle)))\n {\n // if the filepointer is not the current directory\n // or the parent directory\n if($item != '.' && $item != '..')\n {\n // we build the new path to delete\n $path = $directory.'/'.$item;\n\n // if the new path is a directory\n if(is_dir($path)) \n {\n // we call this function with the new path\n recursive_remove_directory($path);\n\n // if the new path is a file\n }else{\n // we remove the file\n unlink($path);\n }\n }\n }\n // close the directory\n closedir($handle);\n\n // if the option to empty is not set to true\n if($empty == FALSE)\n {\n // try to delete the now empty directory\n if(!rmdir($directory))\n {\n // return false if not possible\n return FALSE;\n }\n }\n // return success\n return TRUE;\n }\n}", "function rmdir_recursive($path, $suicide = TRUE)\r\n\t{\r\n\t\tstatic $self;\r\n\t\tisset($self) OR $self = $path;\r\n\r\n\t\t$result = FALSE;\r\n\t\t$iterator = new DirectoryIterator($path);\r\n\r\n\t\t// Recurse into the path\r\n\t\tforeach ($iterator as $item)\r\n\t\t{\r\n\t\t\t// Remove if it's a file\r\n\t\t\t$item->isFile() AND unlink($item->getRealPath());\r\n\r\n\t\t\t// Go deep Chandler, go!\r\n\t\t\tif ( ! $item->isDot() AND $item->isDir())\r\n\t\t\t{\r\n\t\t\t\trmdir_recursive($item->getRealPath());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Remove child dirs. Source dir (initial $path) will\r\n\t\t// be removed only if it's a suicidal function call!\r\n\t\tif ($suicide OR realpath($self) != realpath($path))\r\n\t\t{\r\n\t\t\trmdir($path);\r\n\t\t}\r\n\t}", "function rmdir_recursive($path, $follow_links=false) {\n\t$to_do = glob($path);\n\tif (!is_array($to_do)) {\n\t\t$to_do = array($to_do);\n\t}\n\tforeach ($to_do as $workingdir) { // Handle wildcards by foreaching.\n\t\tif (file_exists($workingdir)) {\n\t\t\tif (is_dir($workingdir)) {\n\t\t\t\t$dir = opendir($workingdir);\n\t\t\t\twhile ($entry = readdir($dir)) {\n\t\t\t\t\tif (is_file(\"$workingdir/$entry\") || ((!$follow_links) && is_link(\"$workingdir/$entry\"))) {\n\t\t\t\t\t\tunlink(\"$workingdir/$entry\");\n\t\t\t\t\t} elseif (is_dir(\"$workingdir/$entry\") && $entry != '.' && $entry != '..') {\n\t\t\t\t\t\trmdir_recursive(\"$workingdir/$entry\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclosedir($dir);\n\t\t\t\trmdir($workingdir);\n\t\t\t} elseif (is_file($workingdir)) {\n\t\t\t\tunlink($workingdir);\n\t\t\t}\n\t\t}\n\t}\n\treturn;\n}", "function gttn_tpps_rmdir($dir) {\n if (is_dir($dir)) {\n $children = scandir($dir);\n foreach ($children as $child) {\n if ($child != '.' and $child != '..') {\n if (is_dir($dir . '/' . $child) and !is_link($dir . '/' . $child)) {\n gttn_tpps_rmdir($dir . '/' . $child);\n }\n else {\n unlink($dir . '/' . $child);\n }\n }\n }\n rmdir($dir);\n }\n}", "function recursive_remove_directory($directory, $empty = true) {\n\tif (substr($directory, -1) == DIRECTORY_SEPARATOR) {\n\t\t$directory = substr($directory, 0, -1);\n\t}\n\n\t// if the path is not valid or is not a directory ...\n\tif (!file_exists($directory) || !is_dir($directory)) {\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t\t// ... if the path is not readable\n\t} elseif (!is_readable($directory)) {\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t\t// ... else if the path is readable\n\t} else {\n\t\t// we open the directory\n\t\t$handle = opendir($directory);\n\n\t\t// and scan through the items inside\n\t\twhile (FALSE !== ($item = readdir($handle))) {\n\t\t\t// if the filepointer is not the current directory\n\t\t\t// or the parent directory\n\t\t\tif ($item != '.' && $item != '..') {\n\t\t\t\t// we build the new path to delete\n\t\t\t\t$path = $directory . DIRECTORY_SEPARATOR . $item;\n\n\t\t\t\t// if the new path is a directory\n\t\t\t\tif (is_dir($path)) {\n\t\t\t\t\t// we call this function with the new path\n\t\t\t\t\trecursive_remove_directory($path, $empty);\n\t\t\t\t\t// if the new path is a file\n\t\t\t\t} else {\n\t\t\t\t\t// $path = normalize_path($path, false);\n\t\t\t\t\ttry {\n\t\t\t\t\t\t@unlink($path);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// close the directory\n\t\tclosedir($handle);\n\n\t\t// if the option to empty is not set to true\n\t\tif ($empty == FALSE) {\n\t\t\t@rmdir($directory);\n\t\t\t// try to delete the now empty directory\n\t\t\t// if (!rmdir($directory)) {\n\t\t\t//\n\t\t\t// // return false if not possible\n\t\t\t// return FALSE;\n\t\t\t// }\n\t\t}\n\n\t\t// return success\n\t\treturn TRUE;\n\t}\n}", "function remove_directory($directory) {\n\t$it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS);\n\t$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);\n\tforeach ($files as $file) {\n\t\tif ($file->isDir()) {\n\t\t\trmdir($file->getRealPath());\n\t\t} else {\n\t\t\tunlink($file->getRealPath());\n\t\t}\n\t}\n\treturn rmdir($directory);\n}", "function rrmdir($dir) {\r\n\tif (is_dir($dir)) {\r\n\t\t$objects = scandir($dir);\r\n\t\tforeach ($objects as $object) {\r\n\t\t\tif ($object != \".\" && $object != \"..\") {\r\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\r\n\t\t\t}\r\n\t\t}\r\n\t\treset($objects);\r\n\t\treturn rmdir($dir);\r\n\t}\r\n}", "function unlinkRecursive($dir)\n{\n if(!$dh = @opendir($dir))\n {\n return;\n }\n while (false !== ($obj = readdir($dh)))\n {\n if($obj == '.' || $obj == '..')\n {\n continue;\n }\n\n if (!@unlink($dir . '/' . $obj))\n {\n unlinkRecursive($dir.'/'.$obj, true);\n }\n }\n\n closedir($dh);\n \n return;\n}", "function fud_rmdir($dir, $deleteRootToo=false)\n{\n\tif(!$dh = @opendir($dir)) {\n\t\treturn;\n\t}\n\twhile (false !== ($obj = readdir($dh))) {\n\t\tif($obj == '.' || $obj == '..') {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!@unlink($dir .'/'. $obj)) {\n\t\t\tfud_rmdir($dir .'/'. $obj, true);\n\t\t}\n\t}\n\tclosedir($dh);\n\tif ($deleteRootToo) {\n\t\t@rmdir($dir);\n\t}\n\treturn;\n}", "public static function recursive_unlink($file) {\n if (is_dir($file)) {\n // Remove all files in dir.\n $subfiles = array_diff(scandir($file), array('.','..'));\n foreach ($subfiles as $subfile) {\n self::recursive_unlink($file . '/' . $subfile);\n }\n rmdir($file);\n }\n elseif (file_exists($file)) {\n unlink($file);\n }\n }", "function removeDirectory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? removeDirectory($file) : unlink($file);\n }\n rmdir($path);\n return;\n}", "function recursiveDelete($str) {\r\n\tif (is_file($str)) {\r\n\t\treturn @unlink($str);\r\n\t}\r\n\telseif (is_dir($str)) {\r\n\t\t$scan = glob(rtrim($str,'/').'/*');\r\n\t\tforeach($scan as $index=>$path) {\r\n\t\t\trecursiveDelete($path);\r\n\t\t}\r\n\t\treturn @rmdir($str);\r\n\t}\r\n}", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "function rrmdir($dir) {\n if (is_dir($dir)) { \n $objects = scandir($dir); \n foreach ($objects as $object) { \n if ($object != \".\" && $object != \"..\") { \n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object); \n } \n } \n reset($objects);\n rmdir($dir); \n } \n }", "function RecursiveDelete($sDirectory, $bIsEmpty = false) \n{ \n if(substr($sDirectory,-1) == \"/\") \n\t{ \n $sDirectory = substr($sDirectory, 0, -1); \n } \n\n if(!file_exists($sDirectory) || !is_dir($sDirectory)) \n\t{ \n return false; \n } else\n\t\tif(!is_readable($sDirectory)) \n\t\t{ \n\t\t\treturn false; \n\t\t} else \n\t\t{ \n\t\t\t$stDirectoryHandle = opendir($sDirectory); \n\t\t\t\n\t\t\twhile ($sContents = readdir($stDirectoryHandle)) \n\t\t\t{ \n\t\t\t\tif($sContents != '.' && $sContents != '..' && $sContents != '.htaccess') \n\t\t\t\t{ \n\t\t\t\t\t$sPath = $sDirectory . \"/\" . $sContents; \n\t\t\t\t\t\n\t\t\t\t\tif(is_dir($sPath)) \n\t\t\t\t\t{ \n\t\t\t\t\t\tRecursiveDelete($sPath); \n\t\t\t\t\t} else \n\t\t\t\t\t{ \n\t\t\t\t\t\tunlink($sPath); \n\t\t\t\t\t} \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\tclosedir($stDirectoryHandle); \n\n\t\t\tif($bIsEmpty == false) \n\t\t\t{ \n\t\t\t\tif(!rmdir($sDirectory)) \n\t\t\t\t{ \n\t\t\t\t\treturn false; \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\treturn true; \n\t\t} \n}", "function remove_dir($dir){\n\tif( !is_dir( $dir ) )\n\t\treturn false;\n\n\t$objects=scandir($dir);\n\tforeach($objects as $object){\n\t\tif($object!='.'&&$object!='..'){\n\t\t\tif(filetype($dir.'/'.$object)=='dir')\n\t\t\t\tremove_dir($dir.'/'.$object);\n\t\t\telse\n\t\t\t\tunlink($dir.'/'.$object);\n\t\t}\n\t}\n\treset($objects);\n\treturn rmdir($dir);\n}", "function clear_local($dir){\n \n$di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS);\n$ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);\nforeach ( $ri as $file ) {\n $file->isDir() ? rmdir($file) : unlink($file);\n}\n\n\n\n}", "function removeDir($directory){\n foreach(glob(\"{$directory}/*\") as $file){\n if(is_dir($file)) { \n removeDir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "function delTree($dir) { \n\t $files = array_diff(scandir($dir), array('.','..')); \n\t foreach ($files as $file) { \n\t (is_dir(\"$dir/$file\")) ? delTree(\"$dir/$file\") : unlink(\"$dir/$file\"); \n\t } \n\t return rmdir($dir); \n\t}", "function DELETE_RECURSIVE_DIRS($dirname) {\n\t\tif(is_dir($dirname))$dir_handle=opendir($dirname);\n\t\twhile($file=readdir($dir_handle)) {\n\t\t\tif($file!=\".\" && $file!=\"..\") {\n\t\t\t\tif(!is_dir($dirname.\"/\".$file)) unlink ($dirname.\"/\".$file);\n\t\t\telse DELETE_RECURSIVE_DIRS($dirname.\"/\".$file);\n\t\t\t}\n\t\t}\n\t\tclosedir($dir_handle);\n\t\trmdir($dirname);\n\t\treturn true;\n\t}", "function delTree($directory)\n{\n\t$files = array_diff(scandir($directory), array('.','..'));\n \tforeach($files as $file)\n\t{\n\t\t//echo(\"$directory/$file<br />\");\n \t\t(is_dir(\"$directory/$file\")) ? delTree(\"$directory/$file\") : unlink(\"$directory/$file\"); \n \t}\n \treturn rmdir($directory);\n}", "public function recursiveRmdir(string $path) {\n if(!file_exists($path)) { return; }\n $files = glob($path . '/*');\n foreach ($files as $file) {\n if (is_dir($file)) {\n $this->recursiveRmdir($file);\n } else {\n unlink($file);\n }\n }\n rmdir($path);\n }", "function rmdirRecursive($path,$followLinks=false) { \n\t\t$dir = opendir($path) ;\n\t\twhile ($entry = readdir($dir)) { \n\t\t\tif (is_file(\"$path/$entry\") || ((!$followLinks) && is_link(\"$path/$entry\"))) {\n\t\t\t\t@unlink( \"$path/$entry\" );\n\t \t}\n\t \telseif (is_dir(\"$path/$entry\") && $entry!='.' && $entry!='..') {\n\t\t\t\trmdirRecursive(\"$path/$entry\"); // recursive\n\t\t\t}\n\t\t}\n\t\tclosedir($dir);\n\t\treturn @rmdir($path);\n\t}", "function recursive_remove_directory($directory, $empty=FALSE)\n{\n\tif(substr($directory,-1) == '/')\n\t{\n\t\t$directory = substr($directory,0,-1);\n\t}\n\n\t// if the path is not valid or is not a directory ...\n\tif(!file_exists($directory) || !is_dir($directory))\n\t{\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t// ... if the path is not readable\n\t}elseif(!is_readable($directory))\n\t{\n\t\t// ... we return false and exit the function\n\t\treturn FALSE;\n\n\t// ... else if the path is readable\n\t}else{\n\n\t\t// we open the directory\n\t\t$handle = opendir($directory);\n\n\t\t// and scan through the items inside\n\t\twhile (FALSE !== ($item = readdir($handle)))\n\t\t{\n\t\t\t// if the filepointer is not the current directory\n\t\t\t// or the parent directory\n\t\t\tif($item != '.' && $item != '..')\n\t\t\t{\n\t\t\t\t// we build the new path to delete\n\t\t\t\t$path = $directory.'/'.$item;\n\n\t\t\t\t// if the new path is a directory\n\t\t\t\tif(is_dir($path)) \n\t\t\t\t{\n\t\t\t\t\t// we call this function with the new path\n\t\t\t\t\trecursive_remove_directory($path);\n\n\t\t\t\t// if the new path is a file\n\t\t\t\t}else{\n\t\t\t\t\t// we remove the file\n\t\t\t\t\tunlink($path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// close the directory\n\t\tclosedir($handle);\n\n\t\t// if the option to empty is not set to true\n\t\tif($empty == FALSE)\n\t\t{\n\t\t\t// try to delete the now empty directory\n\t\t\tif(!rmdir($directory))\n\t\t\t{\n\t\t\t\t// return false if not possible\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t// return success\n\t\treturn TRUE;\n\t}\n}", "function rrmdir($dir) {\n if (is_dir($dir)) {\n $objects = scandir($dir);\n foreach ($objects as $object) {\n if ($object != \".\" && $object != \"..\") {\n if (filetype($dir.\"/\".$object) == \"dir\") rrmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n }\n }\n reset($objects);\n rmdir($dir);\n }\n }", "private function deleteFolderRecursively($path) {\n\t\t\t$path = self::folderPath($path);\n\t\t\t$handle = opendir($path);\n\t\t\t\n\t\t\tif (!$handle)\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Could not open directory for traversal (recurse): \".$path);\n\t\t \n\t\t while (false !== ($item = readdir($handle))) {\n\t\t\t\tif ($item != \".\" and $item != \"..\" ) {\n\t\t\t\t\t$fullpath = $path.$item;\n\t\n\t\t\t\t\tif (is_dir($fullpath)) {\n\t\t\t\t\t\t$this->deleteFolderRecursively($fullpath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!unlink($fullpath)) {\n\t\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove file (recurse): \".$fullpath);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tclosedir($handle);\n\t\t\t\n\t\t\tif (!rmdir($path))\n\t\t\t\tthrow new ServiceException(\"REQUEST_FAILED\", \"Failed to remove directory (delete_directory_recurse): \".$path);\n\t\t}", "function rmdirRecursive( $dir )\n {\n if ( !is_writable( $dir ) )\n {\n if ( !@chmod( $dir, 0777 ) )\n {\n return FALSE;\n }\n }\n\n $d = dir( $dir );\n while ( FALSE !== ( $entry = $d->read() ) )\n {\n if ( $entry == '.' || $entry == '..' )\n {\n continue;\n }\n $entry = $dir . '/' . $entry;\n if ( is_dir( $entry ) )\n {\n if ( !atkFileUtils::rmdirRecursive( $entry ) )\n {\n return FALSE;\n }\n continue;\n }\n if ( !@unlink( $entry ) )\n {\n $d->close();\n return FALSE;\n }\n }\n\n $d->close();\n\n rmdir( $dir );\n\n return TRUE;\n }", "function ppRmdir($dirname)\n{\n // Sanity check\n if (!file_exists($dirname)) {\n return false;\n }\n \n // Simple delete for a file\n if (is_file($dirname)) {\n return unlink($dirname);\n }\n\n // Loop through the folder\n $dir = dir($dirname);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Recurse\n ppRmdir(\"$dirname/$entry\");\n }\n\n // Clean up\n $dir->close();\n return rmdir($dirname);\n}", "function recursiveDelete ($directory, $empty = true) { \r\n\r\n if(substr($directory,-1) == \"/\") { \r\n $directory = substr($directory,0,-1); \r\n } \r\n\r\n if(!file_exists($directory) || !is_dir($directory)) { \r\n return false; \r\n } elseif(!is_readable($directory)) { \r\n return false; \r\n } else { \r\n $directoryHandle = opendir($directory);\r\n $contents = \".\";\r\n\r\n while ($contents) {\r\n $contents = readdir($directoryHandle);\r\n if(strlen($contents) && $contents != '.' && $contents != '..') {\r\n $path = $directory . \"/\" . $contents; \r\n \r\n if(is_dir($path)) { \r\n recursiveDelete($path); \r\n } else { \r\n unlink($path); \r\n } \r\n } \r\n } \r\n \r\n closedir($directoryHandle); \r\n\r\n if($empty == true) { \r\n if(!rmdir($directory)) {\r\n return false; \r\n } \r\n } \r\n \r\n return true; \r\n } \r\n}", "function rrmdir($src) {\n $dir = opendir($src);\n while(false !== ( $file = readdir($dir)) ) {\n if (( $file != '.' ) && ( $file != '..' )) {\n\n $full = $src . '/' . $file;\n if ( is_dir($full) ) {\n rrmdir($full);\n }\n else {\n unlink($full);\n }\n }\n }\n closedir($dir);\n rmdir($src);\n}", "function rm_rf($file) {\n if (is_dir($file)) {\n if (!($dh = opendir($file))) {\n return false;\n }\n while (($entry = readdir($dh)) !== false) {\n if ($entry == '.' || $entry == '..') continue;\n if (!rm_rf($file . DIRECTORY_SEPARATOR . $entry)) {\n closedir($dh);\n return false;\n }\n }\n closedir($dh);\n return rmdir($file);\n } else {\n return unlink($file);\n }\n}", "function ftp_rm_dir($rmt_dir, $isRecursive=false, $useWhiteList=true) {\n\t\t$rmt_dir = rtrim($rmt_dir, '/');\n\t\tprv_ftp_rm_dir($rmt_dir, $isRecursive, $useWhiteList);\n\t}", "function delete_dir($path)\n{\n $file_scan = scandir($path);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($filecheck != '.' && $filecheck != '..')\n {\n if ($file_extension == '')\n {\n delete_dir($path . $filecheck . '/');\n }\n else\n {\n unlink($path . $filecheck);\n }\n }\n }\n rmdir($path);\n}", "function rrmdir($path) {\n\t$files = glob($path . '/*');\n\tforeach ($files as $file) {\n\t\tis_dir($file) ? rrmdir($file) : unlink($file);\n\t}\n\trmdir($path);\n\treturn;\n}", "protected function wfRecursiveRemoveDir( $dir ) {\n\t\tif ( is_dir( $dir ) ) {\n\t\t\t$objects = scandir( $dir );\n\t\t\tforeach ( $objects as $object ) {\n\t\t\t\tif ( $object != \".\" && $object != \"..\" ) {\n\t\t\t\t\tif ( filetype( $dir . '/' . $object ) == \"dir\" ) {\n\t\t\t\t\t\t$this->wfRecursiveRemoveDir( $dir . '/' . $object );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunlink( $dir . '/' . $object );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treset( $objects );\n\t\t\trmdir( $dir );\n\t\t}\n\t}", "function wpdev_rm_dir($dir) {\r\n\r\n if (DIRECTORY_SEPARATOR == '/')\r\n $dir=str_replace('\\\\','/',$dir);\r\n else\r\n $dir=str_replace('/','\\\\',$dir);\r\n\r\n $files = glob( $dir . '*', GLOB_MARK );\r\n debuge($files);\r\n foreach( $files as $file ){\r\n if( is_dir( $file ) )\r\n $this->wpdev_rm_dir( $file );\r\n else\r\n unlink( $file );\r\n }\r\n rmdir( $dir );\r\n }", "private function rmdir_recursive($dir) {\n $files = scandir($dir);\n array_shift($files); // remove '.' from array\n array_shift($files); // remove '..' from array\n \n foreach ($files as $file) {\n $file = $dir . '/' . $file;\n if (is_dir($file)) {\n $this->rmdir_recursive($file);\n @rmdir($file);\n } else {\n @unlink($file);\n }\n }\n @rmdir($dir);\n }", "public static function rmdir_recursive($dir)\n {\n foreach(scandir($dir) as $file) {\n if ('.' === $file || '..' === $file) continue;\n if (is_dir(\"$dir/$file\")){\n self::rmdir_recursive(\"$dir/$file\");\n }else{\n chmod(\"$dir/$file\", 0777);\n unlink(\"$dir/$file\");\n }\n }\n rmdir($dir);\n }", "function rrmdir($dir) {\n\tif (is_dir($dir)) {\n\t $objects = scandir($dir);\n\n\t //debug($objects);\n\n\t foreach ($objects as $object) {\n\t\tif ($object != \".\" && $object != \"..\") {\n\t\t\t//echo $dir.\"/\".$object . '<br>';\n\n\t\t if (filetype($dir.\"/\".$object) == \"dir\") rmdir($dir.\"/\".$object); else unlink($dir.\"/\".$object);\n\t\t}\n\t }\n\t reset($objects);\n\t rmdir($dir);\n\t}\n }", "public static function removeDirectory($directory,$options=array())\n\t{\n\t\tif(!isset($options['traverseSymlinks']))\n\t\t\t$options['traverseSymlinks']=false;\n\t\t$items=array_merge(\n\t\t\tglob($directory.DIRECTORY_SEPARATOR.'*',GLOB_MARK),\n\t\t\tglob($directory.DIRECTORY_SEPARATOR.'.*',GLOB_MARK)\n\t\t);\n\t\tforeach($items as $item)\n\t\t{\n\t\t\tif(basename($item)=='.' || basename($item)=='..')\n\t\t\t\tcontinue;\n\t\t\tif(substr($item,-1)==DIRECTORY_SEPARATOR)\n\t\t\t{\n\t\t\t\tif(!$options['traverseSymlinks'] && is_link(rtrim($item,DIRECTORY_SEPARATOR)))\n\t\t\t\t\tunlink(rtrim($item,DIRECTORY_SEPARATOR));\n\t\t\t\telse\n\t\t\t\t\tself::removeDirectory($item,$options);\n\t\t\t}\n\t\t\telse\n\t\t\t\tunlink($item);\n\t\t}\n\t\tif(is_dir($directory=rtrim($directory,'\\\\/')))\n\t\t{\n\t\t\tif(is_link($directory))\n\t\t\t\tunlink($directory);\n\t\t\telse\n\t\t\t\trmdir($directory);\n\t\t}\n\t}", "public static function rmdirRecursive($dir)\n {\n $fs = new \\Composer\\Util\\Filesystem();\n if(is_dir($dir)){\n $result = $fs->removeDirectory($dir);\n }else{\n @unlink($dir);\n }\n \n return;\n }", "private function remove_directory($path) {\n $files = glob($path . '/*');\n foreach ($files as $file) {\n is_dir($file) ? remove_directory($file) : unlink($file);\n }\n rmdir($path);\n return;\n }", "function deletedirectory($path)\n{\n $files = glob($path . '*', GLOB_MARK);\n foreach ($files as $file)\n {\n unlink($file);\n }\n rmdir($path);\n}", "private static function rmdirRecursive($path)\n {\n $files = scandir($path);\n array_shift($files);\n array_shift($files);\n\n foreach ($files as $file) {\n $file = $path . DIRECTORY_SEPARATOR . $file;\n if (is_dir($file)) {\n self::rmdirRecursive($file);\n } else {\n unlink($file);\n }\n }\n\n rmdir($path);\n }", "function delete_dir($dir) {\n foreach (array_keys(scan_dir($dir)) as $file) {\n if (is_dir($file)) {\n delete_dir($file);\n } else {\n rm($file);\n }\n }\n\n rmdir($dir);\n}", "function recursive_remove_directory($directory, $empty=FALSE)\r\n{\r\n if(substr($directory,-1) == '/')\r\n {\r\n $directory = substr($directory,0,-1);\r\n }\r\n if(!file_exists($directory) || !is_dir($directory))\r\n {\r\n return FALSE;\r\n }elseif(is_readable($directory))\r\n {\r\n $handle = opendir($directory);\r\n while (FALSE !== ($item = readdir($handle)))\r\n {\r\n if($item != '.' && $item != '..')\r\n {\r\n $path = $directory.'/'.$item;\r\n if(is_dir($path)) \r\n {\r\n recursive_remove_directory($path);\r\n }else{\r\n unlink($path);\r\n }\r\n }\r\n }\r\n closedir($handle);\r\n if($empty == FALSE)\r\n {\r\n if(!rmdir($directory))\r\n {\r\n return FALSE;\r\n }\r\n }\r\n }\r\n return TRUE;\r\n }", "function remove_directory($directory='')\n{\n\t$safe_mode = ini_get('safe_mode');\n\n\tif (!is_dir($directory)) {\n\t\treturn true;\n\t}\n\n\t// need to use the '@' in case we can't open the directory\n\t// otherwise it still throws a notice.\n\tif (!$handle = @opendir($directory)) {\n\t\treturn false;\n\t}\n\n\twhile (($file = readdir($handle)) !== false) {\n\t\tif ($file == '.' || $file == '..') {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$f = $directory . '/' . $file;\n\t\tif (is_dir($f)) {\n\t\t\tremove_directory($f);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (is_file($f)) {\n\t\t\tif (!unlink($f)) {\n\t\t\t\tclosedir($handle);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($handle);\n\n\tif ($safe_mode) {\n\t\t$status = true;\n\t} else {\n\t\t$status = rmdir($directory);\n\t}\n\treturn $status;\n}", "function _removeDir($dir) {\r\n\t\tif(file_exists($dir)) {\r\n\t\t\tif($objs = glob($dir.\"/*\"))\r\n\t\t\t\tforeach($objs as $obj) {\r\n\t\t\t\t\tis_dir($obj) ? rmdir($obj) : unlink($obj);\r\n\t\t\t\t}\r\n\t\t\trmdir($dir);\r\n\t\t}\r\n\t}", "function rmdirRecursively($dir,$noExclude=false) {\n global $exc;\n $trace = '';\n\n // $noExclude |= ( preg_match('/\\w{0,}-\\w{0,}-[0-9|a|b|c|d|e|f]{12}/',$dir) > 0);\n # var_dump($noExclude);\n\n $trace.= \"Erase dir: \" . $dir .\"<Br/>\";\n\n $it = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($dir),\n RecursiveIteratorIterator::CHILD_FIRST\n );\n\n // FilesystemIterator::SKIP_DOTS ./ 5.3+\n\n $excludeDirsNames = isset($exc[\"folders\"]) ? $exc[\"folders\"] : array();\n $excludeFileNames = isset($exc[\"files\"]) ? $exc[\"files\"] : array();\n\n foreach ($it as $entry) {\n\n if ($entry->isDir()) {\n \n // php 5.2 support for skipdot \n if($entry->getFilename() == '.' or $entry->getFilename() == '..'){\n continue;\n }\n \n if ($noExclude || !in_array(getRootName($entry->getPathname()), $excludeDirsNames)) {\n $trace.= rmdirRecursively($entry->getPathname());\n rmdir($entry->getPathname()); // remove dir after its empty\n }\n else{\n $trace.= \"Erase dir: \" . $entry->getPathname() . \" <mark><b>SKIPPED</b></mark><br/>\";\n }\n } elseif ( $noExclude || ( !in_array($entry->getFilename(), $excludeFileNames) && !in_array(getRootName($entry->getPathname()), $excludeDirsNames)) ) {\n $trace.= \"--Erase file: \" . $entry->getPathname() .\"<br/>\";\n unlink($entry->getPathname());\n }\n else{\n $trace.= \"--Erase file: \" . $entry->getPathname() . \" <mark><b>SKIPPED</b></mark><br/>\";\n } \n }\n\n return $trace;\n}", "function deleteTree($dir)\n{\n if (empty($dir) or !$dir) {\n return;\n }\n $dir = realpath($dir);\n $pathLength = strlen($dir);\n $files = array_diff(scandir($dir), array('.', '..'));\n foreach ($files as $file) {\n $file_ = realpath(\"$dir/$file\");\n if (strncmp($file_, $dir, $pathLength) !== 0) {\n throw new Exception(\"Deleting file '$file' would have gone out of base directory ('$dir') => '$file_'.\");\n }\n (is_dir($file_)) ? deleteTree($file_) : unlink($file_);\n }\n rmdir($dir);\n}", "function remove_dir($path) {\n\t\tif (file_exists($path) && is_dir($path))\n\t\t\trmdir($path);\n\t}", "function unlink_directory($folder) {\n if(is_dir($folder)) {\n $dh = opendir($folder);\n }\n if(!$dh) return false;\n while(false !== ($file = readdir($dh))) {\n if($file != '.' AND $file != '..') {\n if(!is_dir($folder.$file)) {\n unlink($folder.$file);\n } else {\n unlink_directory($folder.$file.'/');\n }\n }\n }\n closedir($dh);\n rmdir($folder);\n return true;\n}", "function delete_directory($dirname) {\n if (is_dir($dirname))\n $dir_handle = opendir($dirname);\nif (!$dir_handle)\n return false;\nwhile($myfile = readdir($dir_handle)) {\n if ($myfile != \".\" && $myfile != \"..\") {\n if (!is_dir($dirname.\"/\".$myfile))\n unlink($dirname.\"/\".$myfile);\n else\n delete_directory($dirname.'/'.$myfile);\n }\n}\nclosedir($dir_handle);\nrmdir($dirname);\nreturn true;\n}", "function borrarCarpeta($carpeta) {\r\n foreach(glob($carpeta . \"/*\") as $archivos_carpeta){ \r\n if (is_dir($archivos_carpeta)){\r\n if($archivos_carpeta != \".\" && $archivos_carpeta != \"..\") {\r\n borrarCarpeta($archivos_carpeta);\r\n }\r\n } else {\r\n unlink($archivos_carpeta);\r\n }\r\n }\r\n rmdir($carpeta);\r\n}", "function delete_dir_with_file($target)\n{\n if (is_dir($target)) {\n $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned\n\n foreach ($files as $file) {\n delete_dir_with_file($file);\n }\n\n if (file_exists($target)) {\n rmdir($target);\n }\n } elseif (is_file($target)) {\n unlink($target);\n }\n}", "function cleandir($dir)\n{\n\t$dir = preg_replace('!/*$!', '', $dir);\n\n\tif (!@is_dir($dir)) {\n\t\techo 'Couldn\\'t delete \"'. $dir .'\", directory does not exist<br />';\n\t\treturn;\n\t}\n\n\t$dirs = array(realpath($dir));\n\n\twhile (list(,$v) = each($dirs)) {\n\t\tif (!($files = glob($v .'/*', GLOB_NOSORT))) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach ($files as $file) {\n\t\t\tif (strpos($file, 'GLOBALS.php') !== false || strpos($file, 'oldfrm_upgrade.php') !== false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\n\t\t\tif (is_dir($file) && !is_link($file)) {\n\t\t\t\t$dirs[] = $file;\n\t\t\t} else if (!unlink($file)) {\n\t\t\t\techo '<b>Could not delete file \"'. $file .'\"<br />';\n\t\t\t}\n\t\t}\n\t}\n\n\tforeach (array_reverse($dirs) as $dir) {\n\t\tif (!rmdir($dir)) {\n\t\t\techo '<b>Could not delete directory \"'. $dir .'\"<br />';\n\t\t}\n\t}\n}", "function rrmdir($dir)\n{\n\tif (is_dir($dir))\n\t{\n\t\t$objects = scandir($dir);\n\t\tforeach ($objects as $object)\n\t\t{\n\t\t\tif ($object != \".\" && $object != \"..\")\n\t\t\t{\n\t\t\t\tif (filetype($dir.\"/\".$object) == \"dir\")\n\t\t\t\t$this->rrmdir($dir.\"/\".$object); \n\t\t\t\telse unlink($dir.\"/\".$object);\n\t\t\t}\n\t\t}\n\t\treset($objects);\n\t\trmdir($dir);\n\t}\n}", "public function rrmdir($path) {\n try {\n $i = new DirectoryIterator($path);\n foreach ($i as $f) {\n if ($f->isFile()) {\n unlink($f->getRealPath());\n } else if (!$f->isDot() && $f->isDir()) {\n $this->rrmdir($f->getRealPath());\n }\n }\n rmdir($path);\n } catch(\\Exception $e ){}\n }", "function rm_r ($what)\n{\n\tif (!is_dir($what))\n\t\tunlink($what);\n\telse\n\t{\n\t\t$dir = getTreeStructure($what, GTS_ALL, GTS_SHALLOW);\n\t\t\n\t\tfor($i=0; $i<count($dir); $i++)\n\t\t\trm_r($what . '/' . $dir[$i]);\n\t\t\n\t\trmdir($what);\n\t}\n}", "protected function removeRecursively(string $dir): bool\n {\n $success = $this->removeFiles($dir);\n\n $objects = $this->streamSafeGlob($dir, '*');\n\n foreach ($objects as $object) {\n if (!is_dir($object)) {\n continue;\n }\n\n if (is_link($object)) {\n unlink($object);\n } else {\n $success = $this->removeRecursively($object) && $success;\n rmdir($object);\n }\n }\n\n return $success;\n }", "function rrmdir($dir)\n {\n if (is_dir($dir)) {\n $files = scandir($dir);\n foreach ($files as $file) {\n if (filetype($dir . \"/\" . $file) == \"dir\") {\n rrmdir($dir . \"/\" . $file);\n } else {\n unlink($dir . \"/\" . $file);\n }\n }\n rmdir($dir);\n }\n }", "protected function recursiveRemoveDirectory($directory) {\n foreach (glob(\"{$directory}/{,.}*\", GLOB_BRACE) as $file) {\n if ($file === \"{$directory}/.\" || $file === \"{$directory}/..\")\n continue;\n if (is_dir($file)) {\n $this->recursiveRemoveDirectory($file);\n } else {\n unlink($file);\n }\n }\n rmdir($directory);\n }", "function deltree($dir)\n {\n if (! file_exists($dir)) {\n return false;\n }\n\n $files = array_diff(scandir($dir), ['.', '..']);\n\n foreach ($files as $file) {\n (is_dir(\"$dir/$file\")) ? delTree(\"$dir/$file\") : unlink(\"$dir/$file\");\n }\n\n return rmdir($dir);\n }", "function delDir($dir) {\n if (!file_exists($dir)) return true;\n if (!is_dir($dir)) return unlink($dir);\n foreach (scandir($dir) as $item) {\n if ($item == '.' || $item == '..') continue;\n if (!delDir($dir . DS . $item)) return false;\n }\n return rmdir($dir);\n}", "function DeleteTree($object, $recursive = TRUE) {\n if ($recursive && is_dir($object)) {\n $els = GetFilesList($object);\n foreach ($els as $el) {\n DeleteTree($object.DS.$el, $recursive);\n }\n }\n return (is_dir($object)) ? rmdir($object) : unlink($object);\n}", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function fn_rm($source, $delete_root = true, $pattern = '')\n{\n // Simple copy for a file\n if (is_file($source)) {\n $res = true;\n if (empty($pattern) || (!empty($pattern) && preg_match('/' . $pattern . '/', fn_basename($source)))) {\n $res = @unlink($source);\n }\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source) && $dir = dir($source)) {\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_rm($source . '/' . $entry, true, $pattern) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return ($delete_root == true && empty($pattern)) ? @rmdir($source) : true;\n } else {\n return false;\n }\n}", "public function rmdir_recursive($dir) {\n foreach (scandir($dir) as $file) {\n if ('.' === $file || '..' === $file)\n continue;\n if (is_dir(\"$dir/$file\"))\n $this->rmdir_recursive(\"$dir/$file\");\n else\n unlink(\"$dir/$file\");\n }\n\n rmdir($dir);\n }", "public static function rmdirRecursive(string $path) : File\n {\n return (new File($path))->rmdirRecursive();\n }", "function rrmdir($path)\n{\n exec(\"rm -rf {$path}\");\n}", "function unlink_recursive($path, $fail_callback = null) {\n if ($fail_callback === null) {\n $fail_callback = function($path) {\n trigger_error(\"Could not delete \\\"$path\\\".\", E_USER_ERROR);\n };\n }\n if (is_file($path)) {\n if (@unlink($path) === false) {\n $fail_callback($path);\n return false;\n }\n } else {\n foreach (scandir($path) as $node) {\n if ($node === \".\" || $node === \"..\")\n continue;\n if (!unlink_recursive(\"$path/$node\"))\n return false;\n }\n if (@rmdir($path) === false) {\n $fail_callback($path);\n return false;\n }\n }\n return true;\n}", "function delete_dir($directory) {\n //If it's empty or contains root, don't let it delete the root directory!\n if($directory === '/' || !isset($directory)) {\n //TODO: When you decide to make a logging mechanism, log that someone tried deleting root.\n return false;\n }\n \n //Scan the files in the subdirectory (and remove '.' and '..' <- I forget why these even exist)\n $items = array_diff(scandir($directory), array('.', '..'));\n //Now determine if each one is a file or subdirectory:\n foreach($items as $item) {\n //Recursively delete the subdirectory inside the current directory:\n if(is_dir($directory . '/' . $item)) {\n delete_dir($directory . '/' . $item);\n }\n else { //If it's a file, delete it:\n unlink($directory . '/' . $item);\n }\n }\n //Finally, try deleting this deepest-level directory\n return rmdir($directory);\n }", "private function remove_dir($path) {\n\t $item = new DirectoryIterator($path);\n\t foreach($item as $folder) {\n\t if($folder->isFile()) {\n\t unlink($folder->getRealPath());\n\t } else if(!$folder->isDot() && $folder->isDir()) {\n\t $this->remove_dir($folder->getRealPath());\n\t }\n\t }\n\t rmdir($path);\n\t}", "public function removeDir($p){\n //remove / from last character\n if( substr($p, strlen($p)-1, 1) == '/' ) $p = substr($p, 0, strlen($p)-1);\n\n //check is dir\n if( is_dir($p) ){\n $files = scandir($p);\n\n foreach($files as $file){\n if( $file != '..' && $file != '.' ){\n if( !is_dir($p . '/' . $file) ) unlink($p . '/' . $file); else $this->removeDir($p . '/' . $file);\n }\n }//end foreach\n\n rmdir( $p );//remove empty folder\n }//end if\n\n return true;\n }", "function rmdirr($dirname)\n{\n // Sanity check\n if (!file_exists($dirname)) {\n return false;\n }\n\n // Simple delete for a file\n if (is_file($dirname) || is_link($dirname)) {\n return unlink($dirname);\n }\n\n // Loop through the folder\n $dir = dir($dirname);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n\n // Recurse\n rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);\n }\n\n // Clean up\n $dir->close();\n return rmdir($dirname);\n}", "public function removeDirectory($file)\n\t{\n\t\t$errors = 0;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Remove trailing slashes..\n\t\t//-----------------------------------------\n\t\t\n\t\t$file = rtrim( $file, '/' );\n\t\t\n\t\tif ( file_exists($file) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Attempt CHMOD\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t@chmod( $file, IPS_FOLDER_PERMISSION );\n\t\t\t\n\t\t\tif ( is_dir( $file ) )\n\t\t\t{\n\t\t\t\t$handle = opendir( $file );\n\t\t\t\t\n\t\t\t\twhile ( ($filename = readdir($handle)) !== false )\n\t\t\t\t{\n\t\t\t\t\tif ( ($filename != \".\") && ($filename != \"..\") )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->removeDirectory( $file . \"/\" . $filename );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tclosedir($handle);\n\t\t\t\t\n\t\t\t\tif ( ! @rmdir($file) )\n\t\t\t\t{\n\t\t\t\t\t$errors++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( ! @unlink($file) )\n\t\t\t\t{\n\t\t\t\t\t$errors++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $errors == 0 )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function extend_delete_directory($dirname){\n if (is_dir($dirname))\n // change its mode to 755 (rwx,rw,rw)\n chmod($dirname, 0755);\n\n // open the directory, the script cannot open the directory then stop\n $dir_handle = opendir($dirname);\n if (!$dir_handle)\n return false;\n\n // traversal for every entry in the directory\n while (($file = readdir($dir_handle)) !== false){\n // ignore '.' and '..' directory\n if ($file != \".\" && $file != \"..\") {\n\n // if entry is directory then go recursive !\n if (is_dir($dirname.\"/\".$file)){\n extend_delete_directory($dirname.'/'.$file);\n\n // if file then delete this entry\n } else {\n unlink($dirname.\"/\".$file);\n }\n }\n }\n // chose the directory\n closedir($dir_handle);\n\n // delete directory\n rmdir($dirname);\n}", "static function deleteDir($dir) {\n if (file_exists($dir)) {\n $iterator = new RecursiveDirectoryIterator($dir);\n foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {\n if ($file->isDir()) {\n rmdir($file->getPathname());\n } else {\n unlink($file->getPathname());\n }\n }\n rmdir($dir);\n }\n }" ]
[ "0.7608796", "0.7591758", "0.75141746", "0.74944925", "0.7427784", "0.7362288", "0.7359423", "0.73390704", "0.72920024", "0.72878957", "0.72793853", "0.72610784", "0.7256907", "0.72455513", "0.72195005", "0.72153896", "0.7211862", "0.72017395", "0.7198957", "0.71957517", "0.71874654", "0.7176013", "0.7163653", "0.71534026", "0.71068025", "0.7093021", "0.708128", "0.7070949", "0.70603484", "0.70556366", "0.7049827", "0.7042853", "0.7035068", "0.70294225", "0.7017254", "0.7009328", "0.7005753", "0.6999975", "0.6972044", "0.696679", "0.69560134", "0.69311416", "0.69177264", "0.6917092", "0.69157755", "0.69149417", "0.69142085", "0.6909912", "0.6907067", "0.6905744", "0.68894607", "0.6888429", "0.688394", "0.68465453", "0.6839093", "0.68297344", "0.680666", "0.67869043", "0.6780473", "0.6766965", "0.67659336", "0.6762489", "0.67619985", "0.6754897", "0.6751734", "0.67500854", "0.6732143", "0.6726031", "0.67102385", "0.6705951", "0.67026234", "0.66995764", "0.66975147", "0.669543", "0.6691622", "0.6677957", "0.6665819", "0.6655391", "0.66383296", "0.66306585", "0.66253793", "0.6622014", "0.6618389", "0.6612142", "0.65995735", "0.6598244", "0.6593347", "0.658737", "0.6571859", "0.6571444", "0.6564579", "0.65535057", "0.6544935", "0.65391946", "0.65384436", "0.65334016", "0.65220207", "0.6518355", "0.6511935", "0.64895284" ]
0.6849894
53
PHP seems to have problems correctly detecting utf8 encoding of some .tex files when they are read with the standard file_get_contents() functinon (is this expected?). The following has turned out to work in all cases I have tested.
public function file_get_contents_utf8( $path ) { $content = file_get_contents($path); $encoding = mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true); $content = mb_convert_encoding($content, 'UTF-8', $encoding); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function file_get_contents_utf8($fn) {\r\n\t$content = @file_get_contents($fn);\r\n\tif ( $content === false ) {return false;}\r\n\treturn mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n}", "function file_get_contents_utf8($fn) {\r\n $content = file_get_contents($fn);\r\n return mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n // return iconv(mb_detect_encoding($content, 'UTF-8, ISO-8859-2, ISO-8859-1, ASCII'), true), \"UTF-8\", $content);\r\n}", "function file_get_contents_utf8_advanced($fn) {\r\n\t$options = array(\r\n\t\t'http' => array(\r\n\t\t\t'method' => \"GET\",\r\n\t\t\t'user_agent' => \"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\\r\\n\", // i.e. Googlebot\r\n\t\t\t'header' => \"Accept-language: en\\r\\n\"\r\n\t\t)\r\n\t);\r\n\r\n $context = stream_context_create($options);\r\n $content = file_get_contents($fn, false, $context);\r\n \r\n\tif ( $content === false ) {return false;}\r\n\treturn mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n}", "protected function checkLocaleWithUTF8filesystem() {}", "public function isUTF8() {\r\n if (preg_match('!!u', $this->contents)) return true;\r\n return false;\r\n }", "function seems_utf8($str)\n {\n }", "function iptc_return_utf8($text)\n\t{\n\t# Used for iptc headers to auto-detect the character encoding.\n\tglobal $iptc_expectedchars,$mysql_charset;\n\t\n\t# No inconv library? Return text as-is\n\tif (!function_exists(\"iconv\")) {return $text;}\n\t\n\t# No expected chars set? Return as is\n\tif ($iptc_expectedchars==\"\" || $mysql_charset==\"utf8\") {return $text;}\n\t\n\t$try=array(\"UTF-8\",\"ISO-8859-1\",\"Macintosh\",\"Windows-1252\");\n\tfor ($n=0;$n<count($try);$n++)\n\t\t{\n\t\tif ($try[$n]==\"UTF-8\") {$trans=$text;} else {$trans=@iconv($try[$n], \"UTF-8\", $text);}\n\t\tfor ($m=0;$m<strlen($iptc_expectedchars);$m++)\n\t\t\t{\n\t\t\tif (strpos($trans,substr($iptc_expectedchars,$m,1))!==false) {return $trans;}\n\t\t\t}\n\t\t}\n\treturn $text;\n\t}", "public function testEncoding() {\n $content = utf8_decode(self::ENCODING_CONTENT);\n file_put_contents($this->destination_encoding_file, $content);\n //The first time, the file should be converted, as its content is not utf8 encoded.\n $this->assertTrue(HermesHelper::encodeUTF8($this->destination_encoding_file));\n //The next time, the file should be already converted, and nothing should be done.\n $this->assertFalse(HermesHelper::encodeUTF8($this->destination_encoding_file));\n }", "final public static function load_gettext($from) {\n static $byte = NULL;\n\n\n if (is_null($byte)) {\n $byte = function ($length, $endian, &$resource) {\n return unpack(($endian ? 'N' : 'V') . $length, fread($resource, 4 * $length));\n };\n }\n\n\n if ( ! is_file($from)) {\n return FALSE;\n }\n\n\n $out = array();\n $resource = fopen($from, 'rb');\n\n $test = $byte(1, $endian, $resource);\n $part = strtolower(substr(dechex($test[1]), -8));\n $endian = '950412de' === $part ? FALSE : ('de120495' === $part ? TRUE : NULL);\n\n $test = $byte(1, $endian, $resource);// revision\n $test = $byte(1, $endian, $resource);// bytes\n $all = $test[1];\n\n // offsets\n $test = $byte(1, $endian, $resource);\n $omax = $test[1];// original\n\n $test = $byte(1, $endian, $resource);\n $tmax = $test[1];// translate\n\n // tables\n fseek($resource, $omax);// original\n $otmp = $byte(2 *$all, $endian, $resource);\n\n fseek($resource, $tmax);// translate\n $ttmp = $byte(2 *$all, $endian, $resource);\n\n for ($i = 0; $i < $all; $i += 1) {\n $orig = -1;\n\n if ($otmp[$i * 2 + 1] <> 0) {\n fseek($resource, $otmp[$i * 2 + 2]);\n $orig = fread($resource, $otmp[$i * 2 + 1]);\n }\n\n if ($ttmp[$i * 2 + 1] <> 0) {\n fseek($resource, $ttmp[$i * 2 + 2]);\n $out[$orig] = fread($resource, $ttmp[$i * 2 + 1]);\n }\n }\n\n fclose($resource);\n unset($out[-1]);\n\n return $out;\n }", "function validate_utf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n}", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public function getUnicodeFileSpecification($encoding = 'UTF-8') {}", "function _tc($fileName, $args = array())\n{\n global $lc_defaultLang;\n global $lc_lang;\n\n $langs = array($lc_lang, $lc_defaultLang);\n foreach ($langs as $lng) {\n $file = I18N . 'ctn/' . $lng . '/' . $fileName . '.' . $lng;\n if (is_file($file) && file_exists($file)) {\n $content = file_get_contents($file);\n if (count($args)) {\n foreach ($args as $key => $value) {\n $regex = '/'.$key.'\\b/i';\n $content = preg_replace($regex, $value, $content);\n }\n }\n return $content;\n }\n }\n return '';\n}", "function test1(){\n $tests = array();\n $tests[] = array('äa.txt', '%5g]a.txt');\n $tests[] = array('ä.', '%5g].');\n $tests[] = array('asciistring','asciistring');\n $tests[] = array('ascii-_/.string','ascii-_/.string');\n $tests[] = array('AName','%x%1a]ame');\n $tests[] = array('A Name','%x%0%1a]ame');\n $tests[] = array('Another...Name','%x]nother...%1a]ame');\n $tests[] = array('Aß∂ƒName','%x%5b%6oy%aa%1a]ame');\n $tests[] = array('A%ß-∂_.ƒName','%x%%5b]-%6oy]_.%aa%1a]ame');\n $tests[] = array('A%%ß-∂_.ƒName','%x%%%5b]-%6oy]_.%aa%1a]ame');\n $tests[] = array('데이터도 함께 복원됩니다. 강력한','%zf4%13dg%15ao%zhg%0%164o%yig%0%11at%138w%zk9%zag%zb8].%0%xyt%10cl%164c]');\n $tests[] = array('совместимая','%td%ta%sy%t8%t1%td%te%t4%t8%sw%tr]');\n $tests[] = array('нехватка_файлового_пространства_на_сервере_p0-squid.some.domain.1270211897.txt.gz','%t9%t1%th%sy%sw%te%t6%sw]_%tg%sw%t5%t7%ta%sy%ta%sz%ta]_%tb%tc%ta%td%te%tc%sw%t9%td%te%sy%sw]_%t9%sw]_%td%t1%tc%sy%t1%tc%t1]_p0-squid.some.domain.1270211897.txt.gz');\n\n $tests[] = array('name[1]','name[1]');\n $tests[] = array('Name[1]','%1a]ame[1]');\n $tests[] = array('Name[A]','%1a]ame[%x]]');\n\n foreach($tests as $test){\n list($utf8,$safe) = $test;\n $this->assertEquals(SafeFN::encode($utf8),$safe);\n $this->assertEquals(SafeFN::decode($safe),$utf8);\n }\n }", "public function testFindUnicodeText(): void\n {\n $soup = new Soup('<h1>寿司🍣</h1>');\n $this->assertEquals('寿司🍣', $soup->find(text: '寿司🍣'));\n }", "function _validate_utf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n}", "public function readFile() {\n\t\ttry {\n\t\t\tparent::readFile();\n\t\t} catch (LFException $e) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// convert all language values from utf-8 to the original charset\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, FALSE, array('default'));\n\t\t}\n\t}", "public function getLabelFileContents($raw = false)\n {\n if (isset($this->data['Label']['FileContents']['Contents'])) {\n if ($raw) {\n return $this->data['Label']['FileContents']['Contents'];\n }\n try {\n return gzdecode(base64_decode($this->data['Label']['FileContents']['Contents']));\n } catch (Exception $ex) {\n $this->log('Failed to convert label file, file might be corrupt: '.$ex->getMessage(), 'Urgent');\n }\n\n return false;\n } else {\n return false;\n }\n }", "private function check_utf8_support() {\n\t\treturn 'utf-8' === strtolower( get_bloginfo( 'charset' ) );\n\t}", "public function testFixUtf8()\n {\n // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt\n $tests = [\n '1 Some correct UTF-8 text' => [\n \"\\u{3BA}\\u{1F79}\\u{3C3}\\u{3BC}\\u{3B5}\",\n \"\\u{3BA}\\u{1F79}\\u{3C3}\\u{3BC}\\u{3B5}\",\n ],\n '2 Boundary condition test cases' => [\n '2.1 First possible sequence of a certain length' => [\n '2.1.1 1 byte (U-00000000)' => [\n \"\\x00\",\n \"\\x00\",\n ],\n '2.1.2 2 bytes (U-00000080)' => [\n \"\\u{80}\",\n \"\\u{80}\",\n ],\n '2.1.3 3 bytes (U-00000800)' => [\n \"\\u{800}\",\n \"\\u{800}\",\n ],\n '2.1.4 4 bytes (U-00010000)' => [\n \"\\u{10000}\",\n \"\\u{10000}\",\n ],\n '2.1.5 5 bytes (U-00200000)' => [\n \"\\xF8\\x88\\x80\\x80\\x80\",\n '',\n ],\n '2.1.6 6 bytes (U-04000000)' => [\n \"\\xFC\\x84\\x80\\x80\\x80\\x80\",\n '',\n ],\n ],\n '2.2 Last possible sequence of a certain length' => [\n '2.2.1 1 byte (U-0000007F)' => [\n \"\\x7F\",\n \"\\x7F\",\n ],\n '2.2.2 2 bytes (U-000007FF)' => [\n \"\\u{7FF}\",\n \"\\u{7FF}\",\n ],\n '2.2.3 3 bytes (U-0000FFFF)' => [\n \"\\u{FFFF}\",\n \"\\u{FFFF}\",\n ],\n '2.2.4 4 bytes (U-001FFFFF)' => [\n \"\\xF7\\xBF\\xBF\\xBF\",\n '',\n ],\n '2.2.5 5 bytes (U-03FFFFFF)' => [\n \"\\xFB\\xBF\\xBF\\xBF\\xBF\",\n '',\n ],\n '2.2.6 6 bytes (U-7FFFFFFF)' => [\n \"\\xFD\\xBF\\xBF\\xBF\\xBF\\xBF\",\n '',\n ],\n ],\n '2.3 Other boundary conditions' => [\n '2.3.1 U-0000D7FF' => [\n \"\\u{D7FF}\",\n \"\\u{D7FF}\",\n ],\n '2.3.2 U-0000E000' => [\n \"\\u{E000}\",\n \"\\u{E000}\",\n ],\n '2.3.3 U-0000FFFD' => [\n \"\\u{FFFD}\",\n \"\\u{FFFD}\",\n ],\n '2.3.4 U-0010FFFF' => [\n \"\\u{10FFFF}\",\n \"\\u{10FFFF}\",\n ],\n '2.3.5 U-00110000' => [\n \"\\xF4\\x90\\x80\\x80\",\n '',\n ],\n ],\n ],\n '3 Malformed sequences' => [\n '3.1 Unexpected continuation bytes' => [\n '3.1.1 First continuation byte 0x80' => [\n \"\\x80\",\n '',\n ],\n '3.1.2 Last continuation byte 0xbf' => [\n \"\\xBF\",\n '',\n ],\n '3.1.3 2 continuation bytes' => [\n \"\\x80\\xBF\",\n '',\n ],\n '3.1.4 3 continuation bytes' => [\n \"\\x80\\xBF\\x80\",\n '',\n ],\n '3.1.5 4 continuation bytes' => [\n \"\\x80\\xBF\\x80\\xBF\",\n '',\n ],\n '3.1.6 5 continuation bytes' => [\n \"\\x80\\xBF\\x80\\xBF\\x80\",\n '',\n ],\n '3.1.7 6 continuation bytes' => [\n \"\\x80\\xBF\\x80\\xBF\\x80\\xBF\",\n '',\n ],\n '3.1.8 7 continuation bytes' => [\n \"\\x80\\xBF\\x80\\xBF\\x80\\xBF\\x80\",\n '',\n ],\n '3.1.9 Sequence of all 64 possible continuation bytes (0x80-0xbf)' => [\n implode('', range(\"\\x80\", \"\\xBF\")),\n '',\n ],\n ],\n '3.2 Lonely start characters' => [\n '3.2.1 All 32 first bytes of 2-byte sequences (0xc0-0xdf), each followed by a space character' => [\n implode(' ', range(\"\\xC0\", \"\\xDF\")) . ' ',\n str_repeat(' ', 32),\n ],\n '3.2.2 All 16 first bytes of 3-byte sequences (0xe0-0xef), each followed by a space character' => [\n implode(' ', range(\"\\xE0\", \"\\xEF\")) . ' ',\n str_repeat(' ', 16),\n ],\n '3.2.3 All 8 first bytes of 4-byte sequences (0xf0-0xf7), each followed by a space character' => [\n implode(' ', range(\"\\xF0\", \"\\xF7\")) . ' ',\n str_repeat(' ', 8),\n ],\n '3.2.4 All 4 first bytes of 5-byte sequences (0xf8-0xfb), each followed by a space character' => [\n implode(' ', range(\"\\xF8\", \"\\xFB\")) . ' ',\n str_repeat(' ', 4),\n ],\n '3.2.5 All 2 first bytes of 6-byte sequences (0xfc-0xfd), each followed by a space character' => [\n implode(' ', range(\"\\xFC\", \"\\xFD\")) . ' ',\n str_repeat(' ', 2),\n ],\n ],\n '3.3 Sequences with last continuation byte missing' => [\n '3.3.1 2-byte sequence with last byte missing (U+0000)' => [\n \"\\xC0\",\n '',\n ],\n '3.3.2 3-byte sequence with last byte missing (U+0000)' => [\n \"\\xE0\\x80\",\n '',\n ],\n '3.3.3 4-byte sequence with last byte missing (U+0000)' => [\n \"\\xF0\\x80\\x80\",\n '',\n ],\n '3.3.4 5-byte sequence with last byte missing (U+0000)' => [\n \"\\xF8\\x80\\x80\\x80\",\n '',\n ],\n '3.3.5 6-byte sequence with last byte missing (U+0000)' => [\n \"\\xFC\\x80\\x80\\x80\\x80\",\n '',\n ],\n '3.3.6 2-byte sequence with last byte missing (U-000007FF)' => [\n \"\\xDF\",\n '',\n ],\n '3.3.7 3-byte sequence with last byte missing (U-0000FFFF)' => [\n \"\\xEF\\xBF\",\n '',\n ],\n '3.3.8 4-byte sequence with last byte missing (U-001FFFFF)' => [\n \"\\xF7\\xBF\\xBF\",\n '',\n ],\n '3.3.9 5-byte sequence with last byte missing (U-03FFFFFF)' => [\n \"\\xFB\\xBF\\xBF\\xBF\",\n '',\n ],\n '3.3.10 6-byte sequence with last byte missing (U-7FFFFFFF)' => [\n \"\\xFD\\xBF\\xBF\\xBF\\xBF\",\n '',\n ],\n ],\n '3.4 Concatenation of incomplete sequences' => [\n \"\\xC0\\xE0\\x80\\xF0\\x80\\x80\\xF8\\x80\\x80\\x80\\xFC\\x80\\x80\\x80\\x80\\xDF\\xEF\\xBF\\xF7\\xBF\\xBF\\xFB\\xBF\\xBF\\xBF\\xFD\\xBF\\xBF\\xBF\\xBF\",\n '',\n ],\n '3.5 Impossible bytes' => [\n '3.5.1 fe' => [\n \"\\xFE\",\n '',\n ],\n '3.5.2 ff' => [\n \"\\xFF\",\n '',\n ],\n '3.5.3 fe fe ff ff' => [\n \"\\xFE\\xFE\\xFF\\xFF\",\n '',\n ],\n ],\n ],\n '4 Overlong sequences' => [\n '4.1 Examples of an overlong ASCII character' => [\n '4.1.1 U+002F = c0 af' => [\n \"\\xC0\\xAF\",\n '',\n ],\n '4.1.2 U+002F = e0 80 af' => [\n \"\\xE0\\x80\\xAF\",\n '',\n ],\n '4.1.3 U+002F = f0 80 80 af' => [\n \"\\xF0\\x80\\x80\\xAF\",\n '',\n ],\n '4.1.4 U+002F = f8 80 80 80 af' => [\n \"\\xF8\\x80\\x80\\x80\\xAF\",\n '',\n ],\n '4.1.5 U+002F = fc 80 80 80 80 af' => [\n \"\\xFC\\x80\\x80\\x80\\x80\\xAF\",\n '',\n ],\n ],\n '4.2 Maximum overlong sequences' => [\n '4.2.1 U-0000007F = c1 bf' => [\n \"\\xC1\\xBF\",\n '',\n ],\n '4.2.2 U-000007FF = e0 9f bf' => [\n \"\\xE0\\x9F\\xBF\",\n '',\n ],\n '4.2.3 U-0000FFFF = f0 8f bf bf' => [\n \"\\xF0\\x8F\\xBF\\xBF\",\n '',\n ],\n '4.2.4 U-001FFFFF = f8 87 bf bf bf' => [\n \"\\xF8\\x87\\xBF\\xBF\\xBF\",\n '',\n ],\n '4.2.5 U-03FFFFFF = fc 83 bf bf bf bf' => [\n \"\\xFC\\x83\\xBF\\xBF\\xBF\\xBF\",\n '',\n ],\n ],\n '4.3 Overlong representation of the NUL character' => [\n '4.3.1 U+0000 = c0 80' => [\n \"\\xC0\\x80\",\n '',\n ],\n '4.3.2 U+0000 = e0 80 80' => [\n \"\\xE0\\x80\\x80\",\n '',\n ],\n '4.3.3 U+0000 = f0 80 80 80' => [\n \"\\xF0\\x80\\x80\\x80\",\n '',\n ],\n '4.3.4 U+0000 = f8 80 80 80 80' => [\n \"\\xF8\\x80\\x80\\x80\\x80\",\n '',\n ],\n '4.3.5 U+0000 = fc 80 80 80 80 80' => [\n \"\\xFC\\x80\\x80\\x80\\x80\\x80\",\n '',\n ],\n ],\n ],\n '5 Illegal code positions' => [\n '5.1 Single UTF-16 surrogates' => [\n '5.1.1 U+D800 = ed a0 80' => [\n \"\\xED\\xA0\\x80\",\n '',\n ],\n '5.1.2 U+DB7F = ed ad bf' => [\n \"\\xED\\xAD\\xBF\",\n '',\n ],\n '5.1.3 U+DB80 = ed ae 80' => [\n \"\\xED\\xAE\\x80\",\n '',\n ],\n '5.1.4 U+DBFF = ed af bf' => [\n \"\\xED\\xAF\\xBF\",\n '',\n ],\n '5.1.5 U+DC00 = ed b0 80' => [\n \"\\xED\\xB0\\x80\",\n '',\n ],\n '5.1.6 U+DF80 = ed be 80' => [\n \"\\xED\\xBE\\x80\",\n '',\n ],\n '5.1.7 U+DFFF = ed bf bf' => [\n \"\\xED\\xBF\\xBF\",\n '',\n ],\n ],\n '5.2 Paired UTF-16 surrogates' => [\n '5.2.1 U+D800 U+DC00 = ed a0 80 ed b0 80' => [\n \"\\xED\\xA0\\x80\\xED\\xB0\\x80\",\n '',\n ],\n '5.2.2 U+D800 U+DFFF = ed a0 80 ed bf bf' => [\n \"\\xED\\xA0\\x80\\xED\\xBF\\xBF\",\n '',\n ],\n '5.2.3 U+DB7F U+DC00 = ed ad bf ed b0 80' => [\n \"\\xED\\xAD\\xBF\\xED\\xB0\\x80\",\n '',\n ],\n '5.2.4 U+DB7F U+DFFF = ed ad bf ed bf bf' => [\n \"\\xED\\xAD\\xBF\\xED\\xBF\\xBF\",\n '',\n ],\n '5.2.5 U+DB80 U+DC00 = ed ae 80 ed b0 80' => [\n \"\\xED\\xAE\\x80\\xED\\xB0\\x80\",\n '',\n ],\n '5.2.6 U+DB80 U+DFFF = ed ae 80 ed bf bf' => [\n \"\\xED\\xAE\\x80\\xED\\xBF\\xBF\",\n '',\n ],\n '5.2.7 U+DBFF U+DC00 = ed af bf ed b0 80' => [\n \"\\xED\\xAF\\xBF\\xED\\xB0\\x80\",\n '',\n ],\n '5.2.8 U+DBFF U+DFFF = ed af bf ed bf bf' => [\n \"\\xED\\xAF\\xBF\\xED\\xBF\\xBF\",\n '',\n ],\n ],\n // noncharacters are allowed according to http://www.unicode.org/versions/corrigendum9.html\n '5.3 Other illegal code positions' => [\n '5.3.1 U+FFFE = ef bf be' => [\n \"\\u{FFFE}\",\n \"\\u{FFFE}\",\n ],\n '5.3.2 U+FFFF = ef bf bf' => [\n \"\\u{FFFF}\",\n \"\\u{FFFF}\",\n ],\n ],\n ],\n ];\n\n $stack = [$tests];\n while ($item = array_pop($stack)) {\n if (isset($item[0])) {\n [$in, $out, $label] = $item;\n $this->assertSame('a' . $out . 'b', Strings::fixUtf8('a' . $in . 'b'), $label);\n } else {\n foreach (array_reverse($item) as $label => $tests) {\n $stack[] = $tests + (isset($tests[0]) ? [2 => $label] : []);\n }\n }\n }\n }", "public function testParseHtmlEntities()\n {\n $file = __DIR__ . '/data/encoding.txt';\n $full_message = file_get_contents($file);\n $this->assertNotEmpty($full_message);\n\n $structure = Mime_Helper::decode($full_message, true, true);\n $this->assertEquals(\n \"\\npöördumise töötaja.\\n<b>Võtame</b> töösse võimalusel.\\npöördumisele süsteemis\\n\\n\", $structure->body\n );\n }", "abstract public function hasUTF();", "function getHtmlUtf8 ($url, $input_encoding = \"\") {\n $fp = fopen($url, \"r\");\n $meta_data = stream_get_meta_data($fp);\n $html = stream_get_contents($fp);\n fclose($fp);\n $charset_pattern = \"/charset=([^;\\\\s]+)/i\";\n # Get encoding from response header entries\n if (! $input_encoding) {\n foreach ($meta_data[\"wrapper_data\"] as $line) {\n if (count(($keyval = preg_split(\"/\\\\s*:\\\\s*/\", $line, 2)) == 2)) {\n $key = $keyval[0];\n $val = $keyval[1];\n if ($key == \"Content-Type\" &&\n preg_match($charset_pattern, $val, $matches) ) {\n $input_encoding = trim($matches[1]);\n }\n }\n }\n }\n # Otherwise, get from the HTML meta tag\n if (! $input_encoding) {\n # 2nd byte of SJIS (ISO-2022 incompatible encoding) can be [<>]\n if (($html_utf8 = iconv(\"SJIS\", \"UTF-8\", $html)) &&\n stristr($html_utf8, \"</html>\") ) {\n $html_to_be_checked = $html_utf8;\n } else {\n $html_to_be_checked = $html;\n }\n $html_ascii = preg_replace(\"/[^ -~]/\", \"\", $html_to_be_checked);\n $html_ascii = preg_replace(\"@<body\\\\>.*</body>@\", \"<body/>\",\n $html_ascii );\n $html_ascii = preg_replace(\"@<title\\\\>.*</title>@\", \"<title/>\",\n $html_ascii );\n echo $html_ascii;\n $doc = new DOMDocument();\n $doc->loadHTML($html_ascii);\n $xpath = new DOMXPath($doc);\n $elems = $xpath->query(\"./head/meta[@http-equiv='Content-Type']\");\n foreach ($elems as $elem) {\n if (preg_match($charset_pattern, $elem->getAttribute(\"content\"),\n $matches )) {\n $input_encoding = trim($matches[1]);\n }\n }\n }\n # Failed to get\n if (! $input_encoding) {\n exit(1);\n }\n $input_encoding = strtoupper($input_encoding);\n # Some EUC-JP pages contain OMAJINAI character. Bad habit\n if ($input_encoding == \"EUCJP\" || $input_encoding == \"EUC-JP\") {\n $html = str_replace(\"\\xFD\\xFE\", \"\", $html);\n }\n return iconv($input_encoding, \"UTF-8\", $html);\n }", "public function getContents($encoding = 'UTF-8') {}", "function thefilename($filename) {\n $encode = mb_detect_encoding($filename, \"UTF-8,GBK,GB2312,BIG5,ISO-8859-1\");\n if ($encode != 'UTF-8') {\n $filename = mb_convert_encoding($filename, \"UTF-8\", $encode);\n }\n\n return $filename;\n}", "function getEncoding($filename) {\n\t$info = finfo_open(FILEINFO_MIME_ENCODING);\n $type = finfo_buffer($info, file_get_contents($filename));\n finfo_close($info);\n\n return $type;\n}", "function readFileIntoString ($fileName, &$s) {\n if (function_exists('version_compare') && version_compare(phpversion(),\"4.3.0\",\">=\")) {\n $s = file_get_contents($fileName);\n if ($s === false) return false;\n return true; }\n $fh = fopen($fileName,\"rb\");\n if ($fh === false) return false;\n $fileSize = filesize($fileName);\n if ($fileSize === false) {close ($fh); return false; }\n $s = fread($fh,$fileSize);\n fclose ($fh);\n if (strlen($s) != $fileSize) return false;\n return true; }", "function is_well_formed_utf8($string)\n{\n if ( empty($string) ) {\n return true;\n }\n // iconv is the fastest and best way to check this but it\n // might not be installed\n // The comments in this blog post will explain what is going on\n // http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-slides/\n // Please note that we are validating, not cleaning, the input\n if ( function_exists('iconv') ) {\n return iconv('UTF-8', 'UTF-8', $string) == $string;\n }\n // Falling back to slower regexp if iconv is not available\n // When the u-flag is used, the string must be well formed or\n // nothing will match\n return preg_match('/^.{1}/us', $string) == 1;\n}", "function my_file_get_contents($filename, $use_include_path = 0) {\n\n $data = \"\";\n $file = @fopen($filename, \"rb\", $use_include_path);\n if ($file) {\n while (!feof($file)) {\n $data .= fread($file, 1024);\n }\n fclose($file);\n }\n return $data;\n}", "public static function isNotUtf8Charset() {}", "public function testGetFile() {\n\t\t$filename = 'test.json';\r\n\t textus_get_file($filename);\n\t \r\n\t}", "function ValidateUtf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n }", "function seems_utf8($Str) { # by bmorel at ssi dot fr\n $length = strlen($Str);\n for ($i = 0; $i < $length; $i++) {\n if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\n elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n = 1; # 110bbbbb\n elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n = 2; # 1110bbbb\n elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n = 3; # 11110bbb\n elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n = 4; # 111110bb\n elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n = 5; # 1111110b\n else return false; # Does not match any model\n for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n}", "function readUTF();", "function fileGetContents($filename);", "function mb_is_utf8($string) { \n\treturn mb_detect_encoding($string, 'UTF-8') === 'UTF-8';\n}", "function isTextFile($fileName = '')\n{\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n $mime = $finfo->file($fileName);\n return 0 === strncmp($mime, 'text', 4);\n}", "function safeReadFile($path)\n{\n\techo htmlspecialchars(file_get_contents($path));\n}", "function create_latin1_entities_exhausting_document() {\t\t//var_dump(get_html_translation_table());\r\n\t\t//print(\"1\");\r\n\t\t//<!ENTITY nbsp \"&#160;\">\r\n\t\t//var_dump(file_get_contents(\"DTD/xhtml-lat1.ent\"));\r\n\t\t//$contents = file_get_contents(\"DTD/xhtml-lat1.ent\");\r\n\t\t//$contents = file_get_contents(\"mappings/latin1.php\");\r\n\t\tinclude('mappings' . DS . 'latin1.php');\r\n\t\t//var_dump($latin1array);exit(0);\r\n\t\tforeach($latin1array as $index => $value) {\r\n\t\t\tforeach($value as $index2 => $value2) {\r\n\t\t\t\tprint($value2 . \" \");\r\n\t\t\t}\r\n\t\t\tprint(\"<br>\\r\\n\");\r\n\t\t}exit(0);\r\n\t\t//var_dump($contents);exit(0);\r\n\t\t//preg_match_all('/<!ENTITY\\s+([^\\s]+)\\s+\"([^\"]+)\">/is', $contents, $matches);\r\n\t\t//foreach($matches[0] as $index => $value) {\r\n\t\t//\tprint(html_entity_decode($matches[2][$index]) . \" &\" . $matches[1][$index] . \"; \" . $matches[2][$index] . \"\\r\\n\");\r\n\t\t//}\r\n\t\t//var_dump($matches);\r\n\t\t//var_dump(htmlentities(\"Équipe à l&rsquo;exécution\"));\r\n\t}", "private function getPhpContents($filename) {\n if (is_file($filename)) {\n ob_start();\n require_once $filename;\n $contents = ob_get_contents();\n ob_end_clean();\n return $contents;\n }\n else {\n syslog(LOG_ERR, \"error: file \" . $filename . \" does not exists\");\n }\n return FALSE;\n }", "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "function reading_file($file_txt) {\n\t$data_txt = $file_txt;\n\t$fh = fopen($data_txt, \"r\");\n\t$file = file_get_contents($data_txt);\n\treturn $file;\n}", "function json_load($file)\n{\n $data = [];\n if (file_exists($file)) {\n $data = to_charset(file_get_contents($file));\n $data = json_decode(\n mb_convert_encoding($data, 'UTF-8', \"auto\"), true, 512,\n JSON_OBJECT_AS_ARRAY || JSON_BIGINT_AS_STRING\n );\n }\n if (null === $data) {\n return json_last_error_msg();\n }\n if (is_array($data)) {\n $data = to_charset($data);\n }\n return $data;\n}", "function fileaccess_GetAddinHTML($path)\r\n{\r\n\t$path = $_SERVER['DOCUMENT_ROOT'].$path;\r\n\tif(file_exists($path))\r\n\t{\r\n\r\n\t\t#Het bestand bestaat op de server => de HTML wordt opgehaald\r\n\t\t$handler = fopen($path,'r');\r\n\t\t$html = fread($handler,filesize($path));\r\n\t\t\r\n\t\t/*GEDISABLED OMDAT DE é werd verknoeid... eventueel later andere oplossing zoeken als dit een probleem blijkt.\r\n\t\t//BUGFIX: vervangen van speciale karakters zonder tags te vernietigen\r\n\t\t// Take all the html entities\r\n $caracteres = get_html_translation_table(HTML_ENTITIES);\r\n // Find out the \"tags\" entities\r\n $remover = get_html_translation_table(HTML_SPECIALCHARS);\r\n // Spit out the tags entities from the original table\r\n $caracteres = array_diff($caracteres, $remover);\r\n // Translate the string....\r\n $html = strtr($html, $caracteres);\r\n // And that's it!\r\n\t\t*/\r\n\t\t\r\n\t\treturn $html;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tthrow new Exception(\"You tried to open an addin at $path, that file does not exist\");\r\n\t}\r\n}", "public function sanitizeFileNameUTF8FilesystemDataProvider() {}", "protected function prepareFileContents() {\n\t\t// convert all language values to utf-8\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, TRUE, array('default'));\n\t\t}\n\n\t\t$mainFileContent = array('meta' => $this->prepareMeta());\n\t\t$languages = sgLib::getSystemLanguages();\n\t\tforeach ($languages as $langKey) {\n\t\t\t$mainFileContent = array_merge_recursive(\n\t\t\t\t$mainFileContent,\n\t\t\t\t$this->getLangContent($this->localLang[$langKey], $langKey)\n\t\t\t);\n\t\t}\n\n\t\t// prepare Content for the main file\n\t\t$languageFiles[$this->absFile] = $this->array2xml($mainFileContent, 'T3locallang');\n\n\t\treturn $languageFiles;\n\t}", "private function _get_translations_from_file () {\n\n\t\t$lang = file_exists(self::DIR_LANGS . $this->lang . '.php')\n\t\t\t\t\t? $this->lang : $this->_default_lang;\n\n\t\trequire self::DIR_LANGS . $lang . '.php';\n\n\t\treturn $t;\n\n\t}", "function seems_utf8($Str) {\r\n\tfor ($i=0; $i<strlen($Str); $i++) {\r\n\t\tif (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\r\n\t\telseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb\r\n\t\telseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb\r\n\t\telseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb\r\n\t\telseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb\r\n\t\telseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b\r\n\t\telse return false; # Does not match any model\r\n\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\r\n\t\t\tif ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function getFileContent($file_name, $lang) {\n\t// stores the file's content\n\t$file_content = \"\";\n\n\t// build path to the data folder, where the .txt files are located\n\t$data_path = dirname(dirname(__FILE__)).\"/data/\";\n\n\t// check if the file is language independent\n\tif (file_exists($data_path.$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$file_name.\".txt\");\n\t// check if the file is language dependent\n\t}else if (file_exists($data_path.$lang.\"/\".$file_name.\".txt\")) {\n\t\t// it is\n\t\t// get the requested file's content\n\t\t$file_content = file_get_contents($data_path.$lang.\"/\".$file_name.\".txt\");\n\t}\n\n\t// check if the file_get_contents() returned a failure\n\tif ($file_content === False) {\n\t\t// it did\n\t\t// the content couldn't be retrieved, so set this file's content to an empty string\n\t\t$file_content = \"\";\n\t}\n\n\t// return this file's content\n\treturn($file_content);\n}", "function bom_utf8($texte) {\n\treturn (substr($texte, 0,3) == chr(0xEF).chr(0xBB).chr(0xBF));\n}", "function wp_check_invalid_utf8($text, $strip = \\false)\n {\n }", "private function detect_encoding( $str ) {\r\n }", "function parseFile($filename){\n $file = @fopen($filename, \"rb\");\n if($file === false)\n return null;\n\n $text = fread($file, filesize($filename));\n if(($enc = mb_detect_encoding($text, 'UTF-8, ISO-8859-1, ISO-8859-2, CP-1250')) != 'UTF-8'){\n $text = iconv($enc, 'UTF-8', $text);\n }\n\n return $this->parse($text);\n }", "function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }", "function isUTF8($str) {\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] // ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] // non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] // excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} // straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] // excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} // planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} // planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} // plane 16\n )*$%xs', $str);\n }", "function isUTF8($str) {\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] // ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] // non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] // excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} // straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] // excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} // planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} // planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} // plane 16\n )*$%xs', $str);\n }", "function utf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return $str;\n else return utf8_encode($str);\n}", "function checkAndLatinize($txt)\n{\n $lang = getTransLang();\n switch($lang)\n {\n case 'hr': \n case 'bs':\n case 'sr1':\n $out = cir2lat($txt);\n break;\n default: $out = $txt;\n }\n return $out;\n}", "function getTemplate($fileName) {\n\n $file = file_get_contents($fileName);\n\n if ($file) {\n\n return $file;\n }\n else {\n echo (\"File not found: \" . $fileName);\n }\n}", "function gzfile_get_contents($file) {\n if (!$file = gzfile($file)) {\n return FALSE;\n }\n if (!$file = implode('', $file)) {\n return FALSE;\n }\n return $file;\n}", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "function mb_list_encodings()\n{\n}", "public function getContents($file);", "function rc_utf8_clean($input)\n{\n // handle input of type array\n if (is_array($input)) {\n foreach ($input as $idx => $val)\n $input[$idx] = rc_utf8_clean($val);\n return $input;\n }\n \n if (!is_string($input) || $input == '')\n return $input;\n\n // iconv/mbstring are much faster (especially with long strings)\n if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)\n return $res;\n\n if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)\n return $res;\n\n $regexp = '/^('.\n// '[\\x00-\\x7F]'. // UTF8-1\n '|[\\xC2-\\xDF][\\x80-\\xBF]'. // UTF8-2\n '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|[\\xE1-\\xEC][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xED[\\x80-\\x9F][\\x80-\\xBF]'. // UTF8-3\n '|[\\xEE-\\xEF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n '|[\\xF1-\\xF3][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'.// UTF8-4\n '|\\xF4[\\x80-\\x8F][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n ')$/';\n \n $seq = '';\n $out = '';\n\n for ($i = 0, $len = strlen($input); $i < $len; $i++) {\n $chr = $input[$i];\n $ord = ord($chr);\n // 1-byte character\n if ($ord <= 0x7F) {\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n $out .= $chr;\n // first (or second) byte of multibyte sequence\n } else if ($ord >= 0xC0) {\n if (strlen($seq)>1) {\n\t$out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n } else if ($seq && ord($seq) < 0xC0) {\n $seq = '';\n }\n $seq .= $chr;\n // next byte of multibyte sequence\n } else if ($seq) {\n $seq .= $chr;\n }\n }\n\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n\n return $out;\n}", "function fatchfilecontent($file_path = NULL)\n {\n $handle = fopen($file_path, \"r\");\n $contents = '';\n while (!feof($handle)) {\n $contents .= fread($handle, 8192);\n }\n fclose($handle);\n return $contents;\n }", "function echo8($txt) {\n\techo $txt;\n\t//echo utf8_decode($txt);\n}", "public function getContentEncoding();", "function utf8init()\n{\n mb_internal_encoding('UTF-8');\n\n // Tell PHP that we'll be outputting UTF-8 to the browser\n mb_http_output('UTF-8');\n\n //$str = json_encode($arr, JSON_UNESCAPED_UNICODE); //这样我们存进去的是就是中文了,那么取出的也就是中文了\n\n}", "function uber_file_get_contents($filepath) {\r\n\r\n // try file_open_contents() first\r\n $r = @file_get_contents($filepath);\r\n if ($r !== FALSE) { return $r; }\r\n\r\n // if no open basedir restrictions, return value from file_get_contents\r\n $is_open_basedir_restrictions = ini_get('open_basedir') && !@file_exists(\"/\"); // if root doesn't exist then open_basedir in effect. In future we can check if target filepath matches open_basedir\r\n if (!$is_open_basedir_restrictions) { return $r; }\r\n\r\n if (!function_exists(\"shell_exec\")) { return false; }\r\n\r\n // otherwise, try windows shell commands\r\n if (isWindows()) {\r\n $filepath = str_replace(\"/\", \"\\\\\", $filepath); // use windows slashes\r\n $command = escapeshellcmd(\"type $filepath\");\r\n $response = shell_exec(\"$command\"); // for debugging add: 2>&1\r\n return $response;\r\n }\r\n\r\n // else, try linux commands\r\n $command = escapeshellcmd(\"cat $filepath\");\r\n $response = shell_exec(\"$command\"); // for debugging add: 2>&1\r\n return $response;\r\n}", "public function utf82iso88592($text) {\n$text = str_replace(\"\\xC4\\x85\", 'ą', $text);\n$text = str_replace(\"\\xC4\\x84\", 'Ą', $text);\n$text = str_replace(\"\\xC4\\x87\", 'ć', $text);\n$text = str_replace(\"\\xC4\\x86\", 'Ć', $text);\n$text = str_replace(\"\\xC4\\x99\", 'ę', $text);\n$text = str_replace(\"\\xC4\\x98\", 'Ę', $text);\n$text = str_replace(\"\\xC5\\x82\", 'ł', $text);\n$text = str_replace(\"\\xC5\\x81\", 'Ł', $text);\n$text = str_replace(\"\\xC3\\xB3\", 'ó', $text);\n$text = str_replace(\"\\xC3\\x93\", 'Ó', $text);\n$text = str_replace(\"\\xC5\\x9B\", 'ś', $text);\n$text = str_replace(\"\\xC5\\x9A\", 'Ś', $text);\n$text = str_replace(\"ż\", 'ż', $text);\n$text = str_replace(\"\\xC5\\xBB\", 'Ż', $text);\n$text = str_replace(\"\\xC5\\xBA\", 'ź', $text);\n$text = str_replace(\"\\xC5\\xB9\", 'Ż', $text);\n$text = str_replace(\"\\xc5\\x84\", 'ń', $text);\n$text = str_replace(\"\\xc5\\x83\", 'Ń', $text);\n\nreturn $text;\n}", "public function getFontFile() {}", "public function getFontFile() {}", "public function TessBaseAPIGetUTF8Text($apiHandle): string;", "public static function pcre_utf8_support(): bool\n {\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n return (bool) @\\preg_match('//u', '');\n }", "function load_t2s_text(){\n\tglobal $config, $t2s_langfile, $t2s_text_stand, $templatepath;\n\t\n\tif (file_exists($templatepath.'/lang/'.$t2s_langfile)) {\n\t\t$TL = parse_ini_file($templatepath.'/lang/'.$t2s_langfile, true);\n\t} else {\n\t\tLOGGING(\"For selected T2S language no translation file still exist! Please go to LoxBerry Plugin translation and create a file for selected language \".substr($config['TTS']['messageLang'],0,2),3);\n\t\texit;\n\t}\n\treturn $TL;\n}", "function pdf2string($sourcefile) {\n # Funktion zum direkten lesen von PDF mit PHP\n # gibt den daraus extrahierten Text zurück\n # Quellcode von mattb at bluewebstudios dot com\n # 04-Feb-2005 10:44 http://de2.php.net/manual/en/ref.pdf.php#49690\n \n $fp = fopen($sourcefile, 'rb');\n $content = fread($fp, filesize($sourcefile));\n fclose($fp);\n\n # Locate all text hidden within the stream and endstream tags\n $searchstart = 'stream';\n $searchend = 'endstream';\n $pdfdocument = \"\";\n\n $pos = 0;\n $pos2 = 0;\n $startpos = 0;\n # Iterate through each stream block\n while( $pos !== false && $pos2 !== false ) {\n # Grab beginning and end tag locations if they have not yet been parsed\n $pos = strpos($content, $searchstart, $startpos);\n $pos2 = strpos($content, $searchend, $startpos + 1);\n if( $pos !== false && $pos2 !== false ) {\n # Extract compressed text from between stream tags and uncompress\n $textsection = substr($content, $pos + strlen($searchstart) + 2, $pos2 - $pos - strlen($searchstart) - 1);\n $data = @gzuncompress($textsection);\n # Clean up text via a special function\n $data = $this->extractText($data);\n # Increase our PDF pointer past the section we just read\n $startpos = $pos2 + strlen($searchend) - 1;\n if( $data === false ) { return -1; }\n $pdfdocument = $pdfdocument . $data;\n }\n }\n return $pdfdocument;\n }", "function TxtEncoding4Soap($txt){\r\n $to = $GLOBALS[\"POSTA_SECURITY\"]->Security->configuration['charset'];\r\n return iconv('UTF-8',$to, $txt);\r\n}", "public function testUtf8(): void\n {\n $value = mb_convert_encoding(\"\\xa0a\\xa0\", 'UTF-8', 'ISO-8859-1');\n self::assertSame('a', $this->filter->filter($value));\n }", "function transcoder_page($texte, $headers='') {\n\n\t// Si tout est < 128 pas la peine d'aller plus loin\n\tif (is_ascii($texte)) {\n\t\t#spip_log('charset: ascii');\n\t\treturn $texte;\n\t}\n\n\t// Reconnaitre le BOM utf-8 (0xEFBBBF)\n\tif (bom_utf8($texte)) {\n\t\t$charset = 'utf-8';\n\t\t$texte = substr($texte,3);\n\t}\n\n\t// charset precise par le contenu (xml)\n\telse if (preg_match(\n\t',<[?]xml[^>]*encoding[^>]*=[^>]*([-_a-z0-9]+?),UimsS', $texte, $regs))\n\t\t$charset = trim(strtolower($regs[1]));\n\t// charset precise par le contenu (html)\n\telse if (preg_match(\n\t',<(meta|html|body)[^>]*charset[^>]*=[^>]*([-_a-z0-9]+?),UimsS',\n\t$texte, $regs)\n\t# eviter #CHARSET des squelettes\n\tAND (($tmp = trim(strtolower($regs[2]))) != 'charset'))\n\t\t$charset = $tmp;\n\t// charset de la reponse http\n\telse if (preg_match(',charset=([-_a-z0-9]+),i', $headers, $regs))\n\t\t$charset = trim(strtolower($regs[1]));\n\n\t// normaliser les noms du shif-jis japonais\n\tif (preg_match(',^(x|shift)[_-]s?jis$,i', $charset))\n\t\t$charset = 'shift-jis';\n\n\tif ($charset) {\n\t\tspip_log(\"charset: $charset\");\n\t} else {\n\t\t// valeur par defaut\n\t\tif (is_utf8($texte))\n\t\t\t$charset = 'utf-8';\n\t\telse\n\t\t\t$charset = 'iso-8859-1';\n\t\tspip_log(\"charset probable: $charset\");\n\t}\n\n\treturn importer_charset($texte, $charset);\n}", "public static function findCharsetManually( $content )\n\t{\n\t\treturn mb_detect_encoding($content);\n\t}", "public function sanitizeFileNameNonUTF8FilesystemDataProvider() {}", "function test_pcre_unicode() {\n\tstatic $pcre_ok = 0;\n\n\tif (!$pcre_ok) {\n\t\t$s = \" \".chr(195).chr(169).\"t\".chr(195).chr(169).\" \";\n\t\tif (preg_match(',\\W\\w\\w\\w\\W,uS', $s)) $pcre_ok = 1;\n\t\telse $pcre_ok = -1;\n\t}\n\treturn $pcre_ok == 1;\n}", "function accouk_is_valid_text_file($path) {\n\n // Use finfo to detect mime type\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $path);\n finfo_close($finfo);\n if($mime !== \"text/plain\") return false;\n\n // Check file extension\n $filename_length = strlen($path);\n if(substr($path, $filename_length-4, $filename_length) !== \".txt\") return false;\n\n return true;\n}", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "function is_utf8($string) {\n\t// From http://w3.org/International/questions/qa-forms-utf-8.html\n\treturn preg_match('%^(?:\n\t\t[\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}", "protected static function isUTF8($text)\n {\n /*\n Based on http://w3.org/International/questions/qa-forms-utf-8.html,\n but rewritten to avoid a dependency on PCRE.\n\n Also, the regular expression in the post above seems to limit\n valid inputs to printable characters (for compatibility reasons?).\n See also section 2.2 of http://www.w3.org/TR/xml11 and section 2.2\n of http://www.w3.org/TR/xml/ for a possible explanation.\n\n The code below does not suffer from such limitations.\n */\n $len = strlen($text);\n $res = true;\n for ($i = 0; $i < $len; $i++) {\n // U+0000 - U+007F\n $byte1 = ord($text[$i]);\n if ($byte1 >= 0 && $byte1 <= 0x7F) {\n continue;\n }\n\n // Look for 2nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte2 = ord($text[$i]);\n\n // U+0080 - U-07FF\n if ($byte1 >= 0xC2 && $byte1 <= 0xDF) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // Look for 3nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte3 = ord($text[$i]);\n\n // U+0800 - U+0FFF\n if ($byte1 == 0xE0) {\n if ($byte2 >= 0xA0 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // U+1000 - U+CFFF & U+E000 - U+FFFF\n if ($byte1 >= 0xE1 && $byte1 <= 0xEF && $byte1 !== 0xED) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n $codepoint = (($byte1 & 0x0F) << 12) + (($byte2 & 0x3F) << 6) + ($byte3 & 0x3F);\n if (($codepoint >= 0xE000 && $codepoint <= 0xF8FF) || // Private range\n ($codepoint >= 0xFDD0 && $codepoint <= 0xFDEF) || // Non-characters\n $codepoint == 0xFFFE || $codepoint == 0xFFFF) { // Non-characters\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+D000 - U+D7FF\n if ($byte1 == 0xED) {\n if ($byte2 >= 0x80 && $byte2 <= 0x9F &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // Look for 4nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte4 = ord($text[$i]);\n\n // U+10000 - U+3FFFF\n if ($byte1 == 0xF0) {\n if ($byte2 >= 0x90 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n $codepoint = (($byte1 & 0x07) << 18) +\n (($byte2 & 0x3F) << 12) +\n (($byte3 & 0x3F) << 6) +\n ($byte4 & 0x3F);\n // Non-characters Reserved range\n if ($codepoint == 0x1FFFE || $codepoint == 0x1FFFF || $codepoint >= 0x2FFFE) {\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+40000 - U+FFFFF\n if ($byte1 >= 0xF1 && $byte1 <= 0xF3) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n $codepoint = (($byte1 & 0x07) << 18) +\n (($byte2 & 0x3F) << 12) +\n (($byte3 & 0x3F) << 6) +\n ($byte4 & 0x3F);\n // Reserved range Non characters & private ranges\n if ($codepoint < 0xE0000 || $codepoint >= 0xEFFFE) {\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+100000 - U+10FFFF\n if ($byte1 == 0xF4) {\n if ($byte2 >= 0x80 && $byte2 <= 0x8F &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n // This part contains only non-characters & private ranges.\n $res = null;\n continue;\n }\n return false;\n }\n\n // Byte #1 contained an invalid value.\n return false;\n }\n\n // No decoding error detected, but the given input may contain\n // non-characters/reserved characters, depending on the value of $res.\n return $res;\n }", "function file_get_contents($filename=false)\n\t{\n\t\tif (!is_file($filename) || !is_readable($filename)) {\n\t\t\treturn false;\n\t\t}\n\t\t$handle = fopen($filename, \"r\");\n\t\t$contents = fread($handle, filesize($filename));\n\t\tfclose($handle);\n\t\treturn $contents;\n\t}", "function isUtf8($string) {\n if (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n return mb_check_encoding($string, 'UTF8');\n }\n\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n }", "private function parseMo() {\n /*\n * TODO: gucken, ob file existiert\n */\n $content = file_get_contents(BASE_PATH.'/lang/'.LANGUAGE.'.mo');\n\t $fileSize = strlen($content);\n\t \n\t // Find the byte order of the MO file creator\n\t $byteOrder = substr($content, 0, 4);\n\t \n\t // Little endian\n\t if ($byteOrder == \"\\xde\\x12\\x04\\x95\") {\n\t \t$tmpl = \"V\";\n\t // Big endian\n\t } elseif ($byteOrder == \"\\x95\\x04\\x12\\xde\") {\n\t $tmpl = \"N\";\n\t // Wrong magic number. Not a valid MO file.\n\t } else {\n\t return 'wrong magic number';\n\t }\n\t \n\t // Check the MO format revision number\n\t $revision = unpack($tmpl, substr($content, 4, 4));\n\t if ($revision[1] > 0) return 'wrong revision';\n\t \n\t // Number of strings\n\t $numberOfStrings = unpack($tmpl, substr($content, 8, 4));\n\t \n\t // Offset to the beginning of the original strings\n\t $offo = unpack($tmpl, substr($content, 12, 4));\n\t \n\t // Offset to the beginning of the translated strings\n\t $offt = unpack($tmpl, substr($content, 16, 4));\n\t \n\t $trans = array();\n\t for ($i = 0; $i < $numberOfStrings[1]; $i++) {\n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offo[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offo[1]+($i*8)+4, 4));\n\t \n\t // Original string\n\t $stro = substr($content, $off[1], $len[1]);\n\t \n\t // The first word is the length of the string\n\t $len = unpack($tmpl, substr($content, $offt[1]+($i*8), 4));\n\t \n\t // The second word is the offset of the string\n\t $off = unpack($tmpl, substr($content, $offt[1]+($i*8)+4, 4));\n\t \n\t // Translated string\n\t $strt = substr($content, $off[1], $len[1]);\n\t \n\t // Hash it baby\n\t $trans[$stro] = $strt;\n\t \n\t }\n\t \n\t return $trans;\n }", "function unicodeLiterals($str) {\r\n\t$transTable = array();\r\n\t$utf8reg = '/[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF][\\x80-\\xBF]/';\r\n\tif(!preg_match_all($utf8reg, $str, $matches))\r\n\t\treturn $str;\r\n\r\n\tforeach($matches[0] as $utf8char) {\r\n\t\tif(isset($transTable[$utf8char])) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$transTable[$utf8char] = '\\u'. substr('0000'. bin2hex(mb_convert_encoding($utf8char, 'UTF-16', 'UTF-8')), -4);\r\n\t}\r\n\treturn strtr($str, $transTable);\r\n}", "protected function IsUtf8($word) {\n\t\tif (preg_match ( \"/^([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){1}/\", $word ) == true || preg_match ( \"/([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){1}$/\", $word ) == true || preg_match ( \"/([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){2,}/\", $word ) == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\n}", "function codepress_get_lang($filename)\n {\n }", "public function testParseEmailm1010() : void\n {\n $handle = \\fopen($this->messageDir . '/m1010.txt', 'r');\n $message = $this->parser->parse($handle, true);\n\n $failMessage = 'Failed while parsing m1010';\n $message->setCharsetOverride('iso-8859-1');\n $f = $message->getTextStream(0);\n $this->assertNotNull($f, $failMessage);\n $this->assertTextContentTypeEquals('HasenundFrosche.txt', $f, $failMessage);\n\n $message = null;\n // still open\n \\fseek($handle, 0);\n \\fread($handle, 1);\n \\fclose($handle);\n }", "function genesis_style_check($fileText, $char_list) {\n\n\t$fh = fopen(CHILD_DIR . '/' . $fileText, 'r');\n\t$theData = fread($fh, 1000);\n\tfclose($fh);\n\t\n\t$search = strpos($theData, $char_list);\n\tif($search === false){\n\t return false;\n\t }\n\t return true;\n}", "function comp_file_get_contents($filename) {\n\treturn implode(\"\", file($filename));\n}", "function get_include_contents($filename) {\n\t\tif (is_file($filename)) {\n\t\t\tob_start();\n\t\t\tinclude $filename;\n\t\t\t$contents = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\treturn $contents;\n\t\t}\n\t\treturn false;\n\t}", "function escapeRtf($data) {\n\tif (empty($data)) return $data;\n if (is_array($data)) {\n\t\tforeach($data as $k => $v) $data[$k] = escapeRtf($v);\n } else {\n \t$data = mb_convert_encoding($data,\"UTF-16\",\"UTF-8\");\n\t\t$data = str_split($data,2);\n\t\t$tmp = \"\";\n\t\tforeach($data as $k => $v) $tmp .= '\\u'.(ord($v[0])*256 + ord($v[1])).'?';\n\t\t$data = $tmp;\n \t}\n \treturn $data;\n}" ]
[ "0.7669075", "0.7617049", "0.70760435", "0.6336016", "0.59828264", "0.5867906", "0.5867257", "0.58244425", "0.5763002", "0.5702432", "0.5655835", "0.56395525", "0.559904", "0.55647117", "0.55632174", "0.5544988", "0.5533936", "0.55271745", "0.55246353", "0.5457571", "0.542736", "0.5412584", "0.54075503", "0.53940344", "0.53837186", "0.5375641", "0.53621453", "0.53569835", "0.5349076", "0.5346021", "0.53408474", "0.53371024", "0.53100306", "0.52870077", "0.5279276", "0.5276339", "0.52670777", "0.5265402", "0.52517986", "0.52436054", "0.5224279", "0.5218858", "0.5215209", "0.5214172", "0.52131885", "0.52018595", "0.5197041", "0.51899296", "0.5171829", "0.5153944", "0.5151019", "0.51503056", "0.5147218", "0.5145309", "0.51452494", "0.5139763", "0.5139763", "0.5130105", "0.5128474", "0.5121039", "0.51115954", "0.5103667", "0.5083928", "0.50779986", "0.5073142", "0.5057231", "0.5056174", "0.5052955", "0.50462896", "0.5036935", "0.50351846", "0.5032467", "0.50246036", "0.50244665", "0.50221217", "0.50183725", "0.501756", "0.5012776", "0.5008002", "0.5007237", "0.5003259", "0.5003055", "0.4997809", "0.4988801", "0.49839607", "0.4974347", "0.4974072", "0.49669322", "0.49513537", "0.4949212", "0.49438053", "0.49434382", "0.49375218", "0.4936485", "0.49362737", "0.4932184", "0.4919456", "0.4904772", "0.48975334", "0.48881108" ]
0.6790162
3
Get the path of a feature image of a post Returns the path of the feature image, insired by
public function get_feature_image_path( $post_id ) { $thumb_id = get_post_thumbnail_id($post_id); if(empty($thumb_id)) return ''; $image= wp_get_attachment_image_src($thumb_id, 'full'); if(empty($image)) return ''; $upload_dir = wp_upload_dir(); $base_dir = $upload_dir['basedir']; $base_url = $upload_dir['baseurl']; $imagepath= str_replace($base_url, $base_dir, $image[0]); if (file_exists( $imagepath)) return $imagepath; else return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "public function getImagePath(Post $post): ?string\n {\n if ($post->getThumbnail() === null) {\n return null;\n }\n return '/uploads/post/' . $post->getThumbnail();\n }", "public function get_image_attached($post){\n\t\n\tpreg_match_all('/src=([\"\\'])(.*?)\\1/', $post, $matches);\n\t$img = $matches[2];\n\t\n\treturn $img;\n\t\n\treturn false;\n }", "public function get_name() {\n\t\treturn 'happyden-feature-image';\n\t}", "public function path()\n {\n return $this->image->path;\n }", "function rest_get_featured_image( $post, $field_name, $request ) {\n $attachment_id = $post['featured_media'];\n $attachment_info = wp_get_attachment_image_src( $attachment_id, 'rest_post_thumbnail' );\n return $attachment_info[0];\n}", "public function getImage( $post_id ) {}", "function get_page_feature_image_url($postID, $size)\n{\n //get wp object of featured image\n $feature_image_id = get_post_thumbnail_id($postID);\n //get array of the featured image based on size\n $feature_image_meta = wp_get_attachment_image_src($feature_image_id, $size);\n //the 1st argument of the array is the url of the image 2nd is the width the 3ed is the height\n $link = $feature_image_meta[0];\n //return the first argument\n return $link;\n}", "public function getImgPath()\n {\n return $this->imgPath;\n }", "public function getImagePath()\n {\n return $this->imagepath;\n }", "function getImagePath () {\n return luxbum::getImage($this->dir, $this->file);\n }", "public function getImagePath(){\r\n\t\t\treturn $this->imagePath;\r\n\t\t}", "function ST4_columns_content($column_name, $post_ID) {\n if ($column_name == 'featured_image') {\n $post_featured_image = ST4_get_featured_image($post_ID);\n if ($post_featured_image) {\n echo '<img src=\"' . $post_featured_image . '\" />';\n }\n }\n}", "private function image_url( $post_id ) {\n\n\t\tstatic $uploads;\n\n\t\tif ( empty( $uploads ) ) {\n\t\t\t$uploads = wp_upload_dir();\n\t\t}\n\n\t\tif ( false !== $uploads['error'] ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$file = get_post_meta( $post_id, '_wp_attached_file', true );\n\n\t\tif ( empty( $file ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Check that the upload base exists in the file location.\n\t\tif ( 0 === strpos( $file, $uploads['basedir'] ) ) {\n\t\t\t$src = str_replace( $uploads['basedir'], $uploads['baseurl'], $file );\n\t\t}\n\t\telseif ( false !== strpos( $file, 'wp-content/uploads' ) ) {\n\t\t\t$src = $uploads['baseurl'] . substr( $file, ( strpos( $file, 'wp-content/uploads' ) + 18 ) );\n\t\t}\n\t\telse {\n\t\t\t// It's a newly uploaded file, therefore $file is relative to the baseurl.\n\t\t\t$src = $uploads['baseurl'] . '/' . $file;\n\t\t}\n\n\t\treturn apply_filters( 'wp_get_attachment_url', $src, $post_id );\n\t}", "public function featured_img() {\n\n $featured_img = wp_get_attachment_image_src(\n get_post_thumbnail_id( get_the_ID() ), 'large'\n );\n\n return $featured_img[0];\n }", "public function imagePath(){\n return $this->upload_directory.DS.$this->filename;\n }", "public function getPathByPostUrl() {\n\t\t\n\t\t$url = Request::post('url');\n\n\t\tif ($url && ($Page = $this->Automad->getPage($url))) {\n\t\t\treturn FileSystem::fullPagePath($Page->path);\n\t\t} else {\n\t\t\treturn AM_BASE_DIR . AM_DIR_SHARED . '/';\n\t\t}\n\t\t\n\t}", "function ay_emp_get_pi ( $post_ID ) {\n\t\t$post_thumbnail_id = get_post_thumbnail_id( $post_ID );\n\t\tif ( $post_thumbnail_id ) {\n\t\t\t$post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id );\n\t\t\treturn $post_thumbnail_img[0];\n\t\t}\n\t}", "public function getImage() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('image'));\n }", "function fs_get_featured_image_src( $size ) {\r\n\tglobal $post;\r\n\t$featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $size);\r\n\treturn $featured_image[0];\r\n}", "function get_featured_img_url($id) {\n\t$thumb_id = get_post_thumbnail_id($id);\n\t$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'grid-thumbnail-medium', true);\n\t$thumb_url = $thumb_url_array[0];\n\treturn $thumb_url;\n}", "function catch_that_image() {\n global $post;\n\n $first_img = get_template_directory_uri() . '/img/svg/one.svg';\n\n $output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\n\tif(isset($matches[1][0])) {\n\t\t$first_img = $matches[1][0];\n\t}\n\n return $first_img;\n}", "function _sf_get_spot_listing_image($post_id, $post_title = null) {\n\t\t\n\t\t//// GETS OUR FEATURED IMAGE\n\t\t$image = btoa_get_featured_image($post_id);\n\t\t\n\t\t//// GENERATES OUR MARKUP\n\t\t$markup = '';\n\t\t\n\t\t//// LINK TAG\n\t\t$markup .= '<a href=\"'.get_permalink($post_id).'\" title=\"'.$post_title.'\" class=\"spot-image\">';\n\t\t\n\t\t///// IF IT'S FEATURED\n\t\tif(get_post_meta($post_id, 'featured', true) == 'on') { $markup .= '<span class=\"featured\">'.__('Featured', 'btoa').'</span>'; }\n\t\t\n\t\t///// IMAGE\n\t\t$markup .= '<img src=\"'.ddTimthumb($image, 500, 350).'\" alt=\"'.$post_title.'\" title=\"'.$post_title.'\" />';\n\t\t\n\t\t//// CLOSES LINK TAG\n\t\t$markup .= '</a>';\n\t\t\n\t\treturn $markup;\n\t\t\n\t}", "function tp_get_img_dir() {\n\t$file = new ElggFile();\n\t$file->setFilename('image/');\n\treturn $file->getFilenameOnFilestore();\n}", "function save_admin_fields( $post_id, $post ){\r\n\r\n\t\t// Handle featured image being added/removed from admin\r\n\t\t$fi_id = get_post_thumbnail_id( $post_id );\r\n\t\tif ( $fi_id ) {\r\n\t\t\t$fi_url = wp_get_attachment_url( $fi_id );\r\n\t\t\tupdate_post_meta( $post_id, '_featured_image', $fi_url );\r\n\t\t} else {\r\n\t\t\tdelete_post_thumbnail( $post_id );\r\n\t\t\tdelete_post_meta( $post_id, '_featured_image' );\r\n\t\t}\r\n\r\n\t\treturn $post_id;\r\n\r\n\t}", "function get_post_thumbnail_id($post = \\null)\n {\n }", "abstract public function get_thumbnail_source_path();", "function wp_get_original_image_path($attachment_id, $unfiltered = \\false)\n {\n }", "public function getPath() {\n $path = 'private://dumper/%d/%s/%s';\n $path = sprintf($path,\n $this->og_controller->og_node->nid,\n $this->og_controller->date->format('Y/m/d'),\n $this->entity_type);\n return $path;\n }", "public function getGeneratedImagePath()\r\n {\r\n return $this->image_path;\r\n }", "function getImagePathInfo() \n { \n return $this->_imagePathInfo; \n }", "function fsfcms_getSiteImageFilePath()\n {\n global $fsfcms_api_url;\n \n $fsf_api_file = \"fsf.port.getSiteImageFilePath.php\";\n $fsf_api_options = \"\"; \n $fsf_port_getSiteImageFilePath_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n $fsf_port_getSiteImageFilePath_array = json_decode($fsf_port_getSiteImageFilePath_json);\n $fsfcms_getSiteImageFilePath_output = $fsf_port_getSiteImageFilePath_array[0];\n return $fsfcms_getSiteImageFilePath_output; \n }", "function nb_get_image_src( $object, $field_name, $request ) {\n $featured_img_array = wp_get_attachment_image_src( $object[ 'featured_media'], 'full', true);\n return $featured_img_array[0];\n}", "function cws_get_image_url() {\n\n\tglobal $post;\n\n\t$thumbnail_url = wp_get_attachment_thumb_url( get_post_thumbnail_id( $post->ID ) );\n\t$image_url = print( $thumbnail_url );\n\n\treturn $image_url;\n\n}", "public function get_featured( $args, $assoc_args ){\n\n\t\tlist( $post_id ) = $args;\n\n\t\tif (!isset($post_id)) {\n\t\t\tWP_CLI::error('You mus specify the post ID');\n\t\t}\n\n\t\tif (!empty($assoc_args['return']) ) {\n\t\t\t$return = $assoc_args['return'];\n\t\t} else {\n\t\t\t$return = 'id';\n\t\t}\n\t\t$img = \\wp_get_post_thumbnail_id( absint($post_id) );\n\n\t\tif ($return == 'url') {\n\t\t\t$img = \\wp_get_attachment_url( $img );\n\t\t}\n\t\tif ( \\is_wp_error( $img ) ) {\n\t\t\tWP_CLI::warning( $terms->get_error_message() );\n\t\t} else {\n\t\t\tWP_CLI::print_value( $img, $assoc_args );\n\t\t}\n\t}", "public function getImage()\n {\n return $this->get('image');\n }", "private function getFilename(array $post): string\n\t{\n\t\treturn array_get($post, 'slug', str_slug(array_get($post, 'title')))\n\t\t\t. '.' . $this->extension;\n\t}", "function wp_save_image($post_id)\n {\n }", "function get_the_fa_image_id( $post_id = false ){\n\t// ge the post ID\n\tif( !$post_id ){\n\t\tglobal $post;\n\t\tif( !$post ){\n\t\t\treturn false;\n\t\t}\n\t\t$post_id = $post->ID;\n\t}\t\n\t// slide options\n\t$options = fa_get_slide_options( $post_id );\n\t$image_id = false;\n\t// try to get the slide attached image\n\tif( isset( $options['image'] ) && $options['image'] ){\n\t\t$image_id = $options['image'];\n\t\tif( !wp_get_attachment_image_src( $image_id, 'thumbnail' ) ){\n\t\t\t$image_id = false;\n\t\t};\n\t}\n\t// try to get the slide featured image if slide image isn't available\n\tif( !$image_id ){\n\t\t$image_id = get_post_thumbnail_id( $post_id );\n\t}\n\t// try to get the image retrieved from post content if none of the above worked\n\tif( !$image_id && isset( $options['temp_image_id'] ) && $options['temp_image_id'] ){\n\t\t$image_id = $options['temp_image_id'];\n\t\tif( !wp_get_attachment_image_src( $image_id, 'thumbnail' ) ){\n\t\t\t$image_id = false;\n\t\t};\t\t\n\t}\n\t\n\tif( !$image_id ){\n\t\t// image still wasn't found, try to autodetect, if option is enabled\n\t\t$plugin_options = fa_get_options( 'settings' );\n\t\tif( isset( $plugin_options['allow_image_autodetect'] ) && $plugin_options['allow_image_autodetect'] ){\n\t\t\t$current_post = get_post( $post_id );\n\t\t\tif( $current_post ){\t\t\t\n\t\t\t\t$image = fa_detect_image( $current_post->post_content );\n\t\t\t\tif( isset( $image['id'] ) ){\n\t\t\t\t\t$image_id = $image['id'];\n\t\t\t\t\t// set the temporary image ID to avoid autodetecting in the future\n\t\t\t\t\tfa_update_slide_options( $post_id , array( 'temp_image_id' => $image_id ) );\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n\t\n\treturn $image_id;\n}", "public function getImageFile() \n {\n return isset($this->imagen) ? Yii::$app->basePath . '/web/img/producto/'. $this->imagen : null;\n }", "function getPageImage() {\n global $post;\n\n $imageUrl = esc_url( trailingslashit( get_template_directory_uri() ) . 'img/preview.png' );\n\n // single / page\n if( ( is_single() || is_page() ) && !is_front_page() ) {\n if( function_exists( 'get_field' ) ) {\n $imageId = get_field( 'linkpreview--image', $post->ID );\n if( $imageId ) {\n $imageUrl = wp_get_attachment_image_src( $imageId, 'large' )[0];\n }\n }\n }\n\n return $imageUrl;\n}", "function getting_featured_img_caption() {\n $thumbnail_id = get_post_thumbnail_id($post->ID);\n $thumbnail_image = get_posts(array('p' => $thumbnail_id, 'post_type' => 'attachment'));\n return $thumbnail_image[0]->post_excerpt;\n}", "public function preview_image()\n {\n return 'contact-area/04.png';\n }", "public function getImageFile()\n {\n return isset($this->filetask) ? $this->filetask : null;\n }", "public function preview_image()\n {\n return 'contact-area/02.png';\n }", "public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }", "public function getImage()\n {\n if (empty($this->data)) {\n // failure in processing the image. nothing much we can do\n return null;\n } else {\n $path = $this->data->basePath();\n\n // get path to image\n return $this->processImagePath($path);\n }\n }", "protected function imageName() {}", "public function getLinkToImg()\n {\n return ImgUpload::getLinkToImg($this);\n }", "function dizzy_featured_ogimg () { \n\t $thumb = get_the_post_thumbnail($post->ID);\n\t\t$pattern= \"/(?<=src=['|\\\"])[^'|\\\"]*?(?=['|\\\"])/i\";\n\t\tpreg_match($pattern, $thumb, $thePath);\n\t\t$theSrc = $thePath[0];\n}", "function generate_featured_image($image_url, $post_id){\n\t\tglobal $wpdb;\n\t $upload_dir = wp_upload_dir();\n\t $image_data = file_get_contents($image_url);\n\t $filename = basename($image_url);\n\t if (isset($filename) && $filename!='') {\n\t \t$filename = explode('?', $filename);\n\t\t if(wp_mkdir_p($upload_dir['path']))\n\t\t \t$file = $upload_dir['path'] . '/' . $filename[0];\n\t\t else\n\t\t \t$file = $upload_dir['basedir'] . '/' . $filename[0];\n\t\t \n\t\t\t$results = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}posts where post_type = 'attachment' and post_title = '\".$filename[0].\"'\");\n\t\t\tif(empty($results)) {\n\t\t\t file_put_contents($file, $image_data);\n\t\t\t $wp_filetype = wp_check_filetype($filename[0], null);\n\t\t\t $attachment = array(\n\t\t\t 'post_mime_type' => $wp_filetype['type'],\n\t\t\t 'post_title' => sanitize_file_name($filename[0]),\n\t\t\t 'post_content' => '',\n\t\t\t 'post_status' => 'inherit'\n\t\t\t );\n\n\t\t\t $attach_id = wp_insert_attachment($attachment, $file, $post_id);\n\t\t\t require_once(ABSPATH . 'wp-admin/includes/image.php');\n\t\t\t $attach_data = wp_generate_attachment_metadata($attach_id, $file);\n\t\t\t $res1 = wp_update_attachment_metadata($attach_id, $attach_data);\n\t\t\t} else {\n\t\t\t\t$attach_id = $results[0]->ID;\n\t\t\t}\n\t\t \n\t\t return $attach_id;\n\t\t}\n\t}", "function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}", "function get_thumb_urlfull ($postID) {\n\n$image_id = get_post_thumbnail_id($post); \n\n$image_url = wp_get_attachment_image_src($image_id,'large'); \n\n$image_url = $image_url[0]; \n\nreturn $image_url;\n\n}", "public function get_image_path($image)\n{\n\treturn \"data/\". $image. \".jpg\";\n}", "function get_featured_image_url( $post_id, $size ) {\n // for current post, call it with like $url = get_featured_image_url( get_the_ID(), 'full' );\n //$post_id = get_the_ID(); // try this just in case\n if (!$post_id) { return; } // bail if we still don't have a post_id\n if (!size) { $size = 'thumbnail'; } // default to the \"thumbnail\" sized image if we have no size specified\n\n if ( has_post_thumbnail( $post_id ) ) {\n $thumb_id = get_post_thumbnail_id($post_id);\n $thumbsrc = wp_get_attachment_image_src($thumb_id, $size);\n return $thumbsrc[0];\n }\n else { return; }\n}", "function post_image($data)\n\t{\n\t\tglobal $db;\n\t\t$query = 'SELECT board_image_filename FROM gv_board_post_image WHERE (board_post_id = ' . $data . ') AND (board_image_block = 0) ORDER BY board_image_id ASC LIMIT 1';\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\n\n\t\tif(mysql_num_rows($result) !== 0)\n\t\t{\n\t\t\t$row = mysql_fetch_assoc($result);\n\t\t\textract($row);\n\t\t\t$the_image = $board_image_filename;\n\t\t}\n\t\tif(mysql_num_rows($result) == 0)\n\t\t{\n\t\t\t\t$the_image = \"default.png\";\n\t\t}\n\t\treturn $the_image;\n\t}", "public function saveImageFromPost(){\n if(!empty($_FILES['images'])) {\n $imageData = $_FILES;\n $tmp_name = $imageData['images']['tmp_name'];\n $file_name = $this->getImageName();\n $upload_dir = DIR_IMAGES_DATA . \"/\" . $file_name;\n move_uploaded_file($tmp_name, $upload_dir);\n return $file_name;\n }else{\n return false;\n }\n }", "public function getImageName();", "public function getOpengraphImage();", "function tdc_get_filepath($filenode){\n return $filenode->path[0];\n}", "function get_image_url(){\n $image_id = get_post_thumbnail_id();\n $image_url = wp_get_attachment_image_src($image_id,'full');\n $image_url = $image_url[0];\n echo $image_url;\n }", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function wp_get_attachment_thumb_file($post_id = 0)\n {\n }", "public function getImage() {}", "function add_toolkit_banner_img( $post ) {\t\n\t\t\n\t$post_thumbnail_id = get_post_thumbnail_id( $post );\n\t$banner_feat_img = wp_get_attachment_image_src($post_thumbnail_id, 'full' );\n\t\n\techo $banner_feat_img[0];\n\t\n\t//echo '<pre>';print_r( $wide_banner_img[0] );echo '</pre>';\n\t\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function featuredURL($size = 'full'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo $url;\n}", "function barjeel_autoset_featured_img() {\n\n $post_thumbnail = barjeel_post_thumbnail_check();\n if ($post_thumbnail == true ){\n return the_post_thumbnail();\n }\n if ($post_thumbnail == false ){\n $image_args = array(\n 'post_type' => 'attachment',\n 'numberposts' => 1,\n 'post_mime_type' => 'image',\n 'post_parent' => $post->ID,\n 'order' => 'desc'\n );\n $attached_image = get_children( $image_args );\n if ($attached_image) {\n foreach ($attached_image as $attachment_id => $attachment) {\n set_post_thumbnail($post->ID, $attachment_id);\n }\n return the_post_thumbnail();\n } else { return \" \";}\n }\n }", "function get_product_image_by_post_id( $post_id, $small = false ) {\n\n // Get the image source\n $src = get_post_meta($post_id, '_fullimage', true);\n\n // Get the upload directory\n $upload_dir = untrailingslashit( wp_upload_dir()['baseurl'] );\n\n // If we have no source, use the default instead\n if ($src) {\n\n // Check if file exists in our uploads folder\n $file = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/product-images/'. $src;\n if(file_exists($file)){\n $output = $upload_dir . '/product-images/' . $src;\n } else {\n $output = '/wp-content/themes/randysworldwide/dist/images/randys_product_default_sm.png';\n }\n // Generate the full image source\n return $output;\n }\n\n // If we got to this part, an image has not been found.\n if ($small) {\n return '/wp-content/themes/randysworldwide/dist/images/randys_product_default_sm.png';\n } else {\n return '/wp-content/themes/randysworldwide/dist/images/randys_product_default.png';\n }\n}", "public function GetFeatureContent()\n\t{\n\t\treturn $this->url;\n\t}", "function postImage($path)\n \t{\n return $path && file_exists('storage/'.$path) ? asset('storage/'.$path) : asset('img/product/noimage.jpg');\n \t}", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "function C95_columns_content($column_name, $post_ID) {\n if ($column_name == 'featured_image') {\n $post_featured_image = C95_get_featured_image($post_ID);\n if ($post_featured_image) {\n echo '<img style=\"width:100%;\" src=\"' . $post_featured_image . '\" />';\n }\n }\n}", "public function getSolutionImgAttribute()\n {\n $logo = $this->image()->first();\n\n if ($this->is_company_logo) {\n $company_logo = $this->company()->first();\n if ($company_logo) {\n return $company_logo->logo;\n }\n } else if ($logo) {\n return $logo->image_location;\n }\n\n return null;\n }", "function get_post_thumbnail_id( $post = null ) {\n\t$post = get_post( $post );\n\tif ( ! $post ) {\n\t\treturn '';\n\t}\n\treturn get_post_meta( $post->ID, '_thumbnail_id', true );\n}", "function getImageFile() \n { \n return $this->_imageFile; \n }", "public function getPictureUri()\n\t{\n\t\treturn '/uploads/postcards/' . $this->picture;\n\t}", "function faculty_get_photo( $id = null ) {\n $thumbnail_id = get_post_thumbnail_id( $id );\n\n if ( $thumbnail_id ) {\n return wp_get_attachment_url( $thumbnail_id );\n }\n\n return get_stylesheet_directory_uri() . '/static/img/knight.png';\n}", "function generate_post_image()\n {\n // If there's no featured image, return.\n if (!has_post_thumbnail()) {\n return;\n }\n\n // If we're not on any single post/page or the 404 template, we must be showing excerpts.\n if (!is_singular() && !is_404()) {\n echo apply_filters('generate_featured_image_output', sprintf( // WPCS: XSS ok.\n '<div class=\"post-image\">\n\t\t\t\t\t%3$s\n\t\t\t\t\t<a href=\"%1$s\">\n\t\t\t\t\t\t%2$s\n\t\t\t\t\t</a>\n\t\t\t\t</div>',\n esc_url(get_permalink()),\n get_the_post_thumbnail(\n get_the_ID(),\n apply_filters('generate_page_header_default_size', 'full'),\n array(\n 'itemprop' => 'image',\n )\n ),\n apply_filters('generate_inside_featured_image_output', '')\n ));\n }\n }", "function wp_get_attachment_thumb_url($post_id = 0)\n {\n }", "function imagePath($img, $config) {\n return \"http://\" . $_SERVER[\"HTTP_HOST\"] . $config['global']['path'] . \"assets/rubrics/\" . $img;\n }", "function post_featured_image_json( $data, $post, $context ) {\n $featured_image_id = $data->data['featured_media'];\n $featured_image_url = wp_get_attachment_image_src( $featured_image_id, 'original' );\n if( $featured_image_url ) {\n $data->data['featured_image_url'] = $featured_image_url[0];\n }\n return $data;\n}", "function get_link_img_post(){\n\tglobal $post;\n\tpreg_match_all('/src=\"(.*)\"/Us',get_the_content(),$matches);\n\t$link_img_post = $matches[1];\n\treturn $link_img_post;\n}", "private function getImageSourcePath()\r\n {\r\n // check if relative\r\n if(substr($this->_imagesource, 0, 2) == \"..\" || $this->_imagesource{0} == \".\")\r\n {\r\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $this->_imagesource;\r\n }\r\n else\r\n {\r\n return $this->_imagesource;\r\n }\r\n }", "public function getPath(Image $image);", "public function getImage() : string\n {\n return $this->image;\n }", "public function getImageFields()\n {\n return [\n 'training_resource_thumbnail' => '/'\n ];\n }", "public function image(): string\n {\n return $this->column->isFile();\n }", "public function featimage()\n {\n $res = $this->db->get('feat_gallery')->result_array();\n\n // print_r($res);\n return $res;\n }", "function GetImgFullPath($img = NULL, $spr = NULL, $lang_id = NULL )\n {\n if ( empty($spr) ) $spr = $this->spr;\n //if ( empty($lang_id) ) $lang_id = $this->lang_id;\n if ( empty($img) ) $img = $this->img;\n\n $ret = Spr_Img_Path.$spr;\n if(!empty($lang_id)){\n $ret .= '/'.$lang_id;\n }\n $ret .= '/'.$img;\n return $ret;\n }", "function wgom_get_featured_image() {\n\t// This is the usual code that gets executed.\n\tif ( has_post_thumbnail() ) {\n\t\tif ( 'grid' == get_theme_mod( 'featured_content_layout' ) )\n\t\t\tthe_post_thumbnail();\n\t\telse\n\t\t\tthe_post_thumbnail( 'twentyfourteen-full-width' );\n\t}\n\telse {\n\t\t// This is the WGOM extension part.\n\t\t$image_html = wgom_video_post_featured_image();\n\t\tif (!empty($image_html)) {\n\t\t\techo $image_html;\n\t\t}\n\t}\n\n\twgom_get_featured_overlay();\n}", "function shoestrap_get_attachment_id_from_src( $image_src ) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var( $query );\n return $id;\n}", "public function getRelativeLinkToImg()\n {\n return ImgUpload::getRelativeLinkToImg($this);\n }", "public function get_preview_name(){\n\t\treturn \"{$this->id}_preview.png\";\n\t}", "function msd_post_image() {\n\tglobal $post;\n\t//setup thumbnail image args to be used with genesis_get_image();\n\tif(get_post_type()=='page'){\n\t $size = 'sidebar-image'; // Change this to whatever add_image_size you want\n } else {\n $size = 'post-thumb'; // Change this to whatever add_image_size you want\n }\n\t$default_attr = array(\n\t\t\t'class' => \"aligncenter attachment-$size $size\",\n\t\t\t'alt' => $post->post_title,\n\t\t\t'title' => $post->post_title,\n\t);\n\n\t// This is the most important part! Checks to see if the post has a Post Thumbnail assigned to it. You can delete the if conditional if you want and assume that there will always be a thumbnail\n\tif ( has_post_thumbnail()) {\n\t\tprintf( '%s', genesis_get_image( array( 'size' => $size, 'attr' => $default_attr ) ) );\n\t}\n\n}", "public function getImage()\n\t{\n\t\treturn $this->image;\n\t}" ]
[ "0.6573878", "0.6573878", "0.6296172", "0.6168056", "0.6103291", "0.60804135", "0.6034792", "0.6013491", "0.58720905", "0.5870317", "0.58182037", "0.5749974", "0.5736883", "0.5706038", "0.5667666", "0.56430054", "0.5625451", "0.5622882", "0.56065935", "0.56058884", "0.5603174", "0.55935794", "0.557224", "0.55687124", "0.5525266", "0.55186373", "0.55136627", "0.549116", "0.5463427", "0.545287", "0.54524904", "0.5448693", "0.54473484", "0.5445631", "0.5433072", "0.5432398", "0.542075", "0.540445", "0.54016", "0.53909653", "0.5380821", "0.53751385", "0.5352552", "0.5345624", "0.53432685", "0.53414", "0.53356797", "0.53335696", "0.5332645", "0.53323656", "0.5326939", "0.5323934", "0.5320509", "0.5316701", "0.5311185", "0.53000855", "0.5295696", "0.52929497", "0.5289843", "0.52871627", "0.5284287", "0.52729803", "0.52691406", "0.52690655", "0.52681684", "0.52584505", "0.52580076", "0.52580076", "0.52577424", "0.5251722", "0.52493674", "0.5239926", "0.5226728", "0.5226728", "0.5226728", "0.5226728", "0.52243793", "0.52229285", "0.5222819", "0.5215375", "0.52147835", "0.5212235", "0.52069634", "0.5203796", "0.51992476", "0.5196761", "0.51937044", "0.5188956", "0.51872367", "0.5182342", "0.5179107", "0.5178096", "0.51760876", "0.51688576", "0.5163373", "0.5161597", "0.5154785", "0.51495713", "0.5149249", "0.5146932" ]
0.75880456
0
The function remove old subscribe product
public static function _ClearProductSubscribe($LID) { global $DB; $subProp = COption::GetOptionString("sale", "subscribe_prod", ""); $arSubProp = unserialize($subProp); $dayDelete = IntVal($arSubProp[$LID]["del_after"]); $strSql = "DELETE ". "FROM b_sale_basket ". "WHERE ((ORDER_ID IS NULL) OR (ORDER_ID = 0)) AND CAN_BUY = 'N' AND SUBSCRIBE = 'Y' AND TO_DAYS(DATE_INSERT) < (TO_DAYS(NOW()) - ".$dayDelete.") LIMIT 500"; $db_res = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uc_order_edit_products_remove($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n\n $order_product_id = intval($form_state['triggering_element']['#return_value']);\n\n if (module_exists('uc_stock')) {\n // Replace stock immediately.\n $product = uc_order_product_load($order_product_id);\n uc_stock_adjust($product->model, $product->qty);\n }\n\n uc_order_product_delete($order_product_id);\n\n $order = $form_state['build_info']['args'][0];\n $matches = array();\n preg_match('/products\\[(\\d+)\\]/', $form_state['triggering_element']['#name'], $matches);\n $key = $matches[1];\n\n unset($order->products[$key]);\n $order->products = array_values($order->products);\n}", "public function removeProduct()\n {\n $product_code = filter_var($_GET[\"remove_code\"], FILTER_SANITIZE_STRING);\n\n if(isset($_SESSION[\"products\"][$product_code]))\t{\n unset($_SESSION[\"products\"][$product_code]);\n }\n\n $total_product = count($_SESSION[\"products\"]);\n die(json_encode(array('products'=>$total_product)));\n }", "function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }", "public function removeSubscribes();", "public function removeProduct(Product $product){\n $product->allergieëns()->detach();\n $product->delete();\n return redirect()->back();\n }", "public function addRemoveProducts() {\n\n //date calculation \n $email_content = array();\n $current_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time()));\n $yesterday_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time() - 60 * 60 * 24));\n\n\n //case 1 \n if (Mage::getStoreConfig('sale_category/general/t_shirt_of_day_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/t_shirt_of_day');\n $attr_name = 'special_to_date';\n $email_content['shirt']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'special_from_date';\n $email_content['shirt']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 2 \n if (Mage::getStoreConfig('sale_category/general/after_hour_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/after_hour');\n $attr_name = 'afterhours_to_date';\n $email_content['after_hour']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'afterhours_from_date';\n $email_content['after_hour']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 3 \n if (Mage::getStoreConfig('sale_category/general/gallery_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/gallery');\n $attr_name = 'gallery_to_date';\n $email_content['gallery']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'gallery_from_date';\n $email_content['gallery']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n if (Mage::getStoreConfig('sale_category/general/offer_mail')) {\n $newContent = \"Hi,<br/> These are the products Added or Removed through Auto Sale Extension\";\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n $headers .= 'From: <' . Mage::getStoreConfig('general/store_information/name') . '@magento.com>';\n \n $newContent .='<br/><br/><b><u>T-Shirt of the day </u></b><br/>Added Products';\n foreach ($email_content['shirt']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['shirt']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>After Hour </u></b><br/>Added Products';\n foreach ($email_content['after_hour']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['after_hour']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>Gallery </u></b><br/>Added Products';\n foreach ($email_content['gallery']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['gallery']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n\n $newContent .='<br/><br/> Thanks....<br/>';\n mail(Mage::getStoreConfig('trans_email/ident_general/email'), \"Product Added/Removed By Auto Sale Extension\", $newContent, $headers);\n }\n\n //mage::log($email_content);\n }", "private function deleteOldProducts(): void\n {\n DB::table('products')\n ->whereIn('id', array_keys($this->databaseProducts))\n ->delete();\n }", "public function removeProduct(Product $product): CurrentCart;", "public function product_delete()\n\t\t\t\t{\n\t\t\t\t}", "public function removeProduct($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n\n $cart->pivot->delete();\n }", "protected function saveRemoveProducts()\r\n\t{\r\n\t\tif (count($this->removeProducts) > 0) {\r\n\t\t\r\n\t\t\t// remove product from Magento catalog\r\n\t\t\tforeach ($this->removeProducts as $product) {\r\n\t\t\t $result = $this->client->catalogProductDelete($this->sessionid, $product->sku);\r\n\t\t\t\t$this->log->addInfo('removed', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->removeProducts = array();\r\n\t}", "function delete($product)\n {\n if (array_key_exists($product->id, $this->items)) {\n $storeProductDelete = $this->items[$product->id];\n //giam tien\n $this->totalPrice -= $storeProductDelete['price'];\n //giam so luong\n $this->totalQuantity -= $storeProductDelete['quantity'];\n // xoa phan tu o vi tri $product->id\n unset($this->items[$product->id]);\n }\n }", "function removeSubscription() {\r\n if(isset($_REQUEST['corp_id'])) {\r\n $arrArg=array(\r\n \"id\"=>$_SESSION['id'],\r\n \"corp_id\"=>$_REQUEST['corp_id']\r\n );\r\n $result=loadModel(\"subscription\",\"removeSubscription\",$arrArg);\r\n if ($result == true) {\r\n echo \"UnSubscribed\";\r\n } else {\r\n echo \"Error! Try later\";\r\n }\r\n }\r\n }", "public function removeProduct_get() {\n extract($_GET);\n $result = $this->feeds_model->removeProduct($prod_id);\n return $this->response($result);\n }", "public function removeproductAction() {\n $id = $this->getRequest()->getParam('id');\n $poProductId = $this->getRequest()->getParam('poproductid');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo_product')->load($poProductId);\n $product = Mage::getResourceModel('catalog/product_collection')\n ->addFieldToFilter('entity_id', $model->getProductId())\n ->setPageSize(1)->setCurPage(1)\n ->getFirstItem();\n try {\n $model->delete();\n Mage::getSingleton('vendors/session')->addSuccess(\n $this->helper()->__('Product %s has been removed.', '<i>' . $product->getSku() . '</i>')\n );\n $this->_redirect('*/*/view', array('id' => $id));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('There is error while removing product.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/view', array('id' => $id));\n }\n }", "public function unSubscribe()\n {\n }", "function basel_remove_from_compare() {\n\n\t\t$id = sanitize_text_field( $_GET['id'] );\n\n\t\tif ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) {\n\t\t\tglobal $sitepress;\n\t\t\t$id = wpml_object_id_filter( $id, 'product', true, $sitepress->get_default_language() );\n\t\t}\n\n\t\t$cookie_name = basel_compare_cookie_name();\n\n\t\tif ( ! basel_is_product_in_compare( $id ) ) {\n\t\t\tbasel_compare_json_response();\n\t\t}\n\n\t\t$products = basel_get_compared_products();\n\n\t\tforeach ( $products as $k => $product_id ) {\n\t\t\tif ( intval( $id ) == $product_id ) {\n\t\t\t\tunset( $products[ $k ] );\n\t\t\t}\n\t\t}\n\n\t\tif ( empty( $products ) ) {\n\t\t\tsetcookie( $cookie_name, false, 0, COOKIEPATH, COOKIE_DOMAIN, false, false );\n\t\t\t$_COOKIE[ $cookie_name ] = false;\n\t\t} else {\n\t\t\tsetcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, false, false );\n\t\t\t$_COOKIE[ $cookie_name ] = json_encode( $products );\n\t\t}\n\n\t\tbasel_compare_json_response();\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function remove (Product $product) {\n $basket = session()->get(\"basket\"); // On récupère le panier en session\n unset($basket[$product->id]); // On supprime le produit du tableau $basket\n session()->put(\"basket\", $basket); // On enregistre le panier\n}", "function initializeSubProduct($pid) {\n checkService('sublimation', $pid);\n if (is_null(get_sub_product($pid)) || count(get_sub_product($pid)) == 0 || empty($_SESSION['cart']['sublimation'][$pid])) {\n unset($_SESSION['cart']['sublimation'][$pid]);\n return;\n }\n $dlt_count = 0;\n foreach ($_SESSION['cart']['sublimation'][$pid] as $key=>$prod) {\n if (!array_key_exists('quantity', $prod) || $prod['quantity'] == -1) {\n if (array_key_exists('quantity', $prod))\n unlink(url_to_path($prod['url']));\n array_splice($_SESSION['cart']['sublimation'][$pid], $key- $dlt_count, 1);\n $dlt_count++;\n }\n }\n}", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function delete()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare', $compareProducts)?$this->View()->getSession('compare', $compareProducts):array();\n\n if (in_array($product_id, $compareProducts)) {\n // unseting product from compare session\n $key = array_search($product_id, $compareProducts);\n unset($compareProducts[$key]);\n }\n\n $this->View()->setSession('compare', $compareProducts);\n\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_deleted'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }", "public function productDelete(Varien_Event_Observer $observer)\n {\n try \n {\n $helper = Mage::helper('increasingly_analytics');\n\n if ($helper->isEnabled()){\n $productId = $observer->getEvent()->getProduct()->getId();\n\n $productData = array('product_id' => $productId);\n $helper->deleteBundleOnProductDeleteFromCart($productId);\n $helper->increasinglyApi($productData,'product_delete','track',$helper->getApiToken(),$helper->getApiSecret());\n }\n\n }\n catch(Exception $e)\n {\n Mage::log(\"Product delete tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n }", "function _remove_expired_products(){\n\t\t$this->loadModel('Produit');\n\t\t$produits = $this->Produit->Historique->find('all',array('fields'=>array('Historique.date_expiration',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Historique.produit_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Historique.stock_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'sum(Historique.debit) as debit',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'sum(Historique.credit) as credit',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Produit.*'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array(\"Historique.date_expiration <=\"=>date('Y-m-d'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Historique.date_expiration !='=>'0000-00-00'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'group'=>array('Historique.stock_id','Historique.produit_id','Historique.date_expiration')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$counter=0;\n\t\tforeach($produits as $produit){\n\t\t\t$qty=$produit['Historique']['debit']-$produit['Historique']['credit'];\n\t\t\tif($qty>0){\n\t\t\t\t//create la perte\n\t\t\t\t$perte['id']=null;\n\t\t\t\t$perte['stock_id']=$produit['Historique']['stock_id'];\n\t\t\t\t$perte['produit_id']=$produit['Historique']['produit_id'];\n\t\t\t\t$perte['quantite']=$qty;\n\t\t\t\t$perte['PU']=$this->Product->productPrice($produit['Historique']['produit_id']);\n\t\t\t\t$perte['montant']=$perte['PU']*$perte['quantite'];\n\t\t\t\t$perte['date']=date('Y-m-d');\n\t\t\t\t$perte['date_expiration']=$produit['Historique']['date_expiration'];\n\t\t\t\t$perte['nature']='expiration';\n\t\t\t\t$perte['personnel_id']=11; //id de armand\n\t\t\t\t//decreasing the stock level\n\t\t\t\t$perteData['Perte']=$perte;\n\t\t\t\t$this->Product->stock($perteData,'credit',$produit);\n\t\t\t\t//Saving the loss of goods\n\t\t\t\t$this->Produit->Perte->save($perteData);\n\t\t\t\t//increasing the counter\n\t\t\t\t$counter++;\n\t\t\t}\n\t\t}\n\t}", "public function removeProduct($id){\r\n $stmt = $this->DB->prepare ( \"DELETE FROM products WHERE Product_ID = '$id';\");\r\n $stmt->execute ();\r\n }", "private function deleteRecountProduct() {\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n UPDATE `productrecount` \n SET `isDefault` \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n `isNew` \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n `isDraft` \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n `isUpdate` \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n `isDelete` \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n `isActive` \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n `isApproved` \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n `isReview` \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n `isPost` \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n `executeBy` \t\t= '\" . $this->model->getExecuteBy() . \"',\n `executeTime` \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE `productCode` \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t `productRecountDate`\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n UPDATE [productRecount]\n SET [isDefault] \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n [isNew] \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n [isDraft] \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n [isUpdate] \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n [isDelete] \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n [isActive] \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n [isApproved] \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n [isReview] \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n [isPost] \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n [executeBy] \t\t= '\" . $this->model->getExecuteBy() . \"',\n [executeTime] \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE [productCode] \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t [productRecountDate]\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n UPDATE PRODUCTRECOUNT\n SET ISDEFAULT \t\t= '\" . $this->model->getIsDefault(0, 'single') . \"',\n ISNEW \t\t= '\" . $this->model->getIsNew(0, 'single') . \"',\n ISDRAFT \t\t= '\" . $this->model->getIsDraft(0, 'single') . \"',\n ISUPDATE \t\t= '\" . $this->model->getIsUpdate(0, 'single') . \"',\n ISDELETE \t\t= '\" . $this->model->getIsDelete(0, 'single') . \"',\n ISACTIVE \t\t= '\" . $this->model->getIsActive(0, 'single') . \"',\n ISAPPROVED \t\t= '\" . $this->model->getIsApproved(0, 'single') . \"',\n ISREVIEW \t\t= '\" . $this->model->getIsReview(0, 'single') . \"',\n ISPOST \t\t= '\" . $this->model->getIsPost(0, 'single') . \"',\n EXECUTEBY \t\t= '\" . $this->model->getExecuteBy() . \"',\n EXECUTETIME \t\t= \" . $this->model->getExecuteTime() . \"\n WHERE PRODUCTCODE \t\t= \t'\" . $this->model->getProductCode() . \"'\n\t\t\t AND\t PRODUCTRECOUNTDATE\t=\t'\" . $this->model->getProductRecountDate() . \"'\";\n }\n }\n }\n try {\n $this->q->update($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }", "public function destroy(Product $product) //Eliminar\n {\n //\n }", "public function removeItems($products)\n {\n }", "function jm_sub_fix_action( $valid, $product_id, $quantity )\n{\n\tglobal $woocommerce;\n\n\tif ( !WC_Subscriptions_Product::is_subscription( $product_id ) && WC_Subscriptions_Cart::cart_contains_subscription() ) \n\t\tadd_filter( 'add_to_cart_redirect', 'jm_sub_fix_filter', 10, 1 );\n\n\n\treturn $valid;\n}", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }", "public function destroy(Product $product)\n { \n if($product->stock <=0){\n $product->delete();\n \n $this->onlineSync('Product','delete',$product->id);\n return Redirect::back()->withErrors([\"Item Deleted\" ]);\n }\n else{\n return Redirect::back()->withErrors([\"This Products Stock is not Zero\",'Please Sell or drop that product to delete this Product' ]);\n }\n \n }", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "function cancelExistingSubscription(string $id){\nreturn $this->delete(\"/subscription/{$id}\");\n}", "public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function refuseProductAction($id){\r\n \r\n $em=$this->getDoctrine()->getManager();\r\n $product=$em->getRepository('HologramBundle:Product')->find($id);\r\n $em->remove($product);\r\n $em->flush();\r\n \r\n return $this->redirectToRoute('esprit_hologram');\r\n }", "public function ajaxRemoveProduct()\n\t{\n\n\t\t$modelUserCart = $this->getModel('usercart');\n\t\t$userId = $this->_getUserId();\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$produktID = $jinput->get('produktID');\n\t\t$quantity = $jinput->get('quantity');\n\t\t$produktEigenschaft = $jinput->get('produktEigenschaft');\n\n\t\tif (!JSession::checkToken('get'))\n\t\t{\n\n\t\t\techo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$modelUserCart->removeProductFromCard($userId, $quantity, $produktID,$produktEigenschaft);\n\t\t\tparent::display();\n\t\t}\n\t}", "public function removeFromCart(Varien_Event_Observer $observer)\n { \n try\n { \n $helper = Mage::helper('increasingly_analytics');\n\n if ($helper->isEnabled())\n {\n $item = $observer->getQuoteItem();\n $product = $item->getProduct();\n\n $data = array(\n 'product_id' => $product->getId()\n );\n\n if(Mage::getSingleton('customer/session')->isLoggedIn()) {\n $data['is_logged_in'] = true;\n }\n else {\n $data['is_logged_in'] = false;\n }\n $helper->deleteBundleOnProductDeleteFromCart($product->getId());\n $helper->addEvent('track', 'remove_from_cart', $data);\n }\n \n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n } \n }", "public function remove(Request $request): void\n {\n \\Cart::remove($request->get('product_id'));\n }", "public function order_remove_products($products)\n {\n foreach($products as $product)\n {\n $product_id = $product->id;\n\n $order_id = $this->id;\n\n $quantity = $product->pivot->quantity;\n\n $in_cart_product = $this->product()->where('product_id',$product_id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($in_cart_product))\n\n continue;\n\n if ($quantity >= $in_cart_product->pivot->quantity )\n {\n $this->removeProduct($product);\n }\n else\n {\n $update_quantity = $quantity - $in_cart_product->pivot->quantity;\n\n $in_cart_product->pivot->update(compact('update_quantity'));\n }\n \n }\n\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_type_name_by_id('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_type_name_by_id('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "function remove_move_product_selection() {\n\t\tremove_action( 'wcopc_product_selection_fields_before', 'PP_One_Page_Checkout::opc_messages', 10, 2 );\n\t\tremove_action( 'woocommerce_checkout_before_customer_details', 'PP_One_Page_Checkout::add_product_selection_fields', 11 );\n\t\tadd_action( 'woocommerce_checkout_after_customer_details', 'PP_One_Page_Checkout::add_product_selection_fields', 11);\n\t}", "public function remove(ProductInterface $product);", "public function removeAction() {\r\n $response = Mage::getModel('ajaxcartpro/ajaxresponse');\r\n $id = $this->getRequest()->getParam('id');\r\n Mage::getSingleton('checkout/cart')->removeItem($id)->save();\r\n $response->setCart(Mage::helper('ajaxcartpro')->rendercartpageUpdate());\r\n $response->setSidebar(Mage::helper('ajaxcartpro')->cartItemssidebar());\r\n $response->setLinks(Mage::helper('ajaxcartpro')->topLinkTitle());\r\n $response->send();\r\n }", "public function removeAll()\n {\n echo $this->_em->createQueryBuilder()->delete('Tdms\\Entity\\Product', 'p')->getQuery()->execute();\n }", "function remove_wish($product_id)\n {\n $user = $this->session->userdata('user_id');\n if ($this->get_field('user', $user, 'wishlist') !== 'null') {\n $wished = json_decode($this->get_field('user', $user, 'wishlist'));\n } else {\n $wished = array();\n }\n $wished_new = array();\n foreach ($wished as $row) {\n if ($row !== $product_id) {\n $wished_new[] = $row;\n }\n }\n $this->db->where('user_id', $user);\n $this->db->update('user', array(\n 'wishlist' => json_encode($wished_new)\n ));\n }", "public function delete_product() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo '{\"masterItemsList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while deleting';\n\t}", "function removeAllProducts() {\n ini_set('max_execution_time', 0);\n try {\n $productsContent = [];\n $client = HttpClient::create();\n $productsRequest = $client->request('GET', shopifyApiurl . 'products.json?limit=250&fields=id');\n $productsContent[] = json_decode($productsRequest->getContent(), true);\n $client = HttpClient::create();\n $countRequest = $client->request('GET', shopifyApiurl . 'products/count.json');\n $countContent = json_decode($countRequest->getContent(), true);\n $count = $countContent['count'];\n\n if(array_key_exists('link', $productsRequest->getHeaders())) {\n $paginationLink = $productsRequest->getHeaders()['link'];\n $occurence = floor(($count / 250));\n for($i = 1; $i <= $occurence; $i++) {\n $result = $this->paginationRequestProducts($paginationLink);\n if ($result != false) {\n $productsContent[] = json_decode($result->getContent(), true);\n $paginationLink = $result->getHeaders()['link'];\n }\n }\n }\n foreach ($productsContent as $productId) {\n foreach ($productId['products'] as $id) {\n $client = HttpClient::create();\n $productsDelete = $client->request('DELETE', shopifyApiurl . 'products/'.$id['id'].'.json');\n }\n }\n\n } catch (\\Exception $e) {\n var_dump($e);\n }\n\n return new Response('finish');\n }", "public function remove($product_id)\n {\n\n\n $id = $this->wlm->get_id_wishlist($product_id, $this->session->userdata('id'));\n\n $this->wlm->delete($id);\n redirect(\"retailer/products/detail_product/\" . $product_id);\n }", "function borrarProducto ($nombreproducto){\r\n $enc = false;\r\n for ($i = 0; $i < count ($this->productos) && ($enc == false); $i++){\r\n if ($this->productos[$i]->getNombre() == $nomproducto){\r\n $this->productos[$i] = null;\r\n $enc = true;\r\n }\r\n }\r\n }", "function remove_savedproduct($saved_id){\t\n\t\t\n\t\t$this -> db -> where('saved_id', $saved_id);\n\t\t\n\t\t$this -> db -> delete('tbl_saved_product');\n\t\t\n\t\treturn true;\t\t\n\t}", "public function destroy()\n {\n $this->_session->offsetUnset('products');\n $this->getEventManager()->trigger(CartEvent::EVENT_DELETE_CART_POST, $this, ['cart_id'=>$this->_session->cartId]);\n }", "function remove_product($voucher_id, $prod_id=NULL)\n\t{\n\t\t$where = array('voucher_id'=>$voucher_id);\n\t\t\n\t\tif(!is_null($prod_id))\n\t\t{\n\t\t\t$where['product_id'] = $prod_id;\n\t\t}\n\t\t\t\n\t\t$this->db->where($where);\n\t\t$this->db->delete('vouchers_products');\n\t}", "public function destroy($id)\n {\n $saledProduct = Sale::find($id);\n $product = Product::getProductBySku($saledProduct->sku);\n\n if($product){\n $count = $product->product_qty + $saledProduct->product_qty;\n $pr = Product::find($product->id);\n $pr->product_qty = $count;\n \n $pr->save();\n\n if(Sale::destroy($id)){\n return $pr;\n }\n }else{\n \n return Sale::destroy($id);\n }\n\n\n \n\n }", "function delete_follow_up_product($id)\n {\n return $this->db->delete('follow_up_product',array('id'=>$id));\n }", "public function clearSubscribers();", "function remove_compare($product_id)\n {\n $compared = json_decode($this->session->userdata('compare'),true);\n $new = array();\n foreach ($compared as $row) {\n if($row !== $product_id){\n $new[] = $product_id;\n }\n }\n $compared = json_encode($new);\n $this->session->set_userdata('compare',$compared);\n }", "public function unactive_product($product_id) {\n $this->AuthLogin();\n DB::table('tbl_product')->where('product_id',$product_id)->update(['product_status'=> 0]);\n return Redirect::to('all-product');\n }", "function delItem($product_id)\r\n\t{\r\n\t\t$product_id = (int)$product_id;\r\n\t\tunset($_SESSION['Product'][$product_id]);\r\n\t\tunset($_SESSION['ProductVar'][$product_id]);\r\n\t\tunset($_SESSION['BasketSumm']);\r\n\t\tunset($_SESSION['ShipperId']);\r\n\t\tunset($_SESSION['GewichtSumm']);\r\n\t\tunset($_SESSION['PaymentId']);\r\n\t\theader(\"Location:\" . $_SERVER['HTTP_REFERER']);\r\n\t\texit;\r\n\t}", "private function deleteAlreadyExistingVariants(){\n $product_ids = ProductModel::where('store_url', $this->store_settings->store_name)->pluck('product_id', 'id')->toArray();\n if( !empty($product_ids) ){\n ProductVariantModel::whereIn('product_id', $product_ids)->delete();\n }\n }", "public function destroy(product $product)\n {\n //\n }", "public function destroy(product $product)\n {\n //\n }", "public function removeOpinion(Product $product)\n {\n }", "public function test_products_invalid_subscribe() {\n\t\t$file = dirname( __FILE__ ) . '/invalid/sample_products/sample_plugin/plugin-file.php';\n\t\t\\ThemeisleSDK\\Loader::add_product( $file );\n\t\t$this->assertEmpty( ThemeisleSDK\\Loader::get_products() );\n\t}", "public function deleteUnpublished()\n {\n /**\n * @var OrderProduct[] $products\n */\n $products = $this->products;\n foreach ($products as $product) {\n $product->delete();\n }\n \n $this->delete();\n }", "public function removeOneAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n\t\t\texit();\n\t\t}\n\n\t\t//sécurisation CSRF\n\t\tif(!array_key_exists('CSRFToken', $customer) OR !array_key_exists('CSRFToken', $_GET) OR $_GET['CSRFToken'] !== $customer['CSRFToken'])\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n exit();\n\t\t}\n\n\t\t//vérification des données reçues\n\t\tif (!isset($_GET) OR !isset($_GET['id']))\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n\t\t\texit();\n\t\t}\n\n\t\t//suppression du produit dans la BDD\n\t\t$id = $_GET['id'];\n\t\t$productsManager = new ProductsManager();\n\t\t$productRemoved = $productsManager -> removeOne($id);\n\t\tif ($productRemoved)\n\t\t{\n\t\t\t$_SESSION['alertMessages']['success'][] = 'Le produit a bien été supprimé.';\n\t\t\theader('Location: manageForm');\n\t\t\texit();\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$_SESSION['alertMessages']['error'][] = 'La suppression du produit a échoué.';\n\t\t\theader('Location: manageForm');\n\t\t\texit();\n\t\t}\n\t}", "public function destroy(Subscribe $subscribe)\n {\n //\n }", "public function deleted(Product $product): void\n {\n Artisan::queue('product:update-category-products-count');\n }", "public function remove(\\Webshop\\Products\\Product $product)\n {\n $this->redis->delete('prd', $product->getId());\n }", "public function delete_product(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$product_id = $this->uri->segment(4,0);\r\n\t\t\t$condition = array('id' => $product_id);\r\n\t\t\t$old_product_details = $this->product_model->get_all_details(PRODUCT,array('id'=>$product_id));\r\n\t\t\t$this->update_old_list_values($product_id,array(),$old_product_details);\r\n\t\t\t$this->update_user_product_count($old_product_details);\r\n\t\t\t$this->product_model->commonDelete(PRODUCT,$condition);\r\n\t\t\t$this->setErrorMessage('success','Product deleted successfully');\r\n\t\t\tredirect('admin/product/display_product_list');\r\n\t\t}\r\n\t}", "public function deleting($event)\n {\n if ($event instanceof MaterialRelease) {\n if ($event->result) {\n $event->result->delete();\n }\n }\n\n $event->products()->sync([]);\n }", "public function remove_from_basket_post() {\n\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $retailer_id = (int) $this->post('retailer_id') ? (int)$this->post('retailer_id') : 0;\n $store_id = (int) $this->post('store_id') ? (int) $this->post('store_id') : 0;\n\n $result = $this -> basketmodel -> remove_from_basket($product_id, $user_id);\n \n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailer_id,$store_id);\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['basket_count'] = $basket_count;\n $retArr['message'] = \"Product removed successfully from basket\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Failed to remove product from basket\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }", "public function testDeleteProduct()\n // Ici je fais un test de suppression de produit\n {\n $response = $this->json('GET', '/api/products');\n // Vérifier le status de réussite.\n $response->assertStatus(200);\n // Je prend le premier produit [0]\n $product = $response->getData()[0];\n //Il faut etre connecté pour pouvoir supprimer\n $user = factory(\\App\\User::class)->create();\n //C'est une demande en DELETE à la place de POST \n $delete = $this->actingAs($user, 'api')->json('DELETE', '/api/products/'.$product->id);\n $delete->assertStatus(200);\n $delete->assertJson(['message' => \"Produit supprimé!\"]);\n }", "public function removeProduct($id){\n ProductCategory::where('product_id', $id)->delete();\n $del = DB::table('imageupload')->where('content_id', $id)->get();\n foreach ($del as $img) {\n $path = public_path().'/uploads/'.$img->path;\n if( file_exists($path) ){\n //File::delete('uploads/'.$img->path);\n unlink($path);\n }\n ImageUpload::find($img->id)->delete();\n }\n Product::find($id)->delete();\n return redirect('admin/products');\n }", "function del($id) {\n\t\t\t$this->save(array('id'=>$id,'deleted'=>1));\n\t\t\t\n\t\t\t//*** set the deleted flag on all auctions using this product\n\t\t\t$auctions=$this->Auction->find('all', array('conditions'=>array('product_id'=>$id)));\n\t\t\tforeach ($auctions as $auction) {\n\t\t\t\t$auction['Auction']['deleted']=1;\n\t\t\t\t$this->Auction->create();\n\t\t\t\t$this->Auction->save($auction);\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function deletePremiumSub()\n{\n if (isset($_POST['deletePremium'])) {\n global $connection;\n $userId = $_POST['deletePremium'];\n deleteSubscription($userId, $connection);\n }\n}", "function deleteProduct()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\t\n\t\t$sql='delete from products_table where product_id ='.$id;\n\t\t\n\t\t$obj=new Bin_Query();\n\t\t\n\t\tif($obj->updateQuery($sql))\n\t\t{\t\n\t\t\treturn '<div class=\"success_msgbox\">Product Deleted Successfully</div>';\t\n\t\t}\t\n\t}", "public function onRemove();", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "public function touchProductEntitiesOfExpiredSubscriptions()\n {\n $subscriptionRepo = \\Env::get('em')->getRepository('Cx\\Modules\\Order\\Model\\Entity\\Subscription');\n $subscriptions = $subscriptionRepo->getExpiredSubscriptions();\n \n if (\\FWValidator::isEmpty($subscriptions)) {\n return;\n }\n\n foreach ($subscriptions as $subscription) {\n //Trigger the model event model/expired on the Subscription's product entity.\n \\Env::get('cx')->getEvents()->triggerEvent('model/expired', array(new \\Doctrine\\ORM\\Event\\LifecycleEventArgs($subscription, \\Env::get('em'))));\n }\n \\Env::get('em')->flush();\n }", "public function RemoveStoreOrderFromAddtoCart() {\n if (func_num_args() > 0) {\n $addtocartSerialNo = func_get_arg(0);\n $userid = func_get_arg(1);\n\n try {\n\n $deleted = $this->delete('id= ' . $addtocartSerialNo);\n if ($deleted) {\n\n $select = $this->select()\n ->from(array('act' => 'addtocart'), array('act.user_id', 'act.product_id', 'act.id AS cart_id', 'act.Store_id', 'act.quantity'))\n ->setIntegrityCheck(false)\n ->joinLeft(array('p' => 'products'), 'act.product_id=p.product_id', array('p.name', 'p.imagelink', 'p.cost AS product_cost'))\n ->joinLeft(array('sd' => 'store_details'), 'act.Store_id=sd.store_id')\n ->where('act.user_id = ?', $userid);\n\n $result = $this->getAdapter()->fetchAll($select);\n\n if ($result) {\n $i = 0;\n foreach ($result as $value) {\n $store_id = $value['store_id'];\n $res['store_name'] = $value['store_name'];\n $res['store_id'] = $value['store_id'];\n $res['Deliverycharge'] = $value['Deliverycharge'];\n $res['products'][$i]['product_id'] = $value['product_id'];\n $res['products'][$i]['imagelink'] = $value['imagelink'];\n $res['products'][$i]['cost'] = $value['product_cost'];\n $res['products'][$i]['sub_cost_product'] = $value['product_cost'] * $value['quantity'];\n $res['products'][$i]['quantity'] = $value['quantity'];\n $res['products'][$i]['cart_id'] = $value['cart_id'];\n $res['products'][$i]['product_name'] = $value['name'];\n if (isset($res['subtotal'])) {\n $res['subtotal']+= $res['products'][$i]['sub_cost_product'];\n } else {\n $res['subtotal'] = 0;\n $res['subtotal']+= $res['products'][$i]['sub_cost_product'];\n }\n $i++;\n }\n if ($res) {\n return $res;\n } else {\n return null;\n }\n } else {\n return null;\n }\n } else {\n return 'error';\n }\n } catch (Exception $ex) {\n echo $ex->getTraceAsString();\n }\n } else {\n throw new Exception(\"Argument not passed\");\n }\n }", "public function destroy(){\n $productData = Products::where(\"productId\",request('productId'));\n $productDataImages = ProductImages::where(\"productId\",request('productId'));\n File::delete(\"productImages/\".$productData->get()->first()->thumbnail);\n if(count($productDataImages->get())){\n foreach ($productDataImages->get() as $productDataImage) {\n File::delete(\"productImages/\".$productDataImage->name);\n }\n $productDataImages->delete();\n }\n if($productData->delete()){\n Session()->flash('message', \"Product Sucessfully Updated\");\n }else{\n Session()->flash('error', \"Product Not Sucessfully Updated\"); \n }\n return redirect(\"/products\");\n }", "private function deleteProduct()\n {\n echo PHP_EOL;\n \n try\n {\n $productToDelete = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN);\n $resultOfDelete = $this->productDao->delete($productToDelete); \n\n echo 'Product with id: ' . $productToDelete->id . ' was deleted ' .\n (($resultOfDelete) ? '' : 'un') .\n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n }", "public static function cart_remove_product()\n {\n if (!isset($_REQUEST['cart-item-key'])) {\n WordPress_Rewrite_API_Request::missing_params();\n }\n\n //@TODO Check item_key exist in Cart or Use $_REQUEST['product_id'] as item_key\n\n // Remove\n WooCommerce_Cart::remove_item_cart(sanitize_text_field($_REQUEST['cart-item-key']));\n\n // Result\n wp_send_json_success(self::_return_cart_list(), 200);\n }", "function remove_product($pid){\n\t// scart-products_addorder.php?action=checkout -- id=\"submit_delitem\" \n\t$cart = $_SESSION['custCart_ID']; // the SESSION and COOKIE customer cart items array\n $returnpid = 0; // default 0 failed\n\t$pid=intval($pid);\n\t$max=count($_SESSION[$cart]);\n\tfor($i=0;$i<$max;$i++){\n\t\tif($pid==$_SESSION[$cart][$i]['bookid']){\n\t\t\tunset($_SESSION[$cart][$i]);\n $returnpid = $pid; // success > 0\n\t\t\tbreak;\n\t\t}\n\t}\n\t$_SESSION[$cart]=array_values($_SESSION[$cart]);\n return $returnpid; // default 0 failed, success > 0\n}", "public function removeFromCart() : void\n {\n $this->VIEW = false;\n $this->Cart->removeFromCart($_SESSION['Auth']->id, $_POST);\n }", "function remove_added_to_cart_notice()\n\t{\n\t\tif ( is_page(24770) ) {\n\t\t\t$notices = WC()->session->get( 'wc_notices', array() );\n\t\t\t\n\t\t\tforeach ( $notices['success'] as $key => &$notice ) {\n\t\t\t\tif ( strpos( $notice, 'added to your' ) !== false ) {\n\t\t\t\t\t$added_to_cart_key = $key;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset( $notices['success'][ $added_to_cart_key ] );\n\t\t\t\n\t\t\tWC()->session->set( 'wc_notices', $notices );\n\t\t}\n\t}", "public function del($product_id){\n\t\tunset($_SESSION['panier'][$product_id]);\n\t}", "public function destroy(Product $product)\n {\n // Admin only, should automatically update\n }", "public function deleteProduct($param)\n {\n $prd_id = $this->db->real_escape_string($param['prdId']);\n $prd_parent = $this->db->real_escape_string($param['prdParent']);\n\n $qry = \"DELETE FROM ctt_accesories WHERE prd_parent = $prd_parent AND prd_id = $prd_id;\" ;\n/* print_r($qry );\n exit(); */\n $this->db->query($qry);\n\n\n $qry = \"UPDATE ctt_products SET prd_sku = substr(prd_sku,1,4), sbc_id=152 WHERE prd_id = \".$prd_id.\"\";\n $this->db->query($qry);\n \n\n return $prd_id;\n }", "public function RemoveProdAction($id, Request $request){\n $sn = $this->getDoctrine()->getManager();\n $todo = $sn->getRepository('ShopBundle:Produit')->find($id);\n $sn->remove($todo);\n $sn->flush();\n\n return $this->redirectToRoute('all_produits');\n\n }", "protected function _clearProducts($nht8bfb4e1aa590eab8f08f837b97acf5803a5737ed, $nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61)\n {\n if (!$nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['config']['import']['products']) {\n return array(\n 'result' => 'process',\n 'function' => '_clearCategories'\n );\n }\n $nht0ec6d150549780250a9772c06b619bcc46a0e560 = array(\n 'result' => 'process'\n );\n $nht2037de437c80264ccbce8a8b61d0bf9f593d2322 = $this->_objectManager->create('Magento\\Catalog\\Model\\Product')\n ->getCollection()\n ->addWebsiteFilter($nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['config']['website_id'])\n ->setPageSize($nhta81b09d9521597ebcaf0cc8b49ad7a8be8e4cc61['clear_info']['limit'])\n ->setCurPage(1);\n if (!count($nht2037de437c80264ccbce8a8b61d0bf9f593d2322)) {\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['function'] = '_clearSeoProducts';\n } else {\n foreach ($nht2037de437c80264ccbce8a8b61d0bf9f593d2322 as $nht38a007151abe87cc01a5b6e9cc418e85286e2087) {\n try {\n $nht38a007151abe87cc01a5b6e9cc418e85286e2087->delete();\n } catch (\\Exception $nht58e6b3a414a1e090dfc6029add0f3555ccba127f) {\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['result'] = 'error';\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['msg'] = \"Product Id = {$nht38a007151abe87cc01a5b6e9cc418e85286e2087->getId()} delete failed. Error: \" . $nht58e6b3a414a1e090dfc6029add0f3555ccba127f->getMessage();\n break;\n }\n }\n $nht0ec6d150549780250a9772c06b619bcc46a0e560['function'] = '_clearProducts';\n }\n return $nht0ec6d150549780250a9772c06b619bcc46a0e560;\n }", "public function removeProduct($productId) {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products` WHERE `product_id` = ? AND `product_removed` = ?\");\n\n $query->bindValue(1, $productId);\n $query->bindValue(2, 0);\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n if($rows == 1) {\n\n $query_2 = $this->db->prepare(\"UPDATE `products` SET `product_removed` = ? WHERE `product_id` = ?\");\n\n $query_2->bindValue(1, 1);\n $query_2->bindValue(2, $productId);\n\n $query_2->execute();\n return true;\n\n } else {\n return false;\n }\n\n } catch(PDOException $e) {\n die($e->getMessage());\n }\n }", "public function delete_item_list($product_id){\n\t\t\tunset($_SESSION['terminal_list'][$product_id]);\n\t\t\treturn 'sucess';\n\t}", "function delete_prodInv($prodID)\n {\n $sql = \"delete from product where ProdID=\" . $prodID;\n $query = $this->db->query($sql);\n }", "public function deleteProcuct($productModel) {\n\n }", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "function clearProduct($id = null) {\n $keys = array(\n \"PRODUCT_BASE_{$id}\",\n \"PRODUCT_IS_FEATURED_{$id}\",\n \"PRODUCT_PRICE_{$id}\",\n \"PRODUCT_RATING_COUNTSUM_{$id}\",\n \"PRODUCT_CP_ID_{$id}\",\n \"PRODUCT_AVG_RATING_{$id}\",\n \"PRODUCT_TOTAL_RATING_{$id}\",\n \"EAV_FULL_Model_ProductMeta_{$id}\"\n );\n $this->clear($keys);\n $this->clearType('device'); //because device types are stored by hash. need to clear all\n $this->clearType('category'); //ditto for category\n }", "public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }" ]
[ "0.66609293", "0.66593325", "0.66515213", "0.6575372", "0.65537834", "0.63727605", "0.6341068", "0.63332826", "0.63106346", "0.6256273", "0.62538195", "0.61330545", "0.60929066", "0.6088803", "0.6074131", "0.60539997", "0.6033648", "0.6009281", "0.60074764", "0.5976804", "0.5938311", "0.5937947", "0.59357417", "0.59244055", "0.59099865", "0.5890236", "0.588654", "0.5886061", "0.58693576", "0.5868825", "0.58598244", "0.58573", "0.5845306", "0.58063436", "0.5801511", "0.57910454", "0.57867527", "0.5781648", "0.5780398", "0.5748861", "0.57340384", "0.5712094", "0.5710043", "0.57085973", "0.5703713", "0.57023424", "0.57021695", "0.56957775", "0.5686126", "0.5683385", "0.5678021", "0.5669821", "0.566722", "0.5665633", "0.5663244", "0.5656139", "0.5651736", "0.56460196", "0.56358355", "0.5633627", "0.5632093", "0.56303674", "0.56303674", "0.56270635", "0.5623598", "0.56209105", "0.56191534", "0.5610283", "0.5609621", "0.5605894", "0.5603834", "0.5599672", "0.558778", "0.5583884", "0.5581454", "0.5579923", "0.55732167", "0.5573206", "0.557141", "0.55652833", "0.5564212", "0.55511224", "0.5549958", "0.5548876", "0.5542264", "0.55412215", "0.5538455", "0.55379134", "0.5533736", "0.55304575", "0.5522251", "0.5520032", "0.5519493", "0.55184215", "0.55117095", "0.55114025", "0.5511099", "0.5506863", "0.5499368", "0.5496307" ]
0.60723555
15
override some default cURL opts with the $curlOpts provided.
public function parallelGet($urls, $callback, &$opts, $curlOpts=[]) { $defaultOpts = [ CURLOPT_COOKIE => $this->cookie, CURLOPT_USERAGENT => "LLAnim.us", CURLOPT_ENCODING => "gzip,deflate", CURLOPT_REFERER => "", CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 1, CURLOPT_MAXREDIRS => 2 ]; foreach ($curlOpts as $opt=>$value) { $defaultOpts[$opt] = $value; } // now get all of the given URLs in parallel. $parallelCurl = new ParallelCurl(20, $defaultOpts); foreach ($urls as $url) { $parallelCurl->startRequest($url, $callback, $opts); } $parallelCurl->finishAllRequests(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }", "public function set_curl_options(array $curl_options = array())\n {\n }", "protected function defaultCurlOptions()\n\t{\n\t\treturn [\n\t\t\tCURLOPT_USERAGENT => Yii::$app->name . ' OAuth ' . $this->version . ' Client',\n\t\t\tCURLOPT_CONNECTTIMEOUT => 30,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_SSL_VERIFYPEER => false,\n\t\t];\n\t}", "function curl_options(&$curl, $options) {\n if (!curl_setopt_array($curl, $options)) {\n error('Failed to initialize cURL options for ' . spy($curl) . '.');\n }\n\n return $curl;\n}", "public function setCurlOptions(array $curlOptions, bool $erase = false)\n {\n if (!$erase) {\n $curlOptions = array_replace($this->curlOptions, $curlOptions);\n }\n\n // Remove reserved CURL options\n $reservedOptions = [CURLOPT_HTTP_VERSION,\n CURLOPT_CUSTOMREQUEST,\n CURLOPT_URL,\n CURLOPT_HEADER,\n CURLINFO_HEADER_OUT,\n CURLOPT_HTTPHEADER,\n CURLOPT_RETURNTRANSFER,\n CURLOPT_POST,\n CURLOPT_POSTFIELDS];\n if (defined('CURLOPT_FOLLOWLOCATION')) {\n $reservedOptions[] = CURLOPT_FOLLOWLOCATION;\n }\n\n foreach ($reservedOptions as $reservedOption) {\n unset($curlOptions[$reservedOption]);\n }\n\n $this->curlOptions = $curlOptions;\n }", "protected function transferDeprecatedCurlSettings() {}", "public function applyCurlOptions($channel);", "private function setCurlOptions(&$ch, $headers = array())\n {\n curl_setopt($ch, CURLOPT_USERPWD, $this->authentication);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_BUFFERSIZE, 4096);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 25);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n }", "private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }", "protected function getOAuthCurlOpts()\n\t{\n\t\treturn array(CURLOPT_SSL_VERIFYPEER => false);\n\t}", "private function configureCurl ()\n {\n curl_setopt_array($this->cURL, [\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ]);\n }", "public function setCurlOptions($option, $curlArray = [])\n {\n $this->curlOptions[$option] = $curlArray;\n }", "public function getCurlOptions()\n {\n return $this->curlOptions;\n }", "protected function _getCurlOptions($customCurlOpts = [], $headers = [])\n {\n // default curl options\n $curlOpts = [\n CURLOPT_RETURNTRANSFER => true, // return result instead of echoing\n CURLOPT_SSL_VERIFYPEER => false, // stop cURL from verifying the peer's certificate\n CURLOPT_FOLLOWLOCATION => false, // follow redirects, Location: headers\n CURLOPT_MAXREDIRS => 10, // but don't redirect more than 10 times\n CURLOPT_HTTPHEADER => [],\n CURLOPT_HEADER => 1,\n ];\n\n // merge headers\n $headers = array_merge($curlOpts[CURLOPT_HTTPHEADER], $headers);\n if (TESTS_XDEBUG_ENABLED) {\n $headers[] = 'Cookie: XDEBUG_SESSION=' . TESTS_XDEBUG_SESSION;\n }\n $curlOpts[CURLOPT_HTTPHEADER] = $headers;\n\n // merge custom Curl Options & return\n foreach ($customCurlOpts as $opt => $val) {\n $curlOpts[$opt] = $val;\n }\n\n return $curlOpts;\n }", "public function setCurlOptions(array $options)\n {\n $this->curl_options = $options;\n\n // We need to reinitialize the SOAP client.\n $this->soap = null;\n }", "protected function setOptions($curl)\n {\n if(!curl_setopt($curl, CURLOPT_POST, $this->options->post))\n {\n throw new Exception('Could not set option [post]');\n }\n \n if(!curl_setopt($curl, CURLOPT_HEADER, $this->options->header))\n {\n throw new Exception('Could not set option [header]');\n }\n \n if(!curl_setopt($curl, CURLOPT_RETURNTRANSFER, $this->options->returnTransfer))\n {\n throw new Exception('Could not set option [return transfer]');\n }\n }", "abstract protected function composeRequestCurlOptions($method, $url, array $params);", "protected function _getCurlOpts() {\n return array(\n CURLOPT_TIMEOUT => 10,\n CURLOPT_RETURNTRANSFER => true,\n );\n }", "protected function curlOptions($action, $request)\n {\n $options = \n\t\t\t$this->options['curlopts'] + \n\t\t\tarray(\n\t\t\t\tCURLOPT_SSL_VERIFYPEER => true,\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\t\tCURLOPT_HTTPHEADER => $this->buildHeaders($action),\n\t\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\t\tCURLOPT_HTTPAUTH => ((!empty($this->options['token'])) ? CURLAUTH_BEARER : CURLAUTH_BASIC | CURLAUTH_NTLM)\n\t\t\t); \n\n\t\tif(!empty($this->options['user']) && !empty($this->options['password'])) {\n\n\t\t\t$options[CURLOPT_USERPWD] = $this->options['user'] . ':' . $this->options['password']; \n\n\t\t}\n\n // We shouldn't allow these options to be overridden.\n $options[CURLOPT_HEADER] = true;\n $options[CURLOPT_POST] = true;\n $options[CURLOPT_POSTFIELDS] = $request;\n\n return $options;\n }", "private function setOptionsFromRequest($curl, RequestInterface $request)\n {\n $options = array(\n CURLOPT_HTTP_VERSION => $request->getProtocolVersion() === '1.0' ? CURL_HTTP_VERSION_1_0 : CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => $request->getMethod(),\n CURLOPT_URL => (string) $request->getUri(),\n CURLOPT_HTTPHEADER => $this->getHeaders($request),\n CURLOPT_POSTFIELDS => (string) $request->getBody(),\n );\n\n curl_setopt_array($curl, $options);\n }", "function curl_option(&$curl, $option, $value) {\n return curl_options($curl, [$option => $value]);\n}", "private function initCurl()\n\t{\n\t\t$this->_curl = curl_init();\n\t\t//TODO: delete useless lines\n\t\tcurl_setopt ($this->_curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\t\tcurl_setopt ($this->_curl, CURLOPT_TIMEOUT, 4000);\n\t\tcurl_setopt ($this->_curl, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt ($this->_curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt ($this->_curl, CURLOPT_COOKIEJAR, self::$_COOKIE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_COOKIEFILE, self::$_COOKIE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_POST, 1);\n\t}", "public function curlInit() {\n parent::curlInit();\n curl_setopt($this->curl, CURLOPT_HEADER, true);\n curl_setopt($this->curl, CURLOPT_ACCEPT_ENCODING, 'identity');\n }", "public function set_opt($custom_options = array()) {\r\n\t\t$debug_backtrace = debug_backtrace();\r\n\t\t$this_file = __FILE__;\r\n\t\tif (!empty($debug_backtrace[0][\"file\"]) && !empty($this_file) && ($debug_backtrace[0][\"file\"] == $this_file)) { $internal = true; } else { $internal = false; }\r\n\t\tforeach ($custom_options as $key => $value) {\r\n\t\t\tif (!is_string($key)) { trigger_error(\"curl option name must be string instead of default php constant\", E_USER_WARNING); }\r\n\t\t\telseif (!defined($key)) {\r\n\t\t\t\t$curl_version = curl_version();\r\n\t\t\t\ttrigger_error(\"'{$key}' is not a valid option in php v\".phpversion().\" or curl library v\".$curl_version[\"version\"], E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEFILE\") { $this->set_cookiefile($value); }\r\n\t\t\telseif ($key == \"CURLOPT_COOKIEJAR\") { $this->set_cookiejar($value); }\r\n\t\t\telseif (!$internal && in_array($key, array(\"CURLOPT_SAFE_UPLOAD\", \"CURLOPT_PROTOCOLS\", \"CURLOPT_RETURNTRANSFER\", \"CURLOPT_HEADERFUNCTION\", \"CURLINFO_HEADER_OUT\"))) {\r\n\t\t\t\ttrigger_error(\"'{$key}' option is locked in this class to ensure functionalities\", E_USER_WARNING);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (curl_setopt($this->ch, constant($key), $value)) { $this->options[$key] = $value; }\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function curl_setopts($curl_handle, $config, $service) {\n curl_setopt($curl_handle, CURLOPT_URL, str_replace('%s', $this->url, $config[$service]['url']));\n $timeout = isset($this->options['timeout']) ? $this->options['timeout'] : 6;\n\n // other necessary settings:\n // CURLOPT_HEADER means include header in output, which we do not want\n // CURLOPT_RETURNTRANSER means return output as string or not\n curl_setopt_array($curl_handle, array(\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_TIMEOUT => $timeout,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_SSL_VERIFYHOST => false,\n ));\n\n // set the http method: default is GET\n if($config[$service]['method'] === 'POST') {\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n }\n\n // set the body and headers\n $headers = isset($config[$service]['headers']) ? $config[$service]['headers'] : array();\n $body = isset($config[$service]['body']) ? $config[$service]['body'] : NULL;\n\n if(isset($body)) {\n if(isset($headers['Content-Type']) && $headers['Content-Type'] === 'application/json') {\n $data_string = json_encode($body);\n\n curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data_string);\n }\n }\n\n // set the useragent\n $useragent = isset($config[$service]['User-Agent']) ? $config[$service]['User-Agent'] : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0';\n curl_setopt($curl_handle, CURLOPT_USERAGENT, $useragent);\n }", "protected function setRequestOptions() \n {\n // Set some default CURL options\n $this->optionManager->set('HEADER', true);\n $this->optionManager->set('RETURNTRANSFER', true);\n $this->optionManager->set('USERAGENT', $this->userAgent);\n\n if ($this->cookieFile) {\n $this->optionManager->set('COOKIEFILE', $this->cookieFile);\n $this->optionManager->set('COOKIEJAR', $this->cookieFile);\n }\n\n if ($this->followRedirects) {\n $this->optionManager->set('FOLLOWLOCATION', true);\n } \n\n $this->setCurlOptions(CURLINFO_HEADER_OUT, true);\n\n return $this;\n }", "protected function init()\n {\n // To start with, disable FOLLOWLOCATION since we'll handle it\n curl_setopt($this->curlHandle, \\CURLOPT_FOLLOWLOCATION, false);\n\n // Always return the transfer\n curl_setopt($this->curlHandle, \\CURLOPT_RETURNTRANSFER, true);\n\n // Force IPv4, since this class isn't yet comptible with IPv6\n $curlVersion = curl_version();\n\n if ($curlVersion['features'] & \\CURLOPT_IPRESOLVE) {\n curl_setopt($this->curlHandle, \\CURLOPT_IPRESOLVE, \\CURL_IPRESOLVE_V4);\n }\n }", "private function setUpCurl()\n {\n $this->curl = $this->get('app.curl.connector');\n $this->curl->setEndPointBaseUrl($this->getParameter('themoviedb_endpoint_url'));\n $this->curl->setExtraHeaders([\n CURLOPT_HEADER => false,\n CURLOPT_HTTPHEADER => [\"Accept: application/json\"],\n CURLOPT_SSL_VERIFYPEER => false\n ]);\n }", "public function setupOption($k, $v){\n if($this->isCurlSet()){\n curl_setopt($this->curl, $k, $v);\n } else {\n throw new SdkException(\"cURL instance is not set when calling setup Option.\");\n }\n }", "private function setopt($url, $referer)\n {\n // Set request URL\n curl_setopt($this->handle, CURLOPT_URL, $url);\n\n // Remove any current HTTP headers\n curl_setopt($this->handle, CURLOPT_HEADER, 0);\n\n // Follow redirects, or not\n if ($this->redirs)\n {\n curl_setopt($this->handle, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($this->handle, CURLOPT_MAXREDIRS, 10);\n }\n else\n {\n curl_setopt($this->handle, CURLOPT_FOLLOWLOCATION, 0);\n curl_setopt($this->handle, CURLOPT_MAXREDIRS, 0);\n }\n\n // Return data from transfer\n curl_setopt($this->handle, CURLOPT_RETURNTRANSFER, 1);\n\n // Set UserAgent string\n curl_setopt($this->handle, CURLOPT_USERAGENT, $this->useragent);\n\n // If it's a HTTPS (SSL) URL, disable verification\n if (substr($url, 4, 1) == 's')\n {\n curl_setopt($this->handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, false);\n }\n\n // Set cookie jar\n if ($this->cookies)\n {\n curl_setopt($this->handle, CURLOPT_COOKIEJAR, $this->cookiejar);\n curl_setopt($this->handle, CURLOPT_COOKIEFILE, $this->cookiejar);\n }\n\n // If a proxy is set, use it\n if ($this->proxy != '')\n {\n curl_setopt($this->handle, CURLOPT_PROXY, $this->proxy);\n\n if ($this->proxypwd != '')\n {\n curl_setopt($this->handle, CURLOPT_PROXYUSERPWD, $this->proxypwd);\n }\n }\n\n // Set referrer if one is specified\n if ($referer != '')\n {\n curl_setopt($this->handle, CURLOPT_REFERER, $referer);\n }\n\n // XHR\n if ($this->xhr == true)\n {\n curl_setopt($this->handle, CURLOPT_HTTPHEADER, array(\"X-Requested-With: XMLHttpRequest\"));\n }\n }", "private function setGetCurlOpts($endpoint) {\n // Convert the variables to header data\n $headersData = $this->setHeaders();\n // Define the endpoint\n $url = \"$this->base_url/$endpoint\";\n // Assign the variables to the request opts\n // TODO: Handle additional GET data \n $opts = array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $url,\n CURLOPT_HTTPHEADER => $headersData\n );\n return $opts;\n }", "protected function setCurlConstants(): void\n {\n $constants = [\n 'CURLOPT_SSLVERSION' => 32,\n 'CURL_SSLVERSION_TLSv1_2' => 6,\n 'CURLOPT_SSL_VERIFYPEER' => 64,\n 'CURLOPT_SSLCERT' => 10025,\n ];\n\n foreach ($constants as $key => $value) {\n if (!defined($key)) {\n define($key, $constants[$key]);\n }\n }\n }", "public function setCurl(Curl $curl)\n {\n $this->curl = $curl;\n\n return $this;\n }", "protected function init()\n {\n $this->curl = curl_init();\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n // this line makes it work under https\n curl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookiejar);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookiejar);\n curl_setopt($this->curl, CURLOPT_REFERER, $this->referer);\n if (isset($this->encoding)) {\n curl_setopt($this->curl, CURLOPT_ENCODING, $this->encoding);\n }\n if ($this->omitSSLVerification) {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n }\n if (isset($this->userAuthData)) {\n curl_setopt($this->curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($this->curl, CURLOPT_USERPWD, $this->userAuthData);\n }\n if ($this->proxy != '') {\n curl_setopt($this->curl, CURLOPT_PROXY, $this->proxy);\n if ($this->proxyType == self::PROXY_TYPE_SOCKS4) {\n curl_setopt($this->curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);\n } else if ($this->proxyType == self::PROXY_TYPE_SOCKS5) {\n curl_setopt($this->curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);\n }\n }\n $this->errorno = false;\n $this->error = false;\n }", "private function setOptions(CurlHandle $curlHandle): void\n {\n foreach ($this->options as $optionName => $optionValue) {\n curl_setopt($curlHandle, $optionName, $optionValue);\n }\n }", "private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['curl']['proxy']);\n curl_setopt($this->_cm, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($this->_cm, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->_cm, CURLOPT_TIMEOUT, $config['curl']['timeout']);\n curl_setopt($this->_cm, CURLOPT_POST, true); \n }", "protected static function configure($curl) {\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\t\t\t\t//We want the data returned as a variable\n\t\t\tcurl_setopt($curl, CURLOPT_TIMEOUT, 10);\t\t\t\t\t\t//Maximum wait before timeout\n\t\t\tself::authenticate($curl);\t\t\t\t\t\t\t\t\t//Authenticate our socket\n return $curl;\n\t\t}", "public function __construct(\n $url = null,\n $options = [\n CURLOPT_USERAGENT => \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\",\n CURLOPT_RETURNTRANSFER => true\n ]\n )\n {\n $this->ch = curl_init();\n if(!is_null($url))\n $this->setOption(CURLOPT_URL, $url);\n if(!is_null($options)) {\n foreach ($options as $key => $value) {\n $this->setOption($key, $value);\n }\n }\n }", "public function curl_connect($curlUrl = null, $curl_options = null){\n\t\tif (!$this->curl_connection){\n\t\t\t$header = array();\n\t\t\t$header[0] = \"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\";\n\t\t\t$header[] = \"Cache-Control: max-age=0\";\n\t\t\t$header[] = \"Connection: keep-alive\";\n\t\t\t$header[] = \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\";\n\t\t\t$header[] = \"Accept-Language: en-us,en;q=0.5\";\n\t\t\t$header[] = \"User-Agent: Patron conversion tool\";\n\n\t\t\t$cookie = $this->getCookieJar();\n\n\t\t\t$this->curl_connection = curl_init($curlUrl);\n\t\t\t$default_curl_options = array(\n\t\t\t\t\tCURLOPT_CONNECTTIMEOUT => 20,\n\t\t\t\t\tCURLOPT_TIMEOUT => 60,\n\t\t\t\t\tCURLOPT_HTTPHEADER => $header,\n\t\t\t\t//CURLOPT_USERAGENT => 'User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0',\n\t\t\t\t//CURLOPT_USERAGENT => \"User-Agent:Pika \" . $gitBranch,\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\t\t\tCURLOPT_SSL_VERIFYPEER => false,\n\t\t\t\t\tCURLOPT_FOLLOWLOCATION => true,\n\t\t\t\t\tCURLOPT_UNRESTRICTED_AUTH => true,\n\t\t\t\t\tCURLOPT_COOKIEJAR => $cookie,\n\t\t\t\t\tCURLOPT_COOKIESESSION => false,\n\t\t\t\t\tCURLOPT_FORBID_REUSE => false,\n\t\t\t\t\tCURLOPT_HEADER => false,\n\t\t\t\t\tCURLOPT_AUTOREFERER => true,\n\t\t\t\t// CURLOPT_HEADER => true, // debugging only\n\t\t\t\t// CURLOPT_VERBOSE => true, // debugging only\n\t\t\t);\n\n\t\t\tif ($curl_options) {\n\t\t\t\t$default_curl_options = array_merge($default_curl_options, $curl_options);\n\t\t\t}\n\t\t\tcurl_setopt_array($this->curl_connection, $default_curl_options);\n\t\t}else{\n\t\t\t//Reset to HTTP GET and set the active URL\n\t\t\tcurl_setopt($this->curl_connection, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($this->curl_connection, CURLOPT_URL, $curlUrl);\n\t\t}\n\n\t\treturn $this->curl_connection;\n\t}", "public function useCurl($useCurl)\n {\n $this->request->useCurl($useCurl);\n }", "protected function applyOptions()\n {\n return curl_setopt_array($this->res, $this->options);\n }", "private function _opt($opt, $value) {\n curl_setopt($this->_handle, $opt, $value);\n }", "private function setCurl($is_https = false)\n {\n // Init\n $this->curl = curl_init();\n // Sets basic parameters\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, isset($this->request->settings['timeout']) ? $this->request->settings['timeout'] : 100);\n // Set parameters to maintain cookies across sessions\n curl_setopt($this->curl, CURLOPT_COOKIESESSION, true);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_USERAGENT, 'OLEGNAX-PURCHASE-VERIFY');\n if ($is_https) {\n $this->setSSL();\n }\n }", "protected function setCurlOptions($option, $value)\n {\n curl_setopt($this->request, $option, $value);\n }", "private function initGetRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl().'?'.$this->getQuery())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_GET)\n ;\n }", "private function initCurl() {\r\n\t\tif (isset($this->curl)) { return $this->curl; }\r\n\r\n\t\t$this->curl = curl_init();\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($this->curl, CURLOPT_TIMEOUT, $this->request_timeout);\r\n\r\n\t\tif (isset($this->cookie_jar)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEJAR, $this->cookie_jar);\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_COOKIEFILE, $this->cookie_jar);\r\n\t\t}\r\n\r\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, $this->is_multiple);\r\n\r\n\t\t# If a User Agent has been set, set the curl option\r\n\t\tif (isset($this->user_agent)) {\r\n\t\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\r\n\t\t}\r\n\r\n\t\t# We are not too concerned about the strictness of SSL when finding redirects\r\n\t\t# Without these, some SSL links just fail to return anything\r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0); \r\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0); \r\n\r\n\t\t# We want the headers returned to us to follow redirects\r\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, true); \r\n\t\t$this->code = curl_getinfo($this->curl, CURLINFO_HTTP_CODE);\r\n\t\treturn $this->curl;\r\n\t}", "public static function setExtraCurlOption($key, $value) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setExtraCurlOption($key, $value);\t\t\n\t}", "public function setCurlOption($option, $value){\n\t\tcurl_setopt($this->_curl, $option,$value);\n\t}", "private function buildOptions(array $request) {\n $url = $request['url'];\n $post_data = $request['post_data'];\n $individual_opts = $request['options'];\n $individual_headers = $request['headers'];\n\n $options = ($individual_opts) ? $individual_opts + $this->_options : $this->_options; //merge shared and individual request options\n $headers = ($individual_headers) ? $individual_headers + $this->_headers : $this->_headers; //merge shared and individual request headers\n\n //the below will overide the corresponding default or individual options\n $options[CURLOPT_RETURNTRANSFER] = true;\n\n $options[CURLOPT_NOSIGNAL] = 1;\n\n if(version_compare($this->_curl_version, '7.16.2') >= 0) {\n $options[CURLOPT_CONNECTTIMEOUT_MS] = $this->_timeout;\n $options[CURLOPT_TIMEOUT_MS] = $this->_timeout;\n unset($options[CURLOPT_CONNECTTIMEOUT]);\n unset($options[CURLOPT_TIMEOUT]);\n } else {\n $options[CURLOPT_CONNECTTIMEOUT] = round($this->_timeout / 1000);\n $options[CURLOPT_TIMEOUT] = round($this->_timeout / 1000);\n unset($options[CURLOPT_CONNECTTIMEOUT_MS]);\n unset($options[CURLOPT_TIMEOUT_MS]);\n }\n\n if($url) {\n $options[CURLOPT_URL] = $url;\n }\n\n if($headers) {\n $options[CURLOPT_HTTPHEADER] = $headers;\n }\n\n // enable POST method and set POST parameters\n if($post_data !== null) {\n $options[CURLOPT_POST] = 1;\n $options[CURLOPT_POSTFIELDS] = is_array($post_data)? http_build_query($post_data) : $post_data;\n }\n return $options;\n }", "static public function setOptions($opts = array()) {\n if (isset($opts['gzip'])) {\n self::$optGzip = $opts['gzip'] ? true : false;\n }\n if (isset($opts['minimal'])) {\n self::$optMinimal = $opts['minimal'] ? true : false;\n }\n // global option for http proxy \n if (isset($opts['pmp_http_proxy'])) {\n self::$optHttpProxy = $opts['pmp_http_proxy'] ? $opts['pmp_http_proxy'] : '';\n } \n }", "private function setPostCurlOpts($endpoint, $data) {\n // Sets the default headers for the request\n $headersData = $this->setHeaders();\n // Convert data to a JSON string\n $dataString = json_encode($data);\n // Define the endpoint\n $url = \"$this->base_url/$endpoint\";\n // Assign the variables to the request opts\n $opts = array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $url,\n CURLOPT_HTTPHEADER => $headersData,\n CURLOPT_POSTFIELDS => $dataString\n );\n return $opts;\n }", "public function setupCurl()\n {\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,\"https://jsonplaceholder.typicode.com/posts\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n return $ch;\n }", "private function setRequestOptions()\n {\n $this->client = new Client(['base_uri' => $this->baseUrl]);\n }", "protected function _configureProxy() {\n if ($this->_use_proxy) {\n $this->setOpt(CURLOPT_HTTPPROXYTUNNEL, TRUE);\n if ($this->_proxy_port) {\n $this->setOpt(CURLOPT_PROXYPORT, $this->_proxy_port);\n }\n if ($this->_proxy_address) {\n $this->setOpt(CURLOPT_PROXY, $this->_proxy_address);\n }\n if ($this->_proxy_userpassword) {\n $this->setOpt(CURLOPT_PROXYUSERPWD, $this->_proxy_userpassword);\n }\n }\n return $this;\n }", "private function registerCurl()\n {\n // Curl options\n $curlOptions = [\n [CURLOPT_RETURNTRANSFER, true],\n [CURLOPT_FOLLOWLOCATION, true],\n [CURLOPT_MAXREDIRS, 2],\n [CURLOPT_HTTPAUTH, CURLAUTH_BASIC],\n [CURLOPT_SSLVERSION, 6],\n [CURLOPT_SSL_VERIFYPEER, false],\n [CURLOPT_SSL_VERIFYHOST, false],\n ];\n\n // Register service via dependency injection\n $service = $this->services->register('crawler', '%crawler.class%');\n\n // Set options via setopt\n array_walk(\n $curlOptions,\n function (array $params) use ($service) {\n $service->addMethodCall('setopt', $params);\n }\n );\n\n $this->services->setParameter('crawler.class', 'Curl\\Curl');\n }", "public function initialize()\n {\n curl_setopt($this->ch, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->ch, CURLOPT_MAXREDIRS, 5);\n curl_setopt($this->ch, CURLOPT_USERAGENT, self::$USER_AGENT); \n // curl_setopt($this->ch, CURLOPT_COOKIEFILE, '/tmp/curl_client');\n // curl_setopt($this->ch, CURLOPT_COOKIEJAR, '/tmp/curl_client');\n // curl_setopt($this->ch, CURLOPT_HEADER, TRUE);\n return $this;\n }", "public function __construct() {\n parent::__construct();\n\n $curlversion = curl_version();\n if (isset($curlversion['version']) && stripos($curlversion['version'], '7.35.') === 0) {\n // There is a flaw with curl 7.35.0 that causes problems with client reuse.\n $this->cacheclient = false;\n }\n }", "protected function _preConfig()\n {\n parent::_preConfig();\n if (extension_loaded('curl')) {\n $this->_Solar_Http_Request['adapter'] = 'Solar_Http_Request_Adapter_Curl';\n }\n }", "private function getUrlDefaultOptions() : array\n {\n // Logger.\n $this->logger->debugInit();\n \n // Set cURL options.\n $defaultOptions = array(\n CURLOPT_BINARYTRANSFER => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_FOLLOWLOCATION => true\n );\n \n // Logger.\n $this->logger->debugEnd();\n \n return $defaultOptions;\n \n }", "private function buildCurlOpts($method, &$headers, $endpoint, $params, $output)\n\t{\n\t\t// The username/password\n\t\t$config_userpass = $params->get('username') . ':' . $params->get('password');\n\t\t$curlOpts = array();\n\t\tif ($method === 'POST')\n\t\t{\n\t\t\t$curlOpts[CURLOPT_POST] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$curlOpts[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n\t\t}\n\n\t\t$curlOpts[CURLOPT_URL] = $endpoint;\n\t\t$curlOpts[CURLOPT_SSL_VERIFYPEER] = 0;\n\t\t$curlOpts[CURLOPT_POSTFIELDS] = $output;\n\t\t$curlOpts[CURLOPT_HTTPHEADER] = $headers;\n\t\t$curlOpts[CURLOPT_RETURNTRANSFER] = 1;\n\t\t$curlOpts[CURLOPT_HTTPAUTH] = CURLAUTH_ANY;\n\t\t$curlOpts[CURLOPT_USERPWD] = $config_userpass;\n\t\t$curlOpts[CURLOPT_VERBOSE] = true;\n\t\treturn $curlOpts;\n\t}", "private function initCurlHandle()\n {\n $this->closeCurlHandle();\n $this->curlHandle = \\curl_init();\n }", "private function setCertificates(CurlHandle $curlHandle, HttpClientRequestInterface $request): void\n {\n if ($request->getCACertificate() !== null) {\n curl_setopt($curlHandle, CURLOPT_CAINFO, $request->getCACertificate()->__toString());\n }\n\n if ($request->getClientCertificate() !== null) {\n curl_setopt($curlHandle, CURLOPT_SSLCERT, $request->getClientCertificate()->__toString());\n }\n\n if ($request->getClientCertificatePassword() !== null) {\n curl_setopt($curlHandle, CURLOPT_SSLCERTPASSWD, $request->getClientCertificatePassword());\n }\n\n if ($request->getClientCertificateType() !== null) {\n curl_setopt($curlHandle, CURLOPT_SSLCERTTYPE, $request->getClientCertificateType());\n }\n\n if ($request->getClientKey() !== null) {\n curl_setopt($curlHandle, CURLOPT_SSLKEY, $request->getClientKey()->__toString());\n }\n }", "public function testSetOption()\n {\n $oCurl = oxNew('oxCurl');\n $oCurl->setOption('CURLOPT_VERBOSE', 0);\n $aOptions = $oCurl->getOptions();\n $this->assertEquals(2, count($aOptions));\n $this->assertEquals(0, $aOptions['CURLOPT_VERBOSE']);\n }", "protected function setRequestDefaults($ch, array &$variables) {\n // Set the credentials.\n if (!empty($this->credentials)) {\n curl_setopt($ch, CURLOPT_USERPWD, $this->credentials);\n }\n\n // Set timeout.\n if (!(isset($variables['timeout']) && is_numeric($variables['timeout']) && intval($variables['timeout']) >= 0)) {\n $variables['timeout'] = 30;\n }\n curl_setopt($ch, CURLOPT_TIMEOUT, $variables['timeout']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n // Headers.\n if (isset($variables['headers']) && is_array($variables['headers'])) {\n\n $headers = array();\n foreach ($variables['headers'] as $key => $value) {\n $headers[] = trim($key) . \": \" . trim($value);\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n }", "public function init()\n {\n $this->curl = (new Curl())->setOption(\n CURLOPT_HTTPHEADER, [\n 'Authorization: Basic ' . $this->apiKey,\n 'Content-Type: application/json'\n ]\n );\n }", "public function setOptions($opts) {\n /* Vars that can be set via this function */\n $allowed = array(\n \"quit_on_error\",\n \"error_handler\",\n \"redirect_on_failure\",\n \"redirect_on_failure_url\",\n \"fail_text\",\n \"redirect_on_logout\",\n \"redirect_on_logout_url\",\n \"logout_text\",\n \"wait_time\",\n \"redirect_on_ip_fail\",\n \"redirect_on_ip_fail_url\",\n \"ip_fail_text\"\n );\n\n foreach ($opts as $k => $o) {\n if (in_array($k, $allowed))\n $this->$k = $o;\n }\n }", "private function init()\n {\n $this->curl = curl_init();\n }", "public function get_curl_object() {\n if (!is_null($this->curl)) {\n return $this->curl;\n }\n\n // Connection to Solr is allowed to use 'localhost' and other potentially blocked hosts/ports.\n $this->curl = new \\curl(['ignoresecurity' => true]);\n\n $options = array();\n // Build the SSL options. Based on pecl-solr and general testing.\n if (!empty($this->config->secure)) {\n if (!empty($this->config->ssl_cert)) {\n $options['CURLOPT_SSLCERT'] = $this->config->ssl_cert;\n $options['CURLOPT_SSLCERTTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_key)) {\n $options['CURLOPT_SSLKEY'] = $this->config->ssl_key;\n $options['CURLOPT_SSLKEYTYPE'] = 'PEM';\n }\n\n if (!empty($this->config->ssl_keypassword)) {\n $options['CURLOPT_KEYPASSWD'] = $this->config->ssl_keypassword;\n }\n\n if (!empty($this->config->ssl_cainfo)) {\n $options['CURLOPT_CAINFO'] = $this->config->ssl_cainfo;\n }\n\n if (!empty($this->config->ssl_capath)) {\n $options['CURLOPT_CAPATH'] = $this->config->ssl_capath;\n }\n }\n\n // Set timeout as for Solr client.\n $options['CURLOPT_TIMEOUT'] = !empty($this->config->server_timeout) ? $this->config->server_timeout : '30';\n\n $this->curl->setopt($options);\n\n if (!empty($this->config->server_username) && !empty($this->config->server_password)) {\n $authorization = $this->config->server_username . ':' . $this->config->server_password;\n $this->curl->setHeader('Authorization: Basic ' . base64_encode($authorization));\n }\n\n return $this->curl;\n }", "public function setOpt($opt_key, $opt_value) {\n curl_setopt($this->_getCommHandler(), $opt_key, $opt_value);\n return $this;\n }", "public function init()\n {\n $this->curl = curl_init();\n }", "public function setOptions(array $options) {\n $this->curl->setOpts($options);\n\n return $this;\n }", "public function __construct() {\n $this->_handle = curl_init();\n $this->_opt(CURLOPT_HEADER, false);\n $this->_opt(CURLOPT_RETURNTRANSFER, true);\n }", "public function unsetCurlOption(int $option): void\n {\n // Headers must be handled serperatly\n if (CURLOPT_HTTPHEADER === $option) {\n $this->httpHeaders = [];\n $this->httpHeadersNames = [];\n\n return;\n }\n\n if (array_key_exists($option, $this->curlOptions)) {\n unset($this->curlOptions[$option]);\n }\n }", "private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }", "public function setCurlOption(int $option, $value): void\n {\n // Headers must be handled serperatly\n if (CURLOPT_HTTPHEADER === $option) {\n // $value must be an array. setHttpHeaders() will enforce this.\n $this->setHttpHeaders($value);\n\n return;\n }\n\n $this->curlOptions[$option] = $value;\n }", "public function setOption($key,$value) {\n if($key == CURLOPT_HTTPHEADER)\n return setHeader($value);\n else\n return curl_setopt($this->ch,$key,$value);\n }", "public function __construct($curlHandle, Options $options = null)\n {\n $this->setCurlHandle($curlHandle);\n\n if (null === $options) {\n $options = new Options();\n }\n\n $this->setOptions($options);\n $this->init();\n }", "public function setopt($key, $value){\n curl_setopt($this->ch, $key, $value);\n }", "private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }", "public function getUseCurl()\n\t{\n\t\treturn false;\n\t}", "public function setOpt($key, $value)\n {\n curl_setopt($this->curl, $key, $value);\n }", "public function setOptArray(array $options)\n {\n curl_setopt_array($this->curl, $options);\n }", "public function setupCurlOptArray(array $ary){\n if($this->isCurlSet()){\n curl_setopt_array($this->curl, $ary);\n } else {\n throw new SdkException(\"cURL instance is not set when calling setup curl Option from array.\");\n }\n }", "private function resetCurlHandle()\n {\n if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) {\n \\curl_reset($this->curlHandle);\n } else {\n $this->initCurlHandle();\n }\n }", "function curl_open($url = null, $request = []) {\n if ($request) {\n $url .= '?' . http_build_query($request);\n }\n\n $curl = curl_init($url);\n\n if (!$curl) {\n error('Failed to open cURL resource for ' . spy($url) . '.');\n }\n\n return curl_options($curl, [CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => 60]);\n}", "private function initCurl() {\n\t\tif( $this->valid() ) {\n\t\t\t$this->ch = curl_init();\n\t\t\tcurl_setopt( $this->ch, CURLOPT_URL, \t\t\t\t$this->config['postUrl'] );\n\t\t\tcurl_setopt( $this->ch, CURLOPT_RETURNTRANSFER, \tTRUE);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_FOLLOWLOCATION, \tTRUE);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_TIMEOUT, \t\t\t10);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_HEADER, \t\t\tFALSE ); \n\t\t\tcurl_setopt( $this->ch, CURLOPT_POST, \t\t\t\tcount( $this->getFieldsAsString() ) );\n\t\t\tcurl_setopt( $this->ch, CURLOPT_POSTFIELDS, \t\t$this->getFieldsAsString() ); \n\t\t\tcurl_setopt( $this->ch, CURLOPT_REFERER, \t\t\t$this->config['referrerUrl'] );\n\t\t\tcurl_setopt( $this->ch, CURLOPT_USERAGENT, \t\t\t$this->config['userAgent']);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_AUTOREFERER, \t\tTRUE);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_VERBOSE, \t\t\tFALSE);\n\t\t\tcurl_setopt( $this->ch, CURLOPT_COOKIEJAR, \t\t\t$this->config['cookieFile']);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "function init_curl()\n\t{\n\t\t$this->ch = curl_init();\n\t\t$user_agent = $this->user_agent;\n\t\t$header[] = \"Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/jpeg, application/x-ms-xbap, application/x-shockwave-flash, */*\";\n\t\t$header[] = \"Accept-Language: en-US\";\n\t\t$header[] = \"User-Agent: \" . $user_agent;\n\t\t$header[] = \"Connection: Keep-Alive\";\n\t\t$header[] = \"Pragma:\";\n\t\t$header[] = \"Expect:\";\n\t\t$header[] = \"Content-Type:\";\n\n\t\t$this->header = $header;\n\n\t\t$header2[] = \"Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/jpeg, application/x-ms-xbap, application/x-shockwave-flash, */*\";\n\t\t$header2[] = \"Accept-Language: en-US\";\n\t\t$header2[] = \"User-Agent: \" . $user_agent;\n\t\t$header2[] = \"Connection: Keep-Alive\";\n\t\t$header2[] = \"Content-Type: application/x-www-form-urlencoded\";\n\t\t$header2[] = \"Pragma:\";\n\t\t$header2[] = \"Expect:\";\n\n\t\t$this->header_post = $header2;\n\n\t\t$header3[] = \"Accept: application/json, text/javascript, */*\";\n\t\t$header3[] = \"Accept-Language: en-US\";\n\t\t$header3[] = \"User-Agent: \" . $user_agent;\n\t\t$header3[] = \"Content-Type: application/x-www-form-urlencoded\";\n\t\t$header3[] = \"x-requested-with: XMLHttpRequest\";\n\t\t$header3[] = \"Connection: Keep-Alive\";\n\t\t$header3[] = \"Pragma:\";\n\t\t$header3[] = \"Expect:\";\n\n\t\t$this->header_json = $header3;\n\n\t\t$header4[] = \"Accept: application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/jpeg, application/x-ms-xbap, application/x-shockwave-flash, */*\";\n\t\t$header4[] = \"Accept-Language: en-US\";\n\t\t$header4[] = \"User-Agent: \" . $user_agent;\n\t\t$header4[] = \"Connection: Keep-Alive\";\n\t\t$header4[] = \"Content-Type: multipart/form-data\";\n\t\t$header4[] = \"Pragma:\";\n\t\t$header4[] = \"Expect:\";\n\n\t\t$this->header_multipart = $header4;\n\n\t\tcurl_setopt($this->ch, CURLOPT_USERAGENT, $user_agent);\n\t\tcurl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->opt[\"cookie_dir\"].\"/\".$this->id);\n\t\tcurl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->opt[\"cookie_dir\"].\"/\".$this->id);\n\t\t//curl_setopt($this->ch, CURLOPT_ENCODING, 'gzip, deflate');\n\t\tcurl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($this->ch, CURLOPT_VERBOSE, $this->opt[\"verbose\"]);\n\t\tcurl_setopt($this->ch, CURLOPT_TIMEOUT, $this->opt[\"timeout\"]);\n\t\tcurl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\t\tif ($this->opt[\"use_proxy\"] && isset($proxy))\n\t\tcurl_setopt($this->ch, CURLOPT_PROXY, $proxy);\n\t\t//print \"Set Curl Proxy $proxy\\n\";\n\t\t//curl_setopt($this->ch, CURLOPT_PROXYUSERPWD, \"ocbeta:echo11ra\");\n\n\t\t//if ($this->opt[\"use_ips\"])\n\t\t//curl_setopt($this->ch, CURLOPT_INTERFACE, $this->get_ip());\n\t}", "public function initCurlHandler()\r\n {\r\n $this->curlHandler = curl_init();\r\n }", "function funInitCurl(){\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 20);\n\n return $ch;\n}", "function curl_method(&$curl, $method = 'GET') {\n return curl_option($curl, CURLOPT_CUSTOMREQUEST, $method);\n}", "function curl_request(&$curl, $request, $post = true) {\n if ($post) {\n return curl_option($curl, CURLOPT_POSTFIELDS, $request);\n }\n\n $url = url_strip(curl_url($curl));\n $request = http_build_query(array_merge(url_request($url), $request));\n\n return curl_url($curl, \"$url?$request\");\n}", "private function _setDefaults(): void {\n\t\t// default query options\n\t\t$options['limit'] = 50;\n\t\t$options['offset'] = false;\n\t\t$options['sort'] = false;\n\t\t$options['sortDirection'] = false;\n\t\t$this->setQueryOptions($options);\n\t}", "function curl_url($curl, $url = null) {\n if (func_num_args() >= 2) {\n curl_option($curl, CURLOPT_URL, $url);\n }\n\n return curl_info($curl, CURLINFO_EFFECTIVE_URL);\n}", "public function __construct($url, $username, $password, $options = null, array $addlCurlOptions = array ()) {\n\t\tparent :: __construct($url, $username, $password, $options, $addlCurlOptions);\n\t\t$this->_link_cache = array ();\n\t\t$this->_title_cache = array ();\n\t\t$this->_objTypeId_cache = array ();\n\t\t$this->_type_cache = array ();\n\t\t$this->_changeToken_cache = array ();\n\t}", "public function options($opts)\n {\n parent::options($opts);\n }", "protected static function set_defaults(&$url, &$headers, &$data, &$type, &$options)\n {\n }", "protected function getAllowedOptions()\n {\n return array_merge(parent::getAllowedOptions(), array(\n 'curlPath' => '/.+/',\n ));\n }", "public function getOptions() {\n $opts = $this->query['opts'];\n unset($opts[CURLOPT_FILE]);\n if (isset($opts[CURLOPT_WRITEHEADER])) {\n unset($opts[CURLOPT_WRITEHEADER]);\n }\n return $opts;\n }", "public function __construct()\n {\n $this->curl = curl_init();\n\n curl_setopt_array(\n $this->curl,\n array(\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 60,\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_VERBOSE => true,\n CURLOPT_HEADERFUNCTION => array($this, 'header'),\n CURLOPT_ENCODING => 'gzip,deflate',\n CURLOPT_USERAGENT => 'doi-index/0.1 (+http://goo.gl/AejefJ)',\n CURLOPT_COOKIEFILE => '/tmp/cookies.txt',\n CURLOPT_COOKIEJAR => '/tmp/cookies.txt',\n )\n );\n }", "protected function setHttpClientConfiguration(): void\n {\n $this->setCurlConstants();\n\n $this->httpClientConfig = [\n CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2,\n CURLOPT_SSL_VERIFYPEER => $this->validateSSL,\n ];\n\n // Initialize Http Client\n $this->setClient();\n }", "protected function setCurlOptions($parameters)\n {\n //create request\n $handle = curl_init($this->url);\n\n //set the payload\n curl_setopt($handle, CURLOPT_POST, true);\n curl_setopt($handle, CURLOPT_POSTFIELDS, $parameters);\n\n //return body only\n curl_setopt($handle, CURLOPT_HEADER, 0);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);\n\n //create errors on timeout and on response code >= 300\n curl_setopt($handle, CURLOPT_TIMEOUT, 45);\n curl_setopt($handle, CURLOPT_FAILONERROR, true);\n curl_setopt($handle, CURLOPT_FOLLOWLOCATION, false);\n\n //set up host and cert verification\n curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 2);\n\n /**\n * NOTE on php.net\n * http://php.net/manual/en/function.curl-setopt.php\n * Your best bet is to not set this and let it use the default.\n * Setting it to 2 or 3 is very dangerous given the known vulnerabilities in SSLv2 and SSLv3.\n */\n // curl_setopt($handle, CURLOPT_SSLVERSION, 3);\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\n if($this->sslCACertPath) {\n curl_setopt($handle, CURLOPT_CAINFO, $this->sslCACertPath);\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, true);\n }\n\n return $handle;\n }" ]
[ "0.8059837", "0.7268135", "0.70406604", "0.6825349", "0.67725044", "0.6638282", "0.66277146", "0.66016704", "0.6539561", "0.64865464", "0.6422378", "0.6394634", "0.63555735", "0.6339529", "0.6330404", "0.6277467", "0.6232209", "0.6175173", "0.6166607", "0.61644864", "0.61154926", "0.6070692", "0.6068203", "0.60273033", "0.60271746", "0.6012287", "0.59954506", "0.5965685", "0.5959514", "0.5955692", "0.58999026", "0.5899785", "0.5876536", "0.5849805", "0.58454525", "0.57585955", "0.57354426", "0.57290405", "0.57024026", "0.5701761", "0.5680423", "0.5636956", "0.5635423", "0.5633513", "0.5613154", "0.56121135", "0.56102186", "0.5594987", "0.5555383", "0.5530381", "0.55139816", "0.5496688", "0.5492317", "0.54760015", "0.5464664", "0.5453432", "0.54526705", "0.5438599", "0.5382293", "0.5349981", "0.534907", "0.53297794", "0.5319709", "0.53134614", "0.5308908", "0.5298562", "0.5298415", "0.52890384", "0.5276873", "0.5227706", "0.52259445", "0.5194821", "0.5190728", "0.51649046", "0.5161731", "0.515751", "0.5151958", "0.5149228", "0.5144842", "0.5133418", "0.5127505", "0.5125949", "0.5121037", "0.51034576", "0.50959444", "0.5085212", "0.50820434", "0.5079852", "0.5077276", "0.507432", "0.50735474", "0.50556314", "0.5055328", "0.50411844", "0.503892", "0.50188535", "0.50074357", "0.50061226", "0.5003302", "0.5003283", "0.4998174" ]
0.0
-1
get all from smlouva where id_user
function prepareResponseForProfi($data){ $sql_smlouva = 'SELECT * FROM public."smlouva" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_smlouva = $db->query($sql_smlouva); $data_smlouva = $stmt_smlouva->fetchAll(PDO::FETCH_OBJ); $data->smlouva = $data_smlouva; $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } // get all from faktura where id_user $sql_faktura = 'SELECT castka::numeric::float8 as castka_float, * FROM public."faktura" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_faktura = $db->query($sql_faktura); $data_faktura = $stmt_faktura->fetchAll(PDO::FETCH_OBJ); $data->faktura = $data_faktura; $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } // get count limit from profissionalUser $sql_professionalUser = 'SELECT count_limit FROM public."professionalUser" WHERE id_user = '.$data->id_user; try{ $db = new db(); $db = $db->connect(); $stmt_professionalUser = $db->query($sql_professionalUser); $data_professionalUser = $stmt_professionalUser->fetch(PDO::FETCH_OBJ); $data = (object)array_merge((array)$data, (array)$data_professionalUser); $db = null; } catch(PDOException $e){ throw new Exception('Exception; function: prepareResponseForProfi; PDOException: '.$e.getMessage()); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectMoestuinenByUser($user_id){\n $sql =\"SELECT *,mst_moestuinen.id as moestuinen_id FROM mst_moestuinen LEFT JOIN mst_moestuinen_users on mst_moestuinen.id = mst_moestuinen_users.moestuin_id WHERE mst_moestuinen_users.user_id = :eigenaar2 OR mst_moestuinen.eigenaar = :eigenaar GROUP BY mst_moestuinen.id\";\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindValue(':eigenaar', $user_id);\n $stmt->bindValue(':eigenaar2', $user_id);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function listAllbyUser($id){\n try{\n $sql = 'select * from user u inner join person p on u.id_person = p.id_person where id_user = ?';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "function get_all_user($koneksi){\n\t\t$query = \"SELECT * FROM v_user\";\n\n\t\t$statement = $koneksi->prepare($query);\n\t\t$statement->execute();\n\t\t$result = $statement->fetchAll();\n\n\t\treturn $result;\n\t}", "public function getAllUserById($id);", "public function getAllUsers($id)\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('u.*')\n ->from('users', 'u')\n ->where('gamerID = ?')\n ->setParameter(0, $id);\n $statement = $queryBuilder->execute();\n $usersData = $statement->fetchAll(); \n foreach ($usersData as $userData) {\n $userEntityList[$userData['id']] = new user($userData['id'], $userData['nom'], $userData['prenom'],$userData['gamerID']);\n }\n return $userEntityList;\n }", "public function findByUser($id) {\n\t $this->db->select('*')\n\t ->from($this->getSource())\n\t ->where(\"userId = ?\");\n\t \n\t $this->db->execute([$id]);\n\t return $this->db->fetchAll();\n\t}", "public function getAll($id_user)\r\n\t{\r\n\r\n\t\t$sql = new Sql($this->dbAdapter);\r\n\t\t$select = $sql->select();\r\n\t\t$select->from('users');\r\n\t\t$select->columns(array('id', 'email'));\r\n\t\r\n\t\t$select->join(array('u_d' => 'users_details'),'users.id = u_d.id_user', array('id_user','name','surname', 'campus', 'phone', 'addres','image','pin','key_inventory'), 'Left');\r\n\r\n\t\t$select->join(array('a_u'=>'addresses_users'),'users.id = a_u.id_users', array('postalcode'), 'Left');\r\n\r\n\t\t$select->where(array('users.id' =>$id_user ));\r\n\r\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result=$execute->toArray(); \r\n\r\n\t\t//echo \"<pre>\";print_r($result);exit;\r\n\t\treturn $result;\r\n\r\n\t}", "public function listValue($iduser)\r\n\t{\r\n\t\t$sql = \"SELECT useratribute . * , `key`.name\r\n\t\t\t\tFROM `useratribute`\r\n\t\t\t\tJOIN `key` ON useratribute.`keyu` = `key`.idkey\r\n\t\t\t\tWHERE useratribute.idusers = $iduser\r\n\t\t\t\t\";\r\n\t\treturn $this->getDI()->get('db')->fetchAll($sql, Phalcon\\Db::FETCH_OBJ);\r\n\t}", "public function findUsers($uo_id)\n {\n $em = $this->getEntityManager(); $users = array();\n try\n {\n $fetch = $em->getConnection()->fetchAll(\n 'SELECT users.id as id, users.username as username, users.date_last_login as date_last_login, '.\n 'users.time_last_login as time_last_login, users.is_active as is_active, users.correo as email, '.\n 'trabajador.nombre_apellidos as nombre_apellidos, trabajador.movil as movil, trabajador.id as trab_id, '.\n 'area.nombre as area, unidad_organizativa.nombre as unidad_organizativa '.\n 'FROM users '.\n 'JOIN trabajador ON (users.trabajador_id = trabajador.id) '.\n 'JOIN area ON (trabajador.area_id = area.id) '.\n 'JOIN unidad_organizativa ON (area.unidad_organizativa_id = unidad_organizativa.id AND unidad_organizativa.id = '. $uo_id .');');\n \n foreach ($fetch as $val)\n {\n $user = $this->find($val['id']);\n $trab = $em->getRepository('NomencladorBundle:Trabajador')->find($val['trab_id']);\n \n $users[] = array(\n 'id' => $val['id'],\n 'username' => $val['username'],\n 'nombre' => $val['nombre_apellidos'],\n 'movil' => ($val['movil']) ? $val['movil'] : 'No se conoce.',\n 'email' => ($val['email']) ? $val['email'] : 'No se conoce.',\n 'cargo' => ($trab->getCargo()) ? $trab->getCargo()->getNombre() : 'No se conoce.',\n 'area' => $trab->getArea()->getNombre(),\n 'last_login' => $val['date_last_login'] .' '. $val['time_last_login'],\n 'is_active' => $val['is_active'],\n 'roles' => $user->getStringRoles()\n );\n }\n return $users;\n }\n catch (\\Exception $e)\n {\n return $e->getMessage();\n } \n }", "function GetAllUser(){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM buku ORDER BY judul_buku\");\n\t\tif($hasil->num_rows()>0){\n\t\t\tforeach($hasil->result() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t*/\n\t\t$query=$this->db->get('user');\n\t\tforeach($query->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;\n\t}", "public function retrieve_all_users()\n {\n $table_pengajar = $this->db->dbprefix('pengajar');\n $table_siswa = $this->db->dbprefix('siswa');\n $table_login = $this->db->dbprefix('login');\n\n $sql = \"SELECT {$table_login}.username, {$table_pengajar}.nama FROM {$table_pengajar} INNER JOIN {$table_login} ON {$table_pengajar}.id = {$table_login}.pengajar_id\n UNION\n SELECT {$table_login}.username, {$table_siswa}.nama FROM {$table_siswa} INNER JOIN {$table_login} ON {$table_siswa}.id = {$table_login}.siswa_id\";\n\n $result = $this->db->query($sql);\n\n $data = array();\n foreach ($result->result_array() as $r) {\n # selain yang login\n if (is_login() && $r['username'] == get_sess_data('login', 'username')) {\n continue;\n }\n $data[] = addslashes($r['nama']) . ' [' . $r['username'] . ']';\n }\n\n return $data;\n }", "public function allForUser($userId);", "public function allForUser($userId);", "function get_user($id){\n\t\t $this->db->select('*');\n\t\t $this->db->from('pengguna');\n\t\t $this->db->where('id_user', $id);\n\n\t\t return $this->db->get();\n\t }", "public function list($id){\n try{\n $sql = 'select * from user where id_user = ? limit 1';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function buscarUsuario($idUser){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT * FROM user WHERE id_user = $idUser\");\n\t\t\t\n\t\t\t\t $dados = array();\n\t\t\t\t \tforeach($query->result() as $linha)\n\t\t\t\t \t{\n\t\t\t\t \t\t$dados['id_user'] = $linha->id_user;\n\t\t\t\t \t\t$dados['nome'] = $linha->nome;\n\t\t\t\t \t\t$dados['email'] = $linha->email;\n\t\t\t\t \t\t$dados['login'] = $linha->login;\n\t\t\t\t \t\t$dados['perfil'] = $linha->perfil;\n\t\t\t\t }\n\n\t\t\treturn($dados);\n\t\t\t\n\t\t}", "function get_data_by_idUser($table,$kode){\n\t\t/*$hasil=$this->db->query(\"SELECT * FROM user WHERE username='\".$kode.\"'\");\n\t\tif($hasil->num_rows()>0){\n\t\tforeach($hasil->result() as $row){\n\t\t\t$data[]=$row;\n\t\t}\n\t\treturn $data;*/\n\t\t\n\t\t$this->db->where('username',$kode);\n\t\treturn $this->db->get($table);\n\t}", "public function getUserById($id){\n $sql=\"SELECT * FROM users WHERE (id = ?)\";\n $select=parent::connect_db()->prepare($sql);\n $select->bindValue(1, $id);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }", "public function SeeOneUser($id) {\n\n try {\n /* * * * * * * * * * * * * * * * * * * * * * * *\n * Get All the informations about the user from the ID\n */\n $select = $this->connexion->prepare(\"SELECT user_id, user_date, user_birthday, user_mail, user_pseudo, user_profil_pic, user_type, user_site\n FROM \" . PREFIX . \"user\n WHERE user_type = 'student'\n AND user_id = :userID\");\n \n $select->bindValue(':userID', $id, PDO::PARAM_INT);\n $select->execute();\n $select->setFetchMode(PDO::FETCH_ASSOC);\n $user = $select->FetchAll();\n $select->closeCursor(); \n\n if(isset($user[0]['user_id'])){\n $retour = $user[0];\n } else {\n $retour = $user;\n }\n \n\n if(!empty($user)){\n\n $select2 = $this->connexion->prepare(\"SELECT *\n FROM \" . PREFIX . \"phone\n WHERE user_user_id = :userID\");\n \n $select2->bindValue(':userID', $id, PDO::PARAM_INT);\n $select2->execute();\n $select2->setFetchMode(PDO::FETCH_ASSOC);\n $phone = $select2->FetchAll();\n $select2->closeCursor(); \n\n if(!empty($phone[0])){\n $retour = array_merge($retour, $phone[0]);\n }\n \n $select3 = $this->connexion->prepare(\"SELECT *\n FROM \" . PREFIX . \"adress\n WHERE user_user_id = :userID\");\n \n $select3->bindValue(':userID', $id, PDO::PARAM_INT);\n $select3->execute();\n $select3->setFetchMode(PDO::FETCH_ASSOC);\n $adress = $select3->FetchAll();\n $select3->closeCursor(); \n\n if(!empty($adress[0])){\n $retour = array_merge($retour, $adress[0]);\n }\n\n }\n return $retour;\n \n \n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n }", "public function users_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n if(is_null($search))\n $result = $sutil->getUser($id,$from,$size);\n else \n {\n $result = $sutil->searchUsers($search,$from,$size);\n }\n $this->response($result);\n }", "public function users(){\n\t\t$user = $this->ion_auth->user()->row();\n\n\t\t$query = $this->db->select()\n\t\t\t\t\t\t\t\t\t\t\t ->from('users')\n\t\t\t\t\t\t\t\t\t\t\t ->where('admin_id',$user->id)\n\t\t\t\t\t\t\t\t\t\t\t ->order_by('id', 'asc')\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $query;\n\t}", "public function UserFilterData($value)\n {\n $em = $this->getEntityManager();\n if ($value == 'Display All') {\n $qb1 = $em->createQueryBuilder();\n $qb1->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $qb1->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb1->innerJoin('u.personalProfile', 'up');\n $qb1->innerJoin('u.workProfile', 'uw');\n $qb1->innerJoin('uw.team', 't');\n $result1 = $qb1->getQuery()->getResult();\n return $result1;\n } \n else {\n $qb = $em->createQueryBuilder();\n $qb->select('DISTINCT ur.id');\n $qb->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $qb->innerJoin('u.reportingPersons', 'ur');\n if ($value == 'Non Jyo')\n $qb->where(\"u.id !='14'\");\n elseif ($value == 'Jyo')\n $qb->where(\"u.id = '14'\");\n $result = $qb->getQuery()->getResult();\n\n for ($i = '0'; $i < sizeof($result); $i++) {\n $id = $result[$i]['id'];\n $q = $em->createQueryBuilder();\n $q->select('u.id,up.name,up.photo,up.employeeId,up.email,\n up.mobile,uw.extensionNumber,\n uw.workStation,uw.systemId,uw.systemIp,t.tname');\n $q->from('Vlreleases\\UserBundle\\Entity\\User', 'u');\n $q->leftJoin('u.personalProfile', 'up');\n $q->leftJoin('u.workProfile', 'uw');\n $q->leftJoin('uw.team', 't');\n $q->where(\"u.id='$id'\");\n $finalResult[$i] = $q->getQuery()->getResult();\n }\n \n return $finalResult;\n }\n }", "public function show($id_user)\n {\n //\n return DB::table('users')\n ->select('id_user as Identificación' ,'users.name as Nombre','users.email as Email', 'city as Ciudad', 'direction as Direciión','fotos as Fotos')\n ->where('id_user',$id_user)\n ->get();\n }", "public function intentos_fallidos_de_usuario($user_id)\n\t{\n\t\t\t$intentos_fallidos = DB::select('SELECT * FROM bitacoras \n\t\t\t\t\t\t\tWHERE affected_element_type=\"intento_login\" and affected_person_name=? and deleted_at is null \n\t\t\t\t\t\t\torder by created_at desc limit 50', \n\t\t\t\t\t\t\t[ $user_id ]);\n\n \n return $intentos_fallidos;\n\n\t}", "public function findActiSportsmans($id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT usuario FROM activities_user WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$sportsmans_ids = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$sportsmans = array();\r\n\r\n\t\tforeach($sportsmans_ids as $sportsman_id){\r\n\t\t\t$stmt = $this->db->prepare(\"SELECT username FROM users WHERE id=?\");\r\n\t\t\t$stmt->execute(array($sportsman_id[\"usuario\"]));\r\n\t\t\t$sportsman_db = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t\t\r\n\t\t\tarray_push($sportsmans, new User($sportsman_id[\"usuario\"], $sportsman_db[\"username\"]));\r\n\t\t}\r\n\r\n\t\treturn $sportsmans;\r\n\t}", "public function getList($user);", "public static function getUser($id) {\n $listado = DB::table('users')->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->where('users.id', '=', $id)\n ->select('users.*', 'roles.description')\n ->get();\n\n return $listado;\n }", "public function selectMedecin(){\n $bdd=Connexion::getInstance();\n $req=\" select * from utilisateur u ,specialite s,service ser \n WHERE u.idSpecialite=s.idSpecialite and s.idService=ser.idService\n AND idStatus=\".self::NIVEAU_1;\n $rep=$bdd->query($req);\n return $rep->fetchall();\n \n }", "function modeloUserGetAll (){\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $db = AccesoDatos::getModelo();\n $tusuarios = $db->getUsuarios();\n foreach ($tusuarios as $clave=>$user){\n \n $tabla[$user->id]= ['nombre'=>$user->nombre,\n 'correo'=>$user->correo,\n 'plan'=>PLANES[$user->plan],\n 'estado'=>ESTADOS[$user->estado],\n ];\n }\n return $tabla;\n}", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "public function findUsers($id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities_user WHERE actividad=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$user_ids = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$users = array();\r\n\r\n\t\tforeach($user_ids as $user_id){\r\n\r\n\t\t\t\tarray_push($users, new ActivityWUser($user_id[\"usuario\"],$user_id[\"actividad\"],$user_id[\"conf\"]));\r\n\t\t}\r\n\r\n\t\treturn $users;\r\n\t}", "public function findByUserId($userId){\n return self::find()->where(['user_id' => $userId])->all();\n }", "function all_users($id){\n try{\n $get_users = $this->db->prepare(\"SELECT id, username, user_image FROM `users` WHERE id != ?\");\n $get_users->execute([$id]);\n if($get_users->rowCount() > 0){\n return $get_users->fetchAll(PDO::FETCH_OBJ);\n }\n else{\n return false;\n }\n }\n catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function getUsers()\n {\n $request = \"SELECT user.*, rank.name as rank_name FROM `user` join rank on user.rank = rank.id order by rank.id\";\n $request = $this->connexion->query($request);\n $newsList = $request->fetchAll(PDO::FETCH_ASSOC);\n // var_dump($newsList);\n return $newsList;\n }", "public function apiListTahun($idUser)\n {\n return $dataKrit = DataKriteria::where('id_user', '=', $idUser)\n ->select('tahun')\n ->distinct()\n ->get();\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function use_obtener_otros_sucursales(){\n $cuenta = $this->ci->session->userdata('usuario'); \n $suc = $this->ci->session->userdata('sucursal');\n $sucursales = $this->ci->arixkernel->select_all_content_where('sucursal_id serial, numero, nombre','config.v_cuenta_sucursal', array('cuenta_id' => $cuenta, 'sucursal_id !=' => $suc, 'estado' => true));\n return $sucursales;\n }", "public function getAllUsers(){\n\n $this->db->select('*');\n $this->db->from(\"admin_empresa\");\n $this->db->where('status <>', 2);\n $this->db->order_by(\"id\", 'desc');\n\n return $this->db->get();\n }", "public function getAllUserListaParticipantesByProjeto($id)\n {\n \n $this->db->select('users.id as id_user, users.first_name as fname, users.last_name as lname, setores.nome as setor')\n ->join('users', 'users_listas_participantes.users = users.id', 'inner')\n ->join('setores', 'users.setor_id = setores.id', 'inner') \n ->order_by('users.first_name', 'asc');\n $q = $this->db->get_where('users_listas_participantes', array('projeto' => $id, 'participante_atas' => 1));\n \n \n if ($q->num_rows() > 0) {\n \n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n \n // return $q->row();\n \n \n }\n return FALSE;\n \n }", "function getPermisos($idUser){\n\t\t$sql=\"\n\t\tSELECT DISTINCT\n\t\tcontrol_objeto.clave as 'objeto',\n\t\tcontrol_permiso.tipo as 'tipo'\n\t\tFROM\n\t\tcontrol_perfil_usuario\n\t\tINNER JOIN control_perfil_permiso ON control_perfil_usuario.id_perfil=control_perfil_permiso.id_perfil\n\t\tINNER JOIN control_permiso ON control_perfil_permiso.id_permiso=control_permiso.id_permiso\n\t\tINNER JOIN control_objeto ON control_permiso.id_objeto=control_objeto.id_objeto\n\t\tWHERE control_perfil_usuario.id_usuario=$idUser\";\n\t\treturn $this->toArray($sql);\n\t}", "public function getResultsOfUser($user_id);", "public function getUserAllKameties($user_id){\n\t\t// Get a MySQL DB connection\n\t\t$this->conn = $this->dbConnect->connect();\n\n\t\t$stmt = mysqli_prepare($this->conn, \"SELECT k.id, k.kameti_name, k.admin_id, k.kameti_start_date, k.kameti_members, k.kameti_amount,\n k.kameti_interest_rate, k.bid_start_time, k.bid_end_time, k.bid_amount_minimum, k.bid_timer, k.lucky_draw_amount, k.lucky_members,\n k.runnerup_percentage, k.kameti_rule, k.kameti_status FROM kameti k, kameti_members km WHERE km.kameti_id = k.id AND km.member_id = ?\");\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_param($stmt, 'i', $user_id);\n\t\t$this->throwExceptionOnError();\n\n\n\t\tmysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\n\t\t$rows = array();\n\n\t\tmysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,\n $item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,\n $item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);\n\t\t$this->throwExceptionOnError();\n\n\t\twhile (mysqli_stmt_fetch($stmt)) {\n\t\t\t$rows[] = $item;\n\t\t\t$item = new stdClass();\n\n\n\t\t\tmysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,\n $item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,\n $item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);\n\n\t\t}\n\t\tmysqli_stmt_free_result($stmt);\n\t mysqli_close($this->conn);\n\n\t\tif(count($rows) > 0){\n\t\t\treturn $rows;\n\t\t}else{\n\t\t\treturn NULL;\n\t\t}\n\n\t}", "function get_usuario($user_id)\n {\n return $this->db->get_where('usuarios',array('user_id'=>$user_id))->row_array();\n }", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function getAllByUser(){\n //hacemos la consulta y lo guardamos en una variable\n $sql=\"SELECT * FROM pedidos\"\n .\" where usuario_id={$this->getUsuario_id()} order by id desc\";\n $pedido=$this->db->query($sql);\n //devolvemos un valor en especifico \n return $pedido;\n }", "public function get_usuario_por_id($id_usuario){\r\n $conectar=parent::conexion();// hacemos nuestra conexion\r\n parent::set_names(); // este es para no tener probllemas con las tilde \r\n $sql=\"select * from usuario where id =?\";\r\n $sql=$conectar->prepare($sql); //HACE UNA CONSULTA EN TODOS LOS CAMPOS\r\n $sql->bindValue(1,$id_usuario);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function user_by_id($id) {\n $this->db->where('id_user', $id);\n $consulta = $this->db->get('user');\n $resultado = $consulta->row_array();\n return $resultado;\n }", "function get_info_usuario($id_usuario){\n\n return $this->db->query(\"SELECT*\n FROM usuarios\n WHERE usuarios.usuario_id = $id_usuario\")->result_array();\n }", "public function get($user = ''){\r\n $this->query = ($user != '') ? \"SELECT * FROM users WHERE user = '$user'\" \r\n : \"SELECT * FROM users\";\r\n $this->get_query();\r\n //var_dump($this->rows);\r\n $num_rows = count($this->rows);\r\n $data = array();\r\n foreach ($this->rows as $key => $value) {\r\n array_push($data, $value);\r\n //$data[$key] = $value;\r\n }\r\n return $data;\r\n \r\n\r\n }", "public function get_usuario_por_id_ventas($id_usuario)\n {\n\n\n $conectar = parent::conexion();\n parent::set_names();\n\n\n $sql = \"select u.id_usuario,v.id_usuario\n \n from usuarios u \n \n INNER JOIN ventas v ON u.id_usuario=v.id_usuario\n\n\n where u.id_usuario=?\n\n \";\n\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $id_usuario);\n $sql->execute();\n\n return $resultado = $sql->fetchAll(PDO::FETCH_ASSOC);\n }", "public function ShowUsersPois($db){\n $stmt = $db->prepare(\"SELECT pois.*\n FROM pois\n WHERE user_id = :user_id\n ORDER BY last_edit DESC \");\n $stmt->bindParam(':user_id', $_SESSION[\"user_id\"]);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function getProgressUsulanByUserJurusan($id){\n\t\t$query = $this->db->query(\"SELECT pp.STATUS,pp.ID_USULAN,pp.REVISI_KE FROM usulan AS u, progress_paket AS pp WHERE u.ID_USER = '$id' AND u.ID_USULAN = pp.ID_USULAN\")->row_array();\n\t\treturn $query;\n\t}", "public function getUserById(int $id) :array{\n\t\treturn $this->db->select(\"SELECT * FROM users WHERE id = :id\", [\"id\" => \"$id\"]);\n\t}", "function all_users($logged_user_id)\n\t{\n\t\t//\tSELECT id, first_name, (Select meta_value FROM standard_user_info where user_id =users.id AND meta_key = 'bio' ) FROM users\n\t\t$select = array('id', 'user_file', 'first_name', 'last_name', 'sex','vchDigitalWalletStatus');\n\t\t\n\t $this->db->select($select)->from('users')->where('id!=', $logged_user_id);\n\t $this->db->where('id!=', 1);\n\t $this->db->order_by('id', 'desc');\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t}", "public static function getAllFromUserId($ov) \r\n {\n $conn = pdo_connect();\n\n $sql = $conn->prepare(\n 'SELECT \n id, \n QuizQuestion_id,\n User_id,\n answer,\n FROM QuizAnswerStudent \n WHERE User_id = :User_id'\r\n );\n\n $sql->bindValue(':User_id', $ov->User_id);\n\n $sql->execute();\n \n $result = $sql->fetchAll(PDO::FETCH_OBJ);\n\n return $result;\n }", "public function getListByUserId($userid){\n $qb = $this->createQueryBuilder('kuchigroup')\n ->join('kuchigroup.users', 'users')\n ->where('users.id = :userid')\n ->setParameter('userid', $userid);\n\n return $qb->getQuery()->getResult();\n }", "public function getMebrosEquipeByUsuario($id)\n {\n $this->db->select('membros_equipe.id as id, users_setores.id as id_usuario_setor, users.id as id_usuario, users.first_name as name, users.last_name as last, setores.nome as setor, papeis_responsabilidades.papel as papel, papeis_responsabilidades.descricao as descricao, equipes.nome as equipe, projetos.projeto as projeto')\n ->join('users_setores', 'membros_equipe.usuario = users_setores.id', 'inner') \n ->join('users', 'users_setores.usuario = users.id', 'inner') \n ->join('setores', 'users_setores.setor = setores.id', 'inner')\n ->join('equipes', 'membros_equipe.equipe = equipes.id', 'inner') \n ->join('projetos', 'equipes.projeto = projetos.id', 'inner') \n ->join('papeis_responsabilidades', 'membros_equipe.papel = papeis_responsabilidades.id', 'inner') \n ->order_by('users.first_name', 'asc');\n $q = $this->db->get_where('membros_equipe', array('users_setores.usuario' => $id));\n \n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return FALSE;\n \n }", "function get_by_user_id($user_id) {\n $this->db->where('user_id', $user_id);\n $this->db->from('user');\n $resc = $this->db->get();\n return $resc->row_array();\n }", "public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }", "public function getByUserId($id) {\r\n $sql = \"SELECT * FROM bestelling inner join bestelregel on bestelregel.bestellingid=bestelling.id where bestelling.userid=?\";\r\n $args = func_get_args();\r\n $stmt = parent::execPreppedStmt($sql, $args);\r\n $resultSet = $stmt->fetchall();\r\n $arr = array();\r\n foreach ($resultSet as $result) {\r\n $bestelling = Bestelling:: create($result['id'], $result['userid'], $result['tijdstip']);\r\n $bestelregel = Bestelregel:: create($result['bestelregelid'], $result['bestelregelprijs'], $bestelling);\r\n $arr[] = $bestelregel;\r\n }\r\n return $arr;\r\n }", "public static function get_public_users()\n {\n $connection = Yii::$app->getDb();\n /*$users = Yii::$app->db->createCommand(\"SELECT core_users.*,(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login FROM core_users where core_users.user_type =:user_type\")\n ->bindValue(':user_type', 1)\n ->queryAll();*/\n $users = Yii::$app->db->createCommand(\"SELECT core_users.*,\"\n . \"(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login,\"\n . \"(SELECT core_user_roles.role_name FROM core_user_roles WHERE core_user_roles.role_id = core_users.user_type) role_name FROM core_users \"\n . \"where core_users.user_type = 1\")->queryAll();\n /*$users = $connection->createCommand(\"SELECT core_users.*,(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login FROM core_users where core_users.user_type = 1\")->queryAll();*/\n /*$users = $query->select(['core_users.*','core_sessions.date_created'])->from('core_users')\n ->innerJoin('core_sessions','core_users.user_id = core_sessions.user_id')\n ->where(\"core_users.user_type = '1'\")\n ->orderBy(['core_sessions.date_created' => SORT_DESC])\n ->groupBy('core_sessions.user_id')\n ->All();*/\n return $users;\n }", "public function find($id_user){\n //-- return all query and use the object result in update-profile\n return $find = mysql_query(\"SELECT id_user, id_city, id_rol, image, username, lastname_1, lastname_2, gender, birthday, email, password, street, number_home,location, zip FROM users WHERE id_user='\".$id_user.\"' LIMIT 1\"); \n }", "public function getUsers($id, $role) {\n\n $select;\n\n switch ($role) {\n\n case 'admin':\n\n //all log in users\n $select = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('status =?', 1)\n ->where('a.id !=?', $id)\n ->where('a.online_status =?', 1)\n ->order('b.name')\n ->setIntegrityCheck(false);\n\n break;\n\n case 'doctor':\n\n //all related log in patients\n $select1 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('c' => 'doctor_patient_map'), 'c.patient_id = a.id', array())\n ->join(array('d' => 'doctor'), 'd.id = c.doctor_id', array())\n ->where('d.user_id =?', $id)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n\n //all log in labtest users\n $select2 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 3)\n ->where('status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n //all log in reservation users\n $select3 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 5)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n\n //all log in checking users\n $select4 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 4)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n\n $select = $this->select()\n ->union(array($select1, $select2, $select3, $select4))\n ->order(\"role\");\n\n break;\n\n case 'patient':\n\n //all related log in doctors\n $select1 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('d' => 'doctor'), 'user_id = a.id', array())\n ->join(array('c' => 'doctor_patient_map'), 'c.doctor_id = d.id', array())\n ->where('c.patient_id =?', $id)\n ->where('status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n //all log in labtest users if \"patient is regstered for labtests\" \n $select2 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('d' => 'labtest_patient_map'), 'patient_id = ' . $id, array())\n ->where('a.role_id =?', 3)\n ->where('status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n //all log in reservation users \"if patient is registered for reservations\"\n $select3 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('d' => 'reservation'), 'patient_id = ' . $id, array())\n ->where('a.role_id =?', 5)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n // all log in checkings users \"if pation is registred for checkings\"\n $select4 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('d' => 'checking_patient_map'), 'patient_id = ' . $id, array())\n ->where('a.role_id =?', 4)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n $select = $this->select()\n ->union(array($select1, $select2, $select3, $select4))\n ->order(\"role\");\n\n break;\n\n case 'lbuser':\n\n //get all log in patients registerd for lab tests\n $select1 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('c' => 'labtest_patient_map'), 'c.patient_id = a.id', array())\n ->where('a.role_id =?', 7)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n //get all log in doctors\n $select2 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 2)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n $select = $this->select()\n ->union(array($select1, $select2))\n ->order(\"role\");\n break;\n\n case 'chuser':\n // all log in patients registerd for checkings\n $select1 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('c' => 'checking_patient_map'), 'c.patient_id = a.id', array())\n ->where('a.role_id =?', 7)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n // all log in doctors\n $select2 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 2)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n $select = $this->select()\n ->union(array($select1, $select2))\n ->order(\"role\");\n break;\n\n case 'rsuser':\n // all log in patients registerd for reservations\n $select1 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->join(array('c' => 'reservation'), 'c.patient_id = a.id', array())\n ->where('a.role_id =?', 7)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n // all log in doctors\n $select2 = $this->select()\n ->from(array('a' => 'user'), array(\n 'id',\n 'title',\n 'initials',\n 'first_name',\n 'last_name')\n )\n ->join(array('b' => 'role'), 'a.role_id = b.id', array('id AS role_id', 'name AS role'))\n ->where('a.role_id =?', 2)\n ->where('a.status =?', 1)\n ->where('a.online_status =?', 1)\n ->setIntegrityCheck(false);\n\n $select = $this->select()\n ->union(array($select1, $select2))\n ->order(\"role\");\n break;\n }\n\n $result = $this->fetchAll($select);\n if ($result) {\n return $result->toArray();\n } else {\n return false;\n }\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "function get_sessions_by_user($user){\n $id_user = \"\";\n if(is_int($user)){\n $id_user = $user;\n }else{\n $id_user = $user->id;\n }\n $query = $this->db->query( \"select *\n from mbf_session_user join mbf_session join mbf_user\n on mbf_session_user.session = mbf_session.id and mbf_session_user.user = mbf_user.id\n where mbf_user.id = '$id_user'\n order by date\");\n return $query->result();\n }", "function listarUsuariosId($id){\n\t\t$activo = true;\n\t\t$query = \"SELECT * FROM usuarios WHERE idUsuario='$id' and activo='$activo'\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$resultdb = $link->query($query); //envia el query a la BD\n\t\tif ($resultdb->num_rows == 1) {\n\t\t\t$usuario = $resultdb->fetch_assoc();\n\t\t}\n\t\t$link->close();//cierro conex\n\t\techo json_encode($usuario);//imprimo un JSON con los datos de la consulta\n\t}", "public function busca_vehiculos($iduser=FALSE)\r\n {\r\n if ($iduser === FALSE)\r\n {\r\n $query = $this->db->get('vehiculo');\r\n return $query->result_array();\r\n } \r\n \r\n $query = $this->db->get_where('vehiculo', array('dueño' => $iduser));\r\n return $query->result_array();\r\n\r\n }", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "public function logado($id){\n global $pdo;\n $array= array();\n $sql =\" SELECT name, email FROM usuarios WHERE id_user=:id\";\n $sql=$pdo->prepare($sql);\n $sql->bindValue(\"id\",$id);\n $sql->execute();\n\n if($sql->rowCount()>0){\n\n $array=$sql->fetch();\n\n }\n return $array; \n\n }", "public function selectusers($idprojeto) {\n $array = null;\n //seleciona todos os participantes do projeto\n $dbtableUP = new Application_Model_DbTable_ProjetoUsuario();\n\n $query1 = $dbtableUP->select()->from($dbtableUP)->where('fk_id_projeto = ?', $idprojeto);\n\n /* @var $arrayUserProj type */\n $arrayUserProj = $dbtableUP->fetchAll($query1)->toArray();\n //seleciona da tabela de usuario os usuarios participantes\n\n if ($arrayUserProj != null) {\n $dbTableUse = new Application_Model_DbTable_Usuario();\n foreach ($arrayUserProj as $uspr) {\n $query = $dbTableUse->select()->from($dbTableUse)->where('id_usuario = ?', $uspr['fk_id_usuario']);\n if ($array == null) {\n $array = array($dbTableUse->fetchAll($query)->toArray());\n } else {\n array_push($array, $dbTableUse->fetchAll($query)->toArray());\n }\n }\n }\n //\n return $array;\n }", "function get_all_siswa() {\n $this->db->select('*,siswa.id as idsiswa');\n $this->db->from('tb_siswa siswa');\n $this->db->join('tb_pengguna pengguna', 'siswa.penggunaID = pengguna.id');\n $this->db->where('siswa.status', 1);\n $query = $this->db->get();\n return $query->result_array();\n }", "function getUsulanByIdJurusan($id,$id_jenis){\n\t\t$query = $this->db->query(\"SELECT * from usulan,jurusan,user where user.id_user = usulan.id_user AND user.id_jenis_user = '$id_jenis' AND usulan.ID_JURUSAN = '$id' AND jurusan.ID_JURUSAN = usulan.ID_JURUSAN\")->result_array();\n\t\treturn $query;\n\t}", "public function listarContratoUser(){\n \n $model = new ContratoModel();\n \n if($model->getContratoUserModel($_POST[\"id\"])){\n \n \techo json_encode($model->getContratoUserModel($_POST[\"id\"]));\n \t\n \t}else{\n \t\n \t$retorno = array(\"retorno\" =>\"NO\");\n \t\n \t\techo json_encode($retorno);\n \t}\n \t\n \n }", "public function index()\n {\n return Pensamiento::with('user')->get();\n }", "function getAllUserIds($filter) {\n\t//SELECT id FROM students\n\t$sql = \"SELECT id FROM users WHERE $filter = 1\";\n\t$userIds = queryColumn($sql);\n\n\treturn $userIds;\n}", "public function ls_user_get()\n {\n $this->db->select('id, idrol,rol, nombre, correo, activo');\n $this->db->from('vusuarios');\n $query = $this->db->get();\n if ($query && $query->num_rows() >= 1) {\n $usuarios = $query->result();\n\n foreach ($usuarios as $row) {\n $row->id = (int) $row->id;\n $row->idrol = (int) $row->idrol;\n $row->rol = (int) $row->rol;\n $row->nombre = $row->nombre;\n $row->correo = (int) $row->correo;\n $row->activo = $row->activo;\n }\n $respuesta = array(\n 'usuarios' => $usuarios,\n );\n $status = 200;\n } else {\n $respuesta = array(\n 'message' => 'Valide sus datos de acceso',\n );\n $status = 401;\n }\n $this->response($respuesta, $status);\n }", "public function getDocumentosUsuario($id){\n $sql = \"SELECT d.Nombre AS documento, Ruta, d.Estatus, td.Nombre AS tipo_documento FROM documentos d \n INNER JOIN tipo_documentos td ON td.ID_Tipo_Doc = d.ID_Tipo_Doc WHERE ID_Mt_Ctl=?\";\n $consulta= $this->db->connect()->prepare($sql);\n $consulta->execute(array($id));\n \n if(!empty($consulta))\n {\n $resultado = array();\n while($fila =$consulta->fetch(PDO::FETCH_ASSOC))\n {\n $resultado[] = $fila;\n }\n return $resultado;\n }\n return false;\n }", "public function getAllUsersAtivos(){\n\n $this->db->select('*');\n $this->db->from(\"admin_empresa\");\n $this->db->where('status', 1);\n $this->db->order_by(\"id\", 'desc');\n\n return $this->db->get();\n }", "function listarPorId($id){\r\n\t\t$sql = 'CALL sp_se_idioma(\"AND u.id = '.$id.'\"); ';\r\n\t\t$arrResultado = $this->getArrayObjs(Conexao::executarSql($sql));\r\n\t\treturn $arrResultado;\r\n\t}", "function getAllUser_PrivilageById_Status($id) {\n\t\t$SQL=\"SELECT * FROM user_privilage_tab WHERE id = '$id' AND status = 'Yes'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t\t$result = array();\n\t\t$count = 0;\n\n\t\twhile($rs = $this->db->nextRecord())\n\t\t{\n\t\t\t$user_privilage = new User_Privilage();\n\t\t\t$user_privilage->setId($rs['id']);\n\t\t\t$user_privilage->setOrder_no($rs['order_no']);\n\t\t\t$user_privilage->setCode($rs['code']);\n\t\t\t$user_privilage->setUser_id($rs['user_id']);\n\t\t\t$user_privilage->setPrivilage_id($rs['privilage_id']);\n\t\t\t$user_privilage->setIs_view($rs['is_view']);\n\t\t\t$user_privilage->setIs_save($rs['is_save']);\n\t\t\t$user_privilage->setIs_edit($rs['is_edit']);\n\t\t\t$user_privilage->setIs_delete($rs['is_delete']);\n\t\t\t$user_privilage->setData_date($rs['data_date']);\n\t\t\t$user_privilage->setStatus($rs['status']);\n\t\t\t$user_privilage->setDate_($rs['date_']);\n\t\t\t$result[$count++] = $user_privilage;\n\t\t}\n\n\t\t$this->db->closeRs();\n\t\tif(count($result) > 0 ){\n\t\t\treturn $result[0];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}", "public function getUser($id) {\n $sql = \"select * from infos_contributeur where id_user = $id\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }", "public function getUserStatut($id)\n {\n $query = $this->_em->createQuery('SELECT st FROM SLPlateformBundle:Statut st JOIN st.ecolespersonnes ep JOIN ep.personne p where p.id=:id');\n $query->setParameter('id', $id);\n $results = $query->getSingleResult();\n return $results;\n }", "public static function getListAllCam($user_id = NULL){\n if(empty($user_id)){\n $user_id = Yii::$app->user->identity->id;\n if(empty($user_id)) return false;\n }\n $query = Camera::find()\n -> leftJoin('relations_cam_user', 'relations_cam_user.cam_id=camera.id')\n ->where(['=', 'relations_cam_user.user_id', $user_id])\n ->all();\n return $query;\n }", "public function get($iduser)\n\t{\n\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"SELECT * FROM tb_users WHERE iduser = :iduser\", [\n\t\t\t':iduser'=>$iduser\n\t\t]);\n\n\t\t$this->setData($results[0]);\n\n\t}", "public function allForUser($userId)\n {\n return $this->model->where('staff_id', $userId)->get();\n }", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,u.name,u.IdDepartamento,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public static function modeloUserGetAll ():array {\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $stmt=self::$db->query(\"select * from Usuarios\");\n $usuarios=[];\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n while ($cod=$stmt->fetch()) {\n $datosuser= [\n $cod[\"nombre\"],\n $cod[\"email\"],\n PLANES[$cod[\"plan\"]],\n ESTADOS[$cod[\"estados\"]]\n ];\n $usuarios[$cod[\"user\"]]=$datosuser;\n }\n return $usuarios;\n}", "function obtenerListaSujetos( $dbh, $idu ){\r\n\t\t// Devuelve todos los registros de sujetos de un usuario por área\r\n\t\t$q = \"select * from sujeto where usuario_id = $idu\";\r\n\t\treturn obtenerListaRegistros( mysqli_query( $dbh, $q ) );\r\n\t}", "function getIds($user = null) {\n return DB::executeFirstColumn('SELECT user_id FROM ' . TABLE_PREFIX . 'project_users WHERE project_id = ?', $this->object->getId());\n }", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "public function findSportsmans() {\r\n\t\t$stmt = $this->db->query(\"SELECT * FROM users WHERE tipo='deportista'\");\r\n\t\t$sportsmans_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$sportsmans = array();\r\n\r\n\t\tforeach($sportsmans_db as $sportsman_db){\r\n\t\t\tarray_push($sportsmans, new User($sportsman_db[\"id\"], $sportsman_db[\"username\"]));\r\n\t\t}\r\n\r\n\t\treturn $sportsmans;\r\n\t}", "function getAllUserIDs() \n {\n //This returns all userids that have rating>0\n $query = \"SELECT users.id FROM users WHERE users.rating > 0\";\n //$query = \"SELECT ratings.model_id FROM ratings WHERE ratings.model='User'\";\n $results = $this->query($query); \n $userIDs = Set::extract($results, '{n}.users.id');\n return $userIDs;\n }", "public function getById($id){\n\n\t\t$row = $this->_model\n\t\t->getTable()\n\t\t->createQuery()\n\t\t->Where('estado_id in (0,1)')\n\t\t->andWhere('despachante_aduana_id = ?',$this->_model->despachante_aduana_id)\n\t\t->execute()\n\t\t->toArray();\n\t\treturn $row;\n\t}", "public function getList(){\n\t\t$model=new Model();\n\t\treturn $model->select(\"SELECT * FROM tb_usuarios ORDER BY idusuario\");\n\t}", "public function getAllUserRequests($user_id) {\n $stmt = $this->conn->prepare(\"SELECT r.* , e.name, e.mobile from service_request r inner join employee e on (r.employee_id = e.id) where r.user_id= ? && (r.status = 0 || r.status = 1)\");\n $stmt->bind_param(\"i\", $user_id);\n $stmt->execute();\n $requests = $stmt->get_result();\n $stmt->close();\n return $requests;\n }", "function user_data($user_id){\n $this->db->select('*');\n $this->db->from('users');\n $this->db->where('user_id', $user_id);\n $query = $this->db->get();\n return $query->row_array();\n }", "public function list_all_data()\n {\n $this->db->select(\"*\");\n $this->db->order_by(\"id\", \"asc\");\n $query = $this->db->get(\"user\"); \n return $query;\n }" ]
[ "0.71866804", "0.6999283", "0.6942316", "0.6852727", "0.68445456", "0.6826503", "0.6794524", "0.6761087", "0.6719461", "0.6700037", "0.6650355", "0.6623769", "0.6623769", "0.65577817", "0.6546658", "0.652822", "0.64781266", "0.6469987", "0.646746", "0.6457264", "0.6450308", "0.6425181", "0.6416754", "0.63843226", "0.6384052", "0.6370414", "0.6367099", "0.63650364", "0.6359924", "0.6350264", "0.6339726", "0.63392764", "0.63360316", "0.6335329", "0.6333014", "0.63326544", "0.63312185", "0.6326362", "0.6324639", "0.6324113", "0.63190013", "0.63081366", "0.6295619", "0.6286317", "0.62802243", "0.6273828", "0.6271558", "0.6271174", "0.626678", "0.6257767", "0.625581", "0.62492234", "0.62475944", "0.6243236", "0.62428504", "0.62411743", "0.6232877", "0.62260383", "0.6222002", "0.6217954", "0.62082183", "0.62043375", "0.6203992", "0.61990017", "0.61918277", "0.61891776", "0.61855483", "0.61747664", "0.61668825", "0.6158712", "0.6157927", "0.61568767", "0.615606", "0.6142665", "0.6142136", "0.61402756", "0.61396825", "0.6135611", "0.61345893", "0.61342967", "0.6130269", "0.6124668", "0.61112034", "0.6107106", "0.6106255", "0.6103101", "0.609657", "0.609657", "0.609657", "0.6095281", "0.6093207", "0.6086987", "0.60818756", "0.6080654", "0.6075443", "0.60731983", "0.6073052", "0.607231", "0.60703427", "0.6069334", "0.6069232" ]
0.0
-1
Run the database seeds.
public function run() { User::create([ 'name' => 'admin', 'email' => '[email protected]', 'password' => bcrypt('admin_admin'), 'role' => 0 ]); User::create([ 'name' => 'tec', 'email' => '[email protected]', 'password' => bcrypt('tec_tec'), 'role' => 1 ]); User::create([ 'name' => 'user', 'email' => '[email protected]', 'password' => bcrypt('user_user'), 'role' => 2 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
/ This script can be run at the command line via cron to search for all available jobs in US craigslist cities, input them into a database and email you the results. DB export is inside the folder for import.
function grab_feed($url){ //open our db connection $database="clscrape"; $con = mysql_connect('***.***.***.***','****','****'); //our associateive array of magical parsed xml jobs $arrFeeds = array(); //list of sites we want to search for jobs $sites = array("web/index.rss","eng/index.rss","sof/index.rss","search/crg?query=%20&format=rss","search/cpg?query=%20&format=rss"); foreach ($sites as $site){ //lets create a new document $doc = new DOMDocument(); //load our rss url $doc->load($url.$site); //crete an empty array to feed our items into //loop through the RSS XML document grabbing the title, description and link tags as those are the only ones we care about foreach ($doc->getElementsByTagName('item') as $node) { $itemRSS = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue ); //push each item onto the feed array array_push($arrFeeds, $itemRSS); } } foreach($arrFeeds as $link) { $search_terms = array( 'PHP','sysadmin','php'); foreach ($search_terms as $keyword) { $pos = strpos($link['desc'],$keyword); if($pos) { mysql_select_db('clscrape',$con) or die( 'Unable to select database' . mysql_error()); $hash = md5($link['title'].$link['desc'].$link['link']); $title = mysql_real_escape_string($link['title']); $desc = mysql_real_escape_string($link['desc']); $url = mysql_real_escape_string($link['link']); $query="INSERT INTO clscrape.data (data.hash,data.title,data.desc,data.link) VALUES('$hash','$title','$desc','$url')"; mysql_query($query,$con); } } } //close our db connection mysql_close($con); //return our associative array return $arrFeeds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asu_isearch_cron() {\n\n // Cache data from configuration\n _asu_isearch_cache_dept_feed();\n\n // Cache dept tree and employee types data\n _asu_isearch_cache_dept_tree_data();\n\n // Begin profile migrations\n _asu_isearch_begin_migrate(FALSE);\n\n // Cleanup the profiles which are no longer associated with\n // unit depts in iSearch. Only run once per day.\n $last_clean = variable_get('last_profile_cleanup', NULL);\n\n if ($last_clean != date('ymd', time())) {\n _asu_isearch_cleanup();\n variable_set('last_profile_cleanup', date('ymd', time()));\n }\n}", "function mainExec() {\n $numPerPage = 10;\n $numIterations = 1;\n $dataDir = \"./data\";\n $dataDir = \"./data/samples\";\n $conn = new \\PDO(\"sqlite:\" . \"/opt/sqlite_dbs/gcrawler.db\");\n\n $initialise = new InitialiseDB($conn);\n $initialise->createTables();\n\n $terms = [\n \"nz books\",\n \"nz gems\"\n ];\n\n $searchStorer = new SearchStorer($dataDir);\n\n\n foreach ($terms as $currentTerms) {\n $dateSfx = SearchStorer::getDateSuffix();\n // Don't turn on unless crawling live\t\n//\t\t $searchStorer->getPagesContentForTerms($currentTerms, $numIterations, $numPerPage, $dateSfx);\n\n $storedResultsParser = new StoredResultsParser($dataDir, $conn);\n $allStoredLinks = $storedResultsParser->parseContentFiles($currentTerms);\n\n $dated = (new \\DateTime())->format(\"Y-m-d H:i:s\");\n $searchBatchId = $storedResultsParser->insertSearchBatch($currentTerms, $dated);\n // echo \"searchBatchId: \" . $searchBatchId . PHP_EOL;\n\n $storedResultsParser->insertSearchResultsForBatch($searchBatchId, $allStoredLinks);\n }\n}", "function gather_ua_faculty_jobs( $args = array() ) {\n\n\t// Set up the arguments\n\t$defaults = array(\n\t\t'keywords' => NULL,\n\t);\n\textract( wp_parse_args( $args, $defaults ), EXTR_OVERWRITE );\n\n // Clean up the keywords\n if ( ! empty( $keywords ) ) {\n\n // Make sure $keywords is an array\n if ( ! is_array( $keywords ) )\n $keywords = explode( ',', $keywords );\n\n // Clean up the array\n $keywords = array_map( 'trim', $keywords );\n\n }\n\n // Get jobs from the UA faculty jobs feed - caches for 12 hours\n\t$the_jobs_feed = fetch_ua_faculty_jobs_feed();\n\n\t// Make sure there isn't an error\n\tif ( is_wp_error( $the_jobs_feed ) )\n\t\treturn false;\n\n\t// Figure out how many feed items there are\n\t$feed_count = $the_jobs_feed->get_item_quantity();\n\n\t// Sort/gather the feed items\n\tif ( $orig_feed_items = $the_jobs_feed->get_items( 0, $feed_count ) ) :\n\n\t\t// Create array of feed items to return\n\t\t$feed_items = array();\n\n\t\t// Loop through the items\n\t\tforeach ( $orig_feed_items as $job ) :\n\n // Set the job ID\n $job_id = $job->get_id();\n\n // Set the job title\n $job_title = $job->get_title();\n\n // Set the job content\n $job_content = $job->get_content();\n\n // Set the job authors\n $job_authors = $job->get_authors();\n\n // Search title and content for keywords\n if ( ! empty( $keywords ) && is_array( $keywords ) ) :\n\n // Create the search regex\n $search_regex = '/(' . implode( '|', $keywords ) . ')/i';\n\n // Keyword exist?\n $keyword_exist = false;\n\n // Keywords in the title?\n if ( preg_match( $search_regex, $job_title ) ) {\n\n $keyword_exist = true;\n\n // Keywords in the content?\n } else if ( preg_match( $search_regex, $job_content ) ) {\n\n $keyword_exist = true;\n\n } else {\n\n // Keywords in the authors?\n foreach( $job_authors as $author ) {\n\n // Search the name\n if ( isset( $author->name ) && preg_match( $search_regex, $author->name ) ) {\n\n $keyword_exist = true;\n break;\n\n }\n\n }\n\n }\n\n // If keyword doesn't exist, don't include\n if ( ! $keyword_exist ) {\n\n continue;\n\n }\n\n endif;\n\n\t\t\t// Get published date (is in UTC)\n\t\t\t$published_date = ( $published_date_str = $job->get_gmdate( 'Y-m-d H:i:s O' ) ) ? new DateTime( $published_date_str ) : false;\n\n\t\t\t// Get updated date (is in UTC)\n\t\t\t$updated_date = ( $updated_date_str = $job->get_updated_gmdate( 'Y-m-d H:i:s O' ) ) ? new DateTime( $updated_date_str ) : false;\n\n\t\t\t// Get site's timezone\n\t\t\tif ( $timezone = get_option( 'timezone_string' ) ) {\n\n\t\t\t\t// Convert to timezone\n\t\t\t\t$published_date->setTimezone( new DateTimeZone($timezone ) );\n\t\t\t\t$updated_date->setTimezone( new DateTimeZone($timezone ) );\n\n\t\t\t}\n\n\t\t\t// Add job object\n\t\t\t$feed_items[] = (object) array (\n 'ID' => $job_id,\n\t\t\t\t'permalink' => esc_url( $job->get_permalink() ),\n\t\t\t\t'published' => $published_date,\n\t\t\t\t'updated' => $updated_date,\n\t\t\t\t'title' => esc_html( $job_title ),\n\t\t\t\t'authors' => $job_authors,\n\t\t\t\t'content' => esc_html( $job_content )\n\t\t\t);\n\n\t\tendforeach;\n\n\t\treturn $feed_items;\n\n\tendif;\n\n\treturn false;\n\n}", "function createCrontab()\n\t{\n\t\t$crontabFilePath = '/tmp/crontab.txt';\n\t\t$file = fopen($crontabFilePath, \"w\") or die(\"Unable to open file!\");\n\t\tglobal $mongo,$python_script_path;\n\t\t$db = $mongo->logsearch;\n\t\t$collection = $db->service_config;\n\t\t$cursor = $collection->find();\n\t\tforeach ($cursor as $doc) {\n\t\t\tif( $doc['state'] == 'Running' && $doc['path'] != '' && $doc['crontab'] != ''){\n\t\t\t\t$txt = '# Index, service:\"'.$doc['service'].'\" system:\"'.$doc['system']\n\t\t\t\t\t\t.'\" node:\"'.$doc['node'].'\" process:\"'.$doc['process'].'\" path:\"'.$doc['path'].'\"'.PHP_EOL;\n\t\t\t\tfwrite($file, $txt); \n\t\t\t\t$txt = $doc['crontab'].' sudo -u logsearch python '\n\t\t\t\t\t\t\t.$python_script_path.'indexScript.py index '.$doc['_id'].PHP_EOL;\n\t\t\t\tfwrite($file, $txt); \n\t\t\t}\n\t\t}\n\t\t//purge data here\n\t\t$keepDataMonth = 3;\n\t\t$txt = '# Purge data at 04:00 everyday, keep data '.$keepDataMonth.' months'.PHP_EOL;\n\t\tfwrite($file, $txt);\n\t\t$txt = '0 4 * * *'.' sudo -u logsearch python '.$python_script_path.'purgeData.py '.$keepDataMonth.' '.PHP_EOL;\n\t\tfwrite($file, $txt); \n\t\tfclose($file);\n\t\t$cmd = \"sudo -u logsearch crontab \".$crontabFilePath;\n\t\texec($cmd);\n\t}", "function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT * FROM {$table_name}\";\n\t\t$feeds = $wpdb->get_results( $sql );\n\n\t\t// ===============================\n\t\t// = go over each iCalendar feed =\n\t\t// ===============================\n\t\tforeach( $feeds as $feed ) {\n\t\t // flush the feed\n\t\t $wgobd_settings_controller->flush_ics_feed( false, $feed->feed_url );\n\t\t // import the feed\n\t\t\t$wgobd_importer_helper->parse_ics_feed( $feed );\n\t\t}\n\t}", "public function scrape($dom) {\n\n\t\t$job = new Job();\n\t\t$citylist = $GLOBALS['citylist'];\n\n\t\tif ($dom->find('comment')) {\n\t\t\tif ($dom->find('h2.nafn')) {\n\t\t\t\tif ($dom->find('div.box-left')){\n\n\t\t\t\t\t//Get foreign id\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"nr/\";\n\t\t\t\t\t\t$endString=\"/\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setForeignId('vinnumalastofnun_is_' . trim(implode($output[1])));\n\t\t\t\t\t}\n\n\t \t\t\t//Get job title\n\t\t\t\t\tforeach($dom->find('h2.nafn') as $Jobtitle) {\n\t\t\t\t\t\t$job->setJobTitle($Jobtitle->plaintext);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Get job description\n\t\t\t\t\tforeach($dom->find('div.box-left') as $DESCRIPTION) {\n\t\t\t\t\t\t$str = htmlentities($DESCRIPTION->innertext,ENT_NOQUOTES,'UTF-8',false);\n\t\t\t\t\t\t$str = str_replace(array('&lt;','&gt;'),array('<','>'), $str);\n\t\t\t\t\t\t$str = str_replace(array('&amp;lt;','&amp;gt'),array('&lt;','&gt;'), $str);\t\n\t\t\t\t\t\t$job->setDescription($str);\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = date('Y-m-d');// current date\n\t\t\t\t\t$date = strtotime('+1 week', strtotime($date));\n\t\t\t\t\t$newdate = date ( 'Y-m-j' , $date);\n\n\t\t\t\t\t$outputDate = $newdate.\"T\".date(\"h:i\").\":00Z\";\n\t\t\t\t\t$job->setExpireDate($outputDate);\n\n\t\t\t\t\t$job->addJobLocation(\"Iceland\", false, false, 273716);\n\n\t\t\t\t\tforeach($dom->find('link[rel=canonical]') as $Link) {\n\t\t\t\t\t\t$job->setJobRouting(false, $Link->href, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setJobRouting(false, \"http://\".trim(implode($output[1])), 2);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $job;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}", "function searchJobs() {\n $keyword = htmlspecialchars(trim($_POST['keyword']), ENT_QUOTES);\n $category = $_POST['category'];\n $location = $_POST['location'];\n \n // keyword parse\n if (!empty($keyword)) {\n $keyword = explode(' ', $keyword);\n \n if (count($keyword) > 1) {\n $default = 1;\n \n foreach ($keyword as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $key_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $key_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($keyword) == 1)\n $key_regexp = '[[:<:]]' . $keyword[0] . '[[:>:]]';\n \n $keyword = implode(' ', $keyword);\n } else\n $key_regexp = null;\n\n // category parse\n if (count($category) > 1) {\n $default = 1;\n \n foreach ($category as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $cat_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $cat_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($category) == 1)\n $cat_regexp = '[[:<:]]' . $category[0] . '[[:>:]]';\n else\n $cat_regexp = null;\n\n $category = implode(' ', $category);\n \n // location parse\n if (count($location) > 1) {\n $default = 1;\n \n foreach ($location as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $loc_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $loc_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($location) == 1)\n $loc_regexp = '[[:<:]]' . $location[0] . '[[:>:]]';\n else\n $loc_regexp = null;\n\n $location = implode(' ', $location);\n \n connectDatabase();\n \n if (!empty($key_regexp)) {\n if (ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp')\n ORDER BY pk DESC\");\n\n } elseif (ereg(\"all\", $cat_regexp) && !ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n } elseif (!ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_category REGEXP '$cat_regexp'\n ORDER BY pk DESC\");\n\n } else {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n (title REGEXP '$key_regexp' OR\n description REGEXP '$key_regexp') AND\n fk_category REGEXP '$cat_regexp' AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n }\n } else {\n if (ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1\n ORDER BY pk DESC\");\n \n } elseif (ereg(\"all\", $cat_regexp) && !ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n } elseif (!ereg(\"all\", $cat_regexp) && ereg(\"all\", $loc_regexp)) {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_category REGEXP '$cat_regexp'\n ORDER BY pk DESC\");\n\n } else {\n\n $result = queryDatabase(\"SELECT pk\n FROM job\n WHERE active = 1 AND\n fk_category REGEXP '$cat_regexp' AND\n fk_location REGEXP '$loc_regexp'\n ORDER BY pk DESC\");\n\n }\n }\n\n $ip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];\n $date = date('Y-m-d');\n $total = mysql_num_rows($result);\n \n if (mysql_num_rows($result) > 0) {\n $default = 1;\n \n while ($row = mysql_fetch_object($result)) {\n if ($default == 1)\n $fk_job = $row->pk;\n else {\n $fk_job .= \" $row->pk\";\n }\n\n $default++;\n }\n } else\n $fk_job = 'EMPTY';\n\n queryDatabase(\"INSERT INTO search (ip, keyword, total, searched, fk_category, fk_job, fk_location)\n VALUES ('$ip', '$keyword', $total, '$date', '$category', '$fk_job', '$location')\");\n\n header('Location: ' . HOME . 'browse.php?pk=' . mysql_insert_id());\n}", "static function jobs() {\n\t\tif(self::doCron()):\n\t\t\n\t\twhile(!Db::lock());\n\n\t\tReminder::cron();\n\t\t\n\t\t$ctrl = new Cronjob();\n\t\t$ctrl->checkBookings();\n\t\t$ctrl->cancelPending();\n\t\t$ctrl->unattended();\n\t\t\n\t\twhile(!Db::unlock());\n\t\t\n\t\tPreferences::set('lastCron', date(\"H:i:s\"));\n\t\t_debug(\"CRON JOBS DONE!\");\n\t\tendif;\n\t}", "function Main()\n{\n\tglobal $server;\n\t$company = ECash::getFactory()->getModel('Company');\n\t$company->loadBy(array('name_short' => strtolower(ECash::getConfig()->COMPANY_NAME_SHORT))); \n\n\t$server->company_id = $company->company_id;\n\t$company_id = $company->company_id;\n\t$db = ECash::getMasterDb();\n\t$start_date = getLastProcessTime($db, 'populate_email_queue', 'completed');\n\n\t// If this is null, the process has never run so we'll need to make up a \n\t// new start date.\n\tif (NULL === $start_date)\n\t{\n\t\t// We're going to subtract 6 hours below, so by setting this to 18 hours ago,\n\t\t// we'll ultimately start at 24 hours ago.\n\t\t$start_date = date('YmdHis', strtotime('-18 hourss', time()));\n\t}\n\telse if (EXECUTION_MODE !== 'LIVE') // local and rc time will be off, so...\n\t{\n\t\t$start_date = substr($start_date, 0, 8) . '000000';\n\t}\n\n\t$start_date = date('YmdHis', strtotime('-6 hours', strtotime($start_date)));\n\n\t$pid = Set_Process_Status($db, $company_id, 'populate_email_queue', 'started');\n\tECash::getLog()->Write(\"populate email queue [start:{$start_date}]\");\n\t$email_documents = eCash_Document_DeliveryAPI_Condor::Prpc()->Get_Incoming_Documents($start_date, NULL, NULL, TRUE, 'EMAIL');\n\n\tif(! is_array($email_documents))\n\t{\n\t\tSet_Process_Status($db, $company_id, 'populate_email_queue', 'failed', NULL, $pid);\n\t\treturn;\n\t}\t\t\n\n\tif(! empty($email_documents))\n\t{\n\t\tECash::getLog()->Write(\"Importing New Email Documents:\");\n\t\tECash::getLog()->Write(print_r($email_documents, true));\n\n\t\t$request = new stdClass();\n\t \t$eq = new Incoming_Email_Queue($server, $request);\n\n\t\tforeach ($email_documents as $email)\n\t\t{\n\t\t\t$eq->Add_To_Email_Queue($company_id, $email->archive_id, FALSE, $email->recipient, $email->sender);\n\t\t}\n\t}\n\n\tSet_Process_Status($db, $company_id, 'populate_email_queue', 'completed', NULL, $pid);\n\n}", "function viewSearchedJobs() {\n connectDatabase();\n\t\n $pk = mysql_real_escape_string($_GET['pk']);\n if (isset($_GET['start']))\n $start = $_GET['start'];\n else\n $start = 0;\n \n \n $result = queryDatabase(\"SELECT total, fk_job\n FROM search\n WHERE pk = $pk\");\n\n $row = mysql_fetch_object($result);\n \n $total = $row->total;\n \n if ($total > 0) {\n $results = (($start + 15) > $total) ? $total: ($start + 15);\n \n echo \"<div class=\\\"good\\\">Results \" . ($start + 1) . \"-$results of $total job(s) found</div><br />\";\n } else\n echo \"<div class=\\\"bad\\\">Your search did not match any jobs in our database</div><br />\";\n\n // fk_job parse\n if ($row->fk_job <> 'EMPTY') {\n $row->fk_job = explode(' ', $row->fk_job);\n \n $row->fk_job = array_slice($row->fk_job, $start, 15);\n \n if (count($row->fk_job) > 1) {\n $default = 1;\n \n foreach ($row->fk_job as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $job_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $job_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($row->fk_job) == 1)\n $job_regexp = '[[:<:]]' . $row->fk_job[0] . '[[:>:]]';\n\n $result = queryDatabase(\"SELECT pk, title, inserted, fk_location\n FROM job\n WHERE pk REGEXP '$job_regexp'\n ORDER BY pk DESC\");\n \n echo '<table cellspacing=\"0\" cellpadding=\"0\">';\n\n $default = 1;\n \n while ($row = mysql_fetch_object($result)) {\n $location = explodeFK($row->fk_location, 'location', 1);\n $row->inserted = substr($row->inserted, 5, 2) . \"/\" . substr($row->inserted, 8, 2) . \"/\" . substr($row->inserted, 0, 4);\n\n $backgroundColor = ($default%2) ? '#FFFACD': '#FFFFFF';\n \n $row->title = wordwrap($row->title, 30, \"\\n\", true);\n \n echo <<< END\n<tr>\n<td style=\"background-color:$backgroundColor; height:77px; text-align:left; vertical-align:top; width:280px;\">\n<strong>Title:</strong><br />\n<a href=\"javascript:popUp('detail.php?pk=$row->pk&apply=1')\">$row->title</a>\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:100px;\">\n<strong>Inserted:</strong><br />\n$row->inserted\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:245px;\">\n<strong>Location:</strong><br />\n$location\n</td>\n</tr>\nEND;\n\n $default++;\n }\n\n echo '</table>';\n \n if (($start - 15) >= 0) {\n $previous = $start - 15;\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$previous\\\" alt=\\\"\\\">Previous 15 Jobs</a>&nbsp;&nbsp;&nbsp;\";\n }\n\n if (($start + 15) < $total) {\n $start += 15;\n $next = (($start + 15) <= $total) ? 15: ($total - $start);\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$start\\\" alt=\\\"\\\">Next $next Job(s)</a>\";\n }\n \n }\n}", "function refreshDatabasePrintJobs($nfcid, $jobList) {\n\t// delete existing records about the print queue\n\t$deleteStmt = SQL::prepare('DELETE FROM printjobs WHERE nfcid=?');\n\t$deleteStmt->execute(array($_GET['nfcid']));\n\n\t$insertStmt = SQL::prepare('INSERT INTO printjobs SET nfcid=?, jobid=?, fileUrl=?');\n\tforeach ($jobList as $job) {\n\t\t// insert the print jobs into the database\n\t\t$insertStmt->execute(array($nfcid, $job['id'], $job['fileUrl']));\n\t}\n}", "public function action_index()\n\t{\n\t\t// Called every minute\n\t\tif ($this->modules['geocoded_addresses'])\n\t\t{\n\t\t\t$requests = Jelly::select('address_geocode_request')->where('status', '=', 'queued')->limit(10)->execute();\n\t\t\tforeach ($requests as $request)\n\t\t\t{\n\t\t\t\t$request->process();\n\t\t\t}\n\t\t}\n\t\texit();\n\t}", "function cron_jobs($offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/cron_jobs');\n\t\tlog_message('debug', '_setting/cron_jobs:: [1] offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND S.activity_code LIKE '%\".htmlentities(str_replace(' ', '_', strtolower($phrase)), ENT_QUOTES).\"%'\": '';\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(CRON_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_cron_job_list', 'variables'=>$values ));\n\t\tlog_message('debug', '_setting/cron_jobs:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "public function cron_action()\n\t{\n\n\t\t// process any recently updated inventory\n\t\t$this->inventory_batch();\n\t\t\n\t\t// process any recently shipped orders\n\t\t$this->shipping_batch();\n\n\t\t// process any recently processing orders\n\t\t$this->processing_batch();\n\n\t\t// process any product updates\n\t\t$this->product_batch(); \n\n\t\t// clean up any old records from the queues\n\t\t$this->cleanup();\n\t\texit('done');\n\n\t}", "public function execute() {\n $sql = \"SELECT gcj_id_job\n FROM gems__comm_jobs\n WHERE gcj_active = 1\n ORDER BY gcj_id_order, \n CASE WHEN gcj_id_survey IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_round_description IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_track IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_organization IS NULL THEN 1 ELSE 0 END\";\n\n $jobs = $this->db->fetchAll($sql);\n\n if ($jobs) {\n $batch = $this->getBatch();\n foreach ($jobs as $job) {\n $batch->addTask('Mail\\\\ExecuteMailJobTask', $job['gcj_id_job']);\n }\n } else {\n $this->getBatch()->addMessage($this->_('Nothing to do, please create a mail job first.'));\n }\n }", "public function run()\n {\n \\App\\ContactList::truncate();\n $phone_book = \\App\\ImportPhoneNumber::first();\n\n if ($phone_book) {\n $limit = 50000;\n\n for ($i = 0; $i < $limit; $i++) {\n $number = '88017'. $i . time();\n $number = substr($number, 0, 13);\n\n \\App\\ContactList::create([\n 'pid' => $phone_book->id,\n 'phone_number' => $number\n ]);\n }\n }\n\n }", "public function jobs(){\n\n \\Disco\\manage\\Manager::jobs();\n\n }", "public function run()\n {\n $file_pointer = base_path('resources/dataset/company.csv');\n $dataset = fopen($file_pointer, 'r');\n $iter = 0;\n while (($row = fgetcsv($dataset, 10000, ',')) != false){\n if($iter === 0) {\n $iter = +1;\n continue;\n }\n if(!$row[0] && !is_int($row[0])) {\n continue;\n }\n if(!$row[1] && !is_int($row[1])) {\n continue;\n }\n DB::table('companies')->insert(\n array(\n 'employee_id' => $row[1],\n 'name' => $row[2],\n 'employee_number' => $row[3],\n )\n );\n }\n }", "function search_job()\r\n{\r\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\r\n \r\n /*\r\n\t// GET JOB FIELDS\r\n\t$jobfields = $database->database_query(\"SELECT jobfield_id, jobfield_type, jobfield_options FROM se_jobfields WHERE jobfield_type<>'5'\");\r\n\t$jobvalue_query = \"se_jobs.job_title LIKE '%$search_text%' OR se_jobs.job_body LIKE '%$search_text%'\";\r\n \r\n\t// LOOP OVER JOB FIELDS\r\n\twhile($jobfield_info = $database->database_fetch_assoc($jobfields)) {\r\n \r\n\t // TEXT FIELD OR TEXTAREA\r\n\t if($jobfield_info[jobfield_type] == 1 | $jobfield_info[jobfield_type] == 2) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\" LIKE '%$search_text%'\";\r\n\r\n\t // RADIO OR SELECT BOX\r\n\t } elseif($jobfield_info[jobfield_type] == 3 | $jobfield_info[jobfield_type] == 4) {\r\n\t // LOOP OVER FIELD OPTIONS\r\n\t $options = explode(\"<~!~>\", $jobfield_info[jobfield_options]);\r\n\t for($i=0,$max=count($options);$i<$max;$i++) {\r\n\t if(str_replace(\" \", \"\", $options[$i]) != \"\") {\r\n\t $option = explode(\"<!>\", $options[$i]);\r\n\t $option_id = $option[0];\r\n\t $option_label = $option[1];\r\n\t if(strpos($option_label, $search_text)) {\r\n\t if($jobvalue_query != \"\") { $jobvalue_query .= \" OR \"; }\r\n\t $jobvalue_query .= \"se_jobvalues.jobvalue_\".$jobfield_info[jobfield_id].\"='$option_id'\";\r\n\t }\r\n\t }\r\n\t }\r\n\t }\r\n\t}\r\n */\r\n \r\n /*\r\n $field = new se_field(\"job\");\r\n $text_columns = $field->field_index(TRUE);\r\n \r\n if( !is_array($text_columns) )\r\n $text_columns = array();\r\n */\r\n \r\n\t// CONSTRUCT QUERY\r\n $sql = \"\r\n SELECT\r\n se_jobs.job_id,\r\n se_jobs.job_title,\r\n se_jobs.job_body,\r\n se_jobs.job_photo,\r\n se_users.user_id,\r\n se_users.user_username,\r\n se_users.user_photo,\r\n se_users.user_fname,\r\n se_users.user_lname\r\n FROM\r\n se_jobs\r\n LEFT JOIN\r\n se_users\r\n ON se_jobs.job_user_id=se_users.user_id\r\n LEFT JOIN\r\n se_levels\r\n ON se_users.user_level_id=se_levels.level_id\r\n LEFT JOIN\r\n se_jobvalues\r\n ON se_jobs.job_id=se_jobvalues.jobvalue_job_id\r\n WHERE\r\n (se_jobs.job_search=1 || se_levels.level_job_search=0)\r\n \";\r\n \r\n /*\r\n $sql .= \" && (MATCH (`job_title`, `job_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n if( !empty($text_columns) )\r\n $sql .= \" || MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n $sql .= \")\";\r\n */\r\n \r\n $text_columns[] = 'job_title';\r\n $text_columns[] = 'job_body';\r\n $sql .= \" && MATCH (`\".join(\"`, `\", $text_columns).\"`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\r\n \r\n \r\n\t// GET TOTAL ENTRIES\r\n $sql2 = $sql . \" LIMIT 201\";\r\n $resource = $database->database_query($sql2) or die($database->database_error().\" <b>SQL was: </b>{$sql2}\");\r\n\t$total_entries = $database->database_num_rows($resource);\r\n\r\n\t// IF NOT TOTAL ONLY\r\n\tif( $t==\"job\" )\r\n {\r\n\t // MAKE JOB PAGES\r\n\t $start = ($p - 1) * $results_per_page;\r\n\t $limit = $results_per_page+1;\r\n \r\n\t // SEARCH JOBS\r\n $sql3 = $sql . \" ORDER BY job_id DESC LIMIT {$start}, {$limit}\";\r\n $resource = $database->database_query($sql3) or die($database->database_error().\" <b>SQL was: </b>{$sql3}\");\r\n \r\n\t while( $job_info=$database->database_fetch_assoc($resource) )\r\n {\r\n\t // CREATE AN OBJECT FOR AUTHOR\r\n\t $profile = new se_user();\r\n\t $profile->user_info['user_id'] = $job_info['user_id'];\r\n\t $profile->user_info['user_username'] = $job_info['user_username'];\r\n\t $profile->user_info['user_photo'] = $job_info['user_photo'];\r\n\t $profile->user_info['user_fname'] = $job_info['user_fname'];\r\n\t $profile->user_info['user_lname'] = $job_info['user_lname'];\r\n\t $profile->user_displayname();\r\n \r\n\t // IF EMPTY TITLE\r\n\t if( !trim($job_info['job_title']) )\r\n $job_info['job_title'] = SE_Language::get(589);\r\n \r\n $job_info['job_body'] = cleanHTML($job_info['job_body'], '');\r\n \r\n\t // IF BODY IS LONG\r\n\t if( strlen($job_info['job_body'])>150 )\r\n $job_info['job_body'] = substr($job_info['job_body'], 0, 147).\"...\";\r\n \r\n\t // SET THUMBNAIL, IF AVAILABLE\r\n $thumb_path = NULL;\r\n if( !empty($job_info['job_photo']) )\r\n {\r\n $job_dir = se_job::job_dir($job_info['job_id']);\r\n $job_photo = $job_info['job_photo'];\r\n $job_thumb = substr($job_photo, 0, strrpos($job_photo, \".\")).\"_thumb\".substr($job_photo, strrpos($job_photo, \".\"));\r\n \r\n if( file_exists($job_dir.$job_thumb) )\r\n $thumb_path = $job_dir.$job_thumb;\r\n elseif( file_exists($job_dir.$job_photo) )\r\n $thumb_path = $job_dir.$job_photo;\r\n }\r\n \r\n if( !$thumb_path )\r\n $thumb_path = \"./images/icons/file_big.gif\";\r\n \r\n \r\n $result_url = $url->url_create('job', $job_info['user_username'], $job_info['job_id']);\r\n $result_name = 6400137;\r\n $result_desc = 6400138;\r\n \r\n \r\n\t $results[] = array(\r\n 'result_url' => $result_url,\r\n\t\t\t\t'result_icon' => $thumb_path,\r\n\t\t\t\t'result_name' => $result_name,\r\n\t\t\t\t'result_name_1' => $job_info['job_title'],\r\n\t\t\t\t'result_desc' => $result_desc,\r\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $job_info['user_username']),\r\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\r\n\t\t\t\t'result_desc_3' => $job_info['job_body']\r\n );\r\n \r\n unset($profile);\r\n\t }\r\n \r\n\t // SET TOTAL RESULTS\r\n\t $total_results = $total_entries;\r\n\t}\r\n\r\n\t// SET ARRAY VALUES\r\n\tSE_Language::_preload_multi(6400137, 6400138, 6400139);\r\n\tif( $total_entries>200 )\r\n $total_entries = \"200+\";\r\n \r\n\t$search_objects[] = array(\r\n 'search_type' => 'job',\r\n 'search_lang' => 6400139,\r\n 'search_total' => $total_entries\r\n );\r\n}", "public function run()\n {\n $json = json_decode(file_get_contents('https://core.tadbirrlc.com//StocksHandler.ashx?{%22Type%22:%22ALL21%22,%22Lan%22:%22Fa%22}&jsoncallback='), true);\n\n foreach ($json as $item) {\n DB::table('companies')\n ->insert([\n 'symbol' => $item['sf'],\n 'name' => $item['cn'],\n 'id_code' => $item['ic'],\n 'company_12_digit_name' => $item['nc'],\n 'category_id' => $item['sc']\n ]);\n }\n }", "public function index() {\n $params2 = array(\n 'conditions' => array(\n 'title' => 'Senior Developer',\n 'location' => '10018',\n 'query' => \"Wordpress\",\n 'miles' => 5,\n ),\n 'order' => array(\n 'last_seen_date' => 'DESC',\n ),\n 'limit' => 3,\n 'page' => 1,\n //'fields' => array('job_key', 'title')\n );\n $jobs2 = $this->Simplyhired->find('count', $params2);\n debug($jobs2);\n\n $jobs2 = $this->Simplyhired->find('first', $params2);\n debug($jobs2);\n\n $jobs2 = $this->Simplyhired->find('all', $params2);\n debug($jobs2);\n exit;\n }", "function findOnCraigslist($state = \"Oregon\",$jsonManufacturers = null,$ignoreWords=array(),$cityDepth=null,$depthOverride=true){\n $cityCounter = 0;\n $itemFoundCounter = 0;\n $foundItems = array();\n //Use the Scraper Web API and pull the results in JSON format\n $jsonData = file_get_contents(\"https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=craigslist_cities_1&query=select%20*%20from%20%60swdata%60%20WHERE%20state%20%3D%20'\".$state.\"'\");\n $jsonCraigCities = json_decode($jsonData);\n //$jsonItemManufacturerData = file_get_contents($manufacturerScraperURL.\"%20WHERE%20manufacturer%20%3D%20'\".$itemManufacturer.\"'\");\n //$jsonItemsFromManufacturer = json_decode($jsonItemManufacturerData);\n //echo \"There are \".count($jsonItemsFromManufacturer).\" \".$itemManufacturer.\" items in the system.\\n\";\n $foundURLS = array(); \n if(!empty($jsonData)){\n foreach($jsonCraigCities as $city){\n $itemCounter = 0;\n echo \"-> Parsing link: \".$city->link.\"\\n\";\n //Search each city for each item for a certain item manufacturer in the vintage item database.\n if($cityCounter < $cityDepth || $depthOverride == true || $cityDepth == 0){\n foreach($jsonManufacturers as $item){\n //Example musical instrument search string http://portland.craigslist.org/search/msg?query=korg+microkorg&srchType=A&minAsk=5&maxAsk=&hasPic=1 \n if(!empty($item)){\n $itemName = urlencode(trim($item->name));\n if(!empty($itemName)){ \n $tManName = preg_replace(\"/\\s/\",\"_\",$item->manufacturer);//Build a temp name for the array key\n $itemManufacturer = urlencode($item->manufacturer);\n $search_string = '\"'.strtolower($itemManufacturer).\"+\".$itemName.'\"';\n //$search_string = urlencode($search_string);\n $search_string2 = urlencode($itemName);\n //\"%7C\" = | (This establishes Craiglist's OR search.)\n if(!empty($search_string) && !empty($search_string2)){\n $search_url = $city->link.\"/search/msg?query=\".$search_string.\"+%7C+\".$search_string2.\"&srchType=T&minAsk=5&maxAsk=&hasPic=1\";//Title only and has image\n echo \"--> Scraping: \".$search_url.\"\\n\";\n $html = scraperWiki::scrape($search_url); \n $dom = new simple_html_dom();\n $dom->load($html); //Load the HTML \n foreach($dom->find(\"p.row\") as $item){\n $itemLink = $item->find('a',0); //Find the second link (not the image link)\n if(!empty($itemLink->href)){\n $itemName = $itemLink->innertext;\n $itemName = preg_replace('/\\s-/','',$itemName);\n $itemName = trim($itemName);\n //Check the name against the ignore words\n $addItem = 1;\n foreach($ignoreWords as $word){\n //Make sure that the itemName doesn't include a word to ignore\n if(strpos(strtolower($itemName),strtolower($word))===false){\n //Do something\n }else{\n $addItem = 0;\n }\n }\n //Check to make sure that the item link matches the search city link. \n $searchCity = preg_match(\"@http://([a-z]*+)\\.@\",$city->link,$cityMatches);\n $searchCity = trim($cityMatches[1]);\n $itemCity = preg_match(\"@http://([a-z]*+)\\.@\",$itemLink->href,$itemCityMatches);\n $itemCity = trim($itemCityMatches[1]);\n //echo \"Search city: \".$searchCity.\"\\n\";\n //echo \"Item city: \".$itemCity.\"\\n\";\n if($itemCity != $searchCity){\n $addItem = 0;\n }\n if($addItem == 1 && in_array($itemLink->href,$foundURLS) == 0){\n echo $itemName.\"\\n\";\n $itemInfo = $item->plaintext;\n $itemInfo = explode('$',$itemInfo);\n $itemPrice = \"$\".trim($itemInfo[1]);\n $itemInfo = $itemInfo[0];\n $itemInfo = explode('-',$itemInfo);\n $itemInfo = preg_replace('/&nbsp;/','',$itemInfo);\n $foundItems[$itemFoundCounter]['manufacturer'] = $itemManufacturer;\n $foundItems[$itemFoundCounter]['name'] = $itemName;\n $foundItems[$itemFoundCounter]['post_item_name'] = $itemName;\n //Find the date and price\n if(!empty($itemInfo)){\n if(isset($itemInfo[0])){\n $itemDate = trim($itemInfo[0]);\n $itemDate = preg_replace('/\\s\\s+/',' ',$itemDate); //Strip excess whitespace\n //Change date string\n $itemDateArray = explode(\" \",$itemDate);\n $monthNumVal = getMonthNum($itemDateArray[0]); //ex Nov\n $curYear = date(\"Y\");\n $itemDate = $curYear.\"-\".$monthNumVal.\"-\".$itemDateArray[1];\n echo \"Date posted: \".$itemDate.\"\\n\";\n $foundItems[$itemFoundCounter]['post_item_date'] = $itemDate;\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n }\n if(isset($itemPrice)){\n $itemPrice = trim($itemPrice);\n $itemPrice = preg_replace('/\\(.*\\)/','',$itemPrice);\n $itemPrice = preg_replace('/[a-z]+|[A-Z]+/','',$itemPrice);\n $itemPrice = trim($itemPrice);\n echo \"Price: \".$itemPrice.\"\\n\";\n //Only add the price if a dollar sign exists\n if($itemPrice[0] == \"$\"){\n $foundItems[$itemFoundCounter]['post_item_price'] = $itemPrice;\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"$\".$itemPrice;\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n $foundURLS[] = $itemLink->href; //Add the url to keep track and make sure that only unique URLs are added.\n $foundItems[$itemFoundCounter]['post_item_link'] = $city->link;\n $foundItems[$itemFoundCounter]['post_item_state'] = $city->state;\n $foundItems[$itemFoundCounter]['query'] = $search_string.\"+%7C+\".$search_string2;\n $foundItems[$itemFoundCounter]['link'] = $itemLink->href;\n //Find the page details on the page\n $craigSynthItemPage = scraperWiki::scrape($itemLink->href); \n $craigSynthItemPageDOM = new simple_html_dom();\n $craigSynthItemPageDOM->load($craigSynthItemPage); //Load the HTML\n if(!empty($craigSynthItemPageDOM)){\n $craigSynthItemDesc = $craigSynthItemPageDOM->find(\"div#userbody\",0);\n //print_r($craigSynthItemDesc);\n if(!empty($craigSynthItemDesc)) $craigSynthItemDesc = $craigSynthItemDesc->plaintext;\n $craigSynthItemBlurb = $craigSynthItemPageDOM->find(\"div#userbody] ul.blurbs\",0);\n if(!empty($craigSynthItemBlurb)) $craigSynthItemBlurb = $craigSynthItemBlurb->plaintext;\n $craigSynthItemDesc = str_replace($craigSynthItemBlurb,\"\",$craigSynthItemDesc);\n $postImages = array();\n foreach($craigSynthItemPageDOM->find(\"table[summary='craigslist hosted images'] tbody tr\") as $imageGroup){\n if(!empty($imageGroup)){\n $image = $imageGroup->find(\"img\",0);\n if(!empty($image)){\n $postImages[] = $image->src;\n }\n }\n }\n //print_r($postImages);\n $postImageStr = implode(\",\",$postImages);\n //echo $postImageStr;\n $craigSynthItemDesc = preg_replace(\"/(\\r|\\n|\\r\\n){2,}/\",\"\",$craigSynthItemDesc);\n $craigSynthItemDesc = preg_replace('/[^(\\x20-\\x7F)]*/','', $craigSynthItemDesc); //Remove non-ASCII characters\n echo $craigSynthItemDesc;\n if(!empty($postImageStr)){\n $foundItems[$itemFoundCounter]['post_item_images'] = $postImageStr;\n }else{\n $foundItems[$itemFoundCounter]['post_item_images'] = \"\";\n }\n if(!empty($craigSynthItemDesc)){\n $foundItems[$itemFoundCounter]['post_item_description'] = $craigSynthItemDesc;\n }else{\n $foundItems[$itemFoundCounter]['post_item_description'] = \"\";\n }\n }\n $itemFoundCounter++;\n }else{\n //Do something if the item wasn't added\n }\n }else{\n //Do something if the link is empty\n }\n }\n }\n }else{\n break;\n }\n $itemCounter++; \n }\n }\n }else{\n break;\n }\n $cityCounter++;\n }\n }else{\n echo \"There were no results found for \".$state.\".\";\n }\n \n return $foundItems;\n}", "function findOnCraigslist($state = \"Oregon\",$jsonManufacturers = null,$ignoreWords=array(),$cityDepth=null,$depthOverride=true){\n $cityCounter = 0;\n $itemFoundCounter = 0;\n $foundItems = array();\n //Use the Scraper Web API and pull the results in JSON format\n $jsonData = file_get_contents(\"https://api.scraperwiki.com/api/1.0/datastore/sqlite?format=jsondict&name=craigslist_cities_1&query=select%20*%20from%20%60swdata%60%20WHERE%20state%20%3D%20'\".$state.\"'\");\n $jsonCraigCities = json_decode($jsonData);\n //$jsonItemManufacturerData = file_get_contents($manufacturerScraperURL.\"%20WHERE%20manufacturer%20%3D%20'\".$itemManufacturer.\"'\");\n //$jsonItemsFromManufacturer = json_decode($jsonItemManufacturerData);\n //echo \"There are \".count($jsonItemsFromManufacturer).\" \".$itemManufacturer.\" items in the system.\\n\";\n $foundURLS = array(); \n if(!empty($jsonData)){\n foreach($jsonCraigCities as $city){\n $itemCounter = 0;\n echo \"-> Parsing link: \".$city->link.\"\\n\";\n //Search each city for each item for a certain item manufacturer in the vintage item database.\n if($cityCounter < $cityDepth || $depthOverride == true || $cityDepth == 0){\n foreach($jsonManufacturers as $item){\n //Example musical instrument search string http://portland.craigslist.org/search/msg?query=korg+microkorg&srchType=A&minAsk=5&maxAsk=&hasPic=1 \n if(!empty($item)){\n $itemName = urlencode(trim($item->name));\n if(!empty($itemName)){ \n $tManName = preg_replace(\"/\\s/\",\"_\",$item->manufacturer);//Build a temp name for the array key\n $itemManufacturer = urlencode($item->manufacturer);\n $search_string = '\"'.strtolower($itemManufacturer).\"+\".$itemName.'\"';\n //$search_string = urlencode($search_string);\n $search_string2 = urlencode($itemName);\n //\"%7C\" = | (This establishes Craiglist's OR search.)\n if(!empty($search_string) && !empty($search_string2)){\n $search_url = $city->link.\"/search/msg?query=\".$search_string.\"+%7C+\".$search_string2.\"&srchType=T&minAsk=5&maxAsk=&hasPic=1\";//Title only and has image\n echo \"--> Scraping: \".$search_url.\"\\n\";\n $html = scraperWiki::scrape($search_url); \n $dom = new simple_html_dom();\n $dom->load($html); //Load the HTML \n foreach($dom->find(\"p.row\") as $item){\n $itemLink = $item->find('a',0); //Find the second link (not the image link)\n if(!empty($itemLink->href)){\n $itemName = $itemLink->innertext;\n $itemName = preg_replace('/\\s-/','',$itemName);\n $itemName = trim($itemName);\n //Check the name against the ignore words\n $addItem = 1;\n foreach($ignoreWords as $word){\n //Make sure that the itemName doesn't include a word to ignore\n if(strpos(strtolower($itemName),strtolower($word))===false){\n //Do something\n }else{\n $addItem = 0;\n }\n }\n //Check to make sure that the item link matches the search city link. \n $searchCity = preg_match(\"@http://([a-z]*+)\\.@\",$city->link,$cityMatches);\n $searchCity = trim($cityMatches[1]);\n $itemCity = preg_match(\"@http://([a-z]*+)\\.@\",$itemLink->href,$itemCityMatches);\n $itemCity = trim($itemCityMatches[1]);\n //echo \"Search city: \".$searchCity.\"\\n\";\n //echo \"Item city: \".$itemCity.\"\\n\";\n if($itemCity != $searchCity){\n $addItem = 0;\n }\n if($addItem == 1 && in_array($itemLink->href,$foundURLS) == 0){\n echo $itemName.\"\\n\";\n $itemInfo = $item->plaintext;\n $itemInfo = explode('$',$itemInfo);\n $itemPrice = \"$\".trim($itemInfo[1]);\n $itemInfo = $itemInfo[0];\n $itemInfo = explode('-',$itemInfo);\n $itemInfo = preg_replace('/&nbsp;/','',$itemInfo);\n $foundItems[$itemFoundCounter]['manufacturer'] = $itemManufacturer;\n $foundItems[$itemFoundCounter]['name'] = $itemName;\n $foundItems[$itemFoundCounter]['post_item_name'] = $itemName;\n //Find the date and price\n if(!empty($itemInfo)){\n if(isset($itemInfo[0])){\n $itemDate = trim($itemInfo[0]);\n $itemDate = preg_replace('/\\s\\s+/',' ',$itemDate); //Strip excess whitespace\n //Change date string\n $itemDateArray = explode(\" \",$itemDate);\n $monthNumVal = getMonthNum($itemDateArray[0]); //ex Nov\n $curYear = date(\"Y\");\n $itemDate = $curYear.\"-\".$monthNumVal.\"-\".$itemDateArray[1];\n echo \"Date posted: \".$itemDate.\"\\n\";\n $foundItems[$itemFoundCounter]['post_item_date'] = $itemDate;\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n }\n if(isset($itemPrice)){\n $itemPrice = trim($itemPrice);\n $itemPrice = preg_replace('/\\(.*\\)/','',$itemPrice);\n $itemPrice = preg_replace('/[a-z]+|[A-Z]+/','',$itemPrice);\n $itemPrice = trim($itemPrice);\n echo \"Price: \".$itemPrice.\"\\n\";\n //Only add the price if a dollar sign exists\n if($itemPrice[0] == \"$\"){\n $foundItems[$itemFoundCounter]['post_item_price'] = $itemPrice;\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"$\".$itemPrice;\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n }else{\n $foundItems[$itemFoundCounter]['post_item_date'] = \"\";\n $foundItems[$itemFoundCounter]['post_item_price'] = \"\";\n }\n $foundURLS[] = $itemLink->href; //Add the url to keep track and make sure that only unique URLs are added.\n $foundItems[$itemFoundCounter]['post_item_link'] = $city->link;\n $foundItems[$itemFoundCounter]['post_item_state'] = $city->state;\n $foundItems[$itemFoundCounter]['query'] = $search_string.\"+%7C+\".$search_string2;\n $foundItems[$itemFoundCounter]['link'] = $itemLink->href;\n //Find the page details on the page\n $craigSynthItemPage = scraperWiki::scrape($itemLink->href); \n $craigSynthItemPageDOM = new simple_html_dom();\n $craigSynthItemPageDOM->load($craigSynthItemPage); //Load the HTML\n if(!empty($craigSynthItemPageDOM)){\n $craigSynthItemDesc = $craigSynthItemPageDOM->find(\"div#userbody\",0);\n //print_r($craigSynthItemDesc);\n if(!empty($craigSynthItemDesc)) $craigSynthItemDesc = $craigSynthItemDesc->plaintext;\n $craigSynthItemBlurb = $craigSynthItemPageDOM->find(\"div#userbody] ul.blurbs\",0);\n if(!empty($craigSynthItemBlurb)) $craigSynthItemBlurb = $craigSynthItemBlurb->plaintext;\n $craigSynthItemDesc = str_replace($craigSynthItemBlurb,\"\",$craigSynthItemDesc);\n $postImages = array();\n foreach($craigSynthItemPageDOM->find(\"table[summary='craigslist hosted images'] tbody tr\") as $imageGroup){\n if(!empty($imageGroup)){\n $image = $imageGroup->find(\"img\",0);\n if(!empty($image)){\n $postImages[] = $image->src;\n }\n }\n }\n //print_r($postImages);\n $postImageStr = implode(\",\",$postImages);\n //echo $postImageStr;\n $craigSynthItemDesc = preg_replace(\"/(\\r|\\n|\\r\\n){2,}/\",\"\",$craigSynthItemDesc);\n $craigSynthItemDesc = preg_replace('/[^(\\x20-\\x7F)]*/','', $craigSynthItemDesc); //Remove non-ASCII characters\n echo $craigSynthItemDesc;\n if(!empty($postImageStr)){\n $foundItems[$itemFoundCounter]['post_item_images'] = $postImageStr;\n }else{\n $foundItems[$itemFoundCounter]['post_item_images'] = \"\";\n }\n if(!empty($craigSynthItemDesc)){\n $foundItems[$itemFoundCounter]['post_item_description'] = $craigSynthItemDesc;\n }else{\n $foundItems[$itemFoundCounter]['post_item_description'] = \"\";\n }\n }\n $itemFoundCounter++;\n }else{\n //Do something if the item wasn't added\n }\n }else{\n //Do something if the link is empty\n }\n }\n }\n }else{\n break;\n }\n $itemCounter++; \n }\n }\n }else{\n break;\n }\n $cityCounter++;\n }\n }else{\n echo \"There were no results found for \".$state.\".\";\n }\n \n return $foundItems;\n}", "public function run()\n {\n $name_jobs = [\n ['name_job' => 'ADMINISTRADOR DE REDES Y SERVIDORES'],\n ['name_job' => 'ANALISTA DE MESA DE AYUDA'],\n ['name_job' => 'ANALISTA DE RECURSOS HUMANOS'],\n ['name_job' => 'ANALISTA DE SOPORTE DE PRIMER NIVEL'],\n ['name_job' => 'COORDINADOR DE SERVICIOS INFORMATICOS'],\n ['name_job' => 'ESPECIALISTA DE SOPORTE DE TERCER NIVEL'],\n ['name_job' => 'GERENTE DE PRE VENTA'],\n ['name_job' => 'GESTOR DE CENTRO DE SERVICIOS'],\n ['name_job' => 'INGENIERO POST VENTA'],\n ['name_job' => 'JEFE DE CENTRO DE SERVICIO'],\n ['name_job' => 'JEFE DE PROYECTO'],\n ['name_job' => 'PRACTICANTE TI'],\n ['name_job' => 'PROGRAMADOR'],\n ['name_job' => 'SOPORTE TECNICO DE SEGUNDO NIVEL'],\n ['name_job' => 'SUPERVISOR DE SOPORTE TECNICO DE PRIMER NIVEL'],\n ['name_job' => 'SUPERVISOR DE SOPORTE TECNICO DE SEGUNDO NIVEL'],\n ['name_job' => 'TECNICO SENIOR']\n ];\n\n DB::table('users_jobs')->insert($name_jobs);\n }", "public function getAllJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n return $this->DAO->getAllJobs();\n }", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "public function run()\n {\n DB::table('jobs')->insert([\n [\n 'job_id' => 1,\n 'job_name' => 'ASN/Honorer',\n ],\n [\n 'job_id' => 2,\n 'job_name' => 'Swasta/Karyawan',\n ],\n [\n 'job_id' => 3,\n 'job_name' => 'Wirausaha/Wiraswasta',\n ],\n ]);\n }", "function action_runjobs() {\n global $CFG;\n\n //need the code that defines the scheduled export behaviour\n require_once($CFG->dirroot . '/blocks/php_report/runschedule.php');\n\n $scheduleids = array();\n if ($data = data_submitted()) {\n foreach ($data as $key => $value) {\n if (strpos($key, 'schedule_') === 0) {\n $scheduleid = (int)substr($key, strlen('schedule_'));\n if ($this->can_do_schedule_action($scheduleid)) {\n $scheduleids[] = $scheduleid;\n }\n }\n }\n }\n\n //re-display the list of scheduled jobs for this report\n $this->action_listinstancejobs();\n\n if (count($scheduleids) > 0) {\n //include the necessary javascript libraries for the ASYNC request stuff\n require_js(array('yui_yahoo', 'yui_event'));\n\n //one or more schedules selected, so open the popup to run them\n echo '<script type=\"text/javascript\">\n YAHOO.util.Event.onDOMReady(function() {\n openpopup(\\'/blocks/php_report/lib/run_schedule_popup.php?scheduleids=' . urlencode(json_encode($scheduleids)) . '\\', \\'runjobsnow\\', \\'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\\', 0);\n });\n </script>';\n }\n }", "public function run()\n {\n \t\t$companies = [\n [\n 'company_name' => 'Your Company',\n 'type' => '',\n 'telephone' => '(000) 000-000',\n 'email' => '[email protected]',\n 'website' => 'www.your-company.com',\n 'image_url' => 'logo-placeholder.png',\n 'is_enable' => 0,\n 'created_by' => 1,\n ],\n\n ];\n \n foreach ($companies as $item)\n DB::table('companies')->insert($item);\n }", "public function execute()\n {\n $date = (new \\DateTime('-1 week'))->format(DateTime::DATETIME_PHP_FORMAT);\n $jobs = $this->collectionFactory->create()\n ->addFieldToFilter('scheduled_at', [\n 'or' => [\n ['date' => true, 'to' => $date],\n ['null' => true],\n ]\n ])\n ->addFieldToFilter('created_at', [\n ['date' => true, 'to' => $date]\n ])\n ->setOrder('created_at', 'ASC')\n ->setPageSize(250);\n\n $itemsToRemove = $jobs->count() - 50;\n\n foreach ($jobs as $job) {\n if ($itemsToRemove-- < 0) {\n break;\n }\n\n $job->delete();\n }\n }", "private function find_all_jobs() {\n $jobs = array();\n foreach( glob( $this->crony_job_root . '/*.php') as $job_file ) {\n $job_class = basename( $job_file, '.php' );\n\n // Before we include this job in the job list, we need to make sure it implements \\Crony\\TaskInterface\n $implementations = class_implements( $this->crony_job_namespace . '\\\\' . $job_class );\n if ( in_array( 'Crony\\TaskInterface', $implementations ) ) {\n array_push( $jobs, $job_class );\n }\n }\n\n return $jobs;\n }", "public function jobs($subdomain, $title = '', $location = '', $category = '', $limit = NULL)\n {\n // determine if setting a result limit\n if (!is_null($limit)) {\n Zend_Search_Lucene::setResultSetLimit($limit);\n }\n\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n\n // build the query string\n $queryStr = array();\n\n // restrict searches by the subdomain\n $queryStr[] = '+subdomain:(' . $subdomain . ')';\n\n // check for a title\n if (!empty($title)) {\n // handle spaces as phrases\n if (strpos(trim($title), ' ') !== FALSE) {\n $queryStr[] = '+name:(\"' . $this->sanitize($title) . '\"~10)';\n } else {\n $queryStr[] = '+name:(' . $this->sanitize($title) . ')';\n }\n }\n\n // check for a location\n if (!empty($location)) {\n // handle spaces as phrases\n if (strpos(trim($location), ' ') !== FALSE) {\n $queryStr[] = '+location:(\"' . Clean::uristub($location) . '\"~3)';\n } else {\n $queryStr[] = '+location:(' . Clean::uristub($location) . ')';\n }\n }\n\n // check for a category\n if (!empty($category)) {\n // handle spaces as phrases\n if (strpos(trim($category), ' ') !== FALSE) {\n $queryStr[] = '+category:(\"' . Clean::uristub($category) . '\"~4)';\n } else {\n $queryStr[] = '+category:(' . Clean::uristub($category) . ')';\n }\n }\n \n // merge the query terms\n $queryStr = implode(' ', $queryStr);\n \n // try out sorting\n if (empty($title)) {\n // perform the query\n return $this->index->find(\n $queryStr,\n 'date_posted', SORT_REGULAR, SORT_DESC\n );\n } else {\n // perform the query\n return $this->index->find(\n $queryStr,\n 'score', SORT_NUMERIC, SORT_DESC,\n 'date_posted', SORT_NUMERIC, SORT_DESC\n );\n }\n \n }", "function curlResourceJoe($url,$debugmode,$timezone,$hostName,$userName,$password,$dbName, $category){\n echo \"Running RSS: $url\";\n\t//sean start ============================================================================================\n\t\n$positionofuniqueid=6;\n\n///RSS retrieval\n require_once('magpierss/rss_fetch.inc');\n\t//$url = $_GET['url'];\n\t$rss = fetch_rss( $url );\n\t$myFilewrite = \"../links.php\";\n\t$fw = fopen($myFilewrite, 'w') or die(\"can't open file\");\n\t\n\tforeach ($rss->items as $item) {\n\t\t$href = $item['link'];\n\t\t$title = $item['title'];\n\t\tfwrite($fw, $href.\"\\n\");\n\t\n\t}\n\t\nfclose($fw);\n//RSS end\nmysql_connect($hostName, $userName, $password) or die(\"Unable to connect to host $hostName\");\nmysql_select_db($dbName) or die(\"Unable to select database $dbName\");\n$myFile=\"../links.php\";\n$fh = fopen($myFile, 'r');\n// create a new curl resource\nwhile ((feof ($fh) === false)){\n$ch = curl_init();\n$link = fgets($fh);\n$chunk = explode(\"/\", $link);\n$uniqueid=rtrim($chunk[$positionofuniqueid]);\n$uniqueid = str_replace(\"?ad=\", \"\", $uniqueid);\n\n\n\nif($debugmode==0){\n\tif($num_rows>0)\n\t{\n // echo \"select * from jobs where uniqueid='\".$uniqueid.\"'\";\n // echo \"<h3>Duplicate entry.Program Terminated</h3>\";\n\t\t\t\texit();\n\t}\n}\n\n\n$city=getcity($link);\n// set URL and other appropriate options\ncurl_setopt($ch, CURLOPT_URL, $link);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n// grab URL, and return output\n$output = curl_exec($ch);\n// close curl resource, and free up system resources\ncurl_close($ch);\n// Print output\n//echo $output;ag\n$title = substring_between($output,'<title>','</title>');\n$title = preg_replace('/\\'/','', $title);\n$title = preg_replace('/\\\"/','', $title);\n$title = strip_tags($title);\n\n$images = substring_between($output,\"urlSelect : '[\",\"]',\"); \n\n//echo \"<b>HERE is image string</b>\",$images;\n\n//////ebay does not need ripping if using above substring_between craigs....ya fuck that\n$images = str_replace(array('\\'', '\"'), '', $images);\n$images = str_replace(array('\\'', ']'), '', $images);\n$images = str_replace(array('\\'', '['), '', $images);\n$images = explode(',', $images);\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////////////\n\nforeach ($images as $image) {\n\t $path = $image;\n $picfile = basename($path); \n // echo \"<b>This is name of picture </b>\",$picfile;\n\t // echo \"<br>\";\n \n\t\n\n}\n\n\n\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n//if title is empty\nif($title==''||preg_match(\"/this posting/i\", $title)){\n\tcontinue;\n}\n$varstrings = substring_between($output,\">Price:<\",\"listlabel\");\n//echo \"this is the pattern\",$varstrings;\n$pattern = '/(\\$[0-9,]+(\\.[0-9]{2})?)/';\npreg_match($pattern, $varstrings, $price);\n$price = str_replace(array('\\'', ','), '', $price);\n//echo \"<b>title is:</b> \".$title;\n//echo \"<br>\";\n//echo \"<b>price is:</b> \".$price[0];\n$price=substr($price[0], 1);\n$content=substring_between($output,\"$timezone<br>\",'</table>');\n$content=substring_between($output,'>Description:<','ad-details-links');\n$content = str_replace(\"/span>\", \"\", $content);\n$content = strip_tags($content);\n\n\n$nextmonth=strtotime(\"now\")+2592000;\n$expirationdate=date( 'Y-m-d',$nextmonth);\n$content = preg_replace('/\\'/','', $content);\n$email= substring_between($email,'>','</a>');\n\n$email= html_entity_decode($email);\n\n \nif($email){\n\t$apply_online=1;\n}\nelse{\n\t$apply_online=0;\n}\n $string = $email;\n $pos = strpos($string, \"craigslist.org\");\n\t\n if ($pos === false)\n\t{\n\t\t//echo \"<br>\";\n\t\t//print \"Keyword search: Keyword not found in string! Unique email added!\n\t\t//<br />\";\n\n\t\t\n$query = \"INSERT into vivaru_ads\n(pricesort,adid,adtitle,addesc,area,email,showemail,password,code,cityid,subcatid,price,othercontactok,hits,ip,verified,abused,enabled,createdon,expireson,timestamp,paid,newsletter,user_id,reminder,urgent,adsrc,adlink)\nVALUES\n('\".$price.\"','','\".$title.\"','\".$content.\"','\".$city.\"','\".$email.\"','2','','117.198.242.244.4ab4c865b71db','\".$city.\"','\".$category.\"','\".$price.\"','',0,'','1',0,'1',NOW(),NOW()+INTERVAL 30 DAY,NOW(),'','','','','','ebay','\".$plink.\"');\n\";\n\t////echo $query;\n\t$result = mysql_query($query);\n\t$id=mysql_insert_id();\nif (!$result) {\n\tdie('Invalid query: ' . mysql_error());\n\t\t\t }\n } else \n\t\t\t\t{\n\t\tprint \"<b>----nope, this one didnt work...-----</b><br />\";\n\t\t}\n\t$address= substring_between($output,'<li> Location: ','<li> it');\n\t\n//echo \"This is the adid: \",$id;\t\n///WHATS WRONG HERE?\nforeach ($images as $image) {\t\nif(!@file_get_contents($image))\n{\n //echo 'Couldn¬¥t open image sorry!!';\n}\nelse\n{ \n$picfile = basename($image); \n$fileContent = file_get_contents($image);\nfile_put_contents('../adpics/'.$picfile, $fileContent);\n \t$sql1 = \"INSERT into vivaru_adpics (adid,picfile) VALUES ('\".$id.\"','\".$picfile.\"')\";\n \nmysql_query($sql1);\n\n}\n}\n\n}\n\tmysql_close();\n\t fclose($fh); // Added this line\n}", "function ciniki_services_jobsList($ciniki) {\n // \n // Find all the required and optional arguments\n // \n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'business_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Business'), \n 'type'=>array('required'=>'no', 'blank'=>'no', 'validlist'=>array('pastdue'), 'name'=>'Type'), \n 'status_list'=>array('required'=>'no', 'blank'=>'no', 'type'=>'idlist', 'name'=>'Status List'), \n 'assigned_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Assigned'), \n 'tracking_id_start'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Tracking ID'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n\t//\n\t// Must have type or status_list defined\n\t//\n\tif( !isset($args['type']) && !isset($args['status_list']) && !isset($args['assigned_id']) && !isset($args['tracking_id_start']) ) {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'874', 'msg'=>'Must specify a type or status list.'));\n\t}\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this business\n // \n\tciniki_core_loadMethod($ciniki, 'ciniki', 'services', 'private', 'checkAccess');\n $rc = ciniki_services_checkAccess($ciniki, $args['business_id'], 'ciniki.services.jobsList', 0, 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\t$modules = $rc['modules'];\n\n\t//\n\t// Setup the timezone offset, to get back proper UTC dates from database\n\t//\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'timezoneOffset');\n\t$utc_offset = ciniki_users_timezoneOffset($ciniki);\n\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuoteIDs');\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n\t$date_format = ciniki_users_dateFormat($ciniki);\n\n\t//\n\t// Load the list of status messages for this business\n\t//\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'services', 'private', 'statusList');\n\t$rc = ciniki_services_statusList($ciniki, $args['business_id']);\n\t$status_texts = $rc['list'];\n\n //\n\t// Get the types of customers available for this business\n\t//\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'getCustomerTypes');\n\t$rc = ciniki_customers_getCustomerTypes($ciniki, $args['business_id']);\n\tif( $rc['stat'] != 'ok' ) {\n\t\treturn $rc;\n\t}\n\t$types = $rc['types'];\n\n\t$strsql = \"SELECT ciniki_service_jobs.id, \"\n\t\t. \"ciniki_service_jobs.tracking_id, \"\n\t\t. \"ciniki_services.id AS service_id, \"\n\t\t. \"ciniki_services.name AS service_name, \"\n\t\t. \"ciniki_service_jobs.name, \"\n\t\t. \"ciniki_service_jobs.status, \"\n\t\t. \"ciniki_service_jobs.status AS status_text, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.pstart_date, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS pstart_date, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.pend_date, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS pend_date, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.date_scheduled, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS date_scheduled, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.date_started, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS date_started, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.date_due, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS date_due, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.date_completed, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS date_completed, \"\n\t\t. \"IFNULL(DATE_FORMAT(ciniki_service_jobs.date_completed, '\" . ciniki_core_dbQuote($ciniki, $date_format) . \"'), '') AS date_signedoff, \"\n\t\t. \"ciniki_customers.id AS customer_id, \"\n\t\t. \"\";\n\tif( count($types) > 0 ) {\n\t\t// If there are customer types defined, choose the right name for the customer\n\t\t// This is required here to be able to sort properly\n\t\t$strsql .= \"CASE ciniki_customers.type \";\n\t\tforeach($types as $tid => $type) {\n\t\t\t$strsql .= \"WHEN \" . ciniki_core_dbQuote($ciniki, $tid) . \" THEN \";\n\t\t\tif( $type['detail_value'] == 'business' ) {\n\t\t\t\t$strsql .= \" ciniki_customers.company \";\n\t\t\t} else {\n\t\t\t\t$strsql .= \"CONCAT_WS(' ', first, last) \";\n\t\t\t}\n\t\t}\n\t\t$strsql .= \"ELSE CONCAT_WS(' ', first, last) END AS customer_name \";\n\t} else {\n\t\t// Default to a person\n\t\t$strsql .= \"CONCAT_WS(' ', first, last) AS customer_name \";\n\t}\n\t$strsql .= \", IFNULL(u1.display_name, '') AS assigned_names \";\n\t$strsql .= \"FROM ciniki_service_jobs \"\n\t\t. \"LEFT JOIN ciniki_services ON (ciniki_service_jobs.service_id = ciniki_services.id \"\n\t\t\t. \"AND ciniki_services.business_id = '\" . ciniki_core_dbQuote($ciniki, $args['business_id']) . \"') \"\n\t\t. \"LEFT JOIN ciniki_customers ON (ciniki_service_jobs.customer_id = ciniki_customers.id \"\n\t\t\t. \"AND ciniki_customers.business_id = '\" . ciniki_core_dbQuote($ciniki, $args['business_id']) . \"') \"\n\t\t. \"LEFT JOIN ciniki_service_job_users AS ju1 ON (ciniki_service_jobs.id = ju1.job_id \"\n\t\t\t. \"AND (ju1.perms&0x04) = 0x04 \"\n\t\t\t. \") \"\n\t\t. \"LEFT JOIN ciniki_users AS u1 ON (ju1.user_id = u1.id) \"\n\t\t. \"\";\n\tif( isset($args['assigned_id']) ) {\n\t\t$strsql .= \"LEFT JOIN ciniki_service_job_users AS ju2 ON (ciniki_service_jobs.id = ju2.job_id \"\n\t\t\t. \"AND ju2.user_id = '\" . ciniki_core_dbQuote($ciniki, $args['assigned_id']) . \"' \"\n\t\t\t. \"AND (ju2.perms&0x04) = 0x04 ) \";\n\t}\n\t$strsql .= \"WHERE ciniki_service_jobs.business_id = '\" . ciniki_core_dbQuote($ciniki, $args['business_id']) . \"' \"\n\t\t. \"\";\n\tif( isset($args['type']) && $args['type'] == 'pastdue' ) {\n\t\t$strsql .= \"AND ciniki_service_jobs.status < 60 \"\n\t\t\t. \"AND ciniki_service_jobs.date_due < CURDATE() \"\n\t\t\t. \"\";\n\t} elseif( isset($args['status_list']) ) {\n\t\t$strsql .= \"AND ciniki_service_jobs.status IN (\" . ciniki_core_dbQuoteIDs($ciniki, $args['status_list']) . \") \";\n\t} elseif( isset($args['assigned_id']) ) {\n\t\t$strsql .= \"AND ju2.user_id = '\" . ciniki_core_dbQuote($ciniki, $args['assigned_id']) . \"' \";\n\t} elseif( isset($args['tracking_id_start']) ) {\n\t\t$strsql .= \"AND ciniki_service_jobs.tracking_id LIKE '\" . ciniki_core_dbQuote($ciniki, $args['tracking_id_start']) . \"%' \";\n\t} else {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'875', 'msg'=>'Must specify a type or status list.'));\n\t}\n\tif( isset($args['tracking_id_start']) ) {\n\t\t$strsql .= \"ORDER BY ciniki_service_jobs.tracking_id, customer_name, ciniki_service_jobs.status, ciniki_service_jobs.date_due \";\n\t} else {\n\t\t$strsql .= \"ORDER BY ciniki_service_jobs.status, customer_name, ciniki_service_jobs.date_due \";\n\t}\n\tciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n\t$rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.services', array(\n\t\tarray('container'=>'jobs', 'fname'=>'id', 'name'=>'job',\n\t\t\t'fields'=>array('id'=>'id', 'tracking_id', 'customer_id', 'customer_name', \n\t\t\t\t'service_name', 'name', 'status', 'status_text', \n\t\t\t\t'pstart_date', 'pend_date', \n\t\t\t\t'date_scheduled', 'date_started', 'date_due', 'date_completed', 'date_signedoff', 'assigned_names'),\n\t\t\t'lists'=>array('assigned_names'),\n\t\t\t'maps'=>array('status_text'=>$status_texts)),\n\t\t));\n\tif( $rc['stat'] != 'ok' ) {\n\t\treturn array('stat'=>'fail', 'err'=>array('pkg'=>'ciniki', 'code'=>'873', 'msg'=>'Unable to get jobs', 'err'=>$rc['err']));\n\t}\n\tif( !isset($rc['jobs']) ) {\n\t\treturn array('stat'=>'ok', 'jobs'=>array());\n\t}\n\n\treturn array('stat'=>'ok', 'jobs'=>$rc['jobs']);\n}", "public function run()\n {\n DB::table('addresses')->insert([\n 'home' => 'Car 50 # 20 -10',\n 'city_id' => 1,\n 'created_at' => now(),\n 'updated_at' => now(),\n ]);\n DB::table('addresses')->insert([\n 'home' => 'Cir 01 # 70 - 01',\n 'city_id' => 2,\n 'created_at' => now(),\n 'updated_at' => now(),\n ]);\n DB::table('addresses')->insert([\n 'home' => 'Call 80 # 80 -10',\n 'city_id' => 3,\n 'created_at' => now(),\n 'updated_at' => now(),\n ]);\n }", "public static function processJobLocations() {\n $cityStateHash = [];\n\n // Add one count for each unique location per email.\n foreach (self::$searches as $time => $search) {\n if (!is_array($search)) continue;\n if ($search['type'] != 'jobs') continue;\n if (empty($search['data']['city'])) continue;\n\n $email = $search['email'];\n $location = strtolower($search['data']['city']);\n\n // Location to geocode, to City, State.\n $geocode = GeocodeModel::get($location);\n if (is_null($geocode)) continue;\n $cityState = strtolower(getCityStateFromGeocode($geocode));\n\n if (isset($cityStateHash[$cityState])) {\n if (isset($cityStateHash[$cityState]['email'][$email])) continue;\n $cityStateHash[$cityState]['email'][$email] = true;\n $cityStateHash[$cityState]['count'] ++;\n } else {\n $cityStateHash[$cityState] = [\n 'email' => [$email => true],\n 'count' => 1\n ];\n }\n }\n\n // Extract counts.\n $cityStateCounts = [];\n foreach ($cityStateHash as $cityState => $data) {\n $cityStateCounts[$cityState] = $data['count'];\n }\n\n arsort($cityStateCounts);\n return $cityStateCounts;\n }", "public function run()\n {\n DB::table('cities')->insert([\n ['city' => 'Brasília', 'state' => 'DF'],\n ]);\n\n $this->command->info('Distrito Federal cities imported!');\n }", "function invoke()\r\n\t{\r\n\t\t// get the list of addresses\r\n\t\t$results = $this->getAddresses();\r\n\t\t\r\n\t\t$coords = array();\r\n\t\techo \"<b>Imported and Geocoded address list:</b><br><br>\r\n\t\t\r\n\t\t<table class='table table-bordered' style='width:100%;'>\r\n\t\t\t\t<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th>Address</th>\r\n\t\t\t\t\t<th>Lat/Lng</th>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<th>Status</th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</thead>\r\n\t\t\t\t<tbody>\";\r\n\t\t\t\t\r\n\t\twhile ($row = mysql_fetch_array($results))\r\n\t\t{\r\n\t\t\t// escape the data recursively\r\n\t\t\tarray_walk($row, array($this, 'mysql_escape'));\r\n\t\t\t\r\n\t\t\t// if there is a # sign for a suite number, ignore it (google has problems with these), otherwise use the address\r\n\t\t\tif (strpos($row['address'], '#'))\r\n\t\t\t{\r\n\t\t\t\t$addresses = explode('#',$row['address']);\r\n\t\t\t\t$address = $addresses[0];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$address = $row['address'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// concatenate an address line for geolocation using commas\r\n\t\t\t//$addressline = $address . ', ' . $row['city'] . ', ' . $row['state'] . ', ' . $row['zip'];\r\n\t\t\t$addressline = $address;\r\n\t\t\t\r\n\t\t\t// ship it off to google\r\n\t\t\t$coords = $this->geolocate($addressline);\r\n\t\t\t\r\n\t\t\t// update the database with the coordinates\r\n\t\t\t$this->updatedb($coords['lat'], $coords['lng'], $row['address']);\r\n\t\t}\r\n\t\t\r\n\t\techo \"</tbody></table>\";\r\n\t}", "public function runCron(){\n// $q = 'SELECT * FROM `Intermediair`';\n $q = 'SELECT * FROM `Intermediair` WHERE userid = 11529';\n $res = $this->cmsmanager->customSelectQuery($q)[0];\n $this->generateEmail($res);\n \n// if(count($res) > 0){\n// foreach($res as $intermediair){\n// $this->generateEmail($intermediair);\n// }\n// }\n }", "public function run()\n {\n $jobtypes = ['正社員','契約社員','アルバイト'];\n foreach ($jobtypes as $jobtype) {\n DB::table('jobtypes')->insert(['jobtype'=>$jobtype]);\n }\n }", "function crawl($result){\n foreach ($result as $row) {\n // crawl business, load all to db: business, inspection, violation tables\n $newBusiness = $this->scrapeBusinessPage($row['ahs_id']);\n //check if business is in db and insert if not\n $bResult = Data::selectBusinessByAHSID($newBusiness->getAHSID());\n if(empty($bResult)){\n Data::insertBusiness($newBusiness->getAHSID(),\n $newBusiness->getName(),\n $newBusiness->getType(),\n $newBusiness->getAddress(),\n $newBusiness->getPhone(),\n $newBusiness->getPermitHolder());\n }else{\n echo 'business: ' . $newBusiness->getName() . ' already in DB \\n';\n }\n //Loop through inspections adding them and the violations to the DB\n foreach ($newBusiness->getInspectionsArray() as $inspection) {\n //format date to date object\n date_default_timezone_set('America/Denver');\n $date = new DateTime($inspection->getDate());\n $newDate = $date->format('Y-m-d');\n //query inspection table to check if it is already there\n $inspectionIsHere = Data::selectInspection($newBusiness->getAHSID(), $newDate);\n if(!$inspectionIsHere){\n Data::insertInspection($newBusiness->getAHSID(),\n $newDate,\n $inspection->getType(),\n $inspection->getAction());\n //insert the violations\n foreach ($inspection->getViolations() as $violation) {\n Data::insertViolation($newBusiness->getAHSID(),\n $violation->getName(),\n $violation->getRequirement(),\n $violation->getComment(),\n $violation->getCritical());\n }\n }else{\n echo 'Inspection ' . $newBusiness->getName() . '/' . $inspection->getDate() . ' already in db \\n';\n }\n }\n }\n }", "private function scheduleStarmapJobs(): void\n {\n $this->schedule\n ->command(DownloadStarmap::class, ['--import'])\n ->monthly();\n }", "public static function get_jobs($args) {\n require_once 'Careerjet_API.php';\n $args = self::format_args(wp_parse_args($args, self::get_default_args()));\n \n $api = new Careerjet_API('en_GB') ;\n \n $transient_name = 'careerjet_' . md5(json_encode($args));\n \n if (false === ( $results = get_transient($transient_name) )) {\n $results = array();\n $result = $api->search($args);\n \n if ($result->type == 'JOBS') {\n $num_jobs = $result->hits;\n $total_pages = $result->pages;\n $results = $result->jobs;\n\n if (!empty($results)) {\n set_transient($transient_name, $results, 1800);\n }\n }\n }\n\n return $results;\n }", "public function run()\n\t{\n\t\t$faker = Faker::create('es_ES');\n\n\t\tforeach(range(1, 500) as $index)\n\t\t{\n\t\t\t\\DB::table('companies')->insert(array(\n\t\t\t\t'user_id' => $faker->numberBetween(1,30),\n\t\t\t\t'company_name' => $faker->company,\n\t\t\t\t'ruc' => $faker->numberBetween(1111111111,9999999999),\n\t\t\t\t'tax_address' => $faker->address,\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'lastname' => $faker->lastname,\n\t\t\t\t'relationship' => $faker->word,\n\t\t\t\t'email' => $faker->email,\n 'office_phone' => $faker->phoneNumber,\n 'phone' => $faker->phoneNumber,\n\t\t\t\t'web' => $faker->domainName,\n\t\t\t\t'country' => $faker->country,\n\t\t\t\t'observations' => $faker->text($maxNbChars = 200),\n 'client' => $faker->numberBetween(0,1),\n\t\t\t\t'provider' => $faker->numberBetween(0,1),\n\t\t\t));\n\t\t}\n\n\t}", "public function run()\n {\n $items = $this->getPaysFromCsv();\n foreach($items as $item){\n DB::table('countries')->insert([\n 'code_2' => $item[0],\n 'code_3' => $item[1],\n 'title' => utf8_encode($item[2]),\n 'content' => utf8_encode($item[3]),\n 'prefixPhone' => $item[4],\n 'created_at' => date(\"Y-m-d H:i:s\"),\n ]);\n }\n }", "protected function importFromSearch()\n {\n $api = $this->_getSearchAPI();\n\n for ($i = 1; $i <= self::MAX_PAGES; $i++) {\n Minion_CLI::write(\"Searching page $i...\");\n\n $response = $api->find(self::SEARCH_TERM, array('start_page' => $i));\n $results = $response['repositories'];\n $this->_saveResults($results);\n\n if (count($results) < self::PER_PAGE) {\n break;\n }\n }\n\n Minion_CLI::write('Finished.');\n }", "public function populateJobTables() {\n\t\t$scrapeLog = $this->addLog(JOB_CATEGORY_TABLE);\n\t\t\n\t\t$jobCategories = $this->jobCategoryRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . JOB_CATEGORY_PATH);\n\t\tforeach($jobCategories as $jobCategory) {\n\t\t\t$this->jobCategoryRepository->add($jobCategory);\n\t\t\t\n\t\t\t$this->jobGroupRepository->populateJobTables(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . JOB_GROUP_PATH . $jobCategory->getJobCategoryId(), $jobCategory->getJobCategoryId());\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}", "public function startCron()\n {\n // mysql call\n $resultToNum = $this->getFailedDndNumbers();\n if(empty($resultToNum)){\n echo \"empty to number from db\\n\";\n return;\n }\n echo \"to number from mysql\\n\".print_r($resultToNum,true);\n $file = fopen(\"to_numbers.csv\",\"a\");\n $resultToNum = json_decode(json_encode($resultToNum), true);\n $temp = array();\n foreach ($resultToNum as $key => $value) {\n foreach ($value as $key => $to) {\n fwrite($file,substr($to,-10).\"\\n\");\n $temp[] = $to;\n break;\n }\n break;\n }\n fclose($file);\n $resultToNum = $temp;\n // redis call\n $redisNum = $this->connectToRedis();\n foreach ($resultToNum as $index => $number) {\n $this->addNumberToJfk($redisNum,$number,0);\n }\n }", "public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'My Company',\n 'address' => '2283 Poling Farm Road',\n ]);\n\n DB::table('companies')->insert([\n \t'name' => 'Google',\n \t'address' => '1940 Crowfield Road',\n ]);\n\n DB::table('companies')->insert([\n 'name' => 'Twitter',\n 'address' => '4737 Williams Lane',\n ]);\n \n }", "public static function GET_MAIL_JOBS(){\n\t $SQL_String = \"SELECT * FROM system_mailer WHERE _status_code=0 AND _keep=1 AND _mail_date=:mail_date;\";\n\t return $SQL_String;\n\t}", "public function jobAction()\n {\n $context = $this->_helper->ajaxContext()->getCurrentContext();\n $request = $this->getRequest();\n if ($request->isPost()) {\n $this->view->status = \"error\";\n if ($this->isCsrfTokenValid()) {\n\n // get the search data\n $post = $request->getPost();\n\n // search for matching jobs\n $this->view->categories = $this->Search->job($this->_getSubdomain(), $post['value']);\n $this->view->status = \"success\";\n\n } else {\n $this->view->status = \"error\";\n }\n }\n\n // redirect if not using the json context\n if ($context != 'json') {\n $this->_redirect('/');\n }\n }", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "public function bulk($jobs, $data = '', $queue = null);", "public function getJobs();", "public function getJobs();", "public function run()\n {\n DB::table('jobs')->insert([\n [\n 'employer_id' => '1',\n 'status' => 'open',\n 'category_id' => '1',\n 'job_title' => 'demo title',\n 'description' => 'this is description',\n 'salary_type' => 'per month',\n 'occupation' => 'laravel developer',\n 'education' => 'BSAC',\n 'experience' => '3 Year',\n ],\n [\n 'employer_id' => '1',\n 'status' => 'open',\n 'category_id' => '2',\n 'job_title' => 'demo title 2',\n 'description' => 'this is description',\n 'salary_type' => 'per month',\n 'occupation' => 'php developer',\n 'education' => 'SE',\n 'experience' => '2 Year',\n ],\n ]);\n }", "function scrape_detailed_page($pdo, $scrape_page, $job_portal, $counter)\n\t{\n\t\t$website_page_contents = getURLContents($scrape_page);\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Industry\n\t\t$get_start = '<span class=\"job-type__value\">';\n\t\t$get_end = '</span>';\n\t\t\n\t\t$pos = strpos($website_page_contents, $get_start);\n\t\tif ($pos !== false) {\n\t\t\t$website_page_contents_modified = substr_replace($website_page_contents, \"\", $pos, strlen($get_start));\n\t\t}\n\n\t\tif(strpos($website_page_contents_modified, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents_modified, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents_modified, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\t\t\t\n\t\t\t$job_industry = trim(substr($website_page_contents_modified, $select_pos_start, $select_length));\n\t\t\t$job_industry = str_replace('<dd class=\"col-sm-6\">', \"\", $job_industry);\n\t\t\t$job_industry = trim($job_industry);\n\t\t\t\n\t\t\t//print_r($job_industry.\"\\r\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$job_industry = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Title\n\t\t$get_start = '<h1 class=\"details-header__title \">';\n\t\t$get_end = '</h1>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\t\t\t\n\t\t\t$output_jobTitle = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_jobTitle = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Description\n\t\t$get_start = '<div class=\"details-body__content content-text\">';\n\t\t$get_end = '<h3 class=\"details-body__title\">';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_jobDescription = strip_tags(trim(substr($website_page_contents, $select_pos_start, $select_length)));\n\t\t\t$output_jobDescription = addslashes(trim(strip_tags($output_jobDescription)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_jobDescription = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Email\n\t\t$extractedEmail = extract_email_address($output_jobDescription);\n\t\t$extractedPhone = extract_phone($output_jobDescription);\n\n\t\t$output_email = (!empty($extractedEmail)) ? json_encode($extractedEmail) : NULL;\n\t\t\n\t\t// Phone\n\t\t$output_phone = (!empty($extractedPhone)) ? json_encode($extractedPhone) : NULL;\n\t\t\n\t\t// -------------------------------------\n\t\t// Career Level\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_careerLevel = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_careerLevel = str_replace('<br>', \"\", $output_careerLevel);\n\t\t\t$output_careerLevel = trim($output_careerLevel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_careerLevel = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Employment Type\n\t\t$get_start = '<span class=\"job-type__value\">';\n\t\t$get_end = '</span>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_employmentType = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_employmentType = str_replace('<br>', \"\", $output_employmentType);\n\t\t\t$output_employmentType = trim($output_employmentType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_employmentType = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Minimum Work Experience\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_MinWorkExperience = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_MinWorkExperience = str_replace('<br>', \"\", $output_MinWorkExperience);\n\t\t\t$output_MinWorkExperience = trim($output_MinWorkExperience);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_MinWorkExperience = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Minimum Education Level\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_MinEducationLevel = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_MinEducationLevel = str_replace('<br>', \"\", $output_MinEducationLevel);\n\t\t\t$output_MinEducationLevel = trim($output_MinEducationLevel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_MinEducationLevel = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Monthly Salary Range\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_monthlySalaryRange = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_monthlySalaryRange = str_replace('<br>', \"\", $output_monthlySalaryRange);\n\t\t\t$output_monthlySalaryRange = trim($output_monthlySalaryRange);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_monthlySalaryRange = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Location\n\t\t$get_start = '<li class=\"listing-item__info--item listing-item__info--item-location\">';\n\t\t$get_end = '</li>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_location = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_location = str_replace('<br>', \"\", $output_location);\n\t\t\t$output_location = trim($output_location);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_location = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Name\n\t\t$get_start = '<li class=\"listing-item__info--item listing-item__info--item-company\">';\n\t\t$get_end = '</li>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_companyName = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_companyName = trim($output_companyName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyName = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Overview\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t\n\t\t\t$output_companyOverview = substr($website_page_contents, $select_pos_start, $select_length);\n\t\t\t$output_companyOverview = addslashes(trim(strip_tags($output_companyOverview)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyOverview = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Logo\n\t\t$get_start = '<img class=\"profile__img profile__img-company\" src=\"';\n\t\t$get_end = '\"';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_companyLogo = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_companyLogo = trim($output_companyLogo);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyLogo = '';\n\t\t}\n\t\t\t\n\t\t// -------------------------------------\n // Job Date Posted\n $get_start = '<li class=\"listing-item__info--item listing-item__info--item-date\">';\n\t\t$get_end = '</li>';\n \n if(strpos($website_page_contents, $get_start) > strlen($get_start))\n { \n $select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n $select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n $select_length = $select_pos_end - $select_pos_start;\n \n $output_jobDatePosted = trim(substr($website_page_contents, $select_pos_start, $select_length));\n $output_jobDatePosted_array = explode(\"/\", $output_jobDatePosted);\n\t\t\t\n\t\t\t$output_jobDatePosted = $output_jobDatePosted_array[2].'-'.$output_jobDatePosted_array[1].'-'.$output_jobDatePosted_array[0];\n\t\t\t\n\t\t\t//print_r($output_jobDatePosted.\"\\r\");\n }\n\t\telse\n\t\t{\n\t\t\t$output_jobDatePosted = '';\n\t\t}\n\t\t\n\t\t\n\t\t$output_industry = $job_industry;\n\t\t$output_role = \"\";\n\t\t$output_keyword_skill = \"\";\n\t\t\n\t\t// -------------------------------------\n\t\t\n\t\t\n\t\t//echo '</br>'.$scrape_page;\n\t\t\n\t\t\n\t\t//echo '</br>'.$output_industry.' - '.$output_jobTitle.' - '.$output_jobDescription.' - '.$output_careerLevel.' - '.$output_employmentType.' - '.$output_MinWorkExperience.' - '.$output_MinEducationLevel.' - '.$output_monthlySalaryRange.' || '.$output_location.' || '.$output_companyName. ' - '.$output_jobDatePosted;\n\t\t\n\t\t// --------------------------------------------\n\t\tinsertDBJobDetails(\n\t\t\t\t\t\t\t$pdo,\n\t\t\t\t\t\t\t$job_portal, \n\t\t\t\t\t\t\t$output_industry, \n\t\t\t\t\t\t\t$scrape_page, \n\t\t\t\t\t\t\t$output_jobTitle, \n\t\t\t\t\t\t\t$output_jobDescription, \n\t\t\t\t\t\t\t$output_careerLevel, \n\t\t\t\t\t\t\t$output_employmentType, \n\t\t\t\t\t\t\t$output_MinWorkExperience, \n\t\t\t\t\t\t\t$output_MinEducationLevel, \n\t\t\t\t\t\t\t$output_monthlySalaryRange, \n\t\t\t\t\t\t\t$output_location,\n\t\t\t\t\t\t\t$output_companyName,\n\t\t\t\t\t\t\t$output_companyOverview,\n\t\t\t\t\t\t\t$output_jobDatePosted,\n\t\t\t\t\t\t\t$output_email,\n\t\t\t\t\t\t\t$output_phone,\n\t\t\t\t\t\t\t$output_companyLogo,\n\t\t\t\t\t\t\t$output_role,\n\t\t\t\t\t\t\t$output_keyword_skill\n\t\t\t\t\t\t\t);\n\t\t// --------------------------------------------\n\t\t\n\t}", "public function run()\n {\n foreach ($this->counties as $index => $county)\n {\n $result = \\App\\Models\\Counties::create($county);\n if (!$result) {\n $this->command->info(\"Insert failed at record $index.\");\n return;\n }\n }\n $this->command->info('Inserted '.count($this->counties). ' records');\n }", "public function run()\n {\n $locations = array('Aberdeen', \n 'Barsnley',\n 'Basildon',\n 'Belfast',\n 'Birmingham',\n 'Blackburn',\n 'Blackpool',\n 'Bolton',\n 'Bournmouth',\n 'Bradford',\n 'Brighton',\n 'Bath',\n 'Bristol',\n 'Bury',\n 'Cambridge',\n 'Cardiff',\n 'Chelmsford',\n 'Coventry',\n 'Derby',\n 'Doncaster',\n 'Dudley',\n 'Edinburgh',\n 'Glasgow',\n 'Leeds',\n 'Leicester',\n 'Liverpool',\n 'London',\n 'Manchester',\n 'Middlesbrough',\n 'Milton Keynes',\n 'North Tyneside',\n 'Nottingham',\n 'Peterborough',\n 'Plymouth', \n 'Portsmouth',\n 'Rochdale',\n 'Salford',\n 'Sandwell',\n 'Sheffield',\n 'Southampton',\n 'Sunderland',\n 'Swansea',\n 'Warrington',\n 'Wigan',\n 'York');\n\n \tforeach($locations as $location){\n DB::table('locations')->insert([\n 'location' => $location\n ]);\n }\n }", "public function run()\n {\n foreach (range(1, 10000) as $i) {\n $contact = new Contact();\n\n $contact->email = \"test1300{$i}@example.com\";\n $contact->list_id = 1;\n $contact->save();\n\n // $contact->refresh();\n }\n }", "function action_copyjobs() {\n if ($data = data_submitted()) {\n foreach ($data as $key => $value) {\n if (strpos($key, 'schedule_') === 0) {\n $scheduleid = (int)substr($key, strlen('schedule_'));\n if ($this->can_do_schedule_action($scheduleid)) {\n block_php_report_copy_schedule_instance($scheduleid);\n }\n }\n }\n }\n\n //re-display the list of scheduled jobs for this report\n $this->action_listinstancejobs();\n }", "public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'Моя компания',\n 'requisites' => json_encode(array(\n \t'address' => 'Адрес',\n \t'phone' => '8(3952)000-000'\n ))\n ]);\n }", "function centralCrawlFullAssault(){\n //look for new businesses and update the business IDs in businessAHSID table\n $this->updateAHSIDs();\n //get an array of IDs from the businessAHSID table we just updated\n $result = Data::selectAHSIDs();\n //Crawl each business in our table\n $this->crawl($result);\n }", "public function shopifyCronJob(){\n $this->load->model('Projects_model');\n $projects = $this->db->select('*')->from('projects')->where_in('connection_type',[1,3])->get()->result_array();\n $this->updateArticleInShopify();\n if(!empty($projects)){\n foreach ($projects as $p_key => $p_value) {\n $projectId = $p_value['id'];\n if($this->Projects_model->getValue('cms', $projectId)!='shopify')\n continue;\n $enabled = $this->Projects_model->getValue('enabled', $projectId);\n // check if the last execution time is satisfy the time checking.\n if($enabled == '1'){\n if($p_value['erp_system'] == 'exactonline') {\n $this->importArticleFromExact($projectId);\n $this->importCustomerFromExact($projectId);\n }\n }\n }\n } \n }", "public function getJobsInfo(){ return $this->APICallSub( '/jobs', '', \"Couldn't lookup the job list\" ); }", "public function searchForCronEntry($search_term)\r\n {\r\n //echo \"Search for Cron Entry<br>\";\r\n exec('crontab -l', $cron_contents_raw);\r\n $cron_contents = implode(PHP_EOL, $cron_contents_raw);\r\n $cron_contents_html = implode(\"<br>\", $cron_contents_raw);\r\n //echo $cron_contents_raw[0].\"<br>\";\r\n //echo $cron_contents_raw[1].\"<br>\";\r\n echo \"foreach loop<br>\";\r\n foreach ($cron_contents_raw as $cron_line)\r\n {\r\n echo $cron_line.\"<br>\";\r\n }\r\n echo \"for loop<br>\";\r\n /* for ($x = 0; $x < count($cron_contents_raw); $x++) {\r\n echo \"[Line \".$x.\"] \".$cron_contents_raw[$x].\"<br>\";\r\n } */\r\n for ($x = 0, $size = count($cron_contents_raw); $x < $size; $x++)\r\n {\r\n echo \"[Line \".$x.\"] \".$cron_contents_raw[$x].\"<br>\";\r\n if (strpos($cron_contents_raw[$x], $search_term))\r\n {\r\n $found_line = $x;\r\n }\r\n }\r\n //echo $cron_contents.\"<br>\";\r\n //echo $cron_contents_html.\"<br>\";\r\n return $found_line;\r\n }", "public function getAllJobsBySubdomain($subdomain)\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n\n // restrict searches by the subdomain\n $queryStr = '+subdomain:(' . $subdomain . ')';\n\n // perform the query\n return $this->index->find($queryStr);\n }", "public function run()\n {\n $counties = ['Harju Maakond', 'Pärnu Maakond', 'Tartu Maakond'];\n foreach($counties as $name) {\n $county = new \\App\\County();\n $county->county = $name;\n $county->save();\n }\n }", "public function existenceCheck() {\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\t$jobs = array();\n\t\t$this->out(sprintf(__('* %d records to process'), count($packages)));\n\t\tforeach ($packages as $package) {\n\t\t\t$jobs[] = new PackageExistsJob($package);\n\t\t}\n\n\t\tif (!empty($jobs)) {\n\t\t\t$this->CakeDjjob->bulkEnqueue($jobs, 'default');\n\t\t}\n\n\t\t$this->out(sprintf(__('* Enqueued %d jobs'), count($jobs)));\n\t}", "public function run()\n {\n $company = \\App\\Models\\Company::where('subdomain', 'Goudzwaard')->get();\n if ($company->isEmpty()) {\n DB::table('companies')->insert([\n 'name' => 'Aperture Laboratories',\n 'subdomain' => 'aperture',\n 'email' => '[email protected]',\n 'address' => '-',\n 'phonenumber' => '-'\n ]);\n }\n }", "public function run()\n {\n DB::table('companies')->insert([\n 'name' => 'Ciceros hårvårdsateljé',\n 'address' => 'Borgaregatan 15',\n 'postal_code' => '41666',\n 'lat' => '57.708956',\n 'lng' => '11.973102',\n 'hair' => 1,\n 'nails' => 0,\n 'dental' => 0,\n 'tattoo' => 0,\n 'city' => 'Göteborg',\n 'tel' => '0704903063',\n 'mail' => '[email protected]',\n 'show_stylists' => 1,\n 'password' => '$2y$10$jjuwArwnBlBlk7dWmEJxQeFi8JGfE7roxMoqSvQEF64arVQIx1jaS'\n ]);\n }", "public function run(){\n ini_set('memory_limit', '-1');\n /*\n // REGULAR AUTHOR BATCH PROCESSING\n // Load authors names in csv file to the DB\n (new PopulateAuthorList())->populate($this->authorsToSeachCsvFilePath);\n \n // process authors added\n (new ExtractAcademicsData())->processBatch();\n \n */\n (new StatsDao())->calculateStats();\n }", "public function testCronJobSearchConfig()\n {\n $sql = 'SELECT count(*) FROM s_crontab';\n $totalCronJobCount = Shopware()->Db()->fetchOne($sql);\n\n // Test the search\n $this->checkGetTableListSearch('a', $totalCronJobCount, 'cronJob');\n\n $this->reset();\n\n // Test the search with a pagination\n $this->checkGetTableListSearchWithPagination('a', 'cronJob');\n }", "function print_ua_faculty_jobs( $args = array() ) {\n\n\t// Set up the arguments\n\t$defaults = array(\n\t\t'keywords' => NULL,\n 'highlight_keywords' => true,\n 'show_all' => true,\n\t);\n\n\t// Parse the args\n\t$args = wp_parse_args( $args, $defaults );\n\textract( $args, EXTR_OVERWRITE );\n\n\t// Clean up the keywords\n\tif ( ! empty( $keywords ) ) {\n\n\t\t// Make sure $keywords is an array\n\t\tif ( ! is_array( $keywords ) )\n\t\t\t$keywords = explode( ',', $keywords );\n\n\t\t// Clean up the array\n\t\t$keywords = array_map( 'trim', $keywords );\n\n\t}\n\n // Setup gather args\n $gather_args = array(\n 'keywords' => $show_all ? NULL : $keywords,\n );\n\n\t// Get the jobs\n\tif ( ! ( $jobs = gather_ua_faculty_jobs( $gather_args ) ) ) {\n\n\t\t?><p><em><?php _e( 'There are no faculty jobs at this time.', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></em></p><?php\n\t\treturn;\n\n\t}\n\n\t// Sort jobs by keyword first\n\t$keyword_jobs = array();\n\t$nonkeyword_jobs = array();\n\tforeach ( $jobs as $job ) :\n\n\t\t// Search title and content for keywords\n\t\tif ( ! empty( $keywords ) && is_array( $keywords ) ) :\n\n\t\t\t// Create the search regex\n\t\t\t$search_regex = '/(' . implode( '|', $keywords ) . ')/i';\n\n\t\t\t// Create the regex\n\t\t\t$replace_regex = '/(' . implode( '|', $keywords ) . ')/i';\n\n\t\t\t// Keyword exist?\n\t\t\t$keyword_exist = false;\n\n\t\t\t// Keywords in the title?\n\t\t\tif ( preg_match( $search_regex, $job->title ) ) {\n\n\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $job->title = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $job->title );\n\n\t\t\t}\n\n\t\t\t// Keywords in the author?\n\t\t\tforeach( $job->authors as $author ) {\n\n\t\t\t\t// Search the name\n\t\t\t\tif ( isset( $author->name ) && preg_match( $search_regex, $author->name ) ) {\n\n\t\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $author->name = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $author->name );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Keywords in the content?\n\t\t\tif ( preg_match( $search_regex, $job->content ) ) {\n\n\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $job->content = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $job->content );\n\n\t\t\t}\n\n\t\t\t// Add to the top of the list\n\t\t\tif ( $keyword_exist ) {\n\n\t\t\t\t$keyword_jobs[] = $job;\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\tendif;\n\n\t\t// Add everything else to the end fo the list\n\t\t$nonkeyword_jobs[] = $job;\n\n\tendforeach;\n\n\t?><ul class=\"ua-faculty-jobs\"><?php\n\n\t\tforeach( array( 'keyword-jobs' => $keyword_jobs, 'nonkeyword-jobs' => $nonkeyword_jobs ) as $job_list => $job_list_jobs ) :\n\t\t\tforeach( $job_list_jobs as $job ) :\n\n // Assign classes\n $job_item_classes = array( $job_list );\n\n // Highlight job items if 'highlight_keywords' is true\n if ( $highlight_keywords && 'keyword-jobs' == $job_list )\n $job_item_classes[] = 'highlight';\n\n\t\t\t?><li class=\"<?php echo implode( ' ', $job_item_classes ); ?>\">\n\t\t\t\t<span class=\"title\"><a href=\"<?php echo esc_url( $job->permalink ); ?>\" target=\"_blank\"><?php _e( $job->title, GATHER_UA_JOBS_TEXT_DOMAIN ); ?></a></span>\n\t\t\t\t<ul>\n\t\t\t\t\t<li class=\"published\"><strong><?php _e( 'Published:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php echo $job->published->format( 'F j, Y \\a\\t g:i a' ); ?></li><?php\n\n\t\t\t\t\t\tif ( $job->published != $job->updated ) {\n\t\t\t\t\t\t\t?><li class=\"updated\"><strong><?php _e( 'Updated:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php echo $job->updated->format( 'F j, Y \\a\\t g:i a' ); ?></li><?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t?><li class=\"authors\"><strong><?php _e( 'Authors:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php\n\n\t\t\t\t\t\t// Build author name array\n\t\t\t\t\t\t$author_names = array();\n\t\t\t\t\t\tforeach( $job->authors as $author ) {\n\t\t\t\t\t\t\tif ( isset( $author->name ) )\n\t\t\t\t\t\t\t\t$author_names[] = $author->name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Print author names\n\t\t\t\t\t\techo ! empty( $author_names ) ? implode( ', ', $author_names ) : NULL;\n\n\t\t\t\t\t?></li>\n\t\t\t\t\t<li class=\"content\"><strong><?php _e( 'Description:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php _e( $job->content, GATHER_UA_JOBS_TEXT_DOMAIN ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</li><?php\n\n\t\t\tendforeach;\n\t\tendforeach;\n\n\t?></ul><?php\n\n}", "public function run()\n {\n DB::table('job_description')->insert([\n 'title'=> 'Android Developer',\n 'ex_from' => '0',\n 'ex_to'=>'3',\n 'opening'=>'5',\n 'ctc'=>'3'\n\n ]);\n DB::table('job_description')->insert([\n 'title'=> 'PHP Developer',\n 'ex_from' => '0',\n 'ex_to'=>'3',\n 'opening'=>'5',\n 'ctc'=>'3'\n\n ]);\n DB::table('job_description')->insert([\n 'title'=> 'Python Developer',\n 'ex_from' => '0',\n 'ex_to'=>'3',\n 'opening'=>'5',\n 'ctc'=>'3'\n\n ]);\n\n \n }", "function check(){\n\techo \"Looking for jobs and adding to queue\\n\";\n\t\n\t$times = date('d-M-Y');\n\tif(DEBUG) $qlog = new snowytech\\stphplogger\\logWriter('../logs/check-queue-' . $times . '.txt');\n\t$check = new snowytech\\stphpschedule\\schedule();\n\t//Goes through whole Jobs table and checks interval!\t\n\t$db = db::getInstance();\n\t$sql = \"SELECT * FROM JOBS\";\n\t$stmt = $db->getData($sql);\n\n\t//Count the rows and send console message there are no jobs configured.\n\tif ( count($stmt) > 0) {\n\t\tforeach($stmt as $row){\n\t\t\t$id = $row['id'];\n\t\t\t$job_name = $row['name'];\n\t\t\t$path = $row['path'];\n\t\t\t$in_queue = $row['status_int'];\n\t\t\t$lastrun = $row['last_run'];\n\t\t\t$interval = $row['interval'];\n\t\t\t$global_hold = $row['global_hold'];\n\t\t\t\n\t\t\t$r = $check->interval($lastrun, $interval);\n\t\t\t\n\t\t\t//Dont run if global hold is set to 1\n\t\t\tif($global_hold !=1){\n\t\t\t\t//Dont run if $in_queue = 0 ( already in queue )\n\t\t\t\tif($in_queue != 0){\n\t\t\t\t\tif( $r ) {\n\t\t\t\t\t\techo \"Job hit the queue: \" . $job_name . \"\\n\";\n\t\t\t\t\t\t$count = time();\n\t\t\t\t\t\techo $count . \"\\n\";\n\t\t\t\t\t\tif(DEBUG) $qlog->info('Job hit the queue: ' . $job_name . \" : time: \" . $count);\n\t\t\t\t\t\t \n\t\t\t\t\t\t//Now last update is updating in table. Need to add an entry to the QUE and update last run from there.\t\t\t\t\n\t\t\t\t\t\t$data = array(':jid' => $id, ':path' => $path, ':hold' => '1', ':time' => $count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Add into QUEUE\n\t\t\t\t\t\t$sql= 'INSERT INTO QUEUE (job_id, path, hold, in_que_time) VALUES (:jid,:path,:hold,:time)';\n\t\t\t\t\t\t$db->execQuery($sql, $data);\n\n\t\t\t\t\t\t//update status_int, prevents multiple entries into queue\n\t\t\t\t\t\t$sql= \"UPDATE JOBS SET status_int = 0 WHERE id = '$id'\";\n\t\t\t\t\t\t$db->updateData($sql);\n\t\t\t\t\t}else{ \n\t\t\t\t\t\techo \"NOT ready to run - \" . $job_name . \"\\n\"; \n\t\t\t\t\t\t//Log that its intervnal is not ready\n\t\t\t\t\t\tif(DEBUG) $qlog->info('NOT RUN - interval is ' . $interval . \" minutes on JOB: \" . $job_name . \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else { \n\t\t\t\t\techo \"JOB \" . $job_name . \" - already in QUEUE!\\n\"; \n\t\t\t\t\tif(DEBUG) $qlog->info('JOB ' . $job_name . \" - already in QUEUE!\");\n\t\t\t\t}\n\t\t\t} else { \n\t\t\t\techo \"JOB \" . $job_name . \" is HELD globally!\\n\";\n\t\t\t\tif(DEBUG) $qlog->info(\"JOB \" . $job_name . \" is HELD globally!\\n\");\n\t\t\t}\n\t\t}\n\t} else { echo \"There are no JOBS configured!\"; }\n\t$db->closeDB();\n}", "public function run()\n {\n for ($i=0; $i <= 1000000 ; $i++) { \n DB::table('companies')->insert(\n ['company_name' => 'hieutm',\n 'company_web' => 'aaa.com',\n 'company_address' => 'TDC',\n 'company_code' =>'281',\n 'company_phone' => '12345']\n );\n }\n }", "public function scrape($dom) {\n\n\t\t$job = new Job();\n\n\t\tif ($dom->find('td.fld')) {\n\t\t\tif ($dom->find('td.tdsubhead')) {\n\t\t\t\tif ($dom->find('td.tdcontent')){\n\n\t\t\t\t\t//Get foreign id\n\t\t\t\t\tforeach($dom->find('td.tdcontent') as $Link) {\t\t\t\t\t\t\n\t\t\t\t\t\t$str = substr(strrchr($Link->plaintext, ':'), 1);\n\t\t\t\t\t\t$job->setForeignId('ams_at_'.trim($str));\n\t\t\t\t\t}\n\n\t \t\t\t//Get job title\n\t\t\t\t\tforeach($dom->find('td.tdsubhead') as $Jobtitle) {\n\t\t\t\t\t\tif ($Jobtitle->plaintext == \"Berufsgruppe:\") {\n\t\t\t\t\t\t\t$job->setJobTitle($Jobtitle->next_sibling()->plaintext);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//Get job description\n\t\t\t\t\tforeach($dom->find('td.tdcontent') as $DESCRIPTION) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ($DESCRIPTION->find('script') as $ret) {\n\t\t\t\t\t\t\t$ret->innertext = '';\n\t\t\t\t\t\t\t$ret->outertext = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($DESCRIPTION->find('img') as $ret3) {\n\t\t\t\t\t\t\t$ret3->innertext = '';\n\t\t\t\t\t\t\t$ret3->outertext = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$job->setDescription(utf8_encode($DESCRIPTION->innertext));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = date('Y-m-d');// current date\n\t\t\t\t\t$date = strtotime('+1 week', strtotime($date));\n\t\t\t\t\t$newdate = date ( 'Y-m-j' , $date);\n\n\t\t\t\t\t$outputDate = $newdate.\"T\".date(\"h:i\").\":00Z\";\n\t\t\t\t\t$job->setExpireDate($outputDate);\n\n\n\t\t\t\t\tif (count($dom->find('td.tdsubhead')) < 1) {\n\t\t\t\t\t\t$job->addJobLocation(\"Austria\", false, false, 273621);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach ($dom->find('td.tdsubhead') as $LOCATION) {\n\t\t\t\t\t\t\tif ($LOCATION->plaintext == \"Arbeitsort:\") {\n\t\t\t\t\t\t\t\tif (strlen(trim($LOCATION->next_sibling()->plaintext)) === 0) {\n\t\t\t\t\t\t\t\t\t$job->addJobLocation(\"Austria\", false, false, 273621);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$job->addJobLocation(trim($LOCATION->next_sibling()->plaintext), false, false, 273621);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$job->setJobRouting(false, \"https://jobroom.ams.or.at/jobsuche/FreieSuche.jsp\", 2);\n\n\t\t\t\t\treturn $job;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function my_task_function() {\r\n\twrite_log('CRON: Called and Actioned');\r\n\tset_up_feeds();\r\n\tprune_posts();\r\n\r\n\t// wp_mail( '[email protected]', 'Automatic email', 'Automatic scheduled 5 mine from WordPress.');\r\n}", "public function run()\n {\n DB::table('job')->insert([\n \t[\n\t 'title' => 'job 1',\n\t 'minimumWorkExperience' => 5,\n\t 'state' => 'state',\n\t 'countryID' => 1,\n\t 'responsibilities' => 'eating',\n\t 'workLocation' => 'Subang',\n\t 'jobLevelID' => 1,\n\t 'status' => 1,\n\t\t 'created_at' => new DateTime,\n\t\t 'updated_at' => new DateTime\n \t],\n \t\n ]);\n }", "public function run()\n {\n $data = [];\n $csv_partners = array_map('str_getcsv', file(public_path('data.csv')));\n\n foreach ($csv_partners as $key => $partner) {\n if ($key > 0) {\n $date = null;\n if (isset($partner[1]) && $partner[1] != \"\") {\n $exploaded = explode('/', $partner[1]);\n if (is_array($exploaded)) {\n $day = (int)$exploaded[1] >= 10 ? $exploaded[1] : (int)'0' . $exploaded[1];\n $month = (int)$exploaded[0] >= 10 ? $exploaded[0] : (int)'0' . $exploaded[0];\n $year = (int)'20' . $exploaded[2];\n $date = $year . '-' . $month . '-' . $day;\n }\n }\n $data[] = [\n 'name' => $partner[3],\n 'type' => $partner[2],\n 'city' => $partner[4],\n 'area' => $partner[5],\n 'mandoob_name' => $partner[6],\n 'address' => $partner[7],\n 'lat' => $partner[8],\n 'lng' => $partner[9],\n 'visit_date' => $date,\n ];\n }\n }\n DB::table('partners')->insert($data);\n }", "public function actionCron_jobs_list()\n {\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('cronjobs', 'View cron jobs list'),\n 'pageHeading' => Yii::t('cronjobs', 'View cron jobs list'),\n 'pageBreadcrumbs' => array(\n Yii::t('cronjobs', 'Cron jobs list'),\n )\n ));\n \n $this->render('cron-jobs-list');\n }", "function dbInstall() {\r\n\r\n $data = <<<EOD\r\n scheduled_job: scheduled_job_id int(10) unsigned NOT NULL auto_increment\r\n scheduled_job: name varchar(255) NOT NULL DEFAULT ''\r\n scheduled_job: crontab varchar(200) DEFAULT NULL, \r\n scheduled_job: last_run_date datetime DEFAULT NULL, \r\n scheduled_job: next_run_date datetime DEFAULT NULL, \r\n scheduled_job: status int(11) NOT NULL DEFAULT '0', \r\n scheduled_job: is_active tinyint(1) NOT NULL DEFAULT '0', \r\n scheduled_job: is_periodical tinyint(1) NOT NULL DEFAULT '0',\r\n\r\n scheduled_job_action: scheduled_job_action_id int(10) unsigned NOT NULL AUTO_INCREMENT, \r\n scheduled_job_action: type_id` int(11) NOT NULL, \r\n scheduled_job_action: scheduled_job_id int(11) NOT NULL, \r\n scheduled_job_action: params` varchar(200) NOT NULL\r\n \r\nEOD;\r\n parent::dbInstall($data);\r\n }", "public function cronJob()\r\n {\r\n /*$mailbox = new PhpImap\\Mailbox('{imap.gmail.com:993/imap/ssl}INBOX', '[email protected]', 'culinaryrevolution' , __DIR__);\r\n \r\n $mailsIds = $mailbox->searchMailbox('ALL');\r\n $mail = $mailbox->getMail($mailsIds[count($mailsIds)-1][\"textHtml\"]);\r\n //$message = imap_fetchbody($mailbox,4,1.2);\r\n \r\n if(!$mailsIds) {\r\n die('Mailbox is empty');\r\n }\r\n var_dump($mail);\r\n echo \"<br>\\n<br>\\n<br>\\n<br>\\n<br>\\n\"; */\r\n set_time_limit(4000);\r\n \r\n $mailbox = new PhpImap\\Mailbox('{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX', RECEIPT_MAIL_ADDR, RECEIPT_MAIL_PASSWORD , __DIR__);\r\n $mailsIds = $mailbox->searchMailbox('UNDELETED');\r\n \r\n echo \"Mail Count: \". count($mailsIds). \"<br><br>\\n\";\r\n if (count($mailsIds) == 0) {\r\n \techo \"Mailbox is empty<br>\\n\";\r\n \treturn;\r\n }\r\n\r\n for($j = 0 ; $j < count($mailsIds); $j++) {\r\n $mail = $mailbox->getMail($mailsIds[$j]);\r\n \r\n echo \" - Subject: \". $mail->subject. \" Date: \". $mail->date. \"<br>\\n\"; \r\n \r\n $dom = new DOMDocument();\r\n $string = $mail->textHtml;\r\n \r\n @$dom->loadHTML($string);\r\n $xpath = new DOMXpath($dom);\r\n \r\n $ret = $xpath->query('//td');\r\n \r\n /// get recipt number\r\n //$reciptcode is result\r\n $reciptCode = \"\";\r\n $count = 0; //initial count of account\r\n $ingreArr = array();\r\n $prices = array();\r\n \r\n for($i = 6 ;$i < $ret->length ;$i++){\r\n $code = htmlentities($ret->item($i)->nodeValue , null, 'utf-8');\r\n $codeForArray = htmlentities($ret->item($i)->nodeValue , null, 'utf-8');\r\n \r\n $findme = 'Receipt#:';\r\n $findAccount = \"Account:\";\r\n //$code = str_replace(\"#:\", \"++\" , $code) ;\r\n $code = str_replace('&nbsp;', '', $code);\r\n $pos = strpos($code, $findme);\r\n \r\n // The !== operator can also be used. Using != would not work as expected\r\n // because the position of 'a' is 0. The statement (0 != false) evaluates \r\n // to false.\r\n if ($pos !== false) {\r\n $reciptCode = substr( $code ,$pos + 9, strlen($code)-$pos ); \r\n } else {\r\n \r\n }\r\n /// get account number\r\n $posAccount = strpos($code, $findAccount);\r\n \r\n if ($posAccount !== false && $count == 0) {\r\n $reciptAccount = substr( $code ,$posAccount + 8, strlen($code)-$pos );\r\n $count = $count + 1; \r\n } else {\r\n \r\n }\r\n //// get the ingredient list\r\n $numbercheck = substr($codeForArray , 0 , 4); /// this is for the number check\r\n \r\n $codeArr = array();\r\n if (is_numeric($numbercheck)) {\r\n //then get the product code and amount\r\n $codeArr = explode('&nbsp;' , $codeForArray);\r\n $ingreArr[count($ingreArr)] = $codeArr[0];\r\n $prices[count($prices)] = $codeArr[count($codeArr)-1];\r\n \r\n } else {\r\n // Error\r\n }\r\n }\r\n \r\n echo \"Receipt Code: \". $reciptCode. \"<br>\\n\";\r\n echo \"Account: \". $reciptAccount. \"<br>\\n\";\r\n print_r($ingreArr);\r\n print_r($prices);\r\n \r\n //echo $reciptCode ;\r\n //check the recipt code exist or not\r\n if($reciptCode != \"\"){\r\n\r\n $recipt = ReciptModel::where('code', $reciptCode)->get(); \r\n \r\n if (count($recipt) == 0) {\r\n //get the recipt code\r\n\r\n $customer = CustomerModel::where('accountNumber', $reciptAccount)->get(); \r\n \r\n $customerId = $customer[0]->id;\r\n \r\n //recipt model create\r\n $recipt = new ReciptModel;\r\n $recipt->customer_id = $customerId;\r\n $recipt->code = $reciptCode;\r\n \r\n $recipt->save();\r\n \r\n $reciptId = $recipt->id;\r\n \r\n //// get the codes and update recipt product table\r\n for($k = 0 ; $k < count($ingreArr);$k++){\r\n $upccode = $ingreArr[$k];\r\n //////////////////////////////chenck the prodcut exist with that upccode\r\n $product = ProductModel::where('upcCode', $upccode)->get();\r\n if(count($product) != 0){\r\n $productId = $product[0]->id;\r\n $reciptProductModel = new ReciptProductModel;\r\n $reciptProductModel->recipt_id = $reciptId; \r\n $reciptProductModel->product_id = $productId; \r\n $reciptProductModel->save(); \r\n\r\n $condition = ['customer_id' => $customerId , 'product_id' => $productId ] ;\r\n\r\n $checkCustomerProduct = CabinetModel::where($condition)->get();\r\n\r\n if(count($checkCustomerProduct) == 0){\r\n $newCustomerProduct = new CabinetModel;\r\n $newCustomerProduct->product_id = $productId; \r\n $newCustomerProduct->customer_id = $customerId; \r\n $newCustomerProduct->save(); \r\n }\r\n }\r\n else {\r\n \techo \"Product not found<br>\\n\";\r\n }\r\n }\r\n } else {\r\n echo \"Receipt is already processed<br>\\n\";\r\n }\r\n }\r\n else {\r\n \techo \"Receipt code is empty.<br>\\n\";\r\n }\r\n echo '<br>';\r\n }\r\n }", "public function run()\n {\n $keywords = ['服装', '电脑', '手机', '鞋', '袜子'];\n foreach ($keywords as $keyword) {\n $datas[] = [\n 'keyword' => $keyword,\n 'keyword_count' => 1,\n 'sort' => 1,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n }\n DB::table('searches')->insert($datas);\n }", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function cronprocess(){\n \t\n\t $query = $this->distributiondata->getbyattribute('status',0);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t if ($this->process($row->list_id)===true){\n\t\t\t\t\t \t $darray = array('status'=>1);\n\t\t\t\t\t \t $this->distributiondata->update($row->list_id,$darray);\n\t\t\t\t\t \t echo \"Processed: \".$row->title.\" files<br>\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t}else {\n\t\t\t\techo \"No pending distribution list\";\n\t\t\t}\n\t\t\n\t\t\n\t}", "public function run()\n {\n //\n for ($i = 0; $i < 200; $i++) {\n DB::table('companies')->insert([\n 'company_name' => Str::random(10),\n 'company_web' => Str::random(10),\n 'company_code' => Str::random(10),\n 'company_phone' => Str::random(10),\n ]);\n }\n }", "public function run()\n {\n for($i=0;$i<100;$i++){\n DB::table('companies')->insert([\n 'company_name' => 'Truong123',\n 'company_web' => 'Web2_Truong',\n 'company_address' => 'Thu Duc 123',\n 'company_code' => 'laravel',\n 'company_phone' => '01693861435'\n ]);\n }\n }", "public function run()\n\t{\n\t\t$this->getOnHoldOrders();\n\t\tMage::log(\"On Hold orders compilation completed\",null,$this->logfile);\n\t\t\n\t\t// move file to archive location and rename to today's date\n\t\t$this->archiveFile();\n\t\tMage::log(\"Files archived with name \".$this->archivedFile,null,$this->logfile);\t\n\t\t\n\t\t// process inventory\n\t\t$this->processInventory();\n\t\tMage::log(\"Inventory Sync Completed for \".$this->archivedFile,null,$this->logfile);\t\n\t\n\t\t// write final csv and mail the attachment\n\t\t$this->writecsv();\n\t\t\n\t\t$this->sendMail();\n }", "public function indexAll()\n {\n $jobs = $this->dataMaker($this->jobService->indexAll());\n return $jobs;\n }", "public function run()\n {\n DB::table('jobs')->insert([\n 'worker_id'=>1,\n 'client_id'=>2,\n 'status_id'=>3,\n 'name'=>'order1',\n 'description'=>\"description tutututututu\",\n 'price'=>1000000,\n ]);\n DB::table('jobs')->insert([\n 'worker_id'=>2,\n 'client_id'=>3,\n 'status_id'=>3,\n 'name'=>'order2',\n 'description'=>\"description tutututututu\",\n 'price'=>1000000,\n ]);\n }", "function exportSubToCSV() {\n\tglobal $wpdb;\n\t\n\t$exportEntries = $wpdb->get_results( 'SELECT * FROM ' . SUBTABLE . ' ORDER BY lname ASC, fname ASC, pubdate DESC' );\t\t\t\t\n\t$getFile = fopen( resume_get_plugin_dir( 'path' ) . '/base-files/submission-entries.csv', 'w' );\n\t\n\tfputcsv( $getFile, array( __( 'First Name' ), __( 'Last Name' ), __( 'Address' ), __( 'Suite/Apt' ), __( 'City' ), __( 'State' ), \n\t\t\t\t\t\t\t __( 'Zip Code' ), __( 'Primary Number' ), __( 'Secondary Number' ), __( 'Email' ), __( 'Job' ), __( 'Attachments' ), __( 'Submit Date' ) ), ',' );\n\tforeach ( $exportEntries as $entry ) {\n\t\t$newline = \" \\r\\n\";\n\t\t$attachments = explode( ',', $entry->attachment );\n\t\t\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$attachedNames .= $attachment . $newline;\n\t\t}\n\t\t$getJobArg = array( 'numberposts' => 1,\n\t\t\t\t\t\t\t'post_type' => 'rsjp_job_postings',\n\t\t\t\t\t\t\t'name' => $entry->job ); \n\t\t$getJob = get_posts( $getJobArg );\n\t\tfputcsv( $getFile, array( $entry->fname, $entry->lname, $entry->address, $entry->address2, \n\t\t\t\t\t\t\t\t $entry->city, $entry->state, $entry->zip, $entry->pnumber, $entry->snumber, \n\t\t\t\t\t\t\t\t $entry->email, $getJob[0]->post_title, $attachedNames, date( 'm/d/Y', strtotime( $entry->pubdate ) ) ), ',' );\n\t\t\n\t\twp_reset_postdata();\n\t}\n\tfclose( $getFile );\n}", "public function run()\n {\n DB::table('all_deskjobs')->insert([\n 'deskjob' => \"Algemeen\",\n ]);\n }", "public function getAllJobCount()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n\n // number of document in the index\n $numDocs = $this->index->count();\n $this->_log('There are ' . $numDocs . ' total documents in the search index.');\n\n $count = 0;\n $deletedCount = 0;\n\n for ($id = 0; $id < $numDocs; $id++) {\n if (!$this->index->isDeleted($id)) {\n $count++;\n } else {\n $deletedCount++;\n }\n }\n\n $this->_log('There are ' . $count . ' active documents in the search index.');\n $this->_log('There are ' . $deletedCount . ' deleted documents in the search index.');\n }", "public function run()\n {\n $path = public_path() . '/../database/recipe-data.csv';\n $parser = new Parser();\n $csv = $parser->toArray($path);\n\n foreach ($csv as $row) {\n DB::table('recipes')->insert($row);\n }\n }", "public function scrape($dom) {\n\n\t\t$job = new Job();\n\n\t\tif ($dom->find('link[rel=canonical]')) {\n\t\t\tif ($dom->find('div#content h1')) {\n\t\t\t\tif ($dom->find('table#vakance-view')){\n\n\t\t\t\t\t//Get foreign id\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$str = substr(strrchr(implode($output[1]), '/'), 1);\n\t\t\t\t\t\t$job->setForeignId('cvvp_nva_gov_lv_' . trim($str));\n\t\t\t\t\t}\n\n\t \t\t\t//Get job title\n\t\t\t\t\tforeach($dom->find('div#content h1') as $Jobtitle) {\n\t\t\t\t\t\t$job->setJobTitle($Jobtitle->plaintext);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Get job description\n\t\t\t\t\tforeach($dom->find('table#vakance-view') as $DESCRIPTION) {\n\t\t\t\t\t\tforeach ($DESCRIPTION->find('script') as $ret) {\n\t\t\t\t\t\t\t$ret->innertext = '';\n\t\t\t\t\t\t\t$ret->outertext = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$desc = str_replace(\"td\", \"p\", $DESCRIPTION->innertext);\n\n\t\t\t\t\t\t$job->setDescription($desc);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = date('Y-m-d');// current date\n\t\t\t\t\t$date = strtotime('+1 week', strtotime($date));\n\t\t\t\t\t$newdate = date ( 'Y-m-j' , $date);\n\n\t\t\t\t\t$outputDate = $newdate.\"T\".date(\"h:i\").\":00Z\";\n\t\t\t\t\t$job->setExpireDate($outputDate);\n\n\t\t\t\t\t$job->addJobLocation(\"Latvia\", false, false, 273742);\t\n\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setJobRouting(false, \"http://\".implode($output[1]), 2);\n\t\t\t\t\t}\n\n\n\t\t\t\t\treturn $job;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}", "function run_job()\r\n\t{\r\n\t}", "public function run()\n {\n $date = date('Y-m-d H:i:s');\n\n $data = [\n [\n 'id' => '1',\n 'title' => 'Web Programmer Senior',\n 'description' => 'Dibutuhkan web programmer senior dengan kualifikasi berikut.',\n 'posted_by' => 1,\n 'company_id' => 1,\n 'created_at' => $date,\n 'updated_at' => $date\n ],\n [\n 'id' => '2',\n 'title' => 'Flutter Developer',\n 'description' => 'Dibutuhkan mobile programmer dengan kualifikasi berikut.',\n 'posted_by' => 1,\n 'company_id' => 1,\n 'created_at' => $date,\n 'updated_at' => $date\n ]\n ];\n \n $table = $this->table('jobs');\n $table->insert($data)->save();\n }", "function tripal_jobs_launch ($do_parallel = 0){\n \n // first check if any jobs are currently running\n // if they are, don't continue, we don't want to have\n // more than one job script running at a time\n if(!$do_parallel and tripal_jobs_check_running()){\n return;\n }\n \n // get all jobs that have not started and order them such that\n // they are processed in a FIFO manner. \n $sql = \"SELECT * FROM {tripal_jobs} TJ \".\n \"WHERE TJ.start_time IS NULL and TJ.end_time IS NULL \".\n \"ORDER BY priority ASC,job_id ASC\";\n $job_res = db_query($sql);\n while($job = db_fetch_object($job_res)){\n\n\t\t// set the start time for this job\n\t\t$record = new stdClass();\n\t\t$record->job_id = $job->job_id;\n\t\t$record->start_time = time();\n\t\t$record->status = 'Running';\n\t\t$record->pid = getmypid();\n\t\tdrupal_write_record('tripal_jobs',$record,'job_id');\n\n\t\t// call the function provided in the callback column.\n\t\t// Add the job_id as the last item in the list of arguments. All\n\t\t// callback functions should support this argument.\n\t\t$callback = $job->callback;\n\t\t$args = split(\"::\",$job->arguments);\n\t\t$args[] = $job->job_id;\n\t\tprint \"Calling: $callback(\" . implode(\", \",$args) . \")\\n\"; \n\t\tcall_user_func_array($callback,$args);\n\t\t\n\t\t// set the end time for this job\n\t\t$record->end_time = time();\n\t\t$record->status = 'Completed';\n\t\t$record->progress = '100';\n\t\tdrupal_write_record('tripal_jobs',$record,'job_id');\n\t\t\n\t\t// send an email to the user advising that the job has finished\n }\n}" ]
[ "0.5537103", "0.54606855", "0.5449546", "0.54228944", "0.5410553", "0.5278324", "0.5236165", "0.52066", "0.5195223", "0.5177203", "0.5169428", "0.5155695", "0.50330484", "0.5013517", "0.50096905", "0.49978343", "0.49911544", "0.4990376", "0.49754736", "0.4973946", "0.4946123", "0.49458846", "0.49458846", "0.49443197", "0.49438933", "0.49342427", "0.49027938", "0.48860556", "0.48818126", "0.4875198", "0.4873559", "0.48686212", "0.48597085", "0.4856764", "0.48250198", "0.4823251", "0.48208684", "0.48191062", "0.48128846", "0.47932735", "0.4787855", "0.47868943", "0.47867352", "0.4784355", "0.47825667", "0.477785", "0.47686967", "0.47537497", "0.47316834", "0.47304437", "0.47266984", "0.4710083", "0.4700025", "0.46971613", "0.46971613", "0.46907905", "0.46831518", "0.468017", "0.4678243", "0.46679738", "0.46666357", "0.46655124", "0.46630386", "0.46615022", "0.46557608", "0.46511033", "0.46489364", "0.4644861", "0.46441773", "0.46414992", "0.46400362", "0.4639276", "0.4638335", "0.46373135", "0.4628276", "0.46217164", "0.4620816", "0.462047", "0.46179953", "0.4613366", "0.46044043", "0.45975217", "0.45960617", "0.45958757", "0.45925236", "0.45923582", "0.45860487", "0.45833173", "0.45792583", "0.45760065", "0.45757735", "0.4570682", "0.45653516", "0.45612746", "0.4556422", "0.45548108", "0.4552879", "0.45473567", "0.45443892", "0.45346048" ]
0.5626864
0
Return connection with Connection ID
public function getByCid($cid, $mask = false) { $connection = array_filter((array)$this->getAll($mask), function ($c) use ($cid) { return isset($c['cid']) && $c['cid'] == $cid; }); return $connection ? reset($connection) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConnectionId();", "public function getConnectionId()\n\t{\n\t\tif ( $this->pdo === null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\treturn $this->pdo->query('SELECT CONNECTION_ID()')->fetch(PDO::FETCH_COLUMN);\n\t\t} catch ( \\PDOException $e ) {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getIdConnex()\n {\n return $this->idConnex;\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public function getConnectionName()\n {\n return $this->connection;\n }", "public function getConnectionName()\n {\n return array_search($this, self::$connections, true) ?: null;\n }", "public function getConnection()\n {\n return($this->connx);\n }", "private function getResourceId(ConnectionInterface $conn)\n {\n return $conn->resourceId;\n }", "public function get_connection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return config('ring_central.connection.name');\n }", "public function get_current_connection()\n {\n }", "function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "static private function connection($name) { return self::$connections[$name]['connection']; }", "public function get_connection()\n {\n return $this->connection();\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function getConnection()\n {\n return static::resolveConnection($this->getConnectionName());\n }", "public function getConnection()\n\t{\n\t\treturn static::$instances[$this->_instance];\n\t}", "public function getConnectionName();", "public function getConnectionName();", "public function getConnectionName();", "public function get_connection_id() {\n return empty($this->username) || empty($this->url) ? FALSE : sha1($this->username . '@' . $this->url);\n }", "public function getConnection(){\n\t\treturn $this->connection;\n\t}", "public function getConnectionName()\n {\n return $this->connectionName;\n }", "public function getConnectionName()\n {\n return config('google-ads-api.database.connection') ?? $this->connection;\n }", "public function getConnection() {\n return $this->connection;\n }", "public function getConnection() {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->mc[self::LOCAL_MC];\n }", "public function get_connection() {\n return $this->_connection;\n }", "public function get_connection() {\n return $this->_connection;\n }", "private function getActiveConnection() \n {\n \n return $this->con;\n }", "public function getConnection() {\n return $this->connection;\n }", "public function getConnectorId();", "public function getIdConnectionLog()\n {\n return $this->idConnectionLog;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "protected function getConnection()\n {\n return $this->connection;\n }", "public function getConnection(){\n\t\treturn $this->_connection;\n\t}", "public function getConnection()\n {\n return $this->conn;\n }", "public function getConnection()\n {\n return $this->conn;\n }", "public function get_connection()\n {\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConnection()\n {\n return $this->connection;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn()\n {\n return $this->conn;\n }", "public function getConn(){\n\t\treturn $this->conn;\n\t}", "public function connection()\n {\n return $this->connection;\n }", "public function connection()\n {\n return $this->connection;\n }", "public function connection()\n {\n return $this->connection;\n }", "public function getConn(){\n return $this->conn;\n }", "function connectionName ()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn $this->conn_name;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "function getCONN(){\n return $this ->CONN;\n }", "public function connect()\n {\n if (!isset($this->_resourceId)) {\n $this->_resourceId = $this->_doConnect();\n }\n \n return $this->_resourceId;\n }", "public static function getConnection()\n {\n if (!isset(self::$_primary))\n {\n self::$_primary = self::_getConnection('primary');\n }\n\n return self::$_primary;\n }", "function getConnection() {\r\n\r\n\t\treturn $this->connection;\r\n\r\n\t}", "public function getConnection() {\n\t\treturn $this->_connection;\n\t}", "public function getConnection()\r\n\t{\r\n\t\treturn $this->connection;\r\n\t}", "public function getConn()\n\t{\n\t\treturn $this->conn;\n\t}", "public function getConnection(): Connection\n {\n return $this->connection;\n }", "public function getConnection() {\n return $this->_connection;\n }", "abstract protected function getActiveConnection();", "public function getConnection()\n {\n return $this->_connection;\n }", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function getConnection()\n\t{\n\t\treturn $this->connection;\n\t}", "public function getConnection() {\n return $this->connection;\n }", "public function byId( $connId )\n\t{\n\t\tif( !isset( $this->cache[ $connId ] ) )\n\t\t\t$this->cache[ $connId ] = $this->getConnection( $connId );\n\n\t\treturn $this->cache[ $connId ];\n\t}", "public function getConn()\n {\n return $this->conn;\n }", "public function GetConn() {\n\n return $this->\n config['dbconn'];\n }", "protected function getConnection()\n {\n return $this->_connection;\n }", "protected function getConnectionResource()\n {\n foreach ($this->connections as $id => $connection) {\n if (($connection->isInfoValid() && $connection->isConnected()) || (!$connection->isConnected() && $connection->connect())) {\n return $connection->resource;\n }\n }\n return null;\n }", "public function getConnection(): Connection\n {\n return $this->_connection;\n }", "public static function connection($connectionName = 'default')\n {\n return self::getGlobal()->getConnection($connectionName);\n }", "public function getConnection()\n {\n $this->connection = db($this->connectionName);\n\n return $this->connection;\n }", "public function _getConnection(){\n return $this->_connection;\n }", "public function getConn() {\n\n return $this->conn;\n }", "public function getConn() {\n\t\tif ($this->conn) {\n\t\t\treturn $this->conn;\n\t\t}\n\t}", "public function getConnection()\n\t{\n\t\treturn empty($this->db_conn) ? Db::getConnection($this->getConnectionName()) : $this->db_conn;\n\t}", "function getConnection() {\n\t\tself::createConnection( $this->_connectionName );\n\t\treturn Kwerry::$_connections[ $this->_connectionName ];\n\t}", "public function getConnection() {\n return $this->objDBConnection;\n }", "public function getConnection() {\n return $this->objDBConnection;\n }", "public function getConnection()\n {\n return $this->resolver->connection();\n }", "public function getConnectionName()\n {\n return config('yotpo.database.connection') ?? $this->connection;\n }", "public function getConnection()\n {\n return $this->__connection;\n }", "public function getConnection() {\n return $this->conexion;\n }", "public function get(): ConnectionInterface;", "public static function getConnection() {\n return self::$defaultConnection;\n }", "private function getConnection(): Connection\n {\n return $this->databaseConnection;\n }", "public function getConnection(): Connection;", "public function getConnectionName()\n\t{\n\t\treturn empty($this->db_conn) ? $this->db_conn_name : $this->getConnection()->getName();\n\t}", "public function getConnection(): ActiveQuery\n {\n return $this->hasOne(RabbitMQConnection::class, ['id' => 'connection_id']);\n }", "private function connection()\n {\n return Database::connection($this->connectionName);\n }", "static public function activeConnectionName()\n {\n return self::$activeConnectionName;\n }", "public static function getActiveConnection()\n {\n if (!self::$connection instanceof Connection) {\n return self::connect();\n }\n \n return self::$connection;\n }", "public function getConnection(){\n return $this->dbConnection;\n }", "function get_layer_connection($layer_id) {\n\t\t# $layer_id < 0 Rollenlayer else normal layer\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t`connection_id`,\n\t\t\t\t\" . ($layer_id < 0 ? \"'\" . CUSTOM_SHAPE_SCHEMA . \"' AS \" : \"\") . \"`schema`\n\t\t\tFROM\n\t\t\t\t\" . ($layer_id < 0 ? \"rollenlayer\" : \"layer\") . \"\n\t\t\tWHERE\n\t\t\t\t\" . ($layer_id < 0 ? \"-id\" : \"Layer_ID\") . \" = \" . $layer_id . \" AND\n\t\t\t\t`connectiontype` = 6\n\t\t\";\n\t\t$this->debug->write(\"<p>file:kvwmap class:db_mapObj->get_layer_connection - Lesen der connection Daten des Layers:<br>\" . $sql, 4);\n\t\t$this->db->execSQL($sql);\t\t\n\t\tif ($this->db->success) {\n\t\t\treturn $this->db->result->fetch_assoc();\n\t\t}\n\t\telse {\n\t\t\t$this->debug->write(\"<br>Abbruch beim Lesen der Layer connection in get_layer_connection, Zeile: \" . __LINE__ . \"<br>\" . $this->db->mysqli->error, 4);\n\t\t\treturn array();\n\t\t}\n\t}" ]
[ "0.8229193", "0.7544831", "0.73328567", "0.71325916", "0.71325916", "0.71137863", "0.7074627", "0.70449257", "0.70188385", "0.70017236", "0.69603896", "0.6952511", "0.6927714", "0.6926359", "0.6924797", "0.6924797", "0.6910889", "0.6902436", "0.6902436", "0.6902436", "0.68941075", "0.6883633", "0.68741757", "0.68456864", "0.68407726", "0.68407726", "0.6837538", "0.6830906", "0.6830906", "0.6830164", "0.6826627", "0.68116754", "0.68097556", "0.68062013", "0.68062013", "0.6787294", "0.6768001", "0.6768001", "0.6756315", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.67547476", "0.6752543", "0.6752543", "0.6735091", "0.67341214", "0.67341214", "0.67341214", "0.67187464", "0.6716661", "0.6714837", "0.6696133", "0.6688415", "0.6685515", "0.6680525", "0.6678985", "0.6678408", "0.6678015", "0.66774595", "0.6676384", "0.6670615", "0.66700876", "0.66700876", "0.66569954", "0.66566783", "0.6652767", "0.6649168", "0.66433096", "0.6637588", "0.66352403", "0.6631097", "0.6619038", "0.6613202", "0.6600871", "0.6599864", "0.6593805", "0.6591632", "0.6584667", "0.6584667", "0.65683043", "0.65659505", "0.6560555", "0.655445", "0.65400684", "0.6531898", "0.6526041", "0.65093577", "0.6484977", "0.647909", "0.6448211", "0.64336", "0.6429347", "0.64241916", "0.64173806" ]
0.0
-1
Saves the current model TODO allow resource creation as well as updates, by checking if Id is set
public function save() { // If this object hasn't had its values changed, then abort. if(!$this->isModified()) { return false; } // Discard cached objects $this->invalidateCache(); foreach($this->modifiedAttributes as $a) { $this->payload[$a] = $this->values[$a]; } // Set request method to POST $this->method = "POST"; // Run the request // TODO This should return the modified object - use it $this->get(); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(){\n if( !$this->validate() ){\n return false;\n }\n \n if($this->id){\n return $this->update();\n } else {\n return $this->create();\n }\n }", "public function save() {\r\n if ($this->model->getId()) {\r\n return $this->model->update();\r\n }\r\n return $this->create();\r\n }", "public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }", "public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }", "public function save(){\n // if(isset($this->id)){$this->update();} else {$this->create();}\n return isset($this->id)? $this->update(): $this->create() ;\n\n }", "public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}", "public function save(){\n\t\treturn isset($this->id)?$this->update():$this->create();\t\n\t}", "public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\n }", "public function save() {\n\n return isset($this->id) ? $this->update() : $this->create();\n }", "public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }", "public function save() {\r\n $dateNow = date('Y-m-d H:i:s', time());\r\n $this->id = (int) $this->id;\r\n \r\n if (!empty($this->id)) {\r\n //update case\r\n if ($this->_update()) {\r\n return true;\r\n }\r\n }\r\n else {\r\n //Insert case\r\n if ($this->_insert()) {\r\n return true;\r\n }\r\n }\r\n }", "public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}", "public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function save()\n\t{\n\t\t$this->copyAttributesToValues() ;\n\t\tif( $this->factory )\n\t\t{\n\t\t\tswitch( $this->todo )\n\t\t\t{\n\t\t\t\tcase 1: // Insert\n\t\t\t\t\tif( $this->factory->insertObjectIntoDB( $this ) ) $this->state = \"inserted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 2: // update\n\t\t\t\t\tif( $this->factory->updateObjectIntoDB( $this ) ) $this->state = \"updated\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t\tcase 3: // delete\n\t\t\t\t\tif( $this->factory->deleteObjectIntoDB( $this ) ) $this->state = \"deleted\" ;\n\t\t\t\t\telse $this->state = \"dberror\" ;\n\t\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}", "public function save() {\n\n $data = array(\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n 'metatitle' => $this->getMetatitle(),\n 'metakeywords' => $this->getMetakeywords(),\n 'metadescription' => $this->getMetadescription()\n );\n $data['parent_id'] = 0; // by default it is 0, becouse right now there is no use of parent id in this application\n if (null === ($id = $this->getId())) {\n unset($data['id']);\n $data['status'] = 1;\n return $this->getMapper()->getDbTable()->insert($data);\n } else {\n $data['status'] = $this->getStatus();\n return $this->getMapper()->getDbTable()->update($data, array('id = ?' => $id));\n }\n\n }", "public function save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\n }", "public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }", "public function store()\n {\n $this->validate([\n 'name' => 'required',\n 'content' => 'required',\n ]);\n \n Todo::updateOrCreate(['id' => $this->todo_id], [\n 'name' => $this->name,\n 'content' => $this->content\n ]);\n \n session()->flash('message', \n $this->todo_id ? 'Todo successfully updated.' : 'Todo successfully created.');\n \n $this->closeModal();\n $this->resetInputFields();\n }", "public function save(){\n $this->connect_db();\n if ( $this->ID != NULL){\n $sql = \"UPDATE task SET\n Description='\".$this->description.\"',\n Status='\".$this->status.\"',\n Deadline=\".$this->deadline->format('Y-m-d').\",\n Project=\".$this->project.\" WHERE ID=\".$this->ID.\";\";\n } else {\n $sql = \"INSERT INTO task (Description, Status, Deadline, Project)\n VALUES\n ('\".$this->description.\"',\n '\".$this->status.\"',\n '\".$this->deadline->format('Y-m-d').\"',\n \".$this->project.\"\n )\";\n }\n $this->myDB->exec_sql_statement($sql);\n // retrive ID if new\n if ( $this->ID == NULL){\n $sql = \"SELECT ID FROM task WHERE Description='\".$this->description.\"' and\n Status='\".$this->status.\"' and Deadline='\".$this->deadline->format('Y-m-d').\"'\n and Project=\".$this->project;\n $res = $this->get_by_query($sql);\n $this->ID = $res[0]['ID'];\n }\n $this->disconnect_db();\n return $this;\n }", "public function save(Identifiable $model);", "public function save(): bool\n {\n return $this->id > 0\n ? $this->actionHandler->update()\n : $this->actionHandler->insert();\n }", "public function save()\n {\n $this->setData(array(\n 'modified' => time(),\n 'modifiedReadable' => Zend_Date::now()->get(Zend_Date::ISO_8601)\n ));\n \n $unmappedData = $this->getBean()->asDeepArray(true);\n if(key_exists('_id', $unmappedData)) {\n unset($unmappedData['_id']);\n }\n\n if (!($id = $this->_save($unmappedData, $this->getId()))) {\n return false;\n }\n\n $this->_setId($id);\n \n return true;\n }", "public function save() {\n if(!isset($this->id)) {\n $this->insert();\n } else {\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n $qb = $this::set($data);\n $qb->where(['id' => $this->id])->make();\n return true;\n }\n }", "public function save() {\n if (self::getProjectById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO project (title, description, goal, start_date, duration, owner_id) VALUES ('%s', '%s', %d, '%s', %d, %d) RETURNING id;\";\n $auth_user = User::getCurrentUser();\n $sql = sprintf($sql, pg_escape_string($this->title), pg_escape_string($this->description), $this->goal, $this->start_date->format('Y-m-d'), $this->duration, $auth_user->id);\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE project SET title='%s', description='%s', goal=%d, start_date='%s', duration=%d WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->title), pg_escape_string($this->description), $this->goal, $this->start_date->format('Y-m-d'), $this->duration, $this->id);\n self::$connection->execute($sql);\n }\n }", "public function save()\n {\n $params = array_filter(array_merge($this->ids(), [$this]));\n\n if ($this->exists) {\n return $this->hydrate(\n $this->builder()->request($this->path, 'update', ...$params)\n );\n }\n\n return $this->hydrate(\n $this->builder()->request($this->path, 'create', ...$params)\n );\n }", "public function testNewModelWithIdSpecified() {\n\n $this->loadClass('sample_Resource');\n\n $sessionFactory = $this->getSampleProjectSessionFactory(true);\n \n $session1 = $sessionFactory->openSession();\n $session2 = $sessionFactory->openSession();\n $session3 = $sessionFactory->openSession();\n \n $resource = $session1->add(new sample_Resource('inventory', 'Inventory'));\n \n $session1->flush();\n \n $this->assertEquals(\"inventory\", $resource->resourceId);\n \n $resource = $session2->find('sample_Resource')->filterBy('resourceId', 'inventory')->one();\n $this->assertEquals(\"Inventory\", $resource->name);\n \n $resource->name = 'Inventory Changed';\n \n $session2->flush();\n\n $resource = $session3->find('sample_Resource')->filterBy('resourceId', 'inventory')->one();\n $this->assertEquals(\"Inventory Changed\", $resource->name);\n \n }", "public function save()\n\t{\n\t\t$status = $this->validated ? TRUE : $this->valid();\n\n\t\tif ($status === TRUE)\n\t\t{\n\t\t\tif ($this->data['id']) // Do an update\n\t\t\t\treturn count($this->db->update($this->table_name, $this->data, array('id' => $this->data['id'])));\n\t\t\telse // Do an insert\n\t\t\t{\n\t\t\t\t$id = $this->db->insert($this->table_name, $this->data)->insert_id();\n\t\t\t\treturn ($this->data['id'] = $id);\n\t\t\t}\n\t\t}\n\n\t\tthrow new Kohana_User_Exception('auto_modeler.validation_error', $status);\n\t}", "public function save()\n {\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->newBuilder()->where('_id', $this->convertToMongoId($this->attributes['_id']))->update($this->attributes);\n }\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->newBuilder()->insert($this->attributes);\n }\n\n // TODO: fill() attributes will new or updated values.\n\n return $saved;\n }", "public function save() {\n\t return isset($this->product_id) ? $this->update() : $this->create();\n\t}", "public function save(){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $val->IdDepartamento=$_POST['departamento'];\n $val->IdProyecto=$_POST['proyecto'];\n $val->IdMeta=$_POST['metas'];\n $val->anio=$_POST['anio'];\n if($_POST['id'] == 0){\n $val->add();\n }else{\n $val->update();\n }\n header('location: '.FOLDER_PATH.'/Valida');\n }", "public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }", "public function save()\n {\n $primary = $this->primary_key;\n $id = null;\n\n try {\n \n /** Verifica os campos obrigatórios */\n if ( !$this->required() ) {\n throw new \\Exception('Preencha os campos necessários.');\n }\n\n $date_now = (new \\DateTime())->format('Y-m-d H:i:s');\n\n /** Se for um update */\n if ( !empty($this->data->$primary) ) {\n $this->data->updated_at = $date_now;\n $id = $this->data->$primary;\n $this->update($this->safe(), [\"{$this->primary_key}=\" => $id]);\n }\n\n /** Se for um create */\n if ( empty($this->data->$primary) ) {\n $this->data->created_at = $date_now;\n $this->data->updated_at = $date_now;\n $id = $this->create($this->safe());\n }\n\n if ( !$id ) {\n return false;\n }\n\n $this->data = $this->findByPrimaryKey($id);\n return true;\n\n } catch(\\Exception $exception) {\n $this->fail = $exception;\n return false;\n }\n }", "public function save() \n\t{\n\t\tif (isset($this->id)) {\t\n\t\t\n\t\t\t// Return update when id exists\n\t\t\treturn $this->update();\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t// Return insert when id does not exists\n\t\t\treturn $this->insert();\n\t\t}\n\t}", "public function saveTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\t// Incoming\n\t\t$fields = Request::getArray('fields', array(), 'post');\n\t\t$tmpl = Request::getCmd('tmpl', '');\n\n\t\t$row = new Middleware\\Location($fields['id']);\n\t\tif (!$row->bind($fields))\n\t\t{\n\t\t\tNotify::error($row->getError());\n\t\t\treturn $this->editTask($row);\n\t\t}\n\n\t\t// Store new content\n\t\tif (!$row->store(true))\n\t\t{\n\t\t\tNotify::error($row->getError());\n\t\t\treturn $this->editTask($row);\n\t\t}\n\n\t\tif ($tmpl == 'component')\n\t\t{\n\t\t\tif ($this->getError())\n\t\t\t{\n\t\t\t\techo '<p class=\"error\">' . $this->getError() . '</p>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<p class=\"message\">' . Lang::txt('COM_TOOLS_ITEM_SAVED') . '</p>';\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tNotify::success(Lang::txt('COM_TOOLS_ITEM_SAVED'));\n\n\t\tif ($this->getTask() == 'apply')\n\t\t{\n\t\t\treturn $this->editTask($row);\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t);\n\t}", "public function save() {\n return $this->{static::$primaryKey} === null? $this->create() : $this->update();\n }", "public function save()\n {\n if ($this->_id === false) {\n return $this->create();\n }\n\n return $this->set();\n }", "public function action_save()\n {\n // clear old reject info\n $this->setRejectInfo(null);\n\n if (isset($this->m_partial) && !empty($this->m_partial)) {\n $this->partial($this->m_partial);\n\n return;\n } else {\n $this->doSave();\n }\n }", "public function save() {\n\n $this->get(\"id\") ? $this->_update() : $this->_create();\n return $this;\n\n }", "public function save()\n {\n $this->_validateModifiable();\n\n if($this->isNew())\n {\n $this->_getDataSource()->create($this);\n }\n else\n {\n $this->_getDataSource()->update($this);\n }\n\n $this->_saveRelations();\n $this->_setNew(false);\n }", "function test_save()\n {\n\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n\n //Act\n $test_task->save();\n\n //Assert\n $result = Task::getAll();\n $this->assertEquals($test_task, $result[0]);\n\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "public function save(){\n $data = file_get_contents('php://input');\n //saving data and getting inserted id or the existing one\n $this->id = $this->_so->save($data);\n //returning saved object for frontend sync\n return $this->byId();\n }", "public function save()\n {\n return $this->edit($this->id, $this->data);\n }", "public function beforeSave() {\n if ($this->isNewRecord && $this->document_id == null){\n $this->document_id = $this->getParent()->document_id;\n }\n\n $this->edited = date('Y-m-d H:i:s');\n\n //todo\n //$this->edited_by = current user\n\n return parent::beforeSave();\n }", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save()\n {\n // If the model already exists in the database we can just update our record\n // that is already in this database using the current IDs in this \"where\"\n // clause to only update this model. Otherwise, we'll just insert them.\n if ($this->exists) {\n $saved = $this->isDirty() ? $this->performUpdate() : true;\n }\n\n // If the model is brand new, we'll insert it into our database and set the\n // ID attribute on the model to the value of the newly inserted row's ID\n // which is typically an auto-increment value managed by the database.\n else {\n $saved = $this->performInsert();\n }\n\n // If the model is successfully saved, we need to do a few more things once\n // that is done. We will call the \"saved\" method here to run any actions\n // we need to happen after a model gets successfully saved right here.\n if ($saved) {\n $this->syncOriginal();\n }\n\n return $saved;\n }", "public function save()\n {\n $data = $this->getSaveData();\n $errorString = '<h5 class=\"alert-heading\">Can\\'t save ' . $this->entityName . ' because of the following problems:</h5>';\n\n $errors = $this->checkRequiredColumns( $data );\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n\n if ( defined( 'DEBUG' ) && DEBUG === true ) {\n $dataToSave = !empty( $data ) ? $this->getDataHTMLTable( $data ) : 'None';\n $this->messages->add(\n 'Entity - ' . $this->entityName\n . '<br>Changed - ' . print_r( $this->changed, true )\n . '<br>Data to save - ' . $dataToSave\n . '<br>All column properties - ' . $dataToSave,\n 'info'\n );\n }\n $errors = $this->healthCheck();\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n if ( $this->exists ) {\n return $this->updateDBRow( $data );\n }\n $addRow = $this->addDBRow( $data );\n if ( is_int( $addRow ) ) {\n $this->id = $addRow;\n $this->exists = true;\n }\n return $addRow;\n }", "public function save() {\n\t\t$args = func_get_args();\n\t\t\n\t\t// no argument, so save current object\n\t\tif (empty($args))\n\t\t\t$o = $this;\n\t\t// argument given, so save that object\n\t\telse\n\t\t\t$o = $args[0];\n\n\t\t// ID is set, so update existing object\n\t\tif (isset($o->id))\n\t\t\treturn $this->update($o->id, $o);\n\n\t\t// ID is not set, so create new object\n\t\treturn $this->add($o);\n\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $pelicula = Peliculas::findFirstByid($id);\n\n if (!$pelicula) {\n $this->flash->error(\"pelicula does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $pelicula->id = $this->request->getPost(\"id\");\n $pelicula->nombre = $this->request->getPost(\"nombre\");\n $pelicula->idGenero = $this->request->getPost(\"id_genero\");\n $pelicula->year = $this->request->getPost(\"year\");\n $pelicula->idIdioma = $this->request->getPost(\"id_idioma\");\n \n\n if (!$pelicula->save()) {\n\n foreach ($pelicula->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'edit',\n 'params' => [$pelicula->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"pelicula was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n }", "public function save()\n {\n }", "public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }", "public function saveAction(): void\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $id = $this->request->getPost('id', 'int');\n \n $record = Ana::findFirstById($id);\n \n \n if (!$record) {\n $this->flash->error('ana does not exist');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $data = $this->request->getPost();\n \n \n $form = new AnaForm();\n \n \n if (!$form->isValid($data, $record)) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n \n \n \n if (!$record->save()) {\n foreach ($record->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n $form->clear();\n $this->flash->success('Ana se guardo con èxito');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n }", "public function save()\n {\n return;\n }", "function save()\n {\n $this->form_validation->set_rules($this->_get_rules());\n\n if($this->form_validation->run()){\n $entity = $this->_from_form();\n $this->data['save'] = $this->model->insert_entry($entity);\n $this->data['action_performed'] = 'save';\n $this->success($entity);\n }\n else {\n $this->create();\n }\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $idEmpresa = $this->request->getPost(\"idEmpresa\");\n $empresa = Empresa::findFirstByidEmpresa($idEmpresa);\n\n if (!$empresa) {\n $this->flash->error(\"Empresa does not exist \" . $idEmpresa);\n\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $empresa->nombre = $this->request->getPost(\"nombre\");\n $empresa->nombreInterno = $this->request->getPost(\"nombreInterno\");\n $empresa->nit = $this->request->getPost(\"nit\");\n $empresa->idMunicipio = $this->request->getPost(\"idMunicipio\");\n $empresa->telefono = $this->request->getPost(\"telefono\");\n $empresa->cedulaRepresentante = $this->request->getPost(\"cedulaRepresentante\");\n $empresa->representanteLegal = $this->request->getPost(\"representanteLegal\");\n\n\n if (!$empresa->save()) {\n\n foreach ($empresa->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'edit',\n 'params' => [$empresa->idEmpresa]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Empresa editada exitosamente\");\n\n return $this->response->redirect(\"empresa/index\");\n }", "public function put_edit($id) {\n\t\t$ext = 'json';\n\t\t$header = 'application/json';\n\n\t\tif (Request::accepts('text/xml')) {\n\t\t\t$ext = 'xml';\n\t\t\t$header = 'text/xml';\n\t\t}\n\n\t\t$todo = Todo::find($id);\n\t\tif ($todo == NULL) {\n\t\t\tResponse::status('404');\n\t\t\tResponse::send_headers();\n\t\t\treturn;\n\t\t}\n\n\t\tif (Input::get('title'))\n\t\t\t$todo->title = Input::get('title');\n\t\tif (Input::get('task'))\n\t\t\t$todo->task = Input::get('task');\n\t\tif (Input::get('due_date'))\n\t\t\t$todo->due_date = Input::get('due_date');\n\t\tif (Input::get('done'))\n\t\t\t$todo->done = Input::get('done');\n\t\t$todo->save();\n\t\tResponse::status('201');\n\t\tResponse::header('Location', 'todos/' . $todo->id);\n\t\tResponse::send_headers();\n\n\t}", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $idTipoCodigo = $this->request->getPost(\"idTipoCodigo\");\n $tipocodigo = Tipocodigo::findFirstByidTipoCodigo($idTipoCodigo);\n\n if (!$tipocodigo) {\n $this->flash->error(\"Tipo de Código no Existe \" . $idTipoCodigo);\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $tipocodigo->Descripciontipo = $this->request->getPost(\"descripcionTipo\");\n $tipocodigo->LongitudCodigo = $this->request->getPost(\"longitudCodigo\");\n $tipocodigo->Estadoregistro = $this->request->getPost(\"estadoRegistro\");\n \n\n if (!$tipocodigo->save()) {\n\n foreach ($tipocodigo->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'edit',\n 'params' => [$tipocodigo->idTipoCodigo]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Tipo de código se Actualizó Satisfactoriamente\");\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n }", "protected function saveTask() {}", "public function save(Authenticatable $model);", "private function save($id=NULL,$anime_id=NULL,$serie_id=NULL){\n $mateiral_nome = \"capitulo\";\n if(!empty($anime_id)){\n $multimidia_id = $this->Anime->getField($anime_id,'multimidia_id');\n }else if(!empty ($id)){\n $multimidia_id = $this->Anime->getField($this->Capitulo->getField($id,'anime_id'),'multimidia_id');\n }\n if(isset($multimidia_id)){\n $mateiral_nome = $this->Multimidia->getField($multimidia_id,'unidade');\n }\n if(!empty($this->request->data)){\n $save = $this->Capitulo->save($this->request->data);\n \n if($save!==FALSE){\n $this->Session->setFlash(\"O \".ucfirst($mateiral_nome).\" foi salvo com sucesso!\", 'alert', array(\n 'plugin' => 'TwitterBootstrap',\n 'class' => 'alert-success'\n ));\n $id = $this->Capitulo->getInsertID();\n $id = ((empty($id))?$this->request->data['Capitulo']['id']:$id); \n $this->redirect(array('controller' => $this->name, 'action' => 'edit' , $id ));\n }else{\n $this->Session->setFlash(\"Ocorreu um erro na tentativa de salvar o \".ucfirst($mateiral_nome).\", favor conferir os dados e tentar novamente!\", 'alert', array(\n 'plugin' => 'TwitterBootstrap',\n 'class' => 'alert-error'\n ));\n }\n \n }\n if($id != \"\"){\n $this->request->data = $this->Capitulo->find('first',array('conditions' => array($this->name.'.id' => $id)));\n if(empty($serie_id)){\n $serie_id = $this->Anime->getField($this->request->data['Capitulo']['anime_id'],'serie_id');\n }\n }else{\n if(!empty($anime_id)){\n $this->request->data['Capitulo']['anime_id'] = $anime_id;\n }\n if(empty($serie_id)){\n $serie_id = $this->Anime->getField($anime_id,'serie_id');\n }\n }\n if($id!=NULL)$this->page_title = $this->Capitulo->getField($id,'titulo');\n $fildset = (($id==NULL)?\"Novo \".ucfirst($mateiral_nome).\"\":\"Editar \".ucfirst($mateiral_nome).\"\");\n $campos = array(\n $fildset => array(\n 'id' => array('type'=>'hidden'),\n 'anime_id' => array('type'=>'hidden'),\n 'titulo' => array('required'=>TRUE),\n 'numero' => array('label'=>'Número'),\n )\n );\n $this->set(\n array(\n 'model'=>'Capitulo',\n 'campos' => $campos\n )\n );\n if(!empty($serie_id)){\n $this->set($this->Menus->MenuSerieADMIN($serie_id));\n }\n if(!empty($this->request->data['Capitulo']['anime_id'])){\n $this->set($this->Menus->MenuEpisodiosADMIN($this->request->data['Capitulo']['anime_id']));\n $this->set($this->Menus->MenuTopADMIN('anime',$this->request->data['Capitulo']['anime_id']));\n }\n }", "public function save() {\r\n\t return isset($this->clientid) ? $this->update() : $this->create();\r\n\t}", "public function save() {\r\n\t return isset($this->clientid) ? $this->update() : $this->create();\r\n\t}", "public function saving($model)\n {\n }", "public final function save() {\n }", "public function save(SettingModel $settingModel): bool;", "public function save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }", "private function save($id=NULL){\n if(!empty($this->request->data)){\n $save = $this->Servidor->save($this->request->data);\n \n if($save!==FALSE){\n $this->Session->setFlash(\"O Servidor foi salvo com sucesso!\", 'alert', array(\n 'plugin' => 'TwitterBootstrap',\n 'class' => 'alert-success'\n ));\n $id = $this->Servidor->getInsertID();\n $id = ((empty($id))?$this->request->data['Servidor']['id']:$id); \n $this->redirect(array('controller' => $this->name, 'action' => 'edit' , $id ));\n }else{\n $this->Session->setFlash(\"Ocorreu um erro na tentativa de salvar o servidor, favor conferir os dados e tentar novamente!\", 'alert', array(\n 'plugin' => 'TwitterBootstrap',\n 'class' => 'alert-error'\n ));\n }\n \n }\n \n if($id != \"\"){\n $this->request->data = $this->Servidor->find('first',array('conditions' => array('id' => $id)));\n }\n if($id!=NULL)$this->page_title = $this->Servidor->getField($id,'nome');\n $fildset = (($id==NULL)?\"Novo Servidor\":\"Editar servidor\");\n $campos = array(\n $fildset => array(\n 'id' => array('type'=>'hidden'),\n 'nome' => array('label'=>'Nome','required'=>TRUE),\n 'habilitado' => array('type'=>'radio' , 'options'=>array('1' => 'Ativado','0' => 'Desativado') , \"value\"=>((isset($this->request->data['Servidor']['habilitado'])?$this->request->data['Servidor']['habilitado']:1)) ),\n ),\n 'Adicionais' => array(\n 'usuario' => array('label'=>'Usuário'),\n 'senha' => array(),\n )\n );\n \n $this->set(\n array(\n 'model'=>'Servidor',\n 'campos' => $campos\n )\n );\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $article = Articles::findFirstByid($id);\n if (!$article) {\n $this->flash->error(\"article does not exist \" . $id);\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $article->id = $this->request->getPost(\"id\");\n $article->title = $this->request->getPost(\"title\");\n $article->slug = $this->request->getPost(\"slug\");\n $article->content = $this->request->getPost(\"content\"); \n $article->isPublished = $this->request->getPost(\"isPublished\"); \n\n if (!$article->save()) {\n\n foreach ($article->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"edit\",\n \"params\" => array($article->id)\n ));\n }\n\n $this->flash->success(\"article was updated successfully\");\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n\n }", "public function save() {\n\t\t\n\t\treturn isset($this->members_id) ? $this->update() : $this->create(); //and this one??\n\t\t\n\t}", "public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }", "public function save(){\n\n if (!$this->preSave()) {\n return FALSE;\n }\n\n $reference = $this->_getReference();\n $pk = $this->_getPK();\n\n $data = get_object_vars($this);\n\n if (empty($pk) && $pk !== NULL) {\n throw new \\Exception('Model PK is empty!');\n }\n\n if (is_array($pk)) {\n $pkv = [];\n $_pkv = [];\n $insert = TRUE;\n foreach ($pk as $c) {\n if (!empty($data[$c])) {\n $pkv[] = $data[$c];\n $_pkv[$c] = $data[$c];\n // unset($data[$c]);\n $insert = FALSE;\n }\n }\n\n if (!$insert) {\n $insert = is_null(self::getWhere($_pkv));\n }\n\n\n } else {\n $pkv = !empty($data[$pk]) ? $data[$pk] : NULL;\n $_pkv = [$pk => $pkv];\n\n // Se for AUTO INCREMENT remove dos campos a serem INSERIDOS/ALTERADOS\n if (self::_isPkAi())\n unset($data[$pk]);\n\n $insert = empty($pkv);\n }\n\n unset($data['__error']);\n\n foreach ($data as $key => $value) {\n if (strpos($key, '_') === 0)\n unset($data[$key]);\n }\n\n if ($insert) {\n\n if (array_key_exists('created', $data))\n $data['created'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('updated', $data))\n unset($data['updated']);\n\n\n $res = self::$connection->insert($reference, $data)->execute();\n\n if ($res && $pk !== NULL && !is_array($pk))\n $this->{'set'.$pk}(self::$connection->lastInsertId());\n\n } else {\n\n if (array_key_exists('updated', $data))\n $data['updated'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('created', $data))\n unset($data['created']);\n\n $res = self::$connection->update($reference, $data, $_pkv)->execute();\n\n }\n\n if ($res)\n $this->refresh();\n\n $this->afterSave($res);\n\n return $res;\n\n }", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save()\r\n {\r\n //\r\n }", "public function save(Model $model, DTO $dto): bool;", "public function save()\r\n {\r\n \r\n }", "public function testSave()\n {\n $class = $this->getModelClass();\n\n $model = $this->createModel();\n\n $model->save();\n\n $id = $model->getKey();\n\n // if the save was successful, you should be able to find new record in DB\n $model = $this->getModelInstance($id);\n\n $this->assertInstanceOf($class, $model);\n\n $this->modelAttributesTest($model);\n\n unset($model);\n }", "public function save() : bool {\n $this->getForm();\n $model = (array) $this;\n unset($model['id']);\n\n $colNames = implode(', ', array_keys($model));\n $colValues = ':' . str_replace(', ', ', :', $colNames);\n $arrBind = array_combine(explode(', ', $colValues), array_values($model));\n\n try {\n $db = new DbConnection();\n $db = $db->connect();\n $statement = $db->prepare(\"INSERT INTO \" . static::tableName() . \" (\" . $colNames . \")\n VALUES (\" . $colValues . \")\");\n\n foreach ($arrBind as $key => &$value) {\n $statement->bindParam($key, $value);\n }\n\n $result = $statement->execute();\n $db = null;\n } catch (PDOException $e) {\n $result = false;\n $e->getMessage(); // Only in dev mode\n }\n return $result;\n }", "function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }", "public function save() : bool {\n\t\t// Check if record is new\n\t\t$isNew = isset($this->{$this->primaryKey}) && $this->{$this->primaryKey} ? false : true;\n\n\t\tif ($isNew) {\n\t\t\t// Insert\n\t\t\t$this->database->query('INSERT INTO ' . $this->tableNamePrefixed, $this->getValuesForDatabase());\n\t\t\tif ($this->database->getInsertId()) {\n\t\t\t\t$this->{$this->primaryKey} = $this->database->getInsertId();\n\t\t\t}\n\t\t} else {\n\t\t\t// Update\n\t\t\t$this->database->query(\n\t\t\t\t'UPDATE ' . $this->tableNamePrefixed . ' SET',\n\t\t\t\t$this->getValuesForDatabase(),\n\t\t\t\t'WHERE ' . $this->primaryKey . ' = ?', $this->{$this->primaryKey}\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}", "public function save()\n {\n //\n }", "public function save(Request $request, $id)\n {\n \n $todo = Todo::find($id);\n\n $todo->todo = $request->todo;\n $todo->save();\n\n Session::flash('success', 'Your Todo was updated');\n\n return redirect('todos');\n }", "public final function save()\n {\n }", "public function save(Model $model): void;", "public function save() {\n return $this->entity->save();\n }", "public function save() {\n\t\tif ( ! $this->dirty()) return true;\n\n\t\tif (static::$timestamps) {\n\t\t\t$this->timestamp();\n\t\t}\n\n\t\t$this->fire_event('saving');\n\n\t\t// If the model exists, we only need to update it in the database, and the update\n\t\t// will be considered successful if there is one affected row returned from the\n\t\t// fluent query instance. We'll set the where condition automatically.\n\t\tif ($this->exists) {\n\t\t\t$query = $this->query()->where(static::$key, '=', $this->get_key());\n\n\t\t\t$result = $query->update($this->get_dirty()) === 1;\n\n\t\t\tif ($result) $this->fire_event('updated');\n\t\t}\n\n\t\t// If the model does not exist, we will insert the record and retrieve the last\n\t\t// insert ID that is associated with the model. If the ID returned is numeric\n\t\t// then we can consider the insert successful.\n\t\telse {\n\t\t\t$id = $this->query()->insert_get_id($this->attributes, $this->key());\n\n\t\t\t$this->set_key($id);\n\n\t\t\t$this->exists = $result = is_numeric($this->get_key());\n\n\t\t\tif ($result) $this->fire_event('created');\n\t\t}\n\n\t\t// After the model has been \"saved\", we will set the original attributes to\n\t\t// match the current attributes so the model will not be viewed as being\n\t\t// dirty and subsequent calls won't hit the database.\n\t\t$this->original = $this->attributes;\n\n\t\tif ($result) {\n\t\t\t$this->fire_event('saved');\n\t\t}\n\n\t\treturn $result;\n\t}", "public function save()\n {\n // For V2.0\n }", "public function save() {\n }", "public function save()\n\t{\n\t\tself::$db->model = $this;\n\t\t$boolean = $this->validate();\n\t\tif($boolean){\n\t\t\treturn self::$db->saveNow();\n\t\t}\n\t}", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "function Save(){\n // If id is set, update the current register in database\n if(isset($this->idAval)){\n // Makes the update in the database\n return $this->UpdateSQL([\"ID_AVAL = \".$this->idAval]) > 0;\n }else{\n // If id is not set, insert a new row in database\n $this->fecha = date_format(new \\DateTime('now', new \\DateTimeZone('America/Argentina/Buenos_Aires')), 'Y-m-d H:i:s');\n if($this->InsertSQL()>0){\n // Refresh get the inserted id and refresh the object values\n return $this->Refresh();\n }\n }\n return false;\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function save() {\n\t\tif ($this->data) {\n\t\t\treturn $this->repo->addPost($this->data);\n\t\t}\n\t\treturn false;\n\t}", "public function save() {\n }", "public function save() {\n }" ]
[ "0.6700567", "0.66842246", "0.6660837", "0.6660718", "0.6633421", "0.66014105", "0.65970343", "0.65846545", "0.6536471", "0.65291256", "0.6492164", "0.649023", "0.649023", "0.64850175", "0.64183915", "0.6400639", "0.6377372", "0.6369281", "0.62925893", "0.6266008", "0.625315", "0.619863", "0.61903393", "0.61879075", "0.6173637", "0.616544", "0.6102591", "0.60740525", "0.6039503", "0.6032589", "0.60288954", "0.60253286", "0.60248363", "0.6011085", "0.60005665", "0.5999801", "0.59661347", "0.5930848", "0.59286", "0.5927128", "0.59117883", "0.58990496", "0.58944964", "0.58811766", "0.58561325", "0.5826131", "0.5819607", "0.58180535", "0.58180535", "0.5816479", "0.5809823", "0.580723", "0.5800464", "0.5785704", "0.5742393", "0.5737081", "0.57343763", "0.57297474", "0.5723968", "0.5723908", "0.57136756", "0.5707616", "0.5681321", "0.5679974", "0.5671502", "0.56708723", "0.56696934", "0.56696934", "0.5661365", "0.56593126", "0.5655043", "0.5654556", "0.5650668", "0.56493765", "0.5648952", "0.5642884", "0.5637624", "0.56275785", "0.56190807", "0.5618675", "0.56161433", "0.56066376", "0.5606359", "0.5604209", "0.5602155", "0.55957735", "0.55949587", "0.5593581", "0.55911404", "0.5585232", "0.5581459", "0.5580592", "0.55644983", "0.55644125", "0.5564226", "0.55619365", "0.5547877", "0.55446684", "0.5543495", "0.55428463", "0.55428463" ]
0.0
-1
Checks if the value for an attribute is acceptable
public function validate($name, $value) { if(in_array($name, $this->strings)) { if(is_string($value)) { return true; } } else if(in_array($name, $this->booleans)) { if(is_bool($value)) { return true; } } else if(in_array($name, $this->integers)) { if(is_numeric($value)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final function __validateValue($name, $value) {\n\t\tif(array_key_exists($name, $this->attributes)) {\n\t\t\t$datatype = $this->__getAttributeByName($name)->getType();\n\t\t}\n\t\t\n\t\t// check if the attribute is required\n\t\t$required = $this->__getAttributeByName($name)->isRequired();\n\n\t\t// if the value is empty and not required return a success\n\t\tif(!$required && (strlen($value) == 0)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the value is required and empty return a fault\n\t\tif($required && (strlen($value) == 0)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif($datatype == \"UNDEFINED\") {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// check if the value is valid for the attribute\n\t\treturn preg_match(WAT_OP_AttributeTypes::getRegex($datatype), $value);\n\t}", "abstract protected function mustApplyRuleOnAttribute(): bool;", "private function _check_valid_attr($string) {\n\t\t\n\t\t$result = true;\n\t\t\n\t\t// Check $name for correct characters\n\t\t// \"^[a-zA-Z0-9_-]*$\"\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "function wp_kses_attr_check(&$name, &$value, &$whole, $vless, $element, $allowed_html)\n {\n }", "function areAttributesValid($request) : bool{\n foreach($request->getAttributes() as $key => $value)\n if(!is_numeric($value)) return false;\n return true;\n}", "public function supportsAttribute($attribute);", "function attribute_validation($attribute) {\n\n /* Checks each attribute individually to make sure it is a valid string */\n foreach ($attribute as $value) {\n\n $numbers = '0123456789';\n\n /* Checks to make sure the value is a string and that there are no numbers contained in the string */\n if (!is_string($value) || (strcspn($value, $numbers) != strlen($value))) {\n\n//echo \"strcspn:\".strcspn($value, $numbers).\" strlen:\".strlen($value);\n $errorMessage = \"Sorry \" . $value . \" is not a valid attribute\";\n echo $errorMessage;\n echo \"\\n\";\n\n $errorLog = new ErrorFileHandler($this->logfile);\n $errorLog->add_to_error_log($errorMessage);\n\n return false;\n }\n }\n\n return true;\n }", "public static function isInyectedAttribute( $attr )\n {\n return ( strcmp($attr, \"id\") == 0 || strcmp($attr, \"deleted\") == 0 || strcmp($attr, \"class\") == 0 );\n }", "function wp_kses_check_attr_val($value, $vless, $checkname, $checkvalue)\n {\n }", "protected abstract function supportsAttribute($attribute);", "protected function validateAttribute($object, $attribute) {\n \n }", "public function passes($attribute, $value)\n {\n if (preg_match(\"/^.*[-].*$/\", $value) == true) {\n $this->error_message = \"Please do not use dash(-) sign\";\n return false;\n } else if (preg_match(\"/^[+,0].*$/\", $value) != true) {\n $this->error_message = \"Please start with either 0 or +\";\n return false;\n } else if (preg_match(\"/^[0,+]?[1-9][0-9]{9,14}$/\", $value) != true) {\n $this->error_message = \"Please insert only numbers ranging from 10 to 15 digits\";\n return false;\n }\n return true;\n }", "public function getValidAttribute()\n {\n if (!$this->active) {\n app()->make('error')->code(2016);\n }\n\n if (!$this->credentials OR !$this->credentials->count()) {\n app()->make('error')->code(2022);\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n $validationFlag = false;\n if (!empty($value)) {\n $non_digits = [' ', '(', ')', '-', '.', '+'];\n $nums = str_replace($non_digits, '', $value);\n if (strlen($nums) == 10) {\n $validationFlag = true;\n }\n }\n return $validationFlag;\n }", "public function validateAllowed($attribute, $value, $parameters) {\n\n\t\t$this->requireParameterCount(1, $parameters, 'allowed');\n\n\t\t$value = trim($value);\n\t\tif(empty($value)) return true;\n\n\t\t$allowed = $parameters[0];\n\t\t$allowed_parts = explode(\"-\", $allowed);\n\n\t\t$value_parts = explode(\"|\", $value);\n\n\t\tforeach($value_parts as $vp) {\n\n\t\t\t$vp = $this->startSubstr($vp);\n\n\t\t\tif(!in_array($vp, $allowed_parts)) return false;\n\t\t}\n\n return true;\n }", "private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }", "public function isAttributeValid($attrCode, array $attrParams, array $rowData, $rowNum)\n {\n switch ($attrParams['type']) {\n case 'varchar':\n $val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);\n $valid = Mage::helper('core/string')->strlen($val) < self::DB_MAX_VARCHAR_LENGTH;\n break;\n case 'decimal':\n $val = trim($rowData[$attrCode]);\n $valid = (float)$val == $val;\n break;\n case 'select':\n case 'multiselect':\n $valid = isset($attrParams['options'][strtolower($rowData[$attrCode])]);\n break;\n case 'int':\n $val = trim($rowData[$attrCode]);\n $valid = (int)$val == $val;\n break;\n case 'datetime':\n $val = trim($rowData[$attrCode]);\n $valid = strtotime($val) !== false\n || preg_match('/^\\d{2}.\\d{2}.\\d{2,4}(?:\\s+\\d{1,2}.\\d{1,2}(?:.\\d{1,2})?)?$/', $val);\n break;\n case 'text':\n $val = Mage::helper('core/string')->cleanString($rowData[$attrCode]);\n $valid = Mage::helper('core/string')->strlen($val) < self::DB_MAX_TEXT_LENGTH;\n break;\n default:\n $valid = true;\n break;\n }\n\n if (!$valid) {\n $this->addRowError(Mage::helper('importexport')->__(\"Invalid value for '%s'\"), $rowNum, $attrCode);\n } elseif (!empty($attrParams['is_unique'])) {\n if (isset($this->_uniqueAttributes[$attrCode][$rowData[$attrCode]])) {\n $this->addRowError(Mage::helper('importexport')->__(\"Duplicate Unique Attribute for '%s'\"), $rowNum, $attrCode);\n return false;\n }\n $this->_uniqueAttributes[$attrCode][$rowData[$attrCode]] = true;\n }\n return (bool) $valid;\n }", "public function isError($attribute);", "private function checkAttribute($attr)\n {\n if (! in_array($attr, $this->attributeNames)) {\n throw new BadFunctionCallException(\"Attribute '$attr' doesn't exist for the entity type '$this->entityType'.\");\n }\n }", "protected function _validateAttributeInfo(&$info)\n\t{\n\t\tif(count($info['options']) > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function passes($attribute, $value)\n {\n $request = app(\\Illuminate\\Http\\Request::class);\n if (isset($request->quantity) || isset($request->new_item_quantity) || isset($request->item_quantity)) {\n if ( isset($request->quantity) ) {\n for ($i = 0; $i < count($request->quantity); $i++) {\n if (validateNumbers($request->quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n if ( isset($request->new_item_quantity) ) { \n for ($i = 0; $i < count($request->new_item_quantity); $i++) {\n if (validateNumbers($request->new_item_quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n if ( isset($request->item_quantity) ) { \n for ($i = 0; $i < count($request->item_quantity); $i++) {\n if (validateNumbers($request->item_quantity[$i]) <= 0) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }", "public function passes($attribute, $value)\n {\n $permitidos = \"áéíóúabcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOP QRSTUVWXYZ \";\n //$permitidos = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ \";\n\n for ($i = 0; $i < strlen($value); $i++) {\n if (strpos($permitidos, substr($value, $i, 1)) === false) {\n //no es válido;\n return false;\n }\n }\n\n //si estoy aqui es que todos los caracteres son validos\n return true;\n }", "public function passes($attribute, $value)\n {\n try {\n if (substr($value, 0, 1) != '+') return false;\n if (strlen($value) < 9 || strlen($value) > 14) return false;\n if (!is_numeric(substr($value, 1))) return false;\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "abstract protected function validateValue($value);", "public function passes($attribute, $value)\n {\n return $value === 'tva' || $value === 'is';\n }", "public function passes($attribute, $value)\n {\n\n\n }", "public function passes($attribute, $value)\n {\n if (! is_string($value) && ! is_numeric($value)) {\n return false;\n }\n\n return preg_match('/^[\\pL\\pN\\pM\\pZ\\'_-]+.?$/u', $value) > 0;\n }", "public function valid()\n {\n\n if ($this->container['attribute_type'] === null) {\n return false;\n }\n if ($this->container['numeric_value'] === null) {\n return false;\n }\n if ($this->container['date_value'] === null) {\n return false;\n }\n if ($this->container['flag_value'] === null) {\n return false;\n }\n if ($this->container['is_error_value'] === null) {\n return false;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n if (substr($this->_phone, 0, 1) == \"0\")\n return false;\n if (intval(strlen($this->_phone)) == 10)\n return true;\n return false;\n }", "public function hasValueIfApproved($attribute)\n {\n if ($this->isApproved() && empty($this->$attribute)) {\n $this->addError(\n $attribute,\n 'This approved key was not given a value.'\n );\n }\n }", "abstract public function getIsValidValue($value);", "public function passes($attribute, $value)\n {\n // si no viene un valor pasamos la validacion\n\n if(!$value){\n return true;\n }\n\n //que haya una mayuscula\n $upperCase=preg_match('@[A-Z]@',$value);\n //queremos una minuscula\n $lowerCase=preg_match('@[a-z]@',$value);\n //queremos que exista un numero\n $number=preg_match('@[0-9]@',$value);\n //minimo de 8 caracteres\n $length=strlen($value)>=8;\n $success=true;\n if(!$upperCase|| !$lowerCase || !$number || !$length){\n $success=false;\n }\n return $success;\n }", "public function passes($attribute, $value)\n {\n if ((is_null($this->item->qtty) || empty($this->item->qtty)) && $value < 0) {\n return false;\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n return is_numeric($value) && $this->hasAllowedLength($value) && $this->checksumMatches($value);\n }", "public function passes($attribute, $value)\n {\n// dd($value, $attribute);\n $phoneUtil = \\libphonenumber\\PhoneNumberUtil::getInstance();\n try {\n $phoneUtil->parse($value);\n return true;\n } catch (\\libphonenumber\\NumberParseException $e) {\n return false;\n }\n }", "public function passes($attribute, $value)\r\n {\r\n if (!is_numeric($value)) {\r\n $this->message = 'This :attribute must be integer.';\r\n return false;\r\n }\r\n \r\n if ($value <= 0) {\r\n $this->message = 'This :attribute negative amount not allow.';\r\n return false;\r\n }\r\n\r\n $replaceValue = str_replace('.', '', $value);\r\n if (strlen($replaceValue) > 12) {\r\n $this->message = 'This :attribute length can\\'t be greater than 12 digit.';\r\n return false;\r\n }\r\n \r\n if (!preg_match(\"/^\\d{1,10}(\\.\\d{1,2})?$/\", $value)) {\r\n $this->message = 'This :attribute amount provide invalid.';\r\n return false;\r\n }\r\n return true;\r\n }", "public function hasAttr($attr);", "public function evaluateIsValid()\n\t{\n\t\t$idPath=$this->getControlToValidate();\n\t\tif(strlen($idPath))\n\t\t{\n\t\t\t$control=$this->getTargetControl($idPath);\n\t\t\t$value=$control->getValidationPropertyValue();\n\t\t\tif(!strlen($value))\n\t\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\n\t\tswitch($this->getValueType())\n\t\t{\n\t\t\tcase 'Integer':\n\t\t\t\treturn $this->isValidInteger($value);\n\t\t\tcase 'Float':\n\t\t\tcase 'Double':\n\t\t\t\treturn $this->isValidDouble($value);\n\t\t\tcase 'Currency':\n\t\t\t\treturn $this->isValidCurrency($value);\n\t\t\tcase 'Date':\n\t\t\t\treturn $this->isValidDate($value);\n\t\t\tdefault:\n\t\t\t\treturn $this->isValidString($value);\n\t\t}\n\t}", "protected function validateAttribute($model, $attribute) {\n $value = $this->strip_non_numeric($model->$attribute);\n if (!$this->card_validate($value)) {\n\n $lbls = $model->attributeLabels();\n $lbl = $lbls[$attribute];\n $model->addError($attribute, Yii::t('yii', $lbl . ' ' . $this->invalid_msg));\n Yii::log('CARD CREDIT VALIDATE ERROR');\n return false;\n }\n Yii::log('CARD CREDIT VALIDATE SUCCESSFUL');\n return true;\n }", "abstract protected function isValidValue($value);", "public function passes($attribute, $value)\n {\n //\n if(isset($value) && !empty($value)) : \n try {\n return $this->isValidBTCAddress($value);\n } catch(\\Exception $e) {\n return false;\n }\n else :\n return true;\n endif;\n }", "public function passes($attribute, $value): bool\n {\n return preg_match(self::VALIDATION_REGEX, mb_strtolower($value));\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }", "public function passes($attribute, $value)\n {\n $data = json_decode(json_encode($this->request->all()));\n\n if(gettype($data) != 'object'){\n return false;\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n if (strlen(preg_replace('/[^0-9]/', '', $value)) !== $this->digitsWithoutDash) {\n $this->message = \"The :attribute must include {$this->digitsWithoutDash} digits.\";\n return false;\n }\n if (!preg_match($this->regex, $value)) {\n return false;\n }\n return true;\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_WARRANTYOFFERED,self::VALUE_CUSTOMCODE));\n\t}", "protected function validateAttribute($object,$attribute)\n\t{\n\t\t// be silent! validation handled by validate method as it validates the group of attributes\n\t}", "public function passes($attribute, $value)\n {\n return !strncmp($this->town->short_postcode, $value, 2);\n }", "public function passes($attribute, $value)\n {\n // return strtoupper($value) === $value;\n return preg_match(\"/^[ ,<.>\\/?'\\\"\\;:=+-_)(*&%$@!AÁÀẢÃẠÂẤẦẨẪẬĂẮẰẲẴẶEÉÈẺẼẸÊẾỀỂỄỆIÍÌỈĨỊOÓÒỎÕỌÔỐỒỔỖỘƠỚỜỞỠỢUÚÙỦŨỤƯỨỪỬỮỰYÝỲỶỸỴĐaáàảãạâấầẩẫậăắằẳẵặeéèẻẽẹêếềểễệiíìỉĩịoóòỏõọôốồổỗộơớờởỡợuúùủũụưứừửữựyýỳỷỹỵđ0-9a-zA-Z\\s]+$/\", $value);\n }", "public function passes($attribute, $value)\n {\n return $this->numericValidation() && $this->testUnique();\n }", "public function passes($attribute, $value)\n {\n $splitted = preg_split('/\\./', $attribute);\n $index = $splitted[1];\n\n return $value !== true || $this->permissions[$index]['allowed'] !== false;\n }", "public function matchAttribute($oi, $attribute, $value) {\n $valuefound = $this->getAttribute($oi,$attribute);\n\n // if we do not support this attribute, we skip validation (valuefound is NULL)\n // However, if we do support it, but we have no value, or the value is a mismatch, \n // throw an error\n \n if($valuefound === null || !is_array($valuefound)) {\n return true;\n }\n \n // convert all array values to hashes. We could have done that in the getAttribute method,\n // but that would reduce its applicability and make debugging cumbersome\n $hashes = array();\n foreach($valuefound as $val) {\n $hashes[] = hash('sha256',$val);\n }\n if(!in_array($value,$hashes)) {\n throw new RuntimeException(\"Not Authorized\");\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n if (request()->get('fecha_finalizado') != null) {\n\n $razon = Razon::find(request()->get('razon_id'), ['nombre']);\n\n if (!preg_match(\"/no acepta/i\", $razon->nombre)) {\n\n if (request()->get('valor_aprobado') != request()->get('valor_cotizado')) {\n return false;\n }\n }\n return true;\n }\n return true;\n }", "protected function validate_attributes()\n {\n foreach (static::$object_attributes as $key => $value) {\n if (!isset($this->{$key})) {\n Error::set(Error::ERROR_MISSING_ATTRIBUTE, [$key], Error::ERROR);\n }\n }\n\n return true;\n }", "public function isAttribute($field){\n\t\treturn $this->hasField($field);\n\t}", "public function passes($attribute, $value)\n {\n if(!$this->isValidCard($value)){\n $this->message = '身份证格式错误,请输入正确的身份证.';\n return false;\n }\n\n return true;\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_REPLACEMENTWARRANTY,self::VALUE_DEALERWARRANTY,self::VALUE_MANUFACTURERWARRANTY,self::VALUE_CUSTOMCODE));\n\t}", "public function passes($attribute, $value)\n {\n return preg_match('/^([a-z_\\d])+$/', $value) > 0;\n }", "public function passes($attribute, $value): bool\n {\n if (!Str::containsAll($value, ['data:image/', 'base64,'])) {\n return false;\n }\n\n // get the image size\n $size = (int) (strlen(rtrim($value, '=')) * 3 / 4);\n\n if ($size > $this->max_size) {\n return false;\n }\n\n return true;\n }", "public function passes($attribute, $value)\n {\n \n if(!is_array($value)){\n dd(\"no array\");\n return false;\n }\n\n if(!isset($value['type'])){\n dd(\"no type\");\n return false;\n }\n\n elseif(is_null($value['type']) || $value['type'] == ''){\n dd(\"no type null\");\n return false;\n }\n\n elseif($value['type'] === 2 ){\n dd(\"radio type no label\");\n return false;\n }\n\n\n elseif($value['type'] == 3){\n return false;\n }\n\n\n else{\n return true;\n }\n }", "public function testInvalidAttributeName()\n {\n $config = array(\n\t\tnull\n );\n\n $result = self::processFilter($config, self::$request);\n }", "public function passes($attribute, $value)\n {\n $data = UOM::where('uom_id', $this->uom_id)->first();\n \n if($data['is_decimal'] == 0){\n return ctype_digit($value) == true ? true : false;\n }else if($data['is_decimal'] == 1){\n return true;\n }else{\n return false;\n }\n // echo ctype_digit('10') == true ? 'true' : 'false';\n // exit;\n }", "public function is_valid()\n\t{\n\t\t\n\t\t$field_value = trim($this->value);\n\t\t\n\t\tif($field_value == \"\")\n\t\t\treturn !$this->required;\n\t\t\n\t\tif(!in_array($field_value, $this->enum_array))\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n \t\n\t}", "public function passes($attribute, $value)\n {\n return in_array('team_id', $value)\n && in_array('phone', $value)\n && in_array('sticky_phone_number_id', $value);\n }", "public function isValid($value) {\n return parent::isValid($value) || preg_match($this->_pattren, $value);\n }", "public function passes($attribute, $value)\n {\n return preg_match('/^[\\u4E00-\\u9FA5A-Za-z0-9_-]+$/', $value);\n }", "public function validateHoneypot($attribute, $value, $parameters)\n {\n if (!$this->enabled) {\n return true;\n }\n return $value == '';\n }", "public function validateAssignmentData(Collection $data, string $attribute): bool;", "public function hasAttr(){\n return (is_array($this->attr) && !empty($this->attr));\n }", "public function passes($attribute, $value)\n {\n return $this->validarCedula($value);\n }", "public function passes($attribute, $value)\n {\n $keys = array_keys(json_decode($value, true));\n $diff = array_diff($keys, $this->model->getFillable());\n\n return !count($diff);\n }", "public function passes($attribute, $value)\n {\n return if_exist_asignacion($this->docente_id,$value,$this->grado_id) === true;\n }", "public function passes($attribute, $value)\n {\n $noSpaces = ($value == trim($value) && strpos($value, ' ') !== false) ? false : true;\n\n $specialCharacters = '!\"#$%&\\'()*+,-./:;<=>?@[\\]^_`{|}~';\n\n $specialCharactersExclude = '!\"#$%&\\'()*+,-/:;<=>?@[\\]^`{|}~'; // Exclude underscore and period\n\n $startWithSpecialChars = in_array($value[0], str_split($specialCharacters));\n\n $endsWithSpecialChars = in_array($value[strlen($value) - 1], str_split($specialCharacters));\n\n $containsSpecialCharsExclude = Util::containsChar($specialCharactersExclude, $value);\n\n $moreThanOnePeriod = substr_count($value, '.') > 1 ? true : false;\n\n \n return (\n $noSpaces\n && !$startWithSpecialChars\n && !$endsWithSpecialChars\n && !$moreThanOnePeriod\n && !$containsSpecialCharsExclude\n ) ? true: false;\n }", "public function passes($attribute, $value)\n {\n return $value === \"ShowMeTheVideos\";\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_NOHITCOUNTER,self::VALUE_HONESTYSTYLE,self::VALUE_GREENLED,self::VALUE_HIDDEN,self::VALUE_CUSTOMCODE));\n\t}", "public function passes($attribute, $value)\n {\n //Check if value contain + in the start\n if(substr($value, 0 ,1) == '+') {\n $noPlus = str_replace('+','', $value);\n\n return is_numeric($noPlus);\n }\n\n return is_numeric($value);\n }", "private function is_funciri_attribute($tag, $attr)\n {\n return in_array($attr, array('fill', 'filter', 'stroke', 'marker-start',\n 'marker-end', 'marker-mid', 'clip-path', 'mask', 'cursor'));\n }", "public function passes($attribute, $value)\n {\n try {\n return !resolve(Spam::class)->detect($value);\n } catch (Exception $e) {\n return false;\n }\n }", "public function passes($attribute, $value)\n {\n try {\n return Factory::makeFromNumber($this->card_number)->isValidCvc($value);\n } catch (\\Exception $ex) {\n return false;\n }\n }", "public function passes($attribute, $value)\n {\n// $len = strlen($value);\n $a = false;\n $value = strtolower($value);\n\n if(Str::endsWith($value, 'street')){\n $a = true;\n }\n if($a){\n return true;\n }\n return false;\n }", "public function validate() {\n return v::same($this->value, get($this->attribute . '_confirmation')) or v::same($this->value, $this->data[$this->attribute . '_confirmation']);\n }", "function getAttribute($attr) {\n\n $attribute = getEmptyAttribute($attr);\n\n if (function_exists(\"http_status_code\") && $attribute == \"\") {\n http_status_code(409, \"Attribute cannot be empty\");\n } else {\n return $attribute;\n }\n }", "public function passes($attribute, $value)\n {\n $t_data = explode('.',$attribute);\n\n return (!empty($t_data[1]) and in_array((int)$t_data[1], $this->data_arr))? true : false ;\n }", "public function passes($attribute, $value)\n {\n return !Validator::make(\n [\n \"{$attribute}\" => explode(',', $value)\n ],\n [\n \"{$attribute}.*\" => ['required', 'regex:/(09)[0-9]{9}$|(\\+63)[0-9]{10}$/']\n ]\n )->fails();\n }", "static function validate($val) {\n\t\t$res = false;\n\t\tif (isset($val) && ($val != \"\")){\n\t\t\t$res = true;\n\t\t}\n\t\treturn ($res);\n\t}", "public function passes($attribute, $value)\n {\n if (!ctype_digit($value) && !is_int($value)) {\n return false;\n }\n\n $book = Book::where([\n 'translation_id' => $this->translation->id,\n 'number' => $value\n ])->first();\n\n if (filled($book) && filled($this->book) && $book->id == $this->book->id) {\n return true;\n }\n\n return blank($book);\n }", "public function passes($attribute, $value) : bool\n {\n $rules = [];\n\n if (request()->isMethod('POST')) {\n $rules[] = 'required';\n } else {\n $rules = array_merge($rules, ['sometimes', 'nullable']);\n }\n\n $rules = array_merge($rules, ['image', 'max:5120']);\n\n $validator = Validator::make([\n $attribute => $value,\n ], [\n $attribute => $rules,\n ]);\n\n return !$validator->fails();\n }", "public function passes($attribute, $value)\n {\n $currentAge = Carbon::parse($value)->age;\n\n return $currentAge <= 110;\n }", "protected function _validateAttributeValue($attributeId, &$value, &$options)\n\t{\n\t\tif(isset($options[$attributeId][$value['value_index']])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private static function isAttributeAllowedForTag(DOMAttr $attribute): bool\n {\n return ! in_array(\n $attribute->nodeName,\n Arr::get(static::$validUserTagsAndAttributes, $attribute->parentNode->tagName, []),\n true\n );\n }", "public function validateValue($value)\n {\n }", "public function passes($attribute, $value)\n {\n if (is_null($value)) {\n if (!$this->required) {\n return true;\n }\n }\n return $this->valphone($value);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_JPG,self::VALUE_GIF,self::VALUE_CUSTOMCODE));\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_TOPIC,self::VALUE_AUTHOR,self::VALUE_SOURCE,self::VALUE_COLLECTIONCODE,self::VALUE_KEYWORDS,self::VALUE_AFFILIATION,self::VALUE_DATE));\n\t}", "public function passes($attribute, $value)\n {\n if (! preg_match('/^[0-9]{8,20}$/', $value)) {\n $this->message = __('userandpermission::validation.digits', ['attribute' => $attribute]);\n } elseif (strlen($value) > $this->max) {\n $this->message = __('userandpermission::validation.phone_max', ['attribute' => $attribute, 'max' => $this->max]);\n } elseif (strlen($value) < $this->min) {\n $this->message = __('userandpermission::validation.phone_min', ['attribute' => $attribute, 'min' => $this->min]);\n }\n\n return ($this->message == 'passes');\n }", "protected function getValueAttribute() {}", "function is_valid($value) {\n\t\tif (isset($value) && trim($value) != \"\" && trim(strtolower($value)) != \"null\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function passes($attribute, $value)\n {\n return Consulta::reniec()->validateDigit($this->dni, $value);\n }", "public function hasErrors($attribute = null);", "public function passes($attribute, $value)\n {\n $times = preg_match('/(^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)/', $value);\n if (!$times)\n return false;\n if (Carbon::now()->subYears($this->age)->lt(Carbon::createFromDate(substr($value, 6, 4), substr($value, 10, 2),\n substr($value, 12, 2)))) {\n return false;\n }\n return true;\n }", "public function passes($attribute, $value)\n {\n\n $arr = $value;\n if(is_string($value)){\n $arr = json_decode($value,true);\n if (!is_array($arr)){\n \n return false;\n }\n }\n\n if (is_array($arr)){\n $arr = array_filter($arr);\n }\n\n if (empty($arr)) {\n return true;\n }\n\n foreach ($arr as $key => $val) {\n $data = $this->selectFieldType($key);\n if (!$data) {\n return false;\n }\n $data['value'] = $val;\n $arr[$key] = $data;\n }\n Cache::put('field_request_'.Auth::user()->parent_uid, $arr, 30);\n return true;\n }" ]
[ "0.7249126", "0.68950045", "0.67212325", "0.6633378", "0.6531454", "0.6496891", "0.64922136", "0.6477317", "0.64626116", "0.6415653", "0.6382719", "0.6369392", "0.634994", "0.63326794", "0.63220567", "0.6311655", "0.63056344", "0.62773365", "0.626233", "0.62565786", "0.6251321", "0.62480074", "0.6246383", "0.6223197", "0.61783624", "0.6174575", "0.6168565", "0.61669314", "0.61595225", "0.61571455", "0.6140443", "0.6135125", "0.61338687", "0.61334145", "0.61315036", "0.61314386", "0.612763", "0.6117495", "0.6116031", "0.6112677", "0.61111075", "0.6089936", "0.6066385", "0.60480344", "0.6039659", "0.60383445", "0.60302746", "0.6026459", "0.6022948", "0.6010902", "0.60085887", "0.60076135", "0.60056365", "0.5987261", "0.5987033", "0.59751505", "0.59729666", "0.596861", "0.59632665", "0.59475684", "0.59467804", "0.59412026", "0.5938216", "0.5932078", "0.59314305", "0.5925395", "0.5922008", "0.59171104", "0.59050566", "0.58948046", "0.5894232", "0.5884589", "0.587711", "0.58692926", "0.5858864", "0.58559895", "0.58496433", "0.5848935", "0.58347994", "0.58338207", "0.5827861", "0.58243686", "0.58223325", "0.5818173", "0.58066666", "0.5800333", "0.5798542", "0.5795053", "0.5794609", "0.57911545", "0.57896465", "0.5787476", "0.5785949", "0.57859164", "0.5784297", "0.5782222", "0.5765925", "0.5760746", "0.5753469", "0.575296", "0.5752948" ]
0.0
-1
Mark the given attribute as modified Returns 'true' when marked as modified Returns 'false' if already marked as modified
public function setModified($name) { if(!in_array($name, $this->modifiedAttributes)) { $this->modifiedAttributes[] = $name; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _flagAttributeAsModified($attribute) {\n\t\tif (!in_array($attribute, $this->_modifiedAttributes)) {\n\t\t\t$this->_modifiedAttributes[] = $attribute;\n\t\t}\n\t}", "public function isModified();", "public function isModified(): bool;", "function isModified() { return $this->_modified; }", "function isModified() { return $this->_modified; }", "public function isModified() {\n return count($this->modifiedAttributes) > 0;\n }", "public function isModified($name = NULL);", "public function setModified($value) {}", "public function hasDirtyValueOfAttribute($attributeName);", "public function isModified()\n {\n\treturn $this->modified;\n }", "function IsAttributeModifiable( $attribute )\r\n\t{\r\n\t\treturn getFactory()->getAccessPolicy()->can_modify_attribute($this->getObject(), $attribute)\r\n && $this->getObject()->getAttributeEditable($attribute);\r\n\t}", "public function setModified($modified);", "abstract protected function setModifiedState();", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "public function changed($attribute) {\n\t\treturn array_get($this->attributes, $attribute) != array_get($this->original, $attribute);\n\t}", "function modified() { $this->_modified=1; }", "function modified() { $this->_modified=1; }", "public function setAsModified($name = NULL);", "public function wasModified()\n\t{\n\t\tif ($this->get('modified') && $this->get('modified') != '0000-00-00 00:00:00')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}", "function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}", "function isModified() {\n\t\t$modified = $this->_Modified;\n\n\t\treturn $modified;\n\t}", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified($name) {\n\t\treturn isset($this->_modified[$name]);\n\t}", "public function isDirty()\n {\n return $this->isModified;\n }", "function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }", "function _isDirty() ;", "public function modified($flag = true) {\n\t\t$this->modified = (boolean) $flag;\n\t\treturn $this;\n\t}", "function isModified() {\n\t\t$modified = $this->_Modified;\n\t\tif ( !$modified && $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$modified = $modified || $oObject->isModified();\n\t\t\t}\n\t\t}\n\t\treturn $modified;\n\t}", "function isModified() {\n\t\t$modified = $this->_Modified;\n\t\tif ( !$modified && $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$modified = $modified || $oObject->isModified();\n\t\t\t}\n\t\t}\n\t\treturn $modified;\n\t}", "public function getIsModifiedOnStage() {\n\t\treturn true;\n\t}", "public function _isDirty() {}", "public function isDirty();", "public function updateBoolean( Inx_Api_Recipient_Attribute $attr, $blValue );", "public function isDirty(): bool\n {\n return count($this->changedAttributesName()) > 0;\n }", "public function isMutable()\n\t{\n\t\treturn true;\n\t}", "protected final function _markModified()\n {\n DomainWatcher::addModifiedObject($this);\n }", "public function isMutable(): bool\n {\n return $this->mutable;\n }", "protected static function _isMutable()\n {\n return false;\n }", "public function getCanModifyAttribute()\n {\n // Checks if there are any shared user permissions for this user, if not returnes false\n // If they do have permissions, it will return there modify attribute\n return (count($this->auth_user_share)) ? (bool)($this->auth_user_share[0]->pivot->modify) : false;\n }", "public function isChanged() : bool\n {\n\n return $this->_changed;\n\n }", "public function isDirty(): bool;", "public function isModifyRelationship();", "public function isModifyProtected() {\n\t\treturn $this->getModifyProtected();\n\t}", "public function getModified() {}", "public function isAttributeSave(string $attribute): bool;", "public function hasChanged(): bool\n {\n if (! $this->isSynced()) {\n return true;\n }\n\n return $this->attributes !== $this->original;\n }", "public function isChanged() {\n\t\treturn $this->_changed > 0;\n\t}", "public function getModified();", "function set_timemodified() {\n $this->timemodified = time();\n return true;\n }", "public function getDirtyValueOfAttribute($attributeName);", "public function setModified($modified) {\n\t\t$this->modified = (string) $modified;\n\t}", "public function canBeEdited() {}", "function isDirty() : bool;", "public function isMutable();", "public function getIsUpdatedAttribute (): bool\n {\n return $this->created_at < $this->updated_at;\n }", "public static function isMutable()\n {\n return false;\n }", "private function changed()\n {\n $this->isDirty = true;\n }", "public function isSetFlag($path);", "public function isModified($column)\n {\n if (empty($this->cleanData) || !array_key_exists($column, $this->cleanData)) {\n return array_key_exists($column, $this->data);\n }\n return $this->cleanData[$column] !== $this->data[$column];\n }", "public function setUnmodified()\n {\n\t$this->modified= false;\n }", "public function getScenarioIsModification() {\n\t\treturn self::SCENARIO_MODIFICATION == $this->scenario;\n\t}", "public function isUpdated() {}", "function setModified($inModified = true) {\n\t\tif ( $inModified !== $this->_Modified ) {\n\t\t\t$this->_Modified = $inModified;\n\t\t}\n\t\treturn $this;\n\t}", "public function setChanged()\n {\n\n $this->_changed = true;\n\n }", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "function setModified( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Modified = ( $value );\n }", "function isChanged(): bool;", "public function isDirty() {\n\t\treturn count($this->_modified);\n\t}", "public function hasChanged($name, $value = null)\n {\n if ($value !== null) {\n $this->setNewAttribute($name, $value);\n }\n\n if ($this->hasOldAttribute($name) && $this->hasNewAttribute($name)) {\n return $this->getOldAttribute($name) != $this->getNewAttribute($name);\n } else {\n // Unknown attribute\n }\n }", "public function getModified()\r\n {\r\n return $this->modified;\r\n }", "function isMemberChanged(string $name): bool;", "public function setChanged($changed = true) { $this->changed = $changed; }", "private function GetModified()\n\t\t{\n\t\t\treturn $this->modified;\n\t\t}", "public function set($attr, $value) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] = $value : false;\n }", "public function hasChanged(): bool\n {\n return $this->changed;\n }", "public function markUserAsUpdated(): bool\n {\n return $this->fill([$this->UPDATECOLUMN, Chronos::date()->stamp()])\n ->save();\n }", "public function cleanOnUpdate()\n {\n $value = $this->getAttribute('clean');\n \n return 'true' == $value?true:false;\n \n }", "public function modify($modify);", "final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}", "public function hasChanged() { return $this->changed; }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }", "public function getModified()\n {\n return $this->modified;\n }" ]
[ "0.77045465", "0.7398629", "0.72811955", "0.7070728", "0.7070728", "0.69159573", "0.6888714", "0.68156314", "0.677239", "0.674449", "0.67337763", "0.67033875", "0.6593784", "0.6583811", "0.6583811", "0.6583811", "0.6583811", "0.6526646", "0.64984745", "0.64984745", "0.6424665", "0.63220435", "0.6297108", "0.6297108", "0.6297108", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.6267801", "0.62466806", "0.62439793", "0.62396544", "0.61916375", "0.6191284", "0.6154689", "0.6154689", "0.6140918", "0.6128772", "0.6091599", "0.60577846", "0.6054133", "0.60189825", "0.6014731", "0.6006574", "0.60046303", "0.59990096", "0.5961928", "0.5954182", "0.594781", "0.5947026", "0.5942931", "0.59019", "0.58980596", "0.5873969", "0.5870738", "0.5865816", "0.58490294", "0.58440924", "0.58425355", "0.5837662", "0.5828347", "0.58231986", "0.58128685", "0.57963955", "0.57858443", "0.5767842", "0.5731139", "0.5730831", "0.57286", "0.5703739", "0.5699023", "0.5688999", "0.5685903", "0.5682727", "0.5675138", "0.5656181", "0.56165594", "0.5611575", "0.55997616", "0.5595106", "0.5592493", "0.55868673", "0.55748725", "0.5566908", "0.55656284", "0.55558294", "0.5553487", "0.5550485", "0.5550485", "0.5550485", "0.5550485", "0.5550485" ]
0.71217453
3
Whether or not this model has been 'filled' with data from the API
public function hasData() { return $this->hasData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has_data()\n {\n }", "private function isPopulated() {\n return $this->is_populated;\n }", "public function isFilled()\n {\n return ! empty($this->data);\n }", "public function hasData(){\n return $this->_has(1);\n }", "public function isValidResponse(){\n\t\treturn $this->isLoaded(); \n\t}", "protected function has_data()\n {\n }", "protected function onCreating()\n {\n return $this->isDataOnCreateValid();\n }", "public function hasData(): bool\n {\n return !empty($this->data);\n }", "public function hasData(){\n return $this->_has(10);\n }", "public function hasData(){\n return $this->_has(10);\n }", "public final function hasData()\n {\n return $this->data == false ? false : true;\n }", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "public function isHydrated() {\n\t\treturn !empty($this->originalData);\t\t\n\t}", "public function isValid() {\n\t\treturn !is_array($this->data) && count($this->data->getRawData()) > 0;\n\t}", "public function loaded()\n {\n return is_array($this->data);\n }", "public function is_missing_required_data(){\n\t\tif ( ! $this->exists ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! $this->get_trigger() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( $this->data_layer()->is_missing_data() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function checkAlwaysPopulateRawPostDataSetting() {}", "public function valid() {\n return array_key_exists($this->_key, $this->_data);\n }", "private function setPopulated() {\n $this->is_populated = true;\n }", "public function isKnown() {\n\t\t\treturn $this->hasData(static::$_key);\n\t\t}", "public function valid(): bool\n {\n return count($this->data) != 0;\n }", "public function valid()\n {\n return !is_null(key($this->requests));\n }", "public function isComplete()\n {\n $result = TRUE;\n foreach(['Id','Address','FullName'] as $what):\n $getter = 'get'.$what;\n $value = $this->{$getter}();\n $result = $result && !empty($value);\n endforeach;\n return $result;\n }", "public function valid()\n {\n if (count($this->data) < 1) {\n if ($this->provider instanceof \\Closure) {\n $this->data = $this->provider->__invoke($this->key);\n } else {\n $this->data = $this->manuallyAddedData;\n $this->manuallyAddedData = array();\n }\n }\n\n return count($this->data) > 0;\n }", "protected function is_api_loaded()\n {\n }", "public function hasExplicitBodyData()\n {\n return $this->explicit_body_data !== null;\n }", "public function fill_fields() {\n if (!parent::fill_fields()) {\n return false;\n }\n $stmt = $this->pdo->prepare('select valid from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n }\n $this->valid = $res[0][0];\n return true;\n }", "public function valid() {\n\t\treturn $this->can_fetch() && (false !== $this->fetch());\n\t}", "public function valid()\n {\n return $this->validateData();\n }", "public function valid()\n {\n return ( current( $this->data ) !== false );\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function hasUserData(){\n return $this->_has(2);\n }", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function hasDatas(){\n return $this->_has(5);\n }", "public function valid()\n {\n return $this->datasource->valid();\n }", "public function has_fields()\n {\n }", "public function hasInfo()\n {\n return !empty($this->info) || !empty($this->seat);\n }", "public function hasUserData(){\n return $this->_has(3);\n }", "public function checkModel(): bool\n {\n if (is_null($this->profile)) throw new ProfileModelNotDefined();\n else return true;\n }", "private function fetchDataFromRequest()\n {\n $this->data = (object)$_REQUEST;\n if ($this->getParameter('apicheck',self::REGEX_INTEGER)) {\n $this->apiCheck = true;\n }\n\n return true;\n }", "public function validateData(){\n return true;\n }", "public function hasData(): bool {\n return is_array($this->data);\n }", "public function hasFields(){\n return $this->_has(1);\n }", "public function hasStructuredData() {\n\t\treturn ! empty( $this->data );\n\t}", "public function isFetched() {\n return !empty($this->fetchTime);\n }", "public function fill()\n {\n // obtiene todos los datos del producto con el identificador asignado\n $rows = $this->dao->select([\"*\"], [\"idProducto\" => $this->idProduct]);\n if (!$rows) return false;\n\n // rellena los atributos con los datos obtenidos\n $this->owner = $rows[0][\"propietario\"];\n $this->state = $rows[0][\"estado\"];\n $this->name = $rows[0][\"nombre\"];\n $this->description = $rows[0][\"descripcion\"];\n\n return true;\n }", "public function isValid()\n\t\t{\n\t\t\treturn !is_null($this->data);\n\t\t}", "public function fill_fields() {\n if (isset($this->id) && isset($this->name)) {\n /* already filled */\n return true;\n } else if (isset($this->id)) {\n $stmt = $this->pdo->prepare(\"select name from $this->table where id = :id\");\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n } else {\n $this->name = $res[0][0];\n return true;\n }\n } else if (isset($this->name)) {\n $stmt = $this->pdo->prepare(\"select id from $this->table where name = :name\");\n $stmt->bindValue(':name', $this->name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n } else {\n $this->id = $res[0][0];\n return true;\n }\n } else {\n return false;\n }\n }", "public function exists()\n {\n return !empty($this->data);\n }", "protected function isFetched()\r\n\t{\r\n\t\treturn $this->bFetched;\r\n\t}", "public function hasFields()\n {\n return !empty($this->fields);\n }", "public function apiReady() {\n \n if(!$this->isReady()) {\n $this->error(\"apiReady() - not ready.\");\n return false;\n }\n \n if(empty($this->userId)) {\n $this->error(\"apiReady() - user id is not set.\");\n return false;\n }\n \n if(empty($this->getToken())) {\n $this->error(\"apiReady() - no access token.\");\n return false;\n }\n \n if(empty($this->getSecret())) {\n $this->error(\"apiReady() - no access token secret.\");\n return false;\n }\n \n /* ready! */\n \n return true;\n }", "protected function getAllFieldsAreEmpty() {}", "public function isWired(): bool\n {\n if ($this->attributes && count($this->attributes->whereStartsWith('wire:model')->getIterator())) {\n return false;\n }\n\n return app(FormDataBinder::class)->isWired();\n }", "#[\\ReturnTypeWillChange]\n public function valid()\n {\n return key($this->_data) !== null;\n }", "function isComplete()\n {\n return $this->complete;\n }", "protected function fillableNotSet()\n {\n return ! isset($this->fillable);\n }", "function ready()\n\t{\n\t\treturn $this->isReady();\n\t}", "public function hasData() : bool;", "public function isDataValid(): bool;", "function _initData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$this->_data = null;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}", "public function valid () {\n return isset($this->__fields[key($this->__fields)]);\n }", "public function valid()\n {\n return $this->dataSource->valid();\n }", "public function hasPostData()\r\n\t{\r\n\t\treturn (is_array($this->postData) && !empty($this->postData));\r\n\t}", "public function valid() {\n\t\t\treturn (isset($this->data[$this->index]));\n\t\t}", "public function isValid () {\n return Validator::isEventValid($this->serialize()) &&\n !!($this->getId() && $this->getDefinitionId() && is_array($this->getData()) && $this->getCreatedAt());\n }", "public function hasModel();", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function isReady()\n {\n return $this->isReady;\n }", "public function fill()\n {\n // Load the serialized map.\n // If there is none or it isn't current we will generate it anew.\n if (!$this->load()) {\n $this->generate();\n }\n\n // Still here? Sounds good\n return true;\n }", "public function hasData() {\n try {\n $res = TRUE;\n }\n catch (\\Exception $e) {\n $res = FALSE;\n }\n\n return $res;\n }", "public function isComplete() {\n if ( !empty($this->aliasId) && !empty($this->email) && !empty($this->username)) {\n return true;\n } else {\n return false;\n }\n }", "public function valid() {\n\t\treturn (current($this->_data) !== false);\n\t}", "public function isValid()\n\t{\n\t\treturn $this->response\n\t\t\t&& $this->response->isValid();\n\t}", "public function hasChanges () {\n return !!$this->dirty;\n }", "public function needAdditionalData()\n {\n $result = false;\n if ($this->provider !== null) {\n $result = $this->provider->needAdditionalData();\n }\n\n return $result;\n }", "public function fitted() : bool\n {\n return isset($this->idfs);\n }", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "public function hasDetail() : bool\n {\n return ! empty($this->getDetail());\n }", "public function hasRecord() {}", "function isReady()\n\t{\n\t\treturn ($this->getCompleteResult() !== false);\n\t}", "public function retrieveData ()\r\n {\r\n // deciding on the way we retrieve data\r\n $method = &$_POST;\r\n if ($this->_meta['method'] == 'get')\r\n $method = &$_GET;\r\n if (!isset ($method[$this->_meta['id'].'_submitted']))\r\n return false;\r\n // getting the information for each field\r\n foreach ($this->_fields as $key => $val)\r\n // if a field is missing, make form invalid\r\n if (!isset ($method[$key]) || !$method[$key])\r\n {\r\n if (!isset ($val['value']))\r\n {\r\n $this->_errors[$key] = 'required';\r\n $this->_valid = false;\r\n }\r\n else\r\n $this->_values[$key] = $val['value'];\r\n }\r\n else\r\n $this->_values[$key] = $method[$key];\r\n return true;\r\n }", "public function isEntityFilled(Pickup $object);", "public function is_initialised() {\n return true;\n }", "protected function isRawData() {\n return $this->rawData;\n }", "public function valid()\n {\n\n if ($this->container['correlation_id'] === null) {\n return false;\n }\n if ($this->container['provider_id'] === null) {\n return false;\n }\n if ($this->container['response_code'] === null) {\n return false;\n }\n if ($this->container['response_detail'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n return $this->valid;\n }", "public function valid()\n {\n return $this->valid;\n }", "public function valid()\n {\n return $this->valid;\n }", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "protected function api_connected() {\n\t\treturn ! empty( $this->api );\n\t}", "public function is_loaded()\n {\n return $this->loaded;\n }", "public function isValid()\r\n {\r\n return !empty($this->data) AND empty($this->data['error']);\r\n }", "public function isNotReadyForRequests() {\n return empty($this->service_url) || empty($this->api_key);\n }", "protected function creating()\n {\n return $this->method() == 'POST';\n }", "public function valid()\n {\n\n if ($this->container['incrementId'] === null) {\n return false;\n }\n if ($this->container['entityId'] === null) {\n return false;\n }\n if ($this->container['orderId'] === null) {\n return false;\n }\n if ($this->container['orderIncrementId'] === null) {\n return false;\n }\n if ($this->container['storeId'] === null) {\n return false;\n }\n if ($this->container['customerId'] === null) {\n return false;\n }\n if ($this->container['dateRequested'] === null) {\n return false;\n }\n if ($this->container['customerCustomEmail'] === null) {\n return false;\n }\n if ($this->container['items'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['comments'] === null) {\n return false;\n }\n if ($this->container['tracks'] === null) {\n return false;\n }\n return true;\n }", "protected function validDataFromRequest()\n {\n return array_merge([\n // Current object\n 'obj_type', 'obj_id', 'property',\n // elFinder instance\n 'assets', 'callback'\n ], parent::validDataFromRequest());\n }", "function valid()\n {\n try {\n return (bool)$this->data();\n } catch (Exception $e) {\n return false;\n }\n }" ]
[ "0.6614833", "0.65900844", "0.651978", "0.6503891", "0.6474328", "0.6453933", "0.6337027", "0.6311637", "0.6255252", "0.6255252", "0.62256306", "0.6199904", "0.6199026", "0.61497474", "0.6132087", "0.60428345", "0.6019625", "0.59935266", "0.598046", "0.596523", "0.59613657", "0.592289", "0.59170574", "0.59081364", "0.59059787", "0.58975357", "0.58744323", "0.58570117", "0.5845183", "0.58340585", "0.582843", "0.582843", "0.582843", "0.582843", "0.58273983", "0.5819732", "0.58127034", "0.58090454", "0.5800287", "0.57972836", "0.5788914", "0.57841897", "0.575886", "0.5752717", "0.5751982", "0.5739888", "0.57386404", "0.5723209", "0.5719753", "0.57134414", "0.5713127", "0.57015115", "0.5690394", "0.56883454", "0.568539", "0.56816125", "0.5676855", "0.5669582", "0.5668377", "0.5666836", "0.5662803", "0.56581473", "0.5655425", "0.5650804", "0.5642648", "0.56375194", "0.56268954", "0.5615237", "0.5615201", "0.56087035", "0.5597258", "0.55948746", "0.55825895", "0.558143", "0.55807304", "0.55785835", "0.55745", "0.5572674", "0.55702204", "0.55649304", "0.55634576", "0.5551012", "0.55426717", "0.5542133", "0.5540555", "0.5536274", "0.5527818", "0.55278", "0.5526741", "0.5526741", "0.5526741", "0.5524359", "0.5522851", "0.5522155", "0.5521729", "0.5517615", "0.5494869", "0.549466", "0.5494554", "0.54933846" ]
0.64965266
4
Whether or not this model has been changed locally since last downloaded from the API
public function isModified() { return count($this->modifiedAttributes) > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasChanged() { return $this->changed; }", "public function hasChanged(): bool\n {\n return $this->changed;\n }", "public function isChanged() {\n\t\treturn $this->_changed > 0;\n\t}", "public function isChanged() : bool\n {\n\n return $this->_changed;\n\n }", "public function isUpdated() {}", "public function getHasChanged()\r\n {\r\n return $this->_hasChanged;\r\n }", "public function hasChanges () {\n return !!$this->dirty;\n }", "public function hasChanged(): bool\n {\n if (! $this->isSynced()) {\n return true;\n }\n\n return $this->attributes !== $this->original;\n }", "function isUpdated() {\n\t\treturn $this->_Updated;\n\t}", "public function isDirty()\r\n\t{\r\n\t\treturn (count($this->changelog)>0) ? true : false;\r\n\t}", "public function isModified(): bool;", "public function changed() {\n\t\t\tif (!$this->original_data) {\n\t\t\t\tthrow new Exception('call exists() before calling changed()');\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->last_change != $this->original_last_change ||\n\t\t\t $this->last_change_reason != $this->original_last_change_reason ||\n\t\t\t $this->lanes_affected != $this->original_lanes_affected ||\n\t\t\t $this->traffic_impact != $this->original_traffic_impact ||\n\t\t\t $this->reason != $this->original_reason) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\treturn false;\n\t\t}", "public function trackChanges()\n {\n \n if (!isset(static::$cols['m_version'] ))\n return false;\n\n return static::$trackChanges;\n\n }", "public function getIsUpdated()\n {\n return $this->isUpdated;\n }", "public function hasChanged(): bool;", "public function hasChanged(): bool;", "public function isDirty()\n {\n return $this->isModified;\n }", "public function getIsUpdatedAttribute (): bool\n {\n return $this->created_at < $this->updated_at;\n }", "function getChanged() {\n return $this->changed;\n }", "public function hasChanged() {\n\t\treturn trim( $this->fileSize ) != trim( $this->currentSize );\n\t}", "public function _isDirty() {}", "public function isChanged()\n {\n return ! empty(array_diff_assoc($this->items, $this->clone));\n }", "public function beenUpdated()\n {\n return count($this->updatePlan) > 0;\n }", "public function getChanged() {\n return $this->changed;\n }", "public function isDirty() {\n\t\treturn count($this->_modified);\n\t}", "public function getChanged()\n {\n return $this->changed;\n }", "public function wasModified()\n\t{\n\t\tif ($this->get('modified') && $this->get('modified') != '0000-00-00 00:00:00')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasChanging()\n {\n return $this->changing !== null;\n }", "public static function changed() {\n\treturn self::$instance->changed();\n }", "public function lastChange()\n {\n if ($this->exists()) {\n return filemtime($this->path);\n }\n\n return false;\n }", "public function hasLastUpdate() {\n return $this->_has(2);\n }", "function isModified() { return $this->_modified; }", "function isModified() { return $this->_modified; }", "public function getChanged()\n {\n return $this->_changed;\n }", "public function isDirty(): bool;", "protected function onUpdated()\n {\n return true;\n }", "function isChanged(): bool;", "public function hasChanged();", "public function hasChanged();", "public function isModified()\n {\n\treturn $this->modified;\n }", "public function is_new_data() {\n $rv = FALSE;\n if ($this->is_remote($this->url)) {\n $ts_standard = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = $this->GetRemoteLastModified($this->url . FileFetcher::FILE_COUNTIES);\n }\n else {\n $ts_standard = filemtime($this->url . FileFetcher::FILE_STANDARDS);\n $ts_counties = filemtime($this->url . FileFetcher::FILE_COUNTIES);\n }\n $ts = 0;\n if ($this->last_fetch == '' || $ts_standard > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_standard;\n }\n if ($this->last_fetch == '' || $ts_counties > $this->last_fetch) {\n $rv = TRUE;\n $ts = $ts_counties;\n }\n if ($rv) {\n update_option(\"hecc_standard_last_update_datetime\", $ts);\n }\n return $rv;\n }", "public function isDirty();", "public function isDirty(): bool\n {\n return count($this->changedAttributesName()) > 0;\n }", "public function dirty()\n\t{\n\t\tif ( ! $this->app['files']->exists($this->cacheFilePath))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasChangingFilename() : bool\n {\n return $this->filenameIsChanging;\n }", "public function hasLastUpdated() {\n\t\treturn $this->lastUpdated !== null;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "function isModified() {\n\t\treturn $this->_Modified;\n\t}", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function isModified()\n {\n return !!$this->modifiedColumns;\n }", "public function hasChange()\n {\n return (\n count($this->getFieldsWithUpdate()) > 0\n || count($this->getIndexesWithUpdate()) > 0\n || $this->addSoftDelete\n || $this->dropSoftDelete\n || $this->addTimestamps\n || $this->dropTimestamps);\n }", "private function changed() {\n return !empty($this->tags['new']) || \n !empty($this->tags['del']);\n }", "public function isNew()\n {\n return $this->hasUpdates;\n }", "public function isReloadOnUpdate()\n {\n return $this->reloadOnUpdate;\n }", "public function getShouldUpdate() {\n if (!$this->isReady()) {\n return false;\n }\n\n switch ($this->class) {\n case Source::CLASS_DATA:\n return (time() - $this->lastUpdated) > $this->source->getFrequency();\n break;\n case Source::CLASS_SENSOR:\n return false;\n break;\n }\n }", "protected function isPackageUpdated() {\n return $this->packageUpdated;\n }", "public function updating()\n {\n return false;\n }", "public function getUpdated();", "public function getUpdated();", "public function isModified();", "function isDirty() : bool;", "public function getIsModifiedOnStage() {\n\t\treturn true;\n\t}", "public function getModified() {}", "private function get_updated() {\n\t\t$translation = $this->get_item_from_api();\n\t\treturn ( $translation && isset( $translation['updated'] ) ) ? $translation['updated'] : false;\n\t}", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function has_changes() {\n\t\t\t$properties = array_keys(get_object_vars($this));\n\t\t\t$order = SalesOrderEdit::load($this->sessionid, $this->orderno);\n\n\t\t\tforeach ($properties as $property) {\n\t\t\t\tif ($this->$property != $order->$property) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function hasIfNotModified()\n {\n return isset($this->if_not_modified);\n }", "public function isOutdated() {}", "public function hasUpdates();", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "public function is_saved()\n\t\t{\n\t\t\treturn $this->hash && file_exists($this->get_path_hashed()) || $this->saved;\n\t\t}", "public function hasChangedEntries();", "function _isDirty() ;", "private function changed()\n {\n $this->isDirty = true;\n }", "public function refreshOnSave()\n {\n return $this->refreshOnSave;\n }", "public function hasChangedFields()\n {\n return (count($this->_changedFields) > 0);\n }", "public function needUpdate()\n\t{\n\t\treturn ($this->getLastUpdate() == null || time() - $this->getLastUpdate()->format('U') > 1 * 60);\n\t}", "protected function hasSourceFieldChanged() {\n $source_field_name = $this->getSource()->getConfiguration()['source_field'];\n $current_items = $this->get($source_field_name);\n return isset($this->original) && !$current_items->equals($this->original->get($source_field_name));\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function getUpdated()\n {\n return $this->updated;\n }", "public function skipThisUpdate()\n { // This entire method seems obsolete, due to the SELECT ... WHERE in loadPublishablePermits().\n $result = false;\n $d = $this->getField('deleted') == 1 || $this->getField('hidden') == 1;\n if ($d || $this->getField('lastpublished', true) > $this->getField('lastmodified', true)) {\n $result = true;\n }\n return $result;\n }" ]
[ "0.7683406", "0.74490404", "0.742985", "0.7396284", "0.7310335", "0.7293663", "0.72294325", "0.7219321", "0.7142031", "0.7100573", "0.7053169", "0.70170265", "0.6988353", "0.6915788", "0.6914904", "0.6914904", "0.69112337", "0.6880721", "0.68744403", "0.68695694", "0.6838519", "0.6829844", "0.68276054", "0.6805362", "0.6800324", "0.67924213", "0.67658836", "0.6745807", "0.67431575", "0.6742983", "0.6735989", "0.6734943", "0.6734943", "0.6710474", "0.66861904", "0.6680983", "0.6677865", "0.6668179", "0.6668179", "0.6664496", "0.66439754", "0.6602694", "0.65871865", "0.6567567", "0.6505326", "0.65039533", "0.650315", "0.650315", "0.650315", "0.650315", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6492674", "0.6466042", "0.64638054", "0.64551234", "0.64494216", "0.64371324", "0.6420697", "0.64135337", "0.64132035", "0.64132035", "0.64025986", "0.63960207", "0.6392845", "0.638276", "0.6378875", "0.6376655", "0.63758475", "0.63555986", "0.6351163", "0.63434994", "0.63258296", "0.6316692", "0.63124067", "0.6306412", "0.62925184", "0.629065", "0.6286393", "0.6258327", "0.62423223", "0.622957", "0.622957", "0.622957", "0.622957", "0.622957", "0.622957", "0.622957", "0.622957", "0.622957", "0.6225825" ]
0.656862
43
Finds a model with the specified ID
public function find(int $id = null) { $this->method = "GET"; if(null == $id) { $this->path = $this->objectName; } else { $this->path = $this->objectName . '/' . $id; $this->currentId = $id; } $output = $this->get(); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($model, $id);", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "public function find($id)\n\t{\n\t\treturn Model::where('id', $id)->first();\n\t}", "public function find($id) {\n return $this->model->find($id);\n }", "public function find($id)\n {\n return $this->model->findOrFail($id);\n }", "public function find($id)\n {\n return $this->model->findOrFail($id);\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function find($id = null) {\n $argument = $id?? $this->request->fetch('id')?? null;\n return $this->model->find($argument);\n }", "public static function find($id);", "public function find($id)\n {\n return $this->model->find($id);\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public function findById($id)\n {\n return $this->model->find($id);\n }", "public function findById($id)\n {\n return $this->model->find($id);\n }", "public function findById($id)\n {\n return $this->model->find($id);\n }", "public function findById($id)\n {\n return $this->model()->find($id);\n }", "public static function findById($id);", "protected function getModelInstance($id)\n {\n $class = $this->getModelClass();\n\n return call_user_func([$class, 'find'], $id);\n }", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "private function findModel($id)\n {\n return Pekerjaan::findOne($id);\n }", "public function findById ($id);", "public function find(int $id)\n {\n return $this->model->findOrFail($id);\n }", "public function findById($id)\n {\n return $this->model->find($id);\n //return $this->model->whereId($id)->get();\n }", "public function find( $id );", "public function findById($id)\n {\n return $this->model->with('user')->where('id', '=', $id)->first();\n }", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "public static function find($id)\n {\n Model::getMethod();\n\n }", "public function find($id)\n {\n return $this->driver->find($this->model, $id);\n }", "public function byId($id)\n {\n return $this->model->findOrFail($id);\n }", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "public function findById($id);", "function findById($id);", "public function find($id)\n {\n $params = [\n 'index' => $this->model->_index,\n 'type' => $this->model->_type\n ];\n if ($id) {\n $params['id'] = $id;\n return $this->generateModel($this->client->get($params));\n }\n return null;\n }", "public function find($id):Default_Model_Model{\n\n\n\t\t$result=$this->getDbTable()->find($id);\n\n\t\t//echo \"id=>$id\";\n\n\t\tif(0 == count($result)) return false;\n\n\t\t$row = $result->current();\n\t\t$object = $this->getModel($row->toArray ());\n\n\t\treturn $object;\n\n\t}", "public function find($id)\n {\n $result = $this->model->find($id);\n return $result;\n }", "public function findOne($id)\n {\n return $this->model->find($id);\n }", "function find($id);", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "public function find($id)\n {\n /** @var SFModel $model */\n foreach ($this as $model) {\n if ($model->Id == $id) {\n return $model;\n }\n }\n\n return null;\n }", "public function findById(int $id)\n {\n return $this->model->findOrFail($id);\n }", "public function GetByID($id)\n {\n return $this->model->find($id);\n }", "public function find(int $id) ;", "public function getByID($id)\n {\n return $this->model->findOrFail($id);\n }", "public static function findById($id)\n {\n }", "public function find($id)\n {\n return $this->findOneBy(['id' => $id]);\n }", "public function getById( $id ){\n return $this->model->find($id);\n }", "public function findById(int $id);", "public function findById(int $id);", "public static function findById($id)\n {\n return static::findOne(['id' => $id]);\n }", "public static function findById($id)\n\t{\n\t\t$model = new self;\n\t\treturn $model->fetchRow($model->select()->where('id=?', $id));\n\t}", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "abstract public function find($id);", "protected function findModel($id)\n {\n if (($model = PdmBa14::findOne(['id_ba14'=>$id])) !== null) {\n return $model;\n } \n }", "public static function findModel($id)\n {\n if (($model = self::findOne(['id' => intval($id)])) !== null)\n return $model;\n\n return null;\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function findById($id)\n {\n return $this->findOneBy(['id' => $id]);\n }", "public function getById($id)\n\t{\n\t\treturn $this->model->findOrFail($id);\n\t}", "public static function findById($id)\n\t{\n\t\n\t}", "function find($id)\r\n {\r\n $query = $this->db->where($this->primaryKey, $id)\r\n ->get($this->tableName);\r\n \r\n return $this->modelResponse($query);\r\n }" ]
[ "0.8542804", "0.8434013", "0.8372012", "0.8233802", "0.81540895", "0.8127544", "0.8127544", "0.8091566", "0.80726546", "0.8072079", "0.80689347", "0.8023892", "0.8016556", "0.8016556", "0.8016556", "0.7974566", "0.79600173", "0.7949078", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7937866", "0.7924018", "0.7831804", "0.78133136", "0.7805372", "0.77654546", "0.7762335", "0.77621675", "0.7743384", "0.7709842", "0.7706003", "0.7699729", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7692699", "0.7687628", "0.7681874", "0.76787764", "0.76390934", "0.762797", "0.7607866", "0.76046526", "0.76046526", "0.76032865", "0.7585512", "0.7581706", "0.75697285", "0.75570184", "0.7553736", "0.754899", "0.75021076", "0.7501525", "0.7501525", "0.7500931", "0.7495282", "0.74918604", "0.7490654", "0.7479943", "0.7476338", "0.7471176", "0.7471176", "0.7471176", "0.74685913", "0.74660826", "0.7464024", "0.7458936" ]
0.0
-1
get path to root directory script
public static function getPathToScript() { return realpath(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "static function getCurrentScriptDir(){\n \n return Strings::ditchLastPiece($_SERVER['SCRIPT_NAME']);\n \n }", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}", "public function get_base_root()\r\n {\r\n return realpath(ROOT_DIR_NAME);\r\n }", "public function getRootDir();", "public static function getRoot(): string {\n if (! self::$_root) {\n self::$_root = dirname(dirname(dirname(__FILE__)));\n }\n \n return self::$_root;\n }", "function dirPath() {return (\"../../../../\"); }", "function dirPath() { return (\"../\"); }", "public function getRootPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_ROOT);\r\n\t}", "public function getScriptPath()\n {\n return PUBLIC_THEME_DIR . '/' . $this->directory;\n }", "private function buildRootPath()\n {\n // In Windows script path uses backslash, convert it:\n $scriptPath = str_replace('\\\\', '/', $_SERVER['PHP_SELF']);\n $rootPath = str_replace(' ', '%20', rtrim(substr($scriptPath, 0, strpos($scriptPath, 'index.php')), '/'));\n\n return $rootPath;\n }", "function parcelcheckout_getRootPath()\n\t{\n\t\t$sRootPath = dirname(dirname(dirname(__FILE__)));\n\n\t\tif(strpos($sRootPath, '\\\\') !== false)\n\t\t{\n\t\t\t$sRootPath .= '\\\\';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sRootPath .= '/';\n\t\t}\n\n\t\treturn $sRootPath;\n\t}", "public function get_root_path()\n\t{\n\t\treturn $this->ext_root_path;\n\t}", "public static function scriptDirectory(): string\n\t{\n\t\treturn static::$scriptDirectory;\n\t}", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "public static function getBasePath() {\n\t \tif(!isset(self::$basePath)) {\n\t \t\t$script = self::getScriptName();\n\t \t\tself::$basePath = substr (\n\t \t\t\t\t$script,\n\t \t\t\t\t0,\n\t \t\t\t\tstrrpos($script, '/' ));\n\t \t}\n\t \treturn self::$basePath;\n\t }", "public function getRoot(): string\n {\n return (string)$this->env['SCRIPT_NAME'];\n }", "function dirPath () { return (\"../../\"); }", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "private function getPathToRootDir()\n {\n return '%kernel.project_dir%';\n }", "function qa_path_to_root()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tglobal $qa_root_url_relative;\n\treturn $qa_root_url_relative;\n}", "public function getScriptDirectory()\n\t{\n\t\t$parent = explode('/', $_SERVER['SCRIPT_NAME']);\n\t\treturn sizeof($parent) > 2 ? $parent[1] . \"/\" : false;\n\t}", "public static function getScriptDir() {\n\t return isset(self::$scriptDir)\n\t ? self::$scriptDir\n\t : (self::$scriptDir = self::getBaseDir() . '/scripts');\n\t}", "protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }", "function current_dir() {\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) || !empty($_SERVER['SCRIPT_NAME']) ) {\r\n\r\n $server_root = \"\";\r\n\r\n if ( !empty($_SERVER['PHP_SELF']) ) {\r\n $script = $_SERVER['PHP_SELF'];\r\n }\r\n else {\r\n $script = $_SERVER['SCRIPT_NAME'];\r\n }\r\n\r\n $subDirList = explode(\"/\", $script);\r\n array_pop($subDirList);\r\n\r\n $server_root = implode(\"/\", $subDirList) . \"/\";\r\n }\r\n else {\r\n $server_root = \"\";\r\n }\r\n\r\n return $server_root;\r\n}", "private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }", "public static function getBasePath()\n {\n $base_path = substr(trim(\\ROOT, '/'), strlen(trim($_SERVER['DOCUMENT_ROOT'], '/')));\n if (DS !== '/') {\n $base_path = str_replace(DS, '/', $base_path);\n }\n return $base_path;\n }", "public function getRootPath();", "public function getRootPath();", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }", "public function getBaseRootDir()\n {\n return $this->paths->getBaseRootDir();\n }", "public static function dirRoot()\n\t{\n\t\treturn defined('DIR_ROOT') ? DIR_ROOT : dirname(__DIR__);\n\t}", "public function getRootDir()\n {\n return __DIR__;\n }", "function getAppPath() {\r\n\r\n $root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\r\n if (substr($root, -1) === '/') { // remove any trailing / which should not be there\r\n $root = substr($root, 0, -1);\r\n }\r\n $dir = str_replace('\\\\', '/', dirname(__FILE__));\r\n\r\n $path = str_replace($root, '', $dir) . '/';\r\n\r\n return $path;\r\n\r\n }", "function root_path($path = null)\n{\n return statamic_path('../' . $path);\n}", "function base_path()\n {\n return dirname(__DIR__);\n }", "public function getRootDirectory();", "function getPathToAppRoot() {\r\n\r\n\t\t$currdirectory = getcwd();\r\n\t\t$count = 0;\r\n\t\t$path = \"\";\r\n\r\n\t\t//We need to find the applications root\r\n\t\twhile(!file_exists(\"phpbmsversion.php\") && $count < 9){\r\n\r\n\t\t\t$path.=\"../\";\r\n\t\t\t@ chdir(\"../\");\r\n\t\t\t$count++;\r\n\r\n\t\t}//end while\r\n\r\n\t\tchdir($currdirectory);\r\n\r\n\t\tif($count < 9)\r\n\t\t\treturn $path;\r\n\t\telse\r\n\t\t\treturn NULL;\r\n\r\n}", "public static function getApplicationRoot(){\r\n $path = __DIR__;\r\n return $path;\r\n }", "protected function getPackageRootPath(): string\n {\n return getcwd() . '/';\n }", "public function getRootPath(): string\n {\n return $this->rootPath;\n }", "protected function get_default_root_path(): string {\n return dirname($this->nowqsPath, 4) . DIRECTORY_SEPARATOR;\n }", "public function getRootPath()\r\n\t{\r\n\t\treturn $this->rootPath;\r\n\t}", "function getWebsiteRootPath()\n {\n // Check that the absolute path to the current directory is accessible\n // (some webhosts denies access this way)\n if ( file_exists (FCPATH) ) {\n return FCPATH;\n } else {\n // Fake relative path by using subdirectory\n return 'js/../';\n }\n }", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "public function getRootDir()\n {\n return sys_get_temp_dir() . '/base-kernel/' . 'kernel-' . substr(\n hash(\n 'md5',\n json_encode([\n $this->bundlesToLoad,\n $this->configuration,\n $this->routes,\n ])\n ),\n 0,\n 10\n );\n }", "protected function rootPath()\n {\n return Pi::path('upload') . '/' . $this->getModule();\n }", "static function getScriptRelativePath() {\n\t\treturn self::$_ScriptRelativePath;\n\t}", "private function getAppRootDir()\n {\n return $this->container->get('app.parameter_bag')->get('kernel.project_dir');\n }", "protected function getTestsRootPath()\n {\n return dirname(__FILE__);\n }", "function base_path() {\n\treturn str_replace('index.php','',$_SERVER['SCRIPT_NAME']);\n}", "private static function get_root_path(): ?string {\n\t\t// Try up to 3 levels\n\t\t$wp_dir = '/' . trim( ABSPATH, '/' );\n\t\t$try_dirs = [\n\t\t\t$wp_dir,\n\t\t\tdirname( $wp_dir ),\n\t\t\tdirname( $wp_dir, 2 ),\n\t\t];\n\t\tforeach ( $try_dirs as $dir ) {\n\t\t\t$git_dir = \"{$dir}/.git\";\n\t\t\tif ( file_exists( $git_dir ) && is_dir( $git_dir ) ) {\n\t\t\t\treturn $dir;\n\t\t\t}\n\t\t\t$dir = null;\n\t\t}\n\n\t\treturn null;\n\t}", "public function getBasePath()\n {\n return dirname($this->file);\n }", "public function getBasePath()\n {\n return dirname(__DIR__);\n }", "public function getBasePath()\n {\n return dirname(__DIR__);\n }", "public static function basedir() {\n\t\t$directory = trim($_SERVER['SUBDIRECTORY'], '/');\n\t\t$directory = str_replace('\\\\', '/', $directory);\n\n\t\treturn '/' . $directory;\n\t}", "protected static function getPathThisScript() {}", "public function rootDir(): string\n {\n return $this->root;\n }", "function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}", "public function getRootPath()\n {\n return $this->rootPath;\n }", "public function getRootPath()\n {\n return $this->root_path;\n }", "public function baseUrl() {\n return dirname($_SERVER['PHP_SELF']) . '/';\n }", "abstract public function getRelativeDataDir();", "function url_for($script_path) {\n //add the leading '/' if not present\n if ($script_path[0] != '/') {\n $script_path = \"/\" . $script_path;\n }\n return WWW_ROOT . $script_path;\n }", "static public function getKekuleDir()\n {\n return kekulejs_configs::getScriptDir();\n }", "protected function getProjectRootPath()\n {\n return dirname($this->getTestsRootPath());\n }", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }", "public function getMainScriptPath()\n {\n if (isset($this->raw->main)) {\n return Path::canonical($this->raw->main);\n }\n\n return null;\n }", "public function get_base_dir()\r\n\t\t{\r\n\t\t\treturn str_replace( \"/\", DIRECTORY_SEPARATOR, __DIR__ . \"/../../\" . self::HOME_DIR );\r\n\t\t}", "function url_for($script_path) {\n\t\t// add the leading '/' if not present\n\t\tif($script_path[0] != '/') {\n\t\t\t$script_path = '/'. $script_path;\n\t\t}\n\t\treturn WWW_ROOT . $script_path;\n\t}", "protected function projectRootAbsolutePath()\n {\n return realpath(__DIR__ . '/../../../..');\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "protected function getRootPath()\n {\n return base_path() . '/CertificateBuilder/events';\n }", "static public function getScriptDir()\n {\n return self::getKekuleDir() . 'jslib/';\n }", "protected static function getPathThisScriptNonCli() {}", "function root(string $path){\n global $root;\n return $root.$path;\n}", "public function getWebroot() {\n return Yii::getAlias('@static') .DIRECTORY_SEPARATOR. 'web' .DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR. $this->parent_id .DIRECTORY_SEPARATOR;\n }", "protected function getBasePath()\n {\n return getcwd();\n }", "public static function getModulePath()\n {\n return dirname(__DIR__);\n }", "protected static function getPathThisScriptCli() {}", "public function getBasePath()\n {\n return __DIR__ . '/..';\n }", "public function getRootDir()\n {\n return $this->rootDir;\n }", "function getPathFromDocRoot()\n{\n $doc_root = $_SERVER['DOCUMENT_ROOT'];\n if (FILE_SEPARATOR != '/') {\n $doc_root = eregi_replace('/', FILE_SEPARATOR, $doc_root);\n }\n $doc_root_folders = explode(FILE_SEPARATOR, $doc_root);\n $cwd_folders = explode(FILE_SEPARATOR, getcwd());\n $folders_from_doc_root = array_diff($cwd_folders, $doc_root_folders);\n $path = implode(FILE_SEPARATOR, $folders_from_doc_root);\n //maybe we're in admin or scripts or so\n //echo($path.\"|\".strstr($path, 'admin').\"|\".utf8_substr( $path, 0, utf8_strpos( $path, \"admin\" ) ).\"|\");\n if (eregi('admin',$path) != false or $path == 'admin') {\n $path = substr($path, 0, strpos($path, \"admin\" ) ) ;\n }\n if (eregi('scripts',$path) != false or $path == 'scripts') {\n $path = substr($path, 0, strpos($path, \"scripts\" ) ) ;\n }\n if (eregi('plugins',$path)!= false or $path == 'plugins') {\n $path = substr($path, 0, strpos($path, \"plugins\" ) ) ;\n }\n if (eregi('user',$path) != false or $path == 'user') {\n $path = substr($path, 0, strpos($path, \"user\" ) ) ;\n }\n if ($path == \"\") {\n $path = FILE_SEPARATOR;\n }\n if (substr($path, 0, 1) != FILE_SEPARATOR) {\n $path = FILE_SEPARATOR.$path;\n }\n if (substr($path, strlen($path)-1, strlen($path)) != FILE_SEPARATOR) $path = $path.FILE_SEPARATOR;\n return $path;\n}", "public function getTemplateRootPath()\r\n {\r\n return $this->getDirectoryName($this->templateRootPath);\r\n }", "protected function getBaseInstallationPath()\n {\n\n if ( !$this->composer || !$this->composer->getPackage() ) {\n return self::DEFAULT_ROOT;\n }\n\n $extra = $this->composer->getPackage()->getExtra();\n\n if ( !$extra || empty( $extra['module-dir'] ) ) {\n return self::DEFAULT_ROOT;\n }\n\n return $extra['module-dir'];\n }", "public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}", "protected function getBasePath()\n {\n return $this->vfs()->url();\n }", "public function getPath(): string\n {\n $root = null;\n $currentDirectory = __DIR__;\n\n do {\n $currentDirectory = dirname($currentDirectory);\n $config = $currentDirectory . '/.refresh-database.yml';\n\n if (file_exists($config)) {\n $root = $currentDirectory;\n }\n } while (is_null($root) && $currentDirectory != '/');\n\n return $config;\n }", "public function getAppBaseDirName(){\n return $this->getSite()->getParent()->getAppDir(true);\n }", "public function getBasePath()\n {\n if ($this->basePath === null) {\n $this->basePath = dirname(getcwd());\n }\n\n return $this->basePath;\n }", "public function getFileRootPath(): string\n {\n return str_replace(\n ':',\n '.',\n $this->getDatasetSubmission()->getDataset()->getUdi()\n ) . DIRECTORY_SEPARATOR;\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "public static function getBaseUrl ()\r\n\t{\r\n\t\t# Obtain the value\r\n\t\t$baseUrl = dirname (substr ($_SERVER['SCRIPT_FILENAME'], strlen ($_SERVER['DOCUMENT_ROOT'])));\r\n\t\t\r\n\t\t# Convert backslashes to forwarded slashes if necessary\r\n\t\t$baseUrl = str_replace ('\\\\', '/', $baseUrl);\r\n\t\t\r\n\t\t# Deal with the special case of an application at top-level\r\n\t\tif ($baseUrl == '/') {$baseUrl = '';}\r\n\t\t\r\n\t\t# Return the value\r\n\t\treturn $baseUrl;\r\n\t}", "protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }", "public function getRootDir()\n\t{\n\t\treturn $this->_rootDir;\n\t}" ]
[ "0.78241074", "0.7785946", "0.75854987", "0.7581386", "0.7557679", "0.743944", "0.74073315", "0.73658645", "0.73620665", "0.7355432", "0.73510975", "0.7327718", "0.7326801", "0.7315026", "0.73040026", "0.7288391", "0.7264281", "0.72614485", "0.725067", "0.72393894", "0.7215244", "0.72144693", "0.72108227", "0.7194789", "0.71852475", "0.7181083", "0.7177115", "0.7175835", "0.71689004", "0.7164957", "0.7148575", "0.7148575", "0.71465874", "0.71459347", "0.71322626", "0.7122506", "0.7117046", "0.7096765", "0.7084455", "0.7081991", "0.7056742", "0.7046504", "0.70040846", "0.70019066", "0.6990738", "0.69881225", "0.69787544", "0.69763243", "0.69760484", "0.6949887", "0.69454455", "0.69335604", "0.69236183", "0.6914893", "0.69131863", "0.6897167", "0.688631", "0.6866687", "0.6866687", "0.6849926", "0.6841997", "0.6837412", "0.6834123", "0.6824881", "0.6822976", "0.6813145", "0.6809075", "0.6802019", "0.679002", "0.6776057", "0.6770916", "0.67694145", "0.67656624", "0.67562985", "0.6752651", "0.67372406", "0.67321676", "0.6730279", "0.6726483", "0.672266", "0.67193174", "0.67180943", "0.6712901", "0.66970766", "0.66891354", "0.6682119", "0.6661472", "0.6659767", "0.6657943", "0.6647609", "0.6647104", "0.66369", "0.66110414", "0.66073513", "0.6602608", "0.6599806", "0.65997607", "0.6595459", "0.6592846", "0.6580464" ]
0.7667388
2
/ Gather all information related to a given year for a person training status & location (if any) radio eligibility meals & shower privileges
public static function findForPersonYear($personId, $year) { $info = new PersonEventInfo(); $info->person_id = $personId; $info->year = $year; $requireTraining = PersonPosition::findTrainingPositions($personId); $info->trainings = []; if ($requireTraining->isEmpty()) { $requireTraining = [Position::find(Position::TRAINING)]; } foreach ($requireTraining as $position) { $info->trainings[] = Training::retrieveEducation($personId, $position, $year); } usort($info->trainings, function ($a, $b) { return strcmp($a->position_title, $b->position_title); }); $radio = RadioEligible::findForPersonYear($personId, $year); $info->radio_info_available = setting('RadioInfoAvailable'); $info->radio_max = $radio ? $radio->max_radios : 0; $info->radio_eligible = $info->radio_max > 0 ? true : false; $bmid = Bmid::findForPersonYear($personId, $year); if ($bmid) { $info->meals = $bmid->meals; $info->showers = $bmid->showers; } else { $info->meals = ''; $info->showers = false; } if (current_year() == $year && !setting('MealInfoAvailable')) { $info->meals = 'no-info'; } $ot = PersonOnlineTraining::findForPersonYear($personId, $year); if ($ot) { $info->online_training_passed = true; $info->online_training_date = (string)$ot->completed_at; } else { $info->online_training_passed = false; } $info->vehicles = Vehicle::findForPersonYear($personId, $year); $event = PersonEvent::findForPersonYear($personId, $year); if ($event) { $info->may_request_stickers = $event->may_request_stickers; $info->org_vehicle_insurance = $event->org_vehicle_insurance; $info->signed_motorpool_agreement = $event->signed_motorpool_agreement; } else { $info->may_request_stickers = false; $info->org_vehicle_insurance = false; $info->signed_motorpool_agreement = false; } return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function horoscopeInformation(){\n $horoscope_years = [\n 'Rat' => [\n \"years\" => [2008, 1996, 1984, 1972, 1960, 1948, 1936, 1924],\n \"info\" =>\n 'The Rat is known as a friend for life. You find it difficult to give yourself completely, \n but once you are used to it, you do not let go. You are perfectionistic and sometimes you\n can become a little aggressive if something does not work.\n Properties: charming, sweet, confident, straightforward, possessive.'\n\n ],\n 'Os' => [\n \"years\" => [2009, 1997, 1985, 1973, 1961, 1949, 1937, 1925],\n 'info' =>\n 'De Os is a go-getter. You can quickly condemn someone and often see things black or white.\n If you have a bad mood, others can better stay away from you.\n Characteristics: patient, attentive, inquisitive, overconfident, critical.'\n ,\n ]\n ,\n 'Tiger' => [\n 'years' => [2010, 1998, 1986, 1974, 1962, 1950, 1938, 1926],\n 'info' =>\n 'The Tiger is often a leader. You are adventurous and do not mind going somewhere alone.\n You are sometimes impulsive and direct and can occasionally be possessive.\n Characteristics: very sweet, adventurous, hasty, reckless and passionate.'\n ,\n ],\n 'Rabbit' => [\n 'years' => [2011, 1999, 1987, 1975, 1963, 1951, 1939, 1927],\n 'info' =>\n 'The Rabbit is sometimes difficult to understand. You are sensitive \n and loved by friends and family. You have a good memory and \n are inclined to run away from problems.Properties: very sensitive,\n intelligent, a little affected, modest and tactful.'\n ,\n ],\n 'Dragon' => [\n 'years' => [2012, 2000, 1988, 1976, 1964, 1952, 1940, 1928],\n 'info' =>\n 'The Dragon is right at his turn. You often do first before you think.\n You are protective and confident, but always want confirmation\n that your partner loves you.\n Features: enthusiastic, demanding, energetic and emotional.'\n ,\n ],\n 'Snake' => [\n 'years' => [2013, 2001, 1989, 1977, 1965, 1953, 1941, 1929],\n 'info' =>\n 'The snake is mysterious. You find it difficult to show your feelings, but \n you want love and attention. In addition, you continue until your goal is reached.\n Features: helpful, orderly, fickle, funny and a bad loser.'\n ,\n ],\n 'Horse' => [\n 'years' => [2014, 2002, 1990, 1978, 1966, 1954, 1942, 1930],\n 'info' =>\n 'The Horse is solution-oriented. You are loyal but not good at keeping secrets. \n You would like to know everything, but if it sometimes gets too difficult,\n you will get rid of it.\n Characteristics: hard worker, demanding, talented, moody, lively.'\n ,\n ],\n 'Goat' => [\n 'years' => [2015, 2003, 1991, 1979, 1967, 1955, 1943, 1931],\n 'info' =>\n 'The Sheep is a natural person. You are creative, perfectionist and can sometimes\n be very insecure. You can not handle pressure well and want to be protected.\n Features: creative, romantic, helpful, pessimistic, honest.'\n ,\n ],\n 'Monkey' => [\n 'years' => [2016, 2004, 1992, 1980, 1968, 1956, 1944, 1932],\n 'info' =>\n 'The Monkey is interested in the interest. You are often happy and always talk.\n You like challenges and do not think in problems, but in solutions.\n Characteristics: sympathetic, loyal, creative, insecure, irritable.'\n ,\n ],\n 'Haan' => [\n 'years' => [2017, 2005, 1993, 1981, 1969, 1957, 1945, 1933],\n 'info' =>\n 'Rooster is direct and says what it says. You love clothes and your hairstyle \n and spend a lot of time and money on this. You want to come for the day.\n Characteristics: frank, courageous, fussy, vain, charming.'\n ,\n ],\n 'Dog' => [\n 'years' => [2018, 2006, 1994, 1982, 1970, 1958, 1946, 1934],\n 'info' =>\n 'The Dog wants to have the last word. You find it difficult to agree with someone \n and you like to complain. You like being in your own home and family is important to you.\n You attract a lot of how others feel.\n Characteristics: loyal, patient, enthusiastic, inflexible, anxious.'\n ,\n ],\n 'Pig' => [\n 'years' => [2019, 2007, 1995, 1983, 1971, 1959, 1947, 1935],\n 'info' =>\n 'The Pig is reliable. You like luxury and can therefore be a bit spoiled.\n You are happy and have a big heart. Sometimes you believe things too quickly.\n Characteristics: very sensible, well-meaning, hospitable, passionate and defensive.'\n ,\n ]\n ];\n\n return $horoscope_years;\n }", "public function showClassesAcademicYearWise()\n {\n if ($this->checkEmpty()) return json_encode(array(\"error\" => \"empty\"));\n $this->acd_year = $this->verifyInput($_POST['acd_id']);\n $this->faculty_id = isset($_POST['faculty_id']) ? $this->verifyInput($_POST['faculty_id']) : $_SESSION['faculty_id'];\n $this->dept = isset($_POST['dept_id']) ? $this->verifyInput($_POST['dept_id']) : $_SESSION['dept'];\n $result = $this->getClassByDeptAndAcademicYear([ $this->dept, $this->acd_year]);\n if (!$result) return json_encode(array(\"error\" => \"notfound\"));\n if (isset($result['e'])) return json_encode(array(\"error\" => \"Server Error!\"));\n return json_encode(array(\"error\" => \"none\", \"data\" => $result));\n }", "public static function retrieveRadioEligilibity($currentYear)\n {\n $lastYear = $currentYear-1;\n $prevYear = $currentYear-2;\n\n $people = DB::select(\"SELECT person.id, person.callsign,\n (SELECT SUM(TIMESTAMPDIFF(second, on_duty, off_duty))/3600.0 FROM timesheet WHERE person.id=timesheet.person_id AND year(on_duty)=$lastYear AND position_id NOT IN (1,13)) as hours_last_year,\n (SELECT SUM(TIMESTAMPDIFF(second, on_duty, off_duty))/3600.0 FROM timesheet WHERE person.id=timesheet.person_id AND year(on_duty)=$prevYear AND position_id NOT IN (1,13)) as hours_prev_year,\n EXISTS (SELECT 1 FROM person_position WHERE person_position.person_id=person.id AND person_position.position_id IN (10,12) LIMIT 1) AS shift_lead,\n EXISTS (SELECT 1 FROM person_slot JOIN slot ON person_slot.slot_id=slot.id AND YEAR(slot.begins)=$currentYear AND slot.begins >= '$currentYear-08-15 00:00:00' AND position_id NOT IN (1,13) WHERE person_slot.person_id=person.id LIMIT 1) as signed_up\n FROM person WHERE person.status IN ('active', 'inactive', 'inactive extension', 'retired')\n ORDER by callsign\");\n\n // Person must have worked in one of the previous two years, or is a shift lead\n $people = array_values(array_filter($people, function ($p) {\n return $p->hours_prev_year || $p->hours_last_year || $p->shift_lead;\n }));\n\n foreach ($people as $person) {\n // Normalized the hours - no timesheets found in a given years will result in null\n if (!$person->hours_last_year) {\n $person->hours_last_year = 0.0;\n }\n $person->hours_last_year = round($person->hours_last_year, 2);\n\n if (!$person->hours_prev_year) {\n $person->hours_prev_year = 0.0;\n }\n $person->hours_prev_year = round($person->hours_prev_year, 2);\n\n // Qualified radio hours is last year, OR the previous year if last year\n // was less than 10 hours and the previous year was greater than last year.\n $person->radio_hours = $person->hours_last_year;\n if ($person->hours_last_year < 10.0 && ($person->hours_prev_year > $person->hours_last_year)) {\n $person->radio_hours = $person->hours_prev_year;\n }\n }\n\n return $people;\n }", "public function getResAppByStatusAndYear($status,$resSubspecArg,$year=null,$interviewer=null) {\n\n $userServiceUtil = $this->container->get('user_service_utility');\n $resappUtil = $this->container->get('resapp_util');\n\n //echo \"year=$year<br>\";\n //process.py script: replaced namespace by ::class: ['AppResAppBundle:ResidencyApplication'] by [ResidencyApplication::class]\n $repository = $this->em->getRepository(ResidencyApplication::class);\n $dql = $repository->createQueryBuilder(\"resapp\");\n $dql->select('resapp');\n $dql->leftJoin(\"resapp.appStatus\", \"appStatus\");\n\n if( $status ) {\n if (strpos((string)$status, \"-\") !== false) {\n $statusArr = explode(\"-\", $status);\n $statusStr = $statusArr[0];\n $statusNot = $statusArr[1];\n if ($statusNot && $statusNot == 'not') {\n //'interviewee-not' is dummy status which is all statuses but not\n $dql->where(\"appStatus.name != '\" . $statusStr . \"'\");\n }\n } else {\n $dql->where(\"appStatus.name = '\" . $status . \"'\");\n }\n }\n\n if( $resSubspecArg ) {\n $dql->leftJoin(\"resapp.residencyTrack\",\"residencyTrack\");\n if( is_array($resSubspecArg) ) {\n $restypeArr = array();\n foreach( $resSubspecArg as $residencyTypeID => $residencyTypeName ) {\n $restypeArr[] = \"residencyTrack.id = \".$residencyTypeID;\n }\n $dql->andWhere( implode(\" OR \", $restypeArr) );\n } else {\n $dql->andWhere(\"residencyTrack.id=\".$resSubspecArg);\n }\n }\n\n //application Season Start Year ($applicationSeasonStartDate)\n if( $year ) {\n //echo \"year=$year<br>\";\n if( strpos((string)$year, \",\" ) !== false) {\n //multiple years\n $yearArr = explode(\",\",$year);\n $criterions = array();\n foreach($yearArr as $singleYear) {\n //$bottomDate = $singleYear.\"-01-01\";\n //$topDate = $singleYear.\"-12-31\";\n //$startEndDates = $userServiceUtil->getAcademicYearStartEndDates($singleYear);\n //$startEndDates = $resappUtil->getAcademicYearStartEndDates($singleYear);\n //$bottomDate = $startEndDates['startDate'];\n //$topDate = $startEndDates['endDate'];\n ////startDate - Residency Start Year\n //$criterions[] = \"(\".\"resapp.startDate BETWEEN '\" . $bottomDate . \"'\" . \" AND \" . \"'\" . $topDate . \"'\".\")\";\n\n $startEndDates = $resappUtil->getResAppAcademicYearStartEndDates($singleYear);\n $bottomDate = $startEndDates['Season Start Date'];\n $topDate = $startEndDates['Season End Date'];\n //echo \"bottomDate=$bottomDate, topDate=$topDate <br>\";\n ////applicationSeasonStartDate - Application Season Start Year\n $criterions[] = \"(\".\"resapp.applicationSeasonStartDate BETWEEN '\" . $bottomDate . \"'\" . \" AND \" . \"'\" . $topDate . \"'\".\")\";\n }\n $criterionStr = implode(\" OR \",$criterions);\n $dql->andWhere($criterionStr);\n } else {\n //single year\n //$bottomDate = $year.\"-01-01\";\n //$topDate = $year.\"-12-31\";\n //$startEndDates = $resappUtil->getAcademicYearStartEndDates($year);\n //$bottomDate = $startEndDates['startDate'];\n //$topDate = $startEndDates['endDate'];\n //echo \"get AcademicYearStartEndDates: single year: bottomDate=$bottomDate, topDate=$topDate <br>\";\n ////startDate - Residency Start Year\n //$dql->andWhere(\"resapp.startDate BETWEEN '\" . $bottomDate . \"'\" . \" AND \" . \"'\" . $topDate . \"'\");\n\n $startEndDates = $resappUtil->getResAppAcademicYearStartEndDates($year);\n $bottomDate = $startEndDates['Season Start Date'];\n $topDate = $startEndDates['Season End Date'];\n //echo \"get ResAppAcademicYearStartEndDates: single year: bottomDate=$bottomDate, topDate=$topDate <br>\";\n ////applicationSeasonStartDate - Application Season Start Year\n $dql->andWhere(\"resapp.applicationSeasonStartDate BETWEEN '\" . $bottomDate . \"'\" . \" AND \" . \"'\" . $topDate . \"'\");\n }\n }\n\n if( $interviewer ) {\n $dql->leftJoin(\"resapp.interviews\", \"interviews\");\n $dql->leftJoin(\"interviews.interviewer\", \"interviewer\");\n $dql->andWhere(\"interviewer.id=\".$interviewer->getId());\n }\n\n $dql->orderBy(\"resapp.id\",\"ASC\");\n \n //echo \"dql=\".$dql.\"<br>\";\n\n $query = $dql->getQuery();\n $applicants = $query->getResult();\n \n// echo \"applicants=\".count($applicants).\"<br>\";\n// if( $status == 'active' ) {\n// foreach ($applicants as $resapp) {\n// echo \"ID \" . $resapp->getId() .\n// \"; startDate=\" . $resapp->getStartDate()->format('Y-m-d') .\n// \"; status=\" . $resapp->getAppStatus()->getName() .\n// \"; type=\" . $resapp->getResidencyTrack()->getName() .\n// \"<br>\";\n// }\n// }\n\n return $applicants;\n }", "public function GetHEIFollowUpNational($year, $estatus, $col=\"enrollment_status\", $division='county', $monthly=true)\n\t{\n\t\t$date_range = BaseModel::date_range($year);\n\n\t\t$data = SampleSynchView::selectRaw($division . \", COUNT(DISTINCT patient_id) as totals, month(datetested) as month\")\n\t\t->where('result', 2)\n\t\t->whereBetween('datetested', $date_range)\n\t\t->whereBetween('age', [0.0001, 24])\n\t\t->whereIn('pcrtype', [1, 2, 3])\n\t\t->where($col, $estatus)\n\t\t->where('flag', 1)\n\t\t->where('repeatt', 0)\n\t\t->when(true, function($query) use ($col){\n\t\t\tif($col == \"enrollment_status\"){\n\t\t\t\treturn $query->where('hei_validation', 1);\n\t\t\t}\t\t\t\n\t\t})\n\t\t->when($division, function($query) use ($monthly, $division){\n\t\t\tif($monthly){\n\t\t\t\treturn $query->groupBy('month', $division);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn $query->groupBy($division);\n\t\t\t}\t\t\t\n\t\t})\n\t\t->get(); \n\n\t\treturn $data;\n\t}", "public function getTrainingList2($dept, $month, $year, $status)\n {\n $this->db->select(\"th_ref_id,\n th_training_title,\n to_char(th_date_from, 'dd/mm/yyyy') th_date_from2,\n to_char(th_date_to, 'dd/mm/yyyy') th_date_to2,\n th_training_fee\n \");\n $this->db->from(\"ims_hris.training_head\");\n\n if(!empty($dept)) {\n $this->db->where(\"th_dept_code\", $dept);\n }\n\n if(!empty($month)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'MM'),'') = '$month'\");\n }\n\n if(!empty($year)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'YYYY'),'') = '$year'\");\n }\n\n // if(!empty($year) && !empty($month)) {\n // $this->db->where(\"COALESCE(TO_CHAR(TH_DATE_FROM,'MM/YYYY'),'') = '$month/$year'\");\n // }\n\n if(!empty($status)) {\n $this->db->where(\"COALESCE(th_status, 'ENTRY') = '$status'\");\n }\n \n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->order_by(\"th_date_from, th_date_to, th_training_title, th_ref_id\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public static function sanityChecker($year)\n {\n $withBase = [ 'position:id,title', 'person:id,callsign' ];\n\n $rows = self::whereYear('on_duty', $year)\n ->whereNull('off_duty')\n ->with($withBase)\n ->get()\n ->sortBy('person.callsign')\n ->values();\n\n $onDutyEntries = $rows->map(function ($row) {\n return [\n 'person' => [\n 'id' => $row->person_id,\n 'callsign' => $row->person ? $row->person->callsign : 'Person #'.$row->person_id,\n ],\n 'callsign' => $row->person ? $row->person->callsign : 'Person #'.$row->person_id,\n 'on_duty' => (string) $row->on_duty,\n 'duration' => $row->duration,\n 'credits' => $row->credits,\n 'position' => [\n 'id' => $row->position_id,\n 'title' => $row->position ? $row->position->title : 'Position #'.$row->position_id,\n ]\n ];\n })->values();\n\n $rows = self::whereYear('on_duty', $year)\n ->whereRaw('on_duty > off_duty')\n ->whereNotNull('off_duty')\n ->with($withBase)\n ->get()\n ->sortBy('person.callsign')\n ->values();\n\n /*\n * Do any entries have the end time before the start time?\n * (should never happen..famous last words)\n */\n\n $endBeforeStartEntries = $rows->map(function ($row) {\n return [\n 'person' => [\n 'id' => $row->person_id,\n 'callsign' => $row->person ? $row->person->callsign : 'Person #'.$row->person_id,\n ],\n 'on_duty' => (string) $row->on_duty,\n 'off_duty' => (string) $row->off_duty,\n 'duration' => $row->duration,\n 'position' => [\n 'id' => $row->position_id,\n 'title' => $row->position ? $row->position->title : 'Position #'.$row->position_id,\n ]\n ];\n });\n\n /*\n * Look for overlapping entries\n */\n\n $people = self::whereYear('on_duty', $year)\n ->whereNotNull('off_duty')\n ->with($withBase)\n ->orderBy('person_id')\n ->orderBy('on_duty')\n ->get()\n ->groupBy('person_id');\n\n $overlappingPeople = [];\n foreach ($people as $personId => $entries) {\n $overlapping = [];\n\n $prevEntry = null;\n foreach ($entries as $entry) {\n if ($prevEntry) {\n if ($entry->on_duty->timestamp < ($prevEntry->on_duty->timestamp + $prevEntry->duration)) {\n $overlapping[] = [\n [\n 'timesheet_id' => $prevEntry->id,\n 'position' => [\n 'id' => $prevEntry->position_id,\n 'title' => $prevEntry->position ? $prevEntry->position->title : 'Position #'.$prevEntry->position_id,\n ],\n 'on_duty' => (string) $prevEntry->on_duty,\n 'off_duty' => (string) $prevEntry->off_duty,\n 'duration' => $prevEntry->duration,\n ],\n [\n 'timesheet_id' => $entry->id,\n 'position' => [\n 'id' => $entry->position_id,\n 'title' => $entry->position ? $entry->position->title : 'Position #'.$entry->position_id,\n ],\n 'on_duty' => (string) $entry->on_duty,\n 'off_duty' => (string) $entry->off_duty,\n 'duration' => $entry->duration,\n ]\n ];\n }\n }\n $prevEntry = $entry;\n }\n\n if (!empty($overlapping)) {\n $first = $entries[0];\n $overlappingPeople[] = [\n 'person' => [\n 'id' => $first->person_id,\n 'callsign' => $first->person ? $first->person->callsign : 'Person #'.$first->person_id\n ],\n 'entries' => $overlapping\n ];\n }\n }\n\n usort($overlappingPeople, function ($a, $b) {\n return strcasecmp($a['person']['callsign'], $b['person']['callsign']);\n });\n\n $minHour = 24;\n foreach (Position::PROBLEM_HOURS as $positionId => $hours) {\n if ($hours < $minHour) {\n $minHour = $hours;\n }\n }\n\n $now = now();\n $rows = self:: select('timesheet.*', DB::raw(\"TIMESTAMPDIFF(SECOND, on_duty, IFNULL(off_duty,'$now')) as duration\"))\n ->whereYear('on_duty', $year)\n ->whereRaw(\"TIMESTAMPDIFF(HOUR, on_duty, IFNULL(off_duty,'$now')) >= $minHour\")\n ->with($withBase)\n ->orderBy('duration', 'desc')\n ->get();\n\n /*\n * Look for entries that may be too long. (i.e. a person forgot to signout in a timely manner.)\n */\n\n $tooLongEntries = $rows->filter(function ($row) {\n if (!isset(Position::PROBLEM_HOURS[$row->position_id])) {\n return true;\n }\n\n return Position::PROBLEM_HOURS[$row->position_id] < ($row->duration / 3600.0);\n })->values()->map(function ($row) {\n return [\n 'person' => [\n 'id' => $row->person_id,\n 'callsign' => $row->person ? $row->person->callsign : 'Person #'.$row->person_id,\n ],\n 'on_duty' => (string) $row->on_duty,\n 'off_duty' => (string) $row->off_duty,\n 'duration' => $row->duration,\n 'position' => [\n 'id' => $row->position_id,\n 'title' => $row->position ? $row->position->title : 'Position #'.$row->position_id,\n ]\n ];\n });\n\n return [\n 'on_duty' => $onDutyEntries,\n 'end_before_start' => $endBeforeStartEntries,\n 'overlapping' => $overlappingPeople,\n 'too_long' => $tooLongEntries\n ];\n }", "public function getstudent($txtStartDate,$txtEndDate,$txtSubject,$txtYear)\n\t{\n\t\tif($txtYear==\"1st\"){\n\t\t\t$this->db->where('payment_admission', 1);\n\t\t\t// $this->db->where('gen_type', $txtSubject);\n\t\t\t$this->db->where('gen_type', $txtSubject);\n\t\t\t$this->db->where('admission_payment_date >=', $txtStartDate);\n\t\t\t$this->db->where('admission_payment_date <=', $txtEndDate);\n\t\t\t$this->db->where('trsnfer_flag', 0);\n\t\t\t$this->db->where('cancel', 0);\n\t\t\t$this->db->order_by('college_roll', 'asc');\n\t\t\t$query=$this->db->get('admission_erp');\n\t\t\treturn $query->result();\n\t\t}\n\t\telse{\n\t\t\t$this->db->where('sub_honours', $txtSubject);\n\t\t\t$this->db->where('pay_status_part2', 1);\n\t\t\t$this->db->where('payment_date_2 >=', $txtStartDate);\n\t\t\t$this->db->where('payment_date_2 <=', $txtEndDate);\n\t\t\t$this->db->where('trsnfer_flag', 0);\n\t\t\t$this->db->where('cancel_flag', 0);\n\t\t\t$query=$this->db->get('student_dtl');\n\t\t\treturn $query->result();\n\t\t}\n\t}", "public static function retrieveAllForYearByCallsign($year)\n {\n $rows = self::whereYear('on_duty', $year)\n ->with([ 'person:id,callsign,status', 'position:id,title,type,count_hours' ])\n ->orderBy('on_duty')\n ->get();\n\n if (!$rows->isEmpty()) {\n PositionCredit::warmYearCache($year, array_unique($rows->pluck('position_id')->toArray()));\n }\n\n $personGroups = $rows->groupBy('person_id');\n\n return $personGroups->map(function ($group) {\n $person = $group[0]->person;\n\n return [\n 'id' => $group[0]->person_id,\n 'callsign' => $person ? $person->callsign : \"Person #\".$group[0]->person_id,\n 'status' => $person ? $person->status : 'deleted',\n\n 'total_credits' => $group->pluck('credits')->sum(),\n 'total_duration' => $group->pluck('duration')->sum(),\n 'total_appreciation_duration' => $group->filter(function ($t) {\n return $t->position ? $t->position->count_hours : false;\n })->pluck('duration')->sum(),\n\n 'timesheet' => $group->map(function ($t) {\n return [\n 'on_duty' => (string) $t->on_duty,\n 'off_duty' => (string) $t->off_duty,\n 'duration' => $t->duration,\n 'credits' => $t->credits,\n 'position' => [\n 'id' => $t->position_id,\n 'title' => $t->position ? $t->position->title : \"Position #\".$t->position_id,\n 'count_hours' => $t->position ? $t->position->count_hours : 0,\n ]\n ];\n })->values()\n ];\n })->sortBy('callsign', SORT_NATURAL|SORT_FLAG_CASE)->values();\n }", "public function get_student_by_form_name($form_number,$year)\n\t{\n\t\tif($year==\"1st\"){\n\t\t\t$this->db->where('form_no', $form_number);\n\t\t\t$query=$this->db->get('admission_erp');\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse{\n\t\t\t$this->db->where('addmission_no', $form_number);\n\t\t\t$query=$this->db->get('student_dtl');\n\t\t\treturn $query->result_array();\n\t\t}\t\n\t}", "function preview() {\n\n\t\t\n\t\t// determine this year\n\t\t$now = new DateTime();\n\t\t$thisYear = (int) ($now->format(\"Y\"));\n\n\t\t// get selected year\n\t\t$selectedYear = $this->request->query('selectedYear');\n\t\tif (is_null($selectedYear)) $selectedYear = $thisYear;\n\t\t$nextYear = $selectedYear + 1;\n\n\t\t// get first payment year\n\t\t$firstYear = $this->Department->Project->getFirstProjectYear();\n\n\t\t// get departments\n\t\t$departmentsList = $this->Department->findOrderedList();\n\n\n\t\t// BUILD UP SUMMARY DATA for this year and next\n\n\t\t// THIS YEAR\n\t\t//\n\t\t// get annual contract budgets\n\t\t$contractbudgetsThisYear = $this->Department->Project->Contract->Contractbudget->getContractBudgets($selectedYear);\n\n\t\t// get department budgets for this year\n\t\t$departmentBudgetsThisYear = $this->Department->Departmentbudget->getDepartmentBudgetsList($selectedYear);\n\n\t\t// get department unrestricted allocations for this year\n\t\t$departmentUnrestrictedAllocationThisYear = $this->Department->Departmentbudget->getDepartmentUnrestrictedAllocationsList($selectedYear);\n\n\t\t// NEXT YEAR\n\t\t//\n\t\t// get annual contract budgets\n\t\t$contractbudgetsNextYear = $this->Department->Project->Contract->Contractbudget->getContractBudgets($nextYear);\n\n\t\t// get department budgets for this year\n\t\t$departmentBudgetsNextYear = $this->Department->Departmentbudget->getDepartmentBudgetsList($nextYear);\n\n\t\t// get department unrestricted allocations for next year\n\t\t$departmentUnrestrictedAllocationNextYear = $this->Department->Departmentbudget->getDepartmentUnrestrictedAllocationsList($selectedYear);\n\n\n\t\t// BUILD UP DEPARTMENT-LEVEL DATA\n\t\t$departmentsDetailAnnual = [];\n\t\tforeach ($departmentsList as $department_id => $name) {\n\n\t\t\t$departmentDetailAnnual = array(\n\t\t\t\t'department' => $this->Department->findSimpleById($department_id),\n\t\t\t\t'projects' => $this->Department->Project->getProjectsByDepartmentAndYear($department_id, array($selectedYear, $nextYear)),\n\t\t\t\t'departmentBudgetThisYear' => $departmentBudgetsThisYear[$department_id],\n\t\t\t\t'departmentBudgetNextYear' => $departmentBudgetsNextYear[$department_id],\n\t\t\t\t'departmentUnrestrictedAllocationThisYear' => $departmentUnrestrictedAllocationThisYear[$department_id],\n\t\t\t\t'departmentUnrestrictedAllocationNextYear' => $departmentUnrestrictedAllocationNextYear[$department_id],\n\t\t\t);\n\n\t\t\t$departmentsDetailAnnual[$department_id] = $departmentDetailAnnual;\n\n\t\t}\n\n\n\t\t$this->set(compact(\n\n\t\t\t'departmentsList',\n\t\t\t'firstYear',\n\t\t\t'thisYear',\n\t\t\t'selectedYear',\n\t\t\t'nextYear',\n\t\t\t\n\t\t\t// Summary data\n\t\t\t'departmentBudgetsThisYear',\n\t\t\t'departmentBudgetsNextYear',\n\t\t\t'departmentUnrestrictedAllocationThisYear',\n\t\t\t'departmentUnrestrictedAllocationNextYear',\n\t\t\t'contractbudgetsThisYear',\n\t\t\t'contractbudgetsNextYear',\n\n\t\t\t// department-level\n\t\t\t'departmentsDetailAnnual'\n\t\t\t\n\t\t ));\n\n\t}", "public function Search_Document($type,$course_id,$teacher_id)\n {\n if($teacher_id != null)\n {\n $check_access = $this->Check_Access($teacher_id,$course_id);\n }\n else\n {\n $check_access = null;\n }\n if($type =='special')\n {\n $check_access = true;\n $sql = \"SELECT DISTINCT si.`instructor_id`,`firstname`,`lastname`,s.`semester_num`,s.`year` FROM `special_instructor` si,`course_hire_special_instructor` ci, `semester` s\n WHERE ci.`course_id` = '\".$course_id.\"' AND ci.`instructor_id` = si.`instructor_id` AND ci.`semester_id` = s.`semester_id` ORDER BY `ci`.`updated_date` DESC\" ;\n }\n else if ($type == 'evaluate')\n {\n $sql = \"SELECT `semester_num`,`year` FROM `course_evaluate` e,`semester` s\n WHERE e.`course_id` = '\".$course_id.\"' AND e.`semester_id` = s.`semester_id` ORDER BY e.`updated_date` DESC\" ;\n }\n $data = array();\n \n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n if($type == 'special')\n {\n $data['DATA'][$i]['id'] = $result[$i]['instructor_id'];\n $data['DATA'][$i]['name'] = $result[$i]['firstname'].' '.$result[$i]['lastname'];\n }\n $data['DATA'][$i]['semester'] = $result[$i]['semester_num'];\n $data['DATA'][$i]['year'] = $result[$i]['year'];\n }\n }\n else\n {\n $data['DATA'] = false;\n }\n $data['ACCESS'] = $check_access;\n $data['INFO'] = $this->Get_Course_Info($course_id);\n $dept = $this->Search_Course_Dept($course_id,$this->SEMESTER['id']);\n if($dept)\n {\n $data['INFO']['department'] = $dept['id'];\n\n }\n $sql = \"SELECT sum(se.`student`) as num_student FROM `course_evaluate` ce, `student_evaluate` se \";\n $sql .= \"WHERE ce.`course_evaluate_id` = se.`course_evaluate_id` AND ce.`course_id` = '\".$course_id.\"' AND ce.`semester_id` = '\".$this->SEMESTER['id'].\"'\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n\n if(is_null($result[0]['num_student']))\n {\n $data['INFO']['num_student'] = '0';\n }\n else\n {\n $data['INFO']['num_student'] = $result[0]['num_student'];\n }\n }\n //id,name,semester,year\n return $data;\n }", "public function getTrainingList4($dept, $month, $year)\n {\n $this->db->select(\"th_ref_id,\n th_training_title,\n to_char(th_date_from, 'dd/mm/yyyy') th_date_from2,\n to_char(th_date_to, 'dd/mm/yyyy') th_date_to2,\n th_training_fee\n \");\n $this->db->from(\"ims_hris.training_head\");\n\n if(!empty($dept)) {\n $this->db->where(\"th_dept_code\", $dept);\n }\n\n if(!empty($month)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'MM'),'') = '$month'\");\n }\n\n if (!empty($year)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'YYYY'),'') = '$year'\");\n }\n \n $this->db->where(\"COALESCE(th_status, 'ENTRY') = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->order_by(\"th_date_from, th_date_to, th_training_title, th_ref_id\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function recommends_req_wizard_schools_info($form, &$form_state) {\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['schreq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n );\n $form['schreq']['description'] = array(\n '#type' => 'item',\n '#title' => t('Enter each school which is to receive the recommendation.'),\n );\n\n if (empty($form_state['num_schools'])) {\n $form_state['num_schools'] = 1;\n }\n\n // Build the number of name fieldsets indicated by $form_state['num_schools']\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n $form['schname'][$i] = array(\n '#type' => 'fieldset',\n '#title' => t('School #@num', array('@num' => $i)),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n\n $form['schname'][$i]['schoolname'] = array(\n '#type' => 'textfield',\n '#title' => t('School/Business'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['schoolname']) ? $form_state['values']['schoolname'] : '',\n\n );\n $form['schname'][$i]['schoolprogram'] = array(\n '#type' => 'textfield',\n '#title' => t('School Program/Position'),\n '#size' => 25,\n '#maxlength' => 50,\n '#description' => '<br/><b>Note: </b>If you have any special forms required by the school, email hard copy to <br/>via the \"Email Professor\" link or mail a soft copy to the professor. ',\n '#default_value' => !empty($form_state['values']['schoolname']) ? $form_state['values']['schoolname'] : '',\n\n );\n \n // School contact information.\n $form['schname'][$i]['school_contact_info'] = array(\n '#type' => 'checkboxes',\n '#options' => drupal_map_assoc(array(t('Contact Email'), t('Contact Postal Address'))),\n '#title' => t('School contact information, if known'),\n // This #states rule says that this checkboxes array will be visible only\n // when $form['student_type'] is set to t('High School').\n // It uses the jQuery selector :input[name=student_type] to choose the\n // element which triggers the behavior, and then defines the \"High School\"\n // value as the one that triggers visibility.\n\n \n );\n\n $form['schname'][$i]['school_contact_email'] = array(\n '#type' => 'textfield',\n '#title' => t('School email:'),\n '#size' => 25,\n\n // This #states rule limits visibility to when the $form['tests_taken']\n // 'school_contact_email' checkbox is checked.\"\n '#states' => array(\n 'visible' => array( // action to take.\n ':input[name=\"schname[' . $i . '][school_contact_info][Contact Email]\"]' => array('checked' => TRUE),\n ),\n ),\n );\n $form['schname'][$i]['school_contact_postal'] = array(\n '#type' => 'textarea',\n '#title' => t('Contact Postal address:'),\n '#size' => 4,\n\n // Set this element visible if the postal checkbox above is checked.\n '#states' => array(\n 'visible' => array( // action to take.\n ':input[name=\"schname[' . $i . '][school_contact_info][Contact Postal Address]\"]' => array('checked' => TRUE),\n ),\n ),\n );\n \n $form['schname'][$i]['r_date_due'] = array(\n '#type' => 'date',\n '#title' => t('Last Date due'),\n '#required' => TRUE,\n '#size' => 10,\n \n );\n \n }\n\n // Adds \"Add another school\" button\n $form['add_school'] = array(\n '#type' => 'submit',\n '#value' => t('Add another school'),\n '#submit' => array('recommends_req_schtut_9_add_school'),\n );\n\n // If we have more than one school, this button allows removal of the\n // last name.\n if ($form_state['num_schools'] > 1) {\n $form['remove_school'] = array(\n '#type' => 'submit',\n '#value' => t('Remove latest school'),\n '#submit' => array('recommends_req_schtut_9_remove_school'),\n // Since we are removing a name, don't validate until later.\n '#limit_validation_errors' => array(),\n );\n }\n\n return $form;\n}", "public function yearProvider()\n {\n return array(\n // year = 1\n array('11111111111111111', array(2001, 2031)),\n // year = K\n array('1M8GDM9AXKP042788', array(1989, 2019)),\n // year = 3\n array('5GZCZ43D13S812715', array(2003, 2033)),\n // invalid year\n array('5GZCZ43D1US812715', array())\n );\n }", "public function getLecturerByMajor($major){\n $client = new Client();\n \n $majorID = $major == 'D3'? '57401' : '55301';\n $page = 1; $nameCollection = []; $userIDCollection = []; $gIDCollection = []; $imageCollection = [];\n $link = 'https://sinta.ristekbrin.go.id/departments/detail?page=1&afil=413&id='.$majorID.'&view=authors&sort=year2';\n $crawler = $client->request('GET', $link );\n \n // Get total amount written in sinta web\n $infoAmount = $crawler->filter('.uk-table > caption')->text();\n $pieces = explode(' ', $infoAmount);\n $sintaAmountLecturerTI = array_pop($pieces);\n \n do {\n $link = 'https://sinta.ristekbrin.go.id/departments/detail?page='.$page.'&afil=413&id='.$majorID.'&view=authors&sort=year2';\n $crawler = $client->request('GET', $link );\n \n // Scrape name\n $crawler->filter('.uk-description-list-line > dt > a')->each(function($node) use (&$nameCollection){\n array_push($nameCollection,$node->text());\n });\n \n // Scrape profile picture\n $crawler->filter('.author-photo-small')->each(function($node) use (&$imageCollection){\n array_push($imageCollection,$node->attr('src'));\n });\n \n // Scrape Sinta user ID\n $crawler->filter('.uk-description-list-line > dt > a')->each(function($node) use (&$userIDCollection){\n // Get only the user id from the link\n preg_match('/id=(.*)&view/', $node->attr('href'), $matches);\n $extractedUserID = $matches[1];\n \n array_push($userIDCollection,$extractedUserID);\n });\n \n // Scrape gscholar ID\n $crawler->filter('.author-photo-small')->each(function($node) use (&$gIDCollection){\n // Get only the user id from the link\n preg_match('/user=(.*)&citpid/', $node->attr('src'), $matches);\n $extractedID = $matches[1];\n \n array_push($gIDCollection,$extractedID);\n });\n \n $page++;\n } while (count($nameCollection) < $sintaAmountLecturerTI);\n \n for ($i=0; $i < count($nameCollection); $i++) { \n $collection[$i]['name'] = $nameCollection[$i];\n $collection[$i]['image'] = $imageCollection[$i];\n $collection[$i]['userID'] = $userIDCollection[$i];\n $collection[$i]['gscholarID'] = $gIDCollection[$i];\n }\n \n return $collection;\n }", "private function inclusionByYearByTypeEssai()\n {\n $em = $this->getDoctrine()->getManager();\n\n $inclusionByYearByTypeEssai = $em->getRepository(Inclusion::class)\n ->createQueryBuilder('i')\n ->select(' count(i) as nb, YEAR(i.datInc) AS year, e.typeEssai as type')\n ->join('i.essai', 'e')\n ->where('i.datInc IS NOT NULL')\n ->groupBy('year, type')\n ->orderBy('year')\n ->getQuery()\n ->getResult();\n\n $data = [];\n $years = [];\n $essais = [];\n foreach ($inclusionByYearByTypeEssai as $resp) {\n if (empty($data[$resp['year']][$resp['type']]))\n $data[$resp['year']][$resp['type']] = 0;\n $data[$resp['year']][$resp['type']] += $resp['nb'];\n $years[] = $resp['year'];\n $essais[] = $resp['type'];\n }\n $years = array_unique($years);\n $essais = array_unique($essais);\n sort($years);\n sort($essais);\n foreach ($data as $year => $v) {\n $total = 0;\n foreach ($v as $nb) {\n $total += $nb;\n }\n foreach ($v as $name => $nb) {\n $data[$year][$name] = $data[$year][$name] / $total * 100;\n }\n }\n\n $data_by_type = [];\n foreach ($years as $year) {\n foreach ($essais as $v) {\n if (empty($data[$year][$v]))\n $data_by_type[$v][] = 0;\n else\n $data_by_type[$v][] = $data[$year][$v];\n }\n }\n\n return [\"years\" => $years, \"data\" => $data_by_type];\n }", "public function ARTClinicNewlyMalesAllAges() {\r\n $query = \"SELECT TOP 1 [code_year_quarter].[year] AS [year],\r\n [code_year_quarter].[quarter] AS [quarter],\r\n CONCAT ([code_year_quarter].[year], ' Q',[code_year_quarter].[quarter]) AS [year_quarter],\r\n [code_hdepartment].[hfacility_id] AS [facility_id],\r\n [code_hfacility].[hfacility_name] AS [facility_name],\r\n (SELECT CONCAT ('Newly - ', [concept].[concept_name]) FROM [dbo].[concept] WHERE [concept].[ID] = [obs].[data_element]) AS [concept_name],\r\n (CAST([obs].[data_value] AS INT)) AS [newly_registered] \r\n FROM [dbo].[obs_dimensions] \r\n LEFT JOIN [dbo].[obs] ON [obs].[obs_dimensions_ID] = [obs_dimensions].[ID] \r\n LEFT JOIN [dbo].[art_clinic_obs] ON [art_clinic_obs].[ID] = [obs_dimensions].[art_clinic_obs_id] \r\n LEFT JOIN [dbo].[code_hdepartment] ON [code_hdepartment].[ID] = [art_clinic_obs].[hdepartment_id]\r\n LEFT JOIN [dbo].[code_year_quarter] ON [code_year_quarter].[ID] = [art_clinic_obs].[year_quarter_id]\r\n LEFT JOIN [dbo].[code_hfacility] ON [code_hfacility].[ID] = [code_hdepartment].[hfacility_id]\r\n\t\t WHERE \r\n [sub_group] = 398\r\n AND [period_report] = 393\r\n AND [obs].[data_element] = 14\r\n AND [art_clinic_obs].[year_quarter_id] = :year_quarter_id\r\n AND [code_hdepartment].[hfacility_id] = :health_facility_id\r\n AND [code_hdepartment].[hservice] = 294\";\r\n //Prepare query statement\r\n $stmt = $this->conn->prepare($query);\r\n //Bind values\r\n $stmt->bindParam(':year_quarter_id', $this->year_quarter);\r\n $stmt->bindParam(':health_facility_id', $this->health_facility_id);\r\n //Execute statement\r\n $stmt->execute();\r\n return $stmt;\r\n }", "public function former_student($year,$subject,$ddlSession)\n\t{\n\t\tif($year==\"1st\"){\n\t\t\t$this->db->where('gen_type', $subject);\n\t\t\t$this->db->where('trsnfer_flag', 1);\n\t\t\t$this->db->where('session_id', $ddlSession);\n\t\t\t$this->db->order_by('college_roll', 'asc');\n\t\t\t$query=$this->db->get('admission_erp');\n\t\t\treturn $query->result();\n\t\t}\n\t\telse{\n\t\t\t$this->db->where('sub_honours', $subject);\n\t\t\t$this->db->where('trsnfer_flag', 1);\n\t\t\t$this->db->where('session_id', $ddlSession);\n\t\t\t$query=$this->db->get('student_dtl');\n\t\t\treturn $query->result();\n\t\t}\n\t\t\n\t}", "public function getTrainingList5($dept, $month, $year)\n {\n $this->db->select(\"th_ref_id,\n th_training_title,\n to_char(th_date_from, 'dd/mm/yyyy') th_date_from2,\n to_char(th_date_to, 'dd/mm/yyyy') th_date_to2,\n th_training_fee\n \");\n $this->db->from(\"ims_hris.training_head\");\n\n if(!empty($dept)) {\n $this->db->where(\"th_dept_code\", $dept);\n }\n\n if(!empty($month)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'MM'),'') = '$month'\");\n }\n\n if (!empty($year)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'YYYY'),'') = '$year'\");\n }\n \n $this->db->where(\"COALESCE(th_status, 'ENTRY') = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->where(\"th_training_fee >= '5000.01'\");\n $this->db->order_by(\"th_date_from, th_date_to, th_training_title\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public static function retrieveCorrectionRequestsForYear($year)\n {\n // Find all the unverified timesheets\n $rows = self::with([ 'person:id,callsign', 'position:id,title'])\n ->whereYear('on_duty', $year)\n ->where('verified', false)\n ->where('notes', '!=', '')\n ->where('review_status', 'pending')\n ->whereNotNull('off_duty')\n ->orderBy('on_duty')\n ->get();\n\n // Warm up the position credit cache so the database is not being slammed.\n PositionCredit::warmYearCache($year, array_unique($rows->pluck('position_id')->toArray()));\n\n return $rows->sortBy(function ($p) {\n return $p->person->callsign;\n }, SORT_NATURAL|SORT_FLAG_CASE)->values();\n }", "public function processData()\n {\n \n $dateTimeStart = new DateTime($this->start);\n \n $dateEnd = $this->end;\n \n if (!$dateEnd) {\n $dateEnd = date('Y-m-d');\n }\n \n $dateTimeEnd = new DateTime($dateEnd);\n $this->yearEnd = $dateTimeEnd->format('Y');\n \n $beginYear = $dateTimeStart->format('Y');\n $this->yearStart = $beginYear;\n \n\n \n $numYears = $this->yearEnd - $this->yearStart;\n \n\n Log::debug( \"Start: {$this->yearStart} End: {$this->yearEnd} Num: {$numYears}\" );\n \n \n if (!$numYears) {\n $numYears = 1;\n }\n \n $this->allYears = [];\n \n for ($num = 0; $num <= $numYears; ++$num) {\n $this->allYears[] = $beginYear;\n ++$beginYear;\n }\n \n if (!$this->active) {\n $this->active = $this->yearEnd;\n }\n \n $active = $this->active;\n \n $this->yearBefore = $active-1;\n $this->yearAfter = $active+1;\n \n // ok ganz simple\n if (count($this->allYears) > 5) {\n\n \n if ($active + 2 >= $this->yearEnd) {\n $active = $this->yearEnd - 2;\n }\n \n if ( ($active - 2) <= $this->yearStart) {\n $active = $this->yearStart + 2;\n }\n \n $this->showYears[] = $active-2;\n $this->showYears[] = $active-1;\n $this->showYears[] = $active;\n $this->showYears[] = $active+1;\n $this->showYears[] = $active+2;\n \n } else {\n \n $this->showYears = $this->allYears;\n }\n \n $this->allYears = array_reverse($this->allYears);\n\n }", "function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}", "public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "function getStudentByMajorValidate(){\n\t\t\n\t\tif(@$this->major == \"\" | @$this->institution == \"\"){\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"Both the major and institution are required!\", \"\");\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->getStudentByMajor( $this->sanitize($this->major), $this->sanitize($this->institution) );\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function Get_Document($type,$course_id,$instructor_id,$teacher_id,$semester,$year)\n {\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n //check responsible\n if($teacher_id != null)\n {\n $check_access = $this->Check_Access($teacher_id,$course_id);\n }\n else\n {\n $check_access = null;\n }\n if($type == 'evaluate')\n {\n $sql = \"SELECT ce.`course_evaluate_id`,ce.`exam_evaluate_id`,ce.`num_section`,ce.`credit_total`,ce.`course_id`,ce.`noorspe`,ce.`type`,ce.`type_other`,ce.`teacher_co`,ce.`absent`,ce.`syllabus`,ce.`submit_user_id`,ce.`submit_date`,cg.*,me.*,ee.* \";\n $sql .=\" FROM `course_evaluate` ce, `criterion_grade` cg, `measure_evaluate` me, `exam_evaluate` ee \";\n $sql .=\" WHERE ce.`criterion_grade_id` = cg.`criterion_grade_id` AND ce.`measure_evaluate_id` = me.`measure_evaluate_id` AND ce.`exam_evaluate_id` = ee.`exam_evaluate_id` AND ce.`course_id` = '\".$course_id.\"' AND `semester_id` = '\".$semester_id.\"'\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n $data = $result[0];\n if($data['syllabus'] == null)\n {\n $data['syllabus'] = false;\n }\n }\n else\n {\n $data = false;\n }\n $data['student'] = array();\n if(isset($data['course_evaluate_id']))\n {\n $sql = \"SELECT `section`,`student` FROM `student_evaluate` WHERE `course_evaluate_id` = \".$data['course_evaluate_id'];\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $data['student'][$result[$i]['section'] -1] = $result[$i]['student'];\n }\n }\n }\n\n $data['exam_mid1_committee_lec'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'MID1' AND `type_commitee` = 'LEC' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_mid1_committee_lec'],$teacher_name);\n }\n }\n\n $data['exam_mid1_committee_lab'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'MID1' AND `type_commitee` = 'LAB' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_mid1_committee_lab'],$teacher_name);\n }\n }\n\n $data['exam_mid2_committee_lec'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'MID2' AND `type_commitee` = 'LEC' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_mid2_committee_lec'],$teacher_name);\n }\n }\n\n $data['exam_mid2_committee_lab'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'MID2' AND `type_commitee` = 'LAB' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_mid2_committee_lab'],$teacher_name);\n }\n }\n\n $data['exam_final_committee_lec'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'FINAL' AND `type_commitee` = 'LEC' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_final_committee_lec'],$teacher_name);\n }\n }\n\n $data['exam_final_committee_lab'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `exam_commitee` WHERE `exam_evaluate_id` = '\".$data['exam_evaluate_id'].\"' AND `type` = 'FINAL' AND `type_commitee` = 'LAB' ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['exam_final_committee_lab'],$teacher_name);\n }\n }\n $data['teacher'] = array();\n $sql = \"SELECT `teacher_id`,`name_type` FROM `teacher_exam_evaluate` WHERE `course_eveluate_id` = \".$data['course_evaluate_id'].\" ORDER BY `updated_date` ASC\";\n $result = $this->DB->Query($sql);\n if($result)\n {\n for($i=0;$i<count($result);$i++)\n {\n $teacher_name = $this->PERSON->Get_Teacher_Name($result[$i]['teacher_id'],$result[$i]['name_type']);\n if($teacher_name != false)\n {\n $temp = explode(\" \",$teacher_name);\n $teacher_name = '';\n for($j=1;$j<count($temp);$j++)\n {\n $teacher_name .= $temp[$j].\" \";\n }\n $teacher_name = trim($teacher_name,\" \");\n }\n array_push($data['teacher'],$teacher_name);\n }\n }\n }\n else if($type == 'special')\n {\n $check_access = true;\n $lecture_detail = array();\n $sql = \"SELECT st.`topic_name`,st.`teaching_date`,st.`teaching_time_start`,st.`teaching_time_end`,st.`teaching_room` FROM `special_lecture_teach` st, `course_hire_special_instructor` ci \";\n $sql .= \"WHERE ci.`instructor_id` = \".$instructor_id.\" AND ci.`course_id` = '\".$course_id.\"' AND st.`hire_id` = ci.`hire_id` AND ci.`semester_id` = \".$semester_id;\n $result = $this->DB->Query($sql);\n if($result)\n {\n $numtable = count($result);\n for ($i=0; $i < count($result); $i++)\n {\n $lecture_detail[$i] = $result[$i];\n }\n }\n else\n {\n $numtable = 0;\n $data['lecture_detail'] = null;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`position`,si.`qualification`,si.`work_place`,si.`phone`,si.`phone_sub`,si.`phone_mobile`,si.`cv`,si.`email`,si.`invited`,ei.`level_teacher`,ei.`level_descript`,ei.`payment_method`,ei.`expense_lec_checked`,ei.`expense_lec_number`,ei.`expense_lec_hour`,ei.`expense_lec_cost`,ei.`expense_lab_checked`,ei.`expense_lab_number`,ei.`expense_lab_hour`,ei.`expense_lab_cost`,ei.`expense_plane_check`,ei.`expense_plane_depart`,ei.`expense_plane_arrive`,ei.`expense_plane_cost`,ei.`expense_taxi_check`,ei.`expense_taxi_depart`,ei.`expense_taxi_arrive`,ei.`expense_taxi_cost`,ei.`expense_car_check`,ei.`expense_car_distance`,ei.`expense_car_unit`,ei.`expense_car_cost`,ei.`expense_hotel_choice`,ei.`expense_hotel_per_night`,ei.`expense_hotel_number`,ei.`expense_hotel_cost`,ei.`cost_total`, ci.*\";\n $sql .= \" FROM `special_instructor` si,`expense_special_instructor` ei, `course_hire_special_instructor` ci \";\n $sql .= \"WHERE ci.`instructor_id` = \".$instructor_id.\" AND ci.`course_id` = '\".$course_id.\"' AND ci.`instructor_id` = si.`instructor_id` AND ci.`expense_id` = ei.`expense_id` AND ci.`semester_id` = \".$semester_id;\n $result = $this->DB->Query($sql);\n if($result)\n {\n $data = $result[0];\n if($data['cv'] == null)\n {\n $data['cv'] = false;\n }\n $data['num_table'] = $numtable;\n $data['lecture_detail'] = $lecture_detail;\n }\n else\n {\n $data = false;\n }\n }\n else\n {\n die(\"รูปแบบข้อมูลผิดพลาด กรุณาติดต่อผู้ดูแลระบบ\");\n }\n $data['ACCESS'] = $check_access;\n return $data;\n }", "public function talentOpportunities($state=null,$institution_type=null,$gender=null,$sport_type=null,$country = null)\n {\n $talent_management_level = Session::get(SiteSessions::USER_MANAGEMENT_LEVEL);\n $managers = null;\n\n switch($talent_management_level)\n {\n case SiteConstants::USER_TALENT_MANAGEMENT_LEVEL_STUDENT:\n\n //Management level and Gender requested by the user.\n $managerManagementLevel = null;\n\n //If Institution type is \"High School\"\n if($institution_type == 1)\n {\n $managerManagementLevel=SiteConstants::USER_MANAGER_MANAGEMENT_LEVEL_HIGH_SCHOOL;\n }\n //If Institution type is \"University\"\n else if($institution_type == 2)\n {\n $managerManagementLevel=SiteConstants::USER_MANAGER_MANAGEMENT_LEVEL_UNIVERSITY;\n }\n\n $managers = ManagersDatabase::managerType(SiteConstants::USER_MANAGER_COACH)\n ->managementLevel($managerManagementLevel)\n ->state($state)\n ->sportGender($gender)\n ->sport($sport_type)\n ->paginate(25);\n\n\n break;\n\n\n case SiteConstants::USER_TALENT_MANAGEMENT_LEVEL_ASPIRING_PRO:\n\n $managers = ManagersDatabase::country($country)\n ->sport($sport_type)\n ->sportGender($gender)\n ->whereIn('management_level',[SiteConstants::USER_MANAGER_MANAGEMENT_LEVEL_AMATEUR,SiteConstants::USER_MANAGER_MANAGEMENT_LEVEL_PRO,SiteConstants::USER_MANAGER_MANAGEMENT_LEVEL_SEMI_PRO])\n ->paginate(25);\n break;\n }\n\n\n $managers_already_contacted = DB::table(\"managers_contacted\")->where('user_id','=',Session::get(SiteSessions::USER_ID))->lists('manager_id');\n\n\n $userProfile=UserProfile::find(Session::get(SiteSessions::USER_ID));\n $userProfile->getMutatedData = false;\n $sport_gender = array_map('ucfirst',array_merge(['0'=>'-- Select Option --'],SportsRepository::getSportsGender()));\n $state = array_map('ucfirst',array_merge(['0' => \"-- Select State --\"],BasicSiteRepository::getAmericanState()));\n $institution_type = array_map('ucfirst',UserProfileRepository::getInstituteType());\n $country = array_map('ucfirst',BasicSiteRepository::getListOfCountries());\n\n\n return view('database.talent_database_search_result',compact('managers','managers_already_contacted','userProfile','sport_gender','state','institution_type','country'));\n }", "public function reportTeacherDatewiseAttendent()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n return view('report.reportTeacherDatewiseAttendent')->wit;\n }", "public function modelYear();", "public function listApprovelAction($year = \"notset\")\n {\n $em = $this->getDoctrine()->getManager();\n \n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:RoomReservation');\n\n $query = $repository->createQueryBuilder('rr')\n ->where('rr.approved = -1')\n ->orderBy('rr.date', 'ASC')\n ->getQuery();\n\n $roomReservations = $query->getResult();\n \n return $this->render('roomreservation/approvellist.html.twig', array(\n 'roomReservations' => $roomReservations\n ));\n }", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function get_student_by_unique_code($year,$txtUniqueCode){\n\t\tif($year==\"1st\"){\n\t\t\t$this->db->like('uniqueID', $txtUniqueCode, 'BOTH');\n\t\t\t$query=$this->db->get('admission_erp');\n\t\t\treturn $query->result();\n\t\t}\n\t\telse{\n\t\t\t$this->db->where('id', $txtUniqueCode);\n\t\t\t$query=$this->db->get('student_dtl');\n\t\t\treturn $query->result();\n\t\t}\n\t\t\n\t}", "public function Get_Special_Report($semester,$year,$dept_id)\n {\n global $FILE_PATH;\n $semester_id = $this->DEADLINE->Search_Semester_id($semester,$year);\n if($semester_id)\n {\n $temp_course = $this->COURSE->Get_Dept_Course($dept_id,$semester_id);\n $dept_course = array();\n if(!isset($temp_course['status']))\n {\n for($i=0;$i<count($temp_course);$i++)\n {\n array_push($dept_course,$temp_course[$i]['id']);\n }\n }\n $DATA = array();\n $DATA['info'] = array();\n $DATA['download'] = $this->DOWNLOAD_URL.\"?course=all&type=report&dept=\".$dept_id.\"&info=special&semester=\".$semester.\"&year=\".$year;\n $sql = \"SELECT DISTINCT `course_id` FROM `course_hire_special_instructor` WHERE `status` = '1' AND `semester_id` = \".$semester_id;\n $result_course = $this->DB->Query($sql);\n if($result_course)\n {\n for($i=0;$i<count($result_course);$i++)\n {\n if(!in_array($result_course[$i]['course_id'],$dept_course))\n {\n continue;\n }\n $sql = \"SELECT si.`instructor_id`,si.`prefix`,si.`firstname`,si.`lastname`,si.`cv` FROM `course_hire_special_instructor` ci ,`special_instructor` si \";\n $sql.= \"WHERE ci.`instructor_id` = si.`instructor_id` AND ci.`course_id` = '\".$result_course[$i]['course_id'].\"' AND ci.`status` = '1' AND ci.`semester_id` = \".$semester_id;\n $result_instructor = $this->DB->Query($sql);\n $data = array();\n $data['id'] = $result_course[$i]['course_id'];\n $data['name'] = $this->COURSE->Get_Course_Name($data['id']);\n $data['special'] = array();\n if($result_instructor)\n {\n for($j=0;$j<count($result_instructor);$j++)\n {\n $instructor['id'] = $result_instructor[$j]['instructor_id'];\n $instructor['name'] = $result_instructor[$j]['prefix'].' '.$result_instructor[$j]['firstname'].' '.$result_instructor[$j]['lastname'];\n $instructor['cv'] = $this->PERSON->Get_CV($instructor['id']);\n $instructor['pdf'] = $this->VIEW_URL.\"?course=\".$data['id'].\"&id=\".$instructor['id'].\"&type=complete&info=special&semester=\".$semester.\"&year=\".$year;\n array_push($data['special'],$instructor);\n }\n }\n array_push($DATA['info'],$data);\n }\n }\n if(count($DATA['info']) == 0)\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n else\n {\n return $DATA;\n }\n }\n else\n {\n $return['status'] = 'error';\n $return['msg'] = 'ไม่พบข้อมูล';\n return $return;\n }\n }", "public function getTrainingList6($dept, $month, $year)\n {\n $this->db->select(\"th_ref_id,\n th_training_title,\n TO_CHAR(th_date_from, 'DD/MM/YYYY') th_date_from2,\n TO_CHAR(th_date_to, 'DD/MM/YYYY') th_date_to2,\n th_training_fee\n \");\n $this->db->from(\"ims_hris.training_head\");\n\n if(!empty($dept)) {\n $this->db->where(\"th_dept_code\", $dept);\n }\n\n if(!empty($month)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'MM'),'') = '$month'\");\n }\n\n if (!empty($year)) {\n $this->db->where(\"COALESCE(TO_CHAR(th_date_from,'YYYY'),'') = '$year'\");\n }\n \n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->order_by(\"th_date_from, th_date_to, th_training_title, th_ref_id\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "public function getYearListTrCost() \n {\t\t\n $this->db->select(\"to_char(th_date_from,'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"TO_CHAR(th_date_from,'YYYY'), th_date_from \");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function index($year)\n\t{\n\t\t/**\n\t\t* get all places that have sowings in a specific year \n\t\t*/\n\t\t$places = Place :: whereHas('sowings', function($query) use ($year){\n\t\t\t$query->where('year','=',$year);\n\t\t})->get();\n\n\t\t$places->each(function($item) use($year){\n\t\t\t// var_dump($item);\n\t\t\t$item->sowings = $item->sowings->filter(function($item) use ($year){\n\t\t\t\treturn $item->year == $year;\n\t\t\t})->all();\n\t\t\t\n\t\t});\n\n\t\t$years = Sowing :: distinct('year')->pluck('year');\n\n\t\treturn view('sowings.index', compact('years','places'));\n\t}", "protected function getExampleTraining() {\n\n\t\t$Data = array(\n\t\t\t'id'\t\t=> DataObject::$DEFAULT_ID,\n\t\t\t'sportid'\t=> Configuration::General()->runningSport(),\n\t\t\t'typeid'\t=> Configuration::General()->competitionType(),\n\t\t\t'time'\t\t=> time(),\n\t\t\t'created'\t=> time(),\n\t\t\t'edited'\t=> time(),\n\t\t\t'is_public'\t=> 1,\n\t\t\t'is_track'\t=> 1,\n\t\t\t'distance'\t=> 10,\n\t\t\t's'\t\t\t=> 51*60+27,\n\t\t\t'elevation'\t=> 57,\n\t\t\t'kcal'\t\t=> 691,\n\t\t\t'pulse_avg'\t=> 186,\n\t\t\t'pulse_max'\t=> 193,\n\t\t\t'vdot_with_elevation'\t=> Configuration::Data()->vdot() + 1,\n\t\t\t'vdot'\t\t=> Configuration::Data()->vdot() + 2,\n\t\t\t'use_vdot'\t=> 0,\n\t\t\t'fit_vdot_estimate'\t=> round(Configuration::Data()->vdot()),\n\t\t\t'fit_recovery_time'\t=> 800,\n\t\t\t'fit_hrv_analysis'\t=> 800,\n\t\t\t'jd_intensity'\t=> 27,\n\t\t\t'trimp'\t\t=> 121,\n\t\t\t'cadence'\t=> 90,\n\t\t\t'stride_length'\t=> 108,\n\t\t\t'groundcontact'\t=> 220,\n\t\t\t'vertical_oscillation'\t=> 76,\n\t\t\t'power'\t\t=> 520,\n\t\t\t'temperature'\t=> 17,\n\t\t\t'weatherid'\t=> 5,\n\t\t\t'splits'\t=> '5|26:51-5|24:36',\n\t\t\t'comment'\t=> str_replace(' ', '&nbsp;', __('Test activity')),\n\t\t\t'partner'\t=> 'Peter',\n\t\t\t'abc'\t\t=> 1,\n\t\t\t'notes'\t\t=> str_replace(' ', '&nbsp;', __('Great run!')),\n\t\t\t'accountid'\t=> SessionAccountHandler::getId(),\n\t\t\t'creator'\t=> '',\n\t\t\t'creator_details'\t=> '',\n\t\t\t'activity_id'\t=> '',\n\t\t\t'elevation_corrected'\t=> 1\n\t\t);\n\n\t\treturn $Data;\n\t}", "public function getYearListAppTr2() \n {\t\t\n $this->db->select(\"to_char(th_date_from,'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"TO_CHAR(th_date_from,'YYYY'), th_date_from\");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public static function statsticsPigeonsYear()\n\t{\n\t\t$pigeonTable=Pigeon::getTableSchema();\n\t\t$query = (new Query())->select([\"COUNT(*) as count\", \"year\", \"sex\"])->from($pigeonTable->name)->where(['IDuser'=>Yii::$app->user->getId()])->groupBy('year, sex');\n\t\t$command = $query->createCommand();\n\t\t$rows = $command->queryAll();\n\t\t$year=[]; $maleCount=[]; $femaleCount=[]; $unknownCount=[];\t\t\n\t\tforeach($rows as $value)\n\t\t{\n\t\t\t$year[$value[\"year\"]]=$value[\"year\"];\n\t\t\t$femaleCount[$value[\"year\"]]=empty($femaleCount[$value[\"year\"]])?0:$femaleCount[$value[\"year\"]];\n\t\t\t$maleCount[$value[\"year\"]]=empty($maleCount[$value[\"year\"]])?0:$maleCount[$value[\"year\"]];\n\t\t\t$unknownCount[$value[\"year\"]]=empty($unknownCount[$value[\"year\"]])?0:$unknownCount[$value[\"year\"]];\n\t\t\tif($value[\"sex\"]==Pigeon::MALE_PIGEON)\n\t\t\t{\n\t\t\t\t$maleCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t\t\n\t\t\tif($value[\"sex\"]==Pigeon::FEMALE_PIGEON)\n\t\t\t{\n\t\t\t\t$femaleCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t\t\n\t\t\tif($value[\"sex\"]==Pigeon::UNKNOWN_SEX_PIGEON) \n\t\t\t{\n\t\t\t\t$unknownCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t}\n\t\t\n\t\t /* Create and populate the pData object */ \n\t\t$MyData = new \\pData(); \n\t\t$MyData->loadPalette(Yii::getAlias(\"@common\").\"/pchart/palettes/light.color\", TRUE);\n\t\t$MyData->addPoints($maleCount,Yii::t('default', 'Male')); \n\t\t$MyData->addPoints($femaleCount,Yii::t('default', 'Female')); \n\t\t$MyData->addPoints($unknownCount,Yii::t('default', 'No sex')); \n\t\t$MyData->setAxisName(0,Yii::t('default', 'Number of pigeons')); \n\t\t$MyData->addPoints($year,\"Year\"); \n\t\t$MyData->setSerieDescription(\"Year\",Yii::t('default', 'Year')); \n\t\t$MyData->setAbscissa(\"Year\"); \n\t\t\n\t\t/* Create the pChart object */ \n\t\t$myPicture = new \\pImage(900,1000,$MyData); \n\t\t\n\t\t/* Turn of Antialiasing */ \n\t\t$myPicture->Antialias = FALSE; \n\t\t\n\t\t/* Set the default font */ \n\t\t$myPicture->setFontProperties(array(\"FontName\"=>Yii::getAlias(\"@common\").\"/pchart/fonts/verdana.ttf\",\"FontSize\"=>10)); \n\t\t\n\t\t/* Define the chart area */ \n\t\t$myPicture->setGraphArea(60,60,800,1000); \n\t\t\n\t\t/* Draw the scale */ \n\t\t$scaleSettings = array(\"GridR\"=>200,\"GridG\"=>200,\"GridB\"=>200,\"DrawSubTicks\"=>TRUE,\"CycleBackground\"=>TRUE, \"Mode\"=>SCALE_MODE_START0, \"Pos\"=>SCALE_POS_TOPBOTTOM); \n\t\t$myPicture->drawScale($scaleSettings); \n\t\t\n\t\t/* Write the chart legend */ \n\t\t$myPicture->drawLegend(480,12,array(\"Style\"=>LEGEND_NOBORDER,\"Mode\"=>LEGEND_HORIZONTAL)); \n\t\t\n\t\t\n\t\t/* Draw the chart */ \n\t\t$myPicture->drawBarChart(); \n\t\t\n\t\t/* Render the picture (choose the best way) */ \n\t\t$myPicture->autoOutput(Yii::getAlias(\"@webroot\").\"/temp/example.drawBarChartYear.png\"); \n\t}", "public function computeAndSave(\n Environment $environment,\n array $fields,\n $year\n );", "function getTrainingParticipant($db, $strDataID = \"\")\n{\n global $words;\n global $strTargetElements;\n global $_REQUEST;\n global $strEmptyOptions;\n global $bolIsEmployee;\n $intMaxShow = 4; // tambahan yang perlu dimunculkan\n if ($bolIsEmployee) {\n $intMaxShow = 1;\n }\n $intAdd = 50; // maksimum tambahan\n $intRows = 0;\n $intShown = 0;\n $strResult = \"\";\n $strButtons = \"\";\n $arrStatus = [\"ok\", \"cancel\"];\n $strResult .= \" <table border=0 class=gridTable cellpadding=0 cellspacing=0 >\\n\";\n $strResult .= \" <tr valign=top class=tableHeader>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('no') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('employee id') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('name') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('training cost') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('other cost') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('status') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('note') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('delete') . \"</td>\\n\";\n // $strResult .= \" <td nowrap>&nbsp;\" .getWords('form').\"</td>\\n\";\n // $strResult .= \" <td nowrap>&nbsp;\" .getWords('certificate').\"</td>\\n\";\n $strResult .= \" </tr>\\n\";\n $arrParticipant = [];\n if ($strDataID != \"\") {\n $strSQL = \"\n SELECT t1.id, t1.note, t1.status, t1.cost, t1.other_cost, \n t2.employee_id, t2.employee_name\n FROM hrd_training_request_participant AS t1 \n LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee \n WHERE t1.id_request = '$strDataID' \n \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrParticipant[$rowDb['id']] = $rowDb;\n }\n writeLog(ACTIVITY_VIEW, MODULE_PAYROLL, \"\", 0);\n } else if (isset($_REQUEST['btnCreate'])) {\n $strPlanID = (isset($_REQUEST['id_plan'])) ? $_REQUEST['id_plan'] : \"\";\n if ($strPlanID != \"\") {\n /*\n $strSQL = \"\n SELECT t1.id, t1.note, t1.status, t2.employee_id, t2.employee_name, 0 as cost, 0 as other_cost\n FROM hrd_training_plan_participant AS t1\n LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee\n WHERE t1.id_plan = '$strPlanID' AND t1.status = 0\n \";\n */\n //Custom: hilangkan participant pada plan => mengacu participant pada request\n //EDIT : Harusnya kosong, ignore all\n /*\n $strSQL = \"SELECT t1.id, t1.note, t1.status, t2.employee_id, t2.employee_name, t1.cost, t1.other_cost\n FROM hrd_training_request_participant AS t1\n LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee\n LEFT JOIN hrd_training_request AS t3 ON t3.id = t1.id_request\n WHERE t3.id_plan = '$strPlanID'\";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrParticipant[$rowDb['id']] = $rowDb;\n }\n */\n }\n }\n $bolCurrentEmpIsParticipant = false;\n foreach ($arrParticipant AS $id => $rowDb) {\n $intRows++;\n $intShown++;\n //CUSTOM: bila employee - hide if not self\n $intRowsVisible = 1;\n $strCustomHide = \"\";\n global $arrUserInfo;\n if ($bolIsEmployee && $rowDb['employee_id'] != $arrUserInfo['employee_id']) {\n $strCustomHide = \" style=display:none \";\n $intShown--;\n $intRowsVisible = $intRows;\n } else {\n $bolCurrentEmpIsParticipant = true;\n }\n $strResult .= \"<tr valign=top $strCustomHide id=\\\"detailRows$intRows\\\">\\n\";\n //--------CUSTOM SELESAI-------------------\n $strResult .= \" <td align=right nowrap><input type=hidden name=detailID$intRows value=\\\"\" . $rowDb['id'] . \"\\\">$intRowsVisible&nbsp;</td>\";\n $strAction = \"onFocus = \\\"AC_kode = 'detailEmployeeID$intRows';AC_nama='detailName$intRows';\\\" \";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailEmployeeID$intRows id=detailEmployeeID$intRows value=\\\"\" . $rowDb['employee_id'] . \"\\\" $strAction></td>\";\n $strResult .= \" <td nowrap>&nbsp;<strong id=\\\"detailName$intRows\\\">\" . $rowDb['employee_name'] . \"</strong></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmount$intRows id=detailAmount$intRows value=\\\"\" . $rowDb['cost'] . \"\\\" class='numberformat numeric'></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmountOther$intRows id=detailAmountOther$intRows value=\\\"\" . $rowDb['other_cost'] . \"\\\" class='numberformat numeric'></td>\";\n $strResult .= \" <td>\" . getComboFromArray($arrStatus, \"detailStatus$intRows\", $rowDb['status']) . \"</td>\";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailNote$intRows id=detailNote$intRows value=\\\"\" . $rowDb['note'] . \"\\\"></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center title='cost \" . standardFormat(\n $rowDb['cost']\n ) . \"'>g<input type=checkbox id='chkID$intRows' name='chkID$intRows' $strAction></td>\\n\";\n // $strActionForm = \" onChange = \\\"chkPrintForm($intRows);\\\" \";\n // $strResult .= \" <td align=center title='id \" .$rowDb['employee_id'].\"'>f<input type=checkbox id='chkIDF$intRows' name='chkIDF$intRows' $strActionForm value='\" .$rowDb['id']. \"'></td>\\n\";\n // $strActionCertificate = \" onChange = \\\"chkPrintCertificate($intRows);\\\" \";\n // $strResult .= \" <td align=center title='id \" .$rowDb['employee_id'].\"'>f<input type=checkbox id='chkIDC$intRows' name='chkIDC$intRows' $strActionCertificate></td>\\n\";\n $strResult .= \"</tr>\\n\";\n $strTargetElements .= \",\\\"detailEmployeeID$intRows\\\"\";\n }\n // tambahkan dengan data kosong\n // Custom: bila employee - tampilkan max 1 data kosong; biar gampang langsung cek dia employee bukan\n if ($bolIsEmployee && !$bolCurrentEmpIsParticipant) {\n $intRows++;\n if ($intRows <= $intMaxShow) {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\">\\n\";\n $intShown++;\n $strDisabled = \"\";\n } else {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\" style=\\\"display:none\\\">\\n\";\n $strDisabled = \"disabled\";\n }\n $strResult .= \" <td align=right nowrap>$intRows&nbsp;</td>\";\n $strAction = \"onFocus = \\\"AC_kode = 'detailEmployeeID$intRows';AC_nama='detailName$intRows';\\\" \";\n //custom sedikit di sini\n global $arrUserInfo;\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailEmployeeID$intRows id=detailEmployeeID$intRows $strDisabled $strAction value = '\" . $arrUserInfo['employee_id'] . \"' readonly></td>\";\n $strResult .= \" <td nowrap>&nbsp;<strong id=\\\"detailName$intRows\\\">\" . $arrUserInfo['employee_name'] . \"</strong></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmount$intRows id=detailAmount$intRows value=0 class='numberformat numeric'></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmountOther$intRows id=detailAmountOther$intRows value=0 class='numberformat numeric'></td>\";\n $strResult .= \" <td>\" . getComboFromArray($arrStatus, \"detailStatus$intRows\") . \"</td>\";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailNote$intRows id=detailNote$intRows></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center><input type=checkbox id='chkID$intRows' name='chkID$intRows' $strAction></td>\\n\";\n // $strActionForm = \" onChange = \\\"chkPrintForm($intRows);\\\" \";\n // $strResult .= \" <td align=center><input type=checkbox id='chkIDF$intRows' name='chkIDF$intRows' $strActionForm></td>\\n\";\n // $strActionCertificate = \" onChange = \\\"chkPrintCertificate($intRows);\\\" \";\n // $strResult .= \" <td align=center><input type=checkbox id='chkIDC$intRows' name='chkIDC$intRows' $strActionCertificate></td>\\n\";\n $strResult .= \"</tr>\\n\";\n $strTargetElements .= \",\\\"detailEmployeeID$intRows\\\"\";\n } else {\n //-------------CUSTOM SELESAI--------------------------\n for ($i = 1; $i <= $intAdd; $i++) {\n $intRows++;\n if ($intRows <= $intMaxShow) {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\">\\n\";\n $intShown++;\n $strDisabled = \"\";\n } else {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\" style=\\\"display:none\\\">\\n\";\n $strDisabled = \"disabled\";\n }\n $strResult .= \" <td align=right nowrap>$intRows&nbsp;</td>\";\n $strAction = \"onFocus = \\\"AC_kode = 'detailEmployeeID$intRows';AC_nama='detailName$intRows';\\\" \";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailEmployeeID$intRows id=detailEmployeeID$intRows $strDisabled $strAction></td>\";\n $strResult .= \" <td nowrap>&nbsp;<strong id=\\\"detailName$intRows\\\"></strong></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmount$intRows id=detailAmount$intRows value=0 class='numberformat numeric'></td>\";\n $strResult .= \" <td><input type=text size=15 maxlength=20 name=detailAmountOther$intRows id=detailAmountOther$intRows value=0 class='numberformat numeric'></td>\";\n $strResult .= \" <td>\" . getComboFromArray($arrStatus, \"detailStatus$intRows\") . \"</td>\";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailNote$intRows id=detailNote$intRows></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center><input type=checkbox id='chkID$intRows' name='chkID$intRows' $strAction></td>\\n\";\n // $strActionForm = \" onChange = \\\"chkPrintForm($intRows);\\\" \";\n // $strResult .= \" <td align=center><input type=checkbox id='chkIDF$intRows' name='chkIDF$intRows' $strActionForm></td>\\n\";\n // $strActionCertificate = \" onChange = \\\"chkPrintCertificate($intRows);\\\" \";\n // $strResult .= \" <td align=center><input type=checkbox id='chkIDC$intRows' name='chkIDC$intRows' $strActionCertificate></td>\\n\";\n $strResult .= \"</tr>\\n\";\n $strTargetElements .= \",\\\"detailEmployeeID$intRows\\\"\";\n }\n }\n $strButtons = \"\";\n //Custom: Employee cuma boleh lihat = 1 - dia or empty\n if (!$bolIsEmployee) {\n $strResult .= \" <tr valign=top><td>&nbsp;</td>\\n\";\n $strResult .= \" <td colspan=10>&nbsp;<a href=\\\"javascript:showMoreInput();\\\">\" . getWords(\n 'more'\n ) . \"</a></td></tr>\\n\";\n }\n $strResult .= \" <tr valign=top><td>&nbsp;</td>\\n\";\n // $strResult .= \" <td colspan=10><input name=\\\"btnPrintForm\\\" type=submit id=\\\"btnPrintForm\\\" value=\\\"\" .getWords('print form').\"\\\" onClick=\\\"goPrintForm();\\\">\";\n // $strResult .= \" &nbsp;<input name=\\\"btnPrintCertificate\\\" type=submit id=\\\"btnPrintCertificate\\\" value=\\\"\" .getWords('print certificate').\"\\\" onClick=\\\"goPrintCertificate();\\\"></td></tr>\";\n $strResult .= \" </table>\\n\";\n // tambahkan hidden data\n $strResult .= \"<input type=hidden id='maxDetail' name='maxDetail' value=$intRows>\";\n $strResult .= \"<input type=hidden id='numShow' name='numShow' value=$intShown>\";\n return $strResult;\n}", "public function getStudentsInProgram ( $year, $programCode )\n {\n\n if ( $this->execQuery ( 'anneeEtude/' . EpcCodeToQuery::getProgramQuery ( $programCode, $year ) ) )\n {\n return $this->getResponse ();\n }\n else\n {\n return $this->getInfo ();\n }\n }", "public function reportStudentDoorAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportStudentDoorAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister); \n }", "function recommends_req_wizard_courses_info($form, &$form_state) {\n $professor = variable_get('recommends_student_professor_email', 'FALSE');\n \n $entry = array();\n $entries = recommends_cp_entry_load_req($entry,$professor);\n \n $keyed_entries = array();\n if (empty($entries)) {\n drupal_set_message(t('There was a problem - There was no entries in the course conducted list. Please contact the professor to report the error. Your request cnnot be completed at this time..'), 'error');\n $form_state['num_courses'] = 0;\n return $form;\n }\n\n foreach ($entries as $entry) {\n $options[$entry->i_pid] = t(\"@i_course - @i_semester @i_year, @i_coursename\", array(\n '@i_pid' => $entry->i_pid, \n '@i_course' => $entry->i_course,\n '@i_coursename' => $entry->i_coursename,\n '@i_objective' => $entry->i_objective,\n '@i_grade_a' => $entry->i_grade_a,\n '@i_grade_b' => $entry->i_grade_b,\n '@i_grade_other' => $entry->i_grade_other,\n '@i_semester' => $entry->i_semester,\n '@i_year' => $entry->i_year,\n '@i_timestamp' => $entry->i_timestamp\n ));\n $keyed_entries[$entry->i_pid] = $entry;\n }\n $default_entry = !empty($form_state['values']['i_pid']) ? $keyed_entries[$form_state['values']['i_pid']] : $entries[0];\n\n $options[] = 'Independent Research';\n $options[] = 'Other interaction ';\n $form_state['entries'] = $keyed_entries; \n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['crsreq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n );\n $form['crsreq']['description'] = array(\n '#type' => 'item',\n '#title' => t('select the course/activity in which you were enrolled with the professor. Click \"add\" for each additional course.'),\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n // Build the number of name fieldsets indicated by $form_state['num_courses']\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $form['crsname'][$i] = array(\n '#type' => 'fieldset',\n '#title' => t('Course #@num', array('@num' => $i)),\n '#collapsible' => TRUE,\n '#collapsed' => FALSE,\n );\n \n $form['crsname'][$i]['i_pid'] = array(\n \n '#type' => 'select',\n '#options' => $options,\n '#required' => TRUE,\n \n );\n \n $form['crsname'][$i]['i_other'] = array(\n '#type' => 'textarea',\n '#title' => t('Other interation - please describe'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n \n\n ); \n }\n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Add another course'),\n '#submit' => array('recommends_req_crstut_9_add_course'),\n );\n\n // If we have more than one name, this button allows removal of the\n // last name.\n if ($form_state['num_courses'] > 1) {\n $form['remove_course'] = array(\n '#type' => 'submit',\n '#value' => t('Remove latest course'),\n '#submit' => array('recommends_req_crstut_9_remove_course'),\n // Since we are removing a name, don't validate until later.\n '#limit_validation_errors' => array(),\n );\n }\n\n return $form;\n}", "function wieting_volunteer_analysis_action($object, $context) {\n static $bot = '======================================================================<p/>';\n static $blanks = \" \";\n static $sep = \" | \";\n\n // Report this volunteer's roles and partner info.\n $first_name = $object->profile_first_name;\n\n // Standard text\n $txt = \"$object->name [$object->uid]<br/>\";\n $mail = ( strstr( $object->mail, \"bogus\" ) ? \"<b>None!</b>\" : $object->mail );\n $txt = \"Email: $mail $sep Phone: $object->profile_phone $sep Roles: \";\n\n // Roles\n $needs_partner = $is_partner = FALSE;\n foreach ( $object->roles as $rid => $role ) {\n if ( $rid > 2 ) {\n $txt .= \"$role, \";\n if ($rid == 5 || $rid == 9) { $needs_partner = TRUE; }\n if ($rid == 12 || $rid == 13) { $is_partner = TRUE; }\n }\n };\n $txt = rtrim( $txt, ', ' );\n $txt .= \"\\n\";\n\n // Construct a string showing this volunteer's available nights (in black, unavailable in red).\n $nights = \"\";\n $nights .= ((strpos($context[row]->node_users_node_data_field_vol_analysis_results_field_available_no_thursdays_value,\"not available\")) ? \"<font color='red'>\" : \"<font color='blue'>\");\n $nights .= \"Th</font>\";\n $nights .= ((strpos($context[row]->node_users_node_data_field_vol_analysis_results_field_available_no_fridays_value,\"not available\")) ? \"<font color='red'>\" : \"<font color='black'>\");\n $nights .= \"Fr</font>\";\n $nights .= ((strpos($context[row]->node_users_node_data_field_vol_analysis_results_field_available_no_saturdays_value,\"not available\")) ? \"<font color='red'>\" : \"<font color='blue'>\");\n $nights .= \"Sa</font>\";\n $nights .= ((strpos($context[row]->node_users_node_data_field_vol_analysis_results_field_available_no_sundays_value,\"not available\")) ? \"<font color='red'>\" : \"<font color='black'>\");\n $nights .= \"Su</font>\";\n\n // drupal_set_message( \"Object: \".print_r($object,TRUE), 'status');\n // drupal_set_message( \"Context: \".print_r($context,TRUE), 'status');\n // drupal_set_message( \"Friday: \".$context[row]->node_users_node_data_field_vol_analysis_results_field_available_no_fridays_value, 'status'); */\n\n // Partner? If $rid is 5 (monitor) or 9 (concession) they should have one!\n $puid = $context[row]->node_users_node_data_field_vol_analysis_results_field_partner_uid;\n // $puid = $context[row]->node_users_node_data_field_partner_field_partner_uid;\n\n if ($puid > 0 && $partner = user_load($puid)) {\n $txt .= \"$first_name ($nights) is partnered with $partner->name [$partner->uid].\";\n } else if ($needs_partner) {\n $txt .= \"$first_name ($nights) has <font color='red'><b>NO</b></font> partner!\";\n } else {\n $txt .= \"$first_name ($nights) has no partner.\";\n }\n\n // If this person is a partner ($rid == 12 or 13) then we need to find out who they are partnered with.\n if ($is_partner) {\n $sql = \"SELECT vid FROM content_type_available_dates WHERE ( field_partner_uid=\".$object->uid.\" )\";\n $resource = db_query( $sql );\n while ($row = db_fetch_array( $resource )) { $vids[] = $row[vid]; }\n foreach ($vids as $vid) {\n $sql = \"SELECT title FROM node_revisions WHERE ( vid=\" . $vid . \" )\";\n $resource = db_query($sql);\n $partners = \"\";\n while ($row = db_fetch_array($resource)) {\n $partners .= \" \" . $row[title] . \",\";\n $onePartner = $row[title];\n }\n $txt .= \"$sep $first_name is a partner for \" . trim($partners, \" ,\") . \".\\n\";\n }\n\n // Assuming they have only ONE partner...print that person's analysis info.\n $sql = \"SELECT vid FROM content_type_available_dates WHERE ( uid='\".$onePartner.\"' )\";\n $resource = db_query( $sql );\n while ($row = db_fetch_array( $resource )) { $vid = $row[vid]; }\n if ($vid > 0) { $txt .= \"\\nonePartner = $onePartner has a NAD VID of $vid.\\n\"; }\n\n } else {\n $txt .= \"\\n\";\n }\n\n /* $msg = print_r($context, TRUE);\n drupal_set_message(\"User context: $msg\", 'status'); */\n\n // Find this volunteer's NOT Available Dates record and load that node.\n $nadNID = $context['row']->node_users_nid;\n if (!$nadNode = node_load($nadNID)) {\n drupal_set_message(\"Could not load NOT Available Dates record [$nadNID] for \".$object->name.\".\", 'error');\n return;\n }\n\n // Save the analysis into the volunteer's NOT_Available_Dates record.\n $nadNode->field_vol_analysis_results[0]['value'] = $txt;\n node_save($nadNode);\n\n return;\n}", "function ciniki_courses_reportStudents($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'start_date'=>array('required'=>'yes', 'blank'=>'no', 'type'=>'date', 'name'=>'Start Date'), \n 'end_date'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'date', 'name'=>'End Date'), \n 'output'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'json', 'name'=>'Output'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'courses', 'private', 'checkAccess');\n $rc = ciniki_courses_checkAccess($ciniki, $args['tnid'], 'ciniki.courses.reportStudents'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n\n //\n // Load tenant details\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'tenantDetails');\n $rc = ciniki_tenants_tenantDetails($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) && is_array($rc['details']) ) { \n $tenant_details = $rc['details'];\n } else {\n $tenant_details = array();\n }\n\n //\n // Get the list of registrations between the dates\n //\n $strsql = \"SELECT registrations.id, \"\n . \"offerings.name AS offering_name, \"\n . \"offerings.code AS offering_code, \"\n . \"offerings.condensed_date AS condensed_date, \"\n . \"courses.name AS course_name, \"\n . \"courses.code AS course_code, \"\n . \"customers.id AS customer_id, \"\n . \"customers.display_name, \"\n . \"DATE_FORMAT(offerings.start_date, '%b %d, %Y') AS start_date, \"\n . \"DATE_FORMAT(offerings.end_date, '%b %d, %Y') AS end_date, \"\n . \"IFNULL(prices.name, '') AS price_name, \"\n . \"emails.email AS emails \"\n . \"FROM ciniki_course_offering_classes AS classes \"\n . \"INNER JOIN ciniki_course_offering_registrations AS registrations ON (\"\n . \"classes.offering_id = registrations.offering_id \"\n . \"AND registrations.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_course_offerings AS offerings ON (\"\n . \"classes.offering_id = offerings.id \"\n . \"AND offerings.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_courses AS courses ON (\"\n . \"offerings.course_id = courses.id \"\n . \"AND courses.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_sapos_invoice_items AS items ON (\"\n . \"registrations.invoice_id = items.invoice_id \"\n . \"AND items.object_id = registrations.id \"\n . \"AND items.object = 'ciniki.courses.offering_registration' \"\n . \"AND items.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_course_offering_prices AS prices ON (\"\n . \"items.price_id = prices.id \"\n . \"AND prices.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_customers AS customers ON (\"\n . \"registrations.student_id = customers.id \"\n . \"AND customers.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_customer_emails AS emails ON (\"\n . \"customers.id = emails.customer_id \"\n . \"AND emails.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE classes.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND classes.class_date >= '\" . ciniki_core_dbQuote($ciniki, $args['start_date']) . \"' \"\n . \"\";\n if( isset($args['end_date']) && $args['end_date'] != '' && $args['end_date'] != '0000-00-00' ) {\n $strsql .= \"AND classes.class_date <= '\" . ciniki_core_dbQuote($ciniki, $args['end_date']) . \"' \";\n }\n $strsql .= \"ORDER BY customers.display_name, courses.name, offerings.name, registrations.id \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.courses', array(\n array('container'=>'customers', 'fname'=>'id', \n 'fields'=>array('id', 'customer_id', 'display_name', 'offering_name', 'offering_code', 'course_code', 'course_name', \n 'condensed_date', 'price_name', 'start_date', 'end_date', 'emails'),\n 'lists'=>array('emails'),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.courses.112', 'msg'=>'Unable to load offering_registrations', 'err'=>$rc['err']));\n }\n $customers = isset($rc['customers']) ? $rc['customers'] : array();\n\n //\n // Output PDF version\n //\n if( $args['output'] == 'pdf' ) {\n //\n // FIXME: Add pdf output\n //\n/* $rc = ciniki_core_loadMethod($ciniki, 'ciniki', 'courses', 'templates', 'offeringRegistrationsPDF');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $fn = $rc['function_call'];\n\n $rc = $fn($ciniki, $args['tnid'], $args['offering_id'], $tenant_details, $courses_settings);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $title = $rc['offering']['code'] . '_' . $rc['offering']['course_name'] . '_' . $rc['offering']['course_name'];\n\n $filename = preg_replace('/[^a-zA-Z0-9_]/', '', preg_replace('/ /', '_', $title));\n if( isset($rc['pdf']) ) {\n $rc['pdf']->Output($filename . '.pdf', 'D');\n } */\n }\n\n //\n // Output Excel version\n //\n elseif( $args['output'] == 'excel' ) {\n require($ciniki['config']['core']['lib_dir'] . '/PHPExcel/PHPExcel.php');\n $objPHPExcel = new PHPExcel();\n $objPHPExcelWorksheet = $objPHPExcel->setActiveSheetIndex(0);\n\n $col = 0;\n $row = 1;\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Student', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Email', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Code', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Course', false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, 'Session', false);\n $row++;\n foreach($customers as $student) {\n $col = 0;\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['display_name'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['emails'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['offering_code'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['course_name'], false);\n $objPHPExcelWorksheet->setCellValueByColumnAndRow($col++, $row, $student['offering_name'], false);\n\n $row++;\n }\n $objPHPExcelWorksheet->getStyle('A1:E1')->getFont()->setBold(true);\n $objPHPExcelWorksheet->getColumnDimension('A')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('D')->setAutoSize(true);\n $objPHPExcelWorksheet->getColumnDimension('E')->setAutoSize(true);\n\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"students.xls\"');\n header('Cache-Control: max-age=0');\n \n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');\n $objWriter->save('php://output');\n \n return array('stat'=>'exit');\n } \n\n return array('stat'=>'ok', 'customers'=>$customers);\n}", "public function getYearListEdtAppTr() \n {\t\t\n $this->db->select(\"to_char(th_date_from,'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"TO_CHAR(th_date_from,'YYYY'),th_date_from \");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "public function get_year_permastruct()\n {\n }", "public function annrep(int $year): View\n {\n $surveyTypeCount = [];\n $modalitiesCount = [];\n $locationsCount = [];\n\n /**\n * @var \\Illuminate\\Database\\Eloquent\\Collection $surveys Collection of surveys performed during $year.\n **/\n $surveys = TestDate::with('machine', 'type')\n ->year($year)\n ->get();\n\n $sType = $surveys->groupBy('type.test_type');\n foreach ($sType as $type=>$s) {\n $surveyTypeCount[$type] = $s->count();\n }\n arsort($surveyTypeCount);\n $surveyTotal = $surveys->count();\n\n /**\n * @var \\Illuminate\\Database\\Eloquent\\Collection $machines Collection of active machines.\n **/\n $machines = Machine::with('modality', 'location')\n ->active()\n ->get();\n\n // Group by modality and count them up\n $mod = $machines->groupBy('modality.modality');\n foreach ($mod as $modality=>$m) {\n $modalitiesCount[$modality] = $m->count();\n }\n arsort($modalitiesCount);\n $machineTotal = $machines->count();\n\n // Group by location and count them up\n $loc = $machines->groupBy('location.location');\n foreach ($loc as $location=>$m) {\n $locationsCount[$location] = $m->count();\n }\n arsort($locationsCount);\n\n return view('ar.annrep', [\n 'year' => $year,\n 'surveyTotal' => $surveyTotal,\n 'machineTotal' => $machineTotal,\n 'surveyTypeCount' => collect($surveyTypeCount),\n 'modalitiesCount' => collect($modalitiesCount),\n 'locationsCount' => collect($locationsCount),\n ]);\n }", "public function show(AcademicYear $academic_year)\n {\n $user = Auth::user();\n //Check if user has permission to view instructors\n $isAuthorized = app('App\\Http\\Controllers\\UserPrivilegeController')->checkPrivileges($user->id, Config::get('settings.academic_year_management'), 'read_priv');\n\n if($isAuthorized){\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Viewed the details of ' . $academic_year->academic_year . '.',\n 'time' => Carbon::now()\n ]);\n return $academic_year;\n }else {\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Attempted to view the details of ' . $academic_year->academic_year . '.',\n 'time' => Carbon::now()\n ]);\n return response()->json([\n 'message' => 'You are not authorized to view academic year records.'\n ],401); // 401: Unauthorized\n }\n }", "function extraction($details, $booking_id)\n\t{\n\t\t$county = 'seminole';\n\t\t$booking_id = 'seminole_' . $booking_id;\n\t\t# database validation \n\t\t$offender = Mango::factory('offender', array(\n\t\t\t'booking_id' => $booking_id\n\t\t))->load();\t\n\t\t# validate against the database\n\t\tif (empty($offender->booking_id)) \n\t\t{\n\t\t\t# extract profile details\n\t\t\t# required fields\n\t\t\t\n\t\t\t$check = preg_match('/FirstNameLabel[^>]*>(.*)</Uis', $details, $match);\n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\t$firstname = '';\n\t\t\t\t$firstname = strtoupper(trim($match[1]));\n\t\t\t\t$check = preg_match('/LastNameLabel[^>]*>(.*)</Uis', $details, $match);\n\t\t\t\tif ($check)\n\t\t\t\t{\n\t\t\t\t\t$lastname = '';\n\t\t\t\t\t$lastname = strtoupper(trim($match[1]));\n\t\t\t\t\t//ArrestDate\">03/11/2011 12:46:00 AM</span>\n\t\t\t\t\t$check = preg_match('/ArrestDate\\\">(.*)<\\//Uis', $details, $match);\n\t\t\t\t\tif ($check)\n\t\t\t\t\t{\n\t\t\t\t\t\t$booking_date = strtotime($match[1]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t#get extra fields\n\t\t\t\t\t\t$extra_fields = array();\n\t\t\t\t\t\t$dob = null;\n\t\t\t\t\t\t//DOBLabel\">10/13/1961</span>\n\t\t\t\t\t\t$check = preg_match('/DOBLabel[^>]*>(.*)</Uis', $details, $match);\n\t\t\t\t\t\tif ($check) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dob = strtotime(trim($match[1]));\n\t\t\t\t\t\t\t$extra_fields['dob'] = $dob; \n\t\t\t\t\t\t}\n\t\t\t\t\t\t$check = preg_match('/divCharges\\\"\\>\\<table\\scellpadding\\=\\'0\\'\\scellspacing\\=\\'0\\'\\sstyle\\=\\'width\\:100\\%\\'\\>(.*)table\\>/Uis', $details, $match);\n\t\t\t\t\t\t$check = preg_match_all('/\\<td\\>(.*)\\<\\/td>/Uis', $match[1], $matches);\n\t\t\t\t\t\tif (isset($matches[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($matches[1] as $charge)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($charge != '&nbsp;')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$charges[] = trim(strtoupper($charge));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($charges))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t###\n\t\t\t\t\t\t\t\t# this creates a charges object for all charges that are not new for this county\n\t\t\t\t\t\t\t\t$charges_object = Mango::factory('charge', array('county' => $this->scrape, 'new' => 0))->load(false)->as_array(false);\n\t\t\t\t\t\t\t\t# I can loop through and pull out individual arrays as needed:\n\t\n\t\t\t\t\t\t\t\tforeach($charges_object as $row)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$list[$row['charge']] = $row['abbr'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t# this gives me a list array with key == fullname, value == abbreviated\n\t\t\t\t\t\t\t\t$ncharges = array();\n\t\t\t\t\t\t\t\t# Run my full_charges_array through the charges check\n\t\t\t\t\t\t\t\t$ncharges = $this->charges_check($charges, $list);\n\t\t\t\t\t\t\t\t###\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t# validate \n\t\t\t\t\t\t\t\tif (empty($ncharges)) // skip the offender if ANY new charges were found\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$fcharges \t= array();\n\t\t\t\t\t\t\t\t\tforeach($charges as $key => $value)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$fcharges[] = trim(strtoupper($value));\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t# make it unique and reset keys\n\t\t\t\t\t\t\t\t\t$fcharges = array_unique($fcharges);\n\t\t\t\t\t\t\t\t\t$fcharges = array_merge($fcharges);\n\t\t\t\t\t\t\t\t\t$dbcharges = $fcharges;\n\t\t\t\t\t\t\t\t\t# begin image extraction\n\t\t\t\t\t\t\t\t\t//http://webbond.seminolesheriff.org/bookingphotos/201100003098.jpg\n\t\t\t\t\t\t\t\t\t$image_link = 'http://webbond.seminolesheriff.org/bookingphotos/'. preg_replace('/seminole\\_/Uis', '', $booking_id) .'.jpg';\n\t\t\t\t\t\t\t\t\t# set image name\n\t\t\t\t\t\t\t\t\t$imagename = date('(m-d-Y)', $booking_date) . '_' . $lastname . '_' . $firstname . '_' . $booking_id;\n\t\t\t\t\t\t\t\t\t# set image path\n\t\t\t\t\t\t\t $imagepath = '/mugs/florida/seminole/'.date('Y', $booking_date).'/week_'.$this->find_week($booking_date).'/';\n\t\t\t\t\t\t\t # create mugpath\n\t\t\t\t\t\t\t $mugpath = $this->set_mugpath($imagepath);\n\t\t\t\t\t\t\t\t\t//@todo find a way to identify extension before setting ->imageSource\n\t\t\t\t\t\t\t\t\t$this->imageSource = $image_link;\n\t\t\t\t\t\t\t $this->save_to = $imagepath.$imagename;\n\t\t\t\t\t\t\t $this->set_extension = true;\n\t\t\t\t\t\t\t\t\t$this->cookie\t\t\t= $this->cookies;\n\t\t\t\t\t\t\t $this->download('curl');\n\t\t\t\t\t\t\t\t\tif (file_exists($this->save_to . '.jpg')) //validate the image was downloaded\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t#@TODO make validation for a placeholder here probably\n\t\t\t\t\t\t\t\t\t\t# ok I got the image now I need to do my conversions\n\t\t\t\t\t\t\t\t # convert image to png.\n\t\t\t\t\t\t\t\t $this->convertImage($mugpath.$imagename.'.jpg');\n\t\t\t\t\t\t\t\t $imgpath = $mugpath.$imagename.'.png';\n\t\t\t\t\t\t\t\t\t\t$img = Image::factory($imgpath);\n\t\t\t\t\t \t//$img->crop(225, 280)->save();\n\t\t\t\t\t\t\t\t $imgpath = $mugpath.$imagename.'.png';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(strlen($fcharges[0]) >= 15)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$charges = $this->charge_cropper($fcharges[0], 400, 15);\n\t\t\t\t\t\t\t\t\t\t\t\tif(!$charges)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn 101;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t//$charges = $this->charges_abbreviator($list, $charges[0], $charges[1]); \n \t$this->mugStamp($imgpath, $firstname . ' ' . $lastname, $charges[0], $charges[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$offender = Mango::factory('offender', \n\t array(\n\t 'scrape' => $this->scrape,\n\t 'state' => strtolower($this->state),\n\t 'county' => $county,\n\t 'firstname' => $firstname,\n\t 'lastname' => $lastname,\n\t 'booking_id' => $booking_id,\n\t 'booking_date' => $booking_date,\n\t 'scrape_time' => time(),\n\t 'image' => $imgpath,\n\t 'charges' => $charges, \n\t\t ))->create();\n\t\t #add extra fields\n\t\t foreach ($extra_fields as $field => $value)\n\t\t {\n\t\t $offender->$field = $value;\n\t\t }\n\t\t $offender->update();\n\t\t \n\t\t # now check for the county and create it if it doesnt exist \n\t\t $mscrape = Mango::factory('mscrape', array('name' => $this->scrape, 'state' => $this->state))->load();\n\t\t if (!$mscrape->loaded())\n\t\t {\n\t\t $mscrape = Mango::factory('mscrape', array('name' => $this->scrape, 'state' => $this->state))->create();\n\t\t }\n\t\t $mscrape->booking_ids[] = $booking_id;\n\t\t $mscrape->update(); \n\t\t # END DATABASE INSERTS\n\t\t return 100;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t# now run through charge logic\n\t\t\t\t\t\t\t\t\t\t$chargeCount = count($fcharges);\n\t\t\t\t\t\t\t\t\t\t# run through charge logic\t\n\t\t\t\t\t\t\t\t\t\t$mcharges \t= array(); // reset the array\n\t\t\t\t\t\t\t\t if ( $chargeCount > 2 ) //if more then 2, run through charges prioritizer\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $mcharges \t= $this->charges_prioritizer($list, $fcharges);\n\t\t\t\t\t\t\t\t\t\t\tif ($mcharges == false) { mail('[email protected]', 'Your prioritizer failed in seminole scrape', \"******Debug Me****** \\n-=\" . $fullname .\"=-\" . \"\\n-=\" . $booking_id . \"=-\"); exit; } // debugging\n\t\t\t\t\t\t\t\t $mcharges \t= array_merge($mcharges); \n\t\t\t\t\t\t\t\t $charge1 \t= $mcharges[0];\n\t\t\t\t\t\t\t\t $charge2 \t= $mcharges[1]; \n\t\t\t\t\t\t\t\t $charges \t= $this->charges_abbreviator($list, $charge1, $charge2); \n\t\t\t\t\t\t\t\t $this->mugStamp($imgpath, $firstname . ' ' . $lastname, $charges[0], $charges[1]);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else if ( $chargeCount == 2 )\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $fcharges \t= array_merge($fcharges);\n\t\t\t\t\t\t\t\t $charge1 \t= $fcharges[0];\n\t\t\t\t\t\t\t\t $charge2 \t= $fcharges[1]; \n\t\t\t\t\t\t\t\t $charges \t= $this->charges_abbreviator($list, $charge1, $charge2);\n\t\t\t\t\t\t\t\t $this->mugStamp($imgpath, $firstname . ' ' . $lastname, $charges[0], $charges[1]); \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t else \n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $fcharges \t= array_merge($fcharges);\n\t\t\t\t\t\t\t\t $charge1 \t= $fcharges[0]; \n\t\t\t\t\t\t\t\t $charges \t= $this->charges_abbreviator($list, $charge1); \n\t\t\t\t\t\t\t\t $this->mugStamp($imgpath, $firstname . ' ' . $lastname, $charges[0]); \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// Abbreviate FULL charge list\n\t\t\t\t\t\t\t\t\t\t$dbcharges = $this->charges_abbreviator_db($list, $dbcharges);\n\t\t\t\t\t\t\t\t\t\t$dbcharges = array_unique($dbcharges);\n\t\t\t\t\t\t\t\t\t\t# BOILERPLATE DATABASE INSERTS\n\t\t\t\t\t\t\t\t\t\t$offender = Mango::factory('offender', \n\t\t\t\t\t\t\t array(\n\t\t\t\t\t\t\t \t'scrape'\t\t=> $this->scrape,\n\t\t\t\t\t\t\t \t'state'\t\t\t=> $this->state,\n\t\t\t\t\t\t\t \t'county'\t\t=> $county,\n\t\t\t\t\t\t\t 'firstname' => $firstname,\n\t\t\t\t\t\t\t 'lastname' => $lastname,\n\t\t\t\t\t\t\t 'booking_id' => $booking_id,\n\t\t\t\t\t\t\t 'booking_date' => $booking_date,\n\t\t\t\t\t\t\t 'scrape_time'\t=> time(),\n\t\t\t\t\t\t\t 'image' => $imgpath,\n\t\t\t\t\t\t\t 'charges'\t\t=> $dbcharges, \n\t\t\t\t\t\t\t ))->create();\n\t\t\t\t\t\t\t\t\t\t#add extra fields\n\t\t\t\t\t\t\t\t\t\tforeach ($extra_fields as $field => $value)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$offender->$field = $value;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$offender->update();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t \t# now check for the county and create it if it doesnt exist \n\t\t\t\t\t\t\t\t\t\t$mscrape = Mango::factory('mscrape', array('name' => $this->scrape, 'state' => $this->state))->load();\n\t\t\t\t\t\t\t\t\t\tif (!$mscrape->loaded())\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$mscrape = Mango::factory('mscrape', array('name' => $this->scrape, 'state' => $this->state))->create();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$mscrape->booking_ids[] = $booking_id;\n\t\t\t\t\t\t\t\t\t\t$mscrape->update();\t \n # END DATABASE INSERTS\n return 100;\n\t\t\t\t\t\t\t\t\t\t\t### END EXTRACTION ###\n\t\t\t\t\t\t\t\t\t} else { return 102; } // image download failed \n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t# add new charges to the charges collection\n\t\t\t\t\t\t\t\t\tforeach ($ncharges as $key => $value)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t#check if the new charge already exists FOR THIS COUNTY\n\t\t\t\t\t\t\t\t\t\t$check_charge = Mango::factory('charge', array('county' => $this->scrape, 'charge' => $value))->load();\n\t\t\t\t\t\t\t\t\t\tif (!$check_charge->loaded())\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (!empty($value))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$charge = Mango::factory('charge')->create();\t\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->charge = $value;\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->abbr = $value;\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->order = (int)0;\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->county = $this->scrape;\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->new \t= (int)0;\n\t\t\t\t\t\t\t\t\t\t\t\t$charge->update();\n\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t return 104; \n\t\t\t\t\t\t\t\t} // ncharges validation\n\t\t\t\t\t\t\t} else { return 101; } // no charges found\t\n\t\t\t\t\t\t} else { return 101; } // no charges found\n\t\t\t\t\t} else { return 101; } // no booking_date\n\t\t\t\t} else { return 101; } // lastname validation failed\n\t\t\t} else { return 101; } // firstname validation\tfailed\n\t\t} else { return 103; } // database validation failed\n\t}", "public function showInfo($parameters){\n header(\"Cache-Control: no-store, must-revalidate, max-age=0\");\n $idUniversity = $parameters[0];\n $degree = $parameters[1];\n $noInfo = false;\n\n $pathPhotos = \"\\EEmobi\\\\resources\\img\\post\\\\\";\n $pathPhotoProfile = \"\\EEmobi\\\\resources\\img\\profiles\\\\\";\n require 'models/UniversitiesModel.php';\n require 'models/StateModel.php';\n require 'models/DegreesModel.php';\n require 'models/TeachersModel.php';\n require 'models/RatingsModel.php';\n require 'models/CountriesModel.php';\n\n\n $universitymodel = new UniversitiesModel();\n $stateInfo = new StateModel();\n $degreeModel = new DegreesModel();\n $teachersModel = new TeachersModel();\n $ratingsModel = new RatingsModel();\n $countryModel = new CountriesModel();\n\n $country = $countryModel->getCountryESByUniversityId($idUniversity);\n $country = strtolower($country->nomPaisES);\n $countryES = str_replace(\" \",\"-\",$country);\n\n $pais = $countryModel ->getCountryByUniversityId($idUniversity);\n $countryModel->disconnect();\n\n $categories = $ratingsModel->getCategories();\n $ratings = $ratingsModel->getRatingsByUni($idUniversity);\n\n\n $degreeSelected = false;\n if(strcmp($degree,\"Tots-els-graus\")==0){\n $info = $stateInfo -> getAllInfo($idUniversity);\n $teacher = $teachersModel -> getTeachersOfUniversity($idUniversity);\n }else{\n $infoCenter = \"placen\";\n $degree = str_replace(\"-\",\" \",$degree);\n $degreeName = $degree;\n $degree = $degreeModel -> getDegreeByName($degree);\n $degreeModel -> disconnect();\n\n if(!empty($degree)){\n $degreeSelected = true;\n $info = $stateInfo -> getAllInfoByDegree($idUniversity,$degree);\n $infoCenter = $stateInfo->getInfoCentreEstudis($idUniversity,$degree);\n $teacher = $teachersModel -> getTeacherByDegree($degree,$idUniversity);\n }else{\n $info = $stateInfo -> getAllInfo($idUniversity);\n $teacher = $teachersModel -> getTeachers();\n\n }\n $stateInfo->disconnect();\n\n }\n $university = $universitymodel -> getUniversityById($idUniversity);\n\n $universitymodel->disconnect();\n\n if(!empty($university)){\n require_once 'models/PublicationsModel.php';\n $publicationsModel = new PublicationsModel();\n $publications = $publicationsModel -> getPublicationOfUniversity($idUniversity);\n \n if($university->fotoPath==\"\" or $university->fotoPath==null ){\n $path = \"/EEmobi/resources/img/universities/notimage.jpg\";\n }else{\n $path = \"/EEmobi/resources/img/universities/\".$university->fotoPath;\n }\n \n if(empty($info)){\n $noInfo = true;\n }\n\n $areRatings = false;\n $totalValorations = 0;\n\n if(!empty($ratings)){\n $areRatings = true;\n $valorations = array();\n $sumValoracions = 0;\n $nValoracions = 0;\n\n\n\n for ($i=1, $size= count($categories); $i < $size; $i++){\n foreach ($ratings as $key=>$value){\n if($value['idCategoria'] == $categories[$i]['idCategoria']){\n $sumValoracions += $value[\"score\"];\n $nValoracions++;\n\n unset($ratings[$key]);\n }\n }\n\n $totalValorations = $nValoracions;\n $valorations[$categories[$i]['titolCategoria']] = round($sumValoracions/$nValoracions, 0, PHP_ROUND_HALF_UP);\n $sumValoracions = 0;\n $nValoracions = 0;\n }\n\n $valorations['General'] = round(array_sum($valorations)/count($valorations), 0, PHP_ROUND_HALF_UP);\n }\n\n $route = $this->view->show(\"UniversityInfo.php\");\n\n include($route);\n }else{\n include '../EEmobi/views/404.php';\n }\n }", "public function logistics($year, Request $request)\n {\n $app = $this->validateYear($year, $request);\n if (! $app instanceof BoardApp) {\n return $app;\n }\n\n if ($app->submitted) {\n return redirect()->route('board.app', $app->year);\n }\n\n $dates = $this->interviewDates();\n\n return view('board.pages.logistics', compact('app', 'dates'));\n }", "function getTrainingTrainer($db, $strDataID = \"\")\n{\n global $words;\n global $strTargetElements;\n global $_REQUEST;\n $intMaxShow = 2; // tambahan yang perlu dimunculkan\n $intAdd = 50; // maksimum tambahan\n $intRows = 0;\n $intShown = 0;\n $strResult = \"\";\n $arrStatus = [\"ok\", \"cancel\"];\n $strResult .= \" <table border=0 class=gridTable cellpadding=0 cellspacing=0 >\\n\";\n $strResult .= \" <tr valign=top class=tableHeader>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('no') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('employee id') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('name') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('status') . \"</td>\\n\";\n $strResult .= \" <td nowrap>&nbsp;\" . getWords('delete') . \"</td>\\n\";\n $strResult .= \" </tr>\\n\";\n $arrParticipant = [];\n if ($strDataID != \"\") {\n $strSQL = \"\n SELECT t1.id, t1.status, t1.cost, t2.employee_id, t2.employee_name \n FROM hrd_training_request_trainer AS t1 \n LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee \n WHERE t1.id_request = '$strDataID' \n \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrParticipant[$rowDb['id']] = $rowDb;\n }\n writeLog(ACTIVITY_VIEW, MODULE_PAYROLL, \"\", 0);\n } else if (isset($_REQUEST['btnCreateSharing'])) {\n $strPlanID = (isset($_REQUEST['id_plan'])) ? $_REQUEST['id_plan'] : \"\";\n if ($strPlanID != \"\") {\n $arrData['dataPlan'] = $strPlanID;\n $strSQL = \"\n SELECT t1.id, t1.status, t1.cost, t2.employee_id, t2.employee_name \n FROM hrd_training_request_participant AS t1 \n LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee \n WHERE t1.id_request = '$strPlanID' \n \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrParticipant[$rowDb['id']] = $rowDb;\n }\n }\n writeLog(ACTIVITY_VIEW, MODULE_PAYROLL, \"\", 0);\n }\n foreach ($arrParticipant AS $id => $rowDb) {\n $intRows++;\n $intShown++;\n $strResult .= \"<tr valign=top id=\\\"detailTrainerRows$intRows\\\">\\n\";\n $strResult .= \" <td align=right nowrap><input type=hidden name=detailTrainerID$intRows value=\\\"\" . $rowDb['id'] . \"\\\">$intRows&nbsp;</td>\";\n $strAction = \"onFocus = \\\"AC_kode = 'detailTrainerEmployeeID$intRows';AC_nama='detailTrainerName$intRows';\\\" \";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailTrainerEmployeeID$intRows id=detailTrainerEmployeeID$intRows value=\\\"\" . $rowDb['employee_id'] . \"\\\" $strAction></td>\";\n $strResult .= \" <td nowrap>&nbsp;<strong id=\\\"detailTrainerName$intRows\\\">\" . $rowDb['employee_name'] . \"</strong></td>\";\n $strResult .= \" <td>\" . getComboFromArray($arrStatus, \"detailTrainerStatus$intRows\", $rowDb['status']) . \"</td>\";\n $strAction = \" onChange = \\\"chkTrainerDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center title='cost \" . standardFormat(\n $rowDb['cost']\n ) . \"'><input type=checkbox id='chkTrainerID$intRows' name='chkTrainerID$intRows' $strAction></td>\\n\";\n $strResult .= \"</tr>\\n\";\n $strTargetElements .= \",\\\"detailTrainerEmployeeID$intRows\\\"\";\n }\n // tambahkan dengan data kosong\n for ($i = 1; $i <= $intAdd; $i++) {\n $intRows++;\n if ($intRows <= $intMaxShow) {\n $strResult .= \"<tr valign=top id=\\\"detailTrainerRows$intRows\\\">\\n\";\n $intShown++;\n $strDisabled = \"\";\n } else {\n $strResult .= \"<tr valign=top id=\\\"detailTrainerRows$intRows\\\" style=\\\"display:none\\\">\\n\";\n $strDisabled = \"disabled\";\n }\n $strResult .= \" <td align=right nowrap>$intRows&nbsp;</td>\";\n $strAction = \"onFocus = \\\"AC_kode = 'detailTrainerEmployeeID$intRows';AC_nama='detailTrainerName$intRows';\\\" \";\n $strResult .= \" <td><input type=text size=20 maxlength=50 name=detailTrainerEmployeeID$intRows id=detailTrainerEmployeeID$intRows $strDisabled $strAction></td>\";\n $strResult .= \" <td nowrap>&nbsp;<strong id=\\\"detailTrainerName$intRows\\\"></strong></td>\";\n $strResult .= \" <td>\" . getComboFromArray($arrStatus, \"detailTrainerStatus$intRows\") . \"</td>\";\n $strAction = \" onChange = \\\"chkTrainerDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center><input type=checkbox id='chkTrainerID$intRows' name='chkTrainerID$intRows' $strAction></td>\\n\";\n $strResult .= \"</tr>\\n\";\n $strTargetElements .= \",\\\"detailTrainerEmployeeID$intRows\\\"\";\n }\n $strResult .= \" <tr valign=top><td>&nbsp;</td>\\n\";\n $strResult .= \" <td colspan=3>&nbsp;<a href=\\\"javascript:showMoreTrainerInput();\\\">\" . getWords(\n 'more'\n ) . \"</a></td></tr>\\n\";\n $strResult .= \" </table>\\n\";\n // tambahkan hidden data\n $strResult .= \"<input type=hidden id='maxTrainerDetail' name='maxTrainerDetail' value=$intRows>\";\n $strResult .= \"<input type=hidden id='numTrainerShow' name='numTrainerShow' value=$intShown>\";\n return $strResult;\n}", "function getPhysicianPatients320Days(){\n// \t\t$returnPatient = $this->__getPHCDoctorPatient320Days($doctorId);\n// \t\t$returnPatient = $this->__getWeblisDoctorPatient320Days();\n\t\t\n\t\tdebug($this->request->data);\n\t\t$puserid = $this->Auth->user('id');\n\t\t$people = $this->Common->searchPhysicianPatient($search,$puserid);\n\t\t//$testOrders = $this->Common->getAllTestOrderPhysician($userid,$puserid);\n\t\t//$persons = $this->Common->searchPhysicianPatient($search=null, $puserid=null);\n\t\tdebug($people);\n\t\t\n\t\t// \t\t$returnPatient = array();\n\t\t/*\n\t\t * Parse return data from Weblis GW\n\t\t*\n\t\t*/\n\t\t$data = array('Patient' => array());\n\t\tif($returnPatient){\n\t\t\t$data['Patient'] = $returnPatient;\n\t\t\t/* $page = 1;\n\t\t\t$total = 2;\n\t\t\t$this->PaginatorArray = $this->Components->load('PaginatorArray');\n\t\t\t$slicedArray = array_slice($returnPatient['PaperAll'],($page - 1) * $this->PaginatorArray->limit ,$this->PaginatorArray->limit);\n// \t\t\t$this->params['paging'] = $this->PaginatorArray->getParamsPaging('Page', $page, $total,count($slicedArray));\n// \t\t\t$this->helpers[] = 'Paginator';\n\t\t\t$data['Paginate']=$slicedArray; */\n\t\t}\n\t\n\t\n\t\n\t\tif($this->RequestHandler->isAjax()){\n\t\t\t$this->set('data',$data);\n\t\t\t$this->header('Content-Type:text/json');\n\t\t\t$this->render('/Common/json');\n\t\t}\n\t\n\t\n\t}", "private function getEristerNewYorkCorrespondent($year)\n {\n $a = $year % 19;\n $b = floor($year / 100);\n $c = $year % 100;\n $d = floor($b / 4);\n $e = $b % 4;\n $f = floor(($b + 8) / 25);\n $g = floor(($b - $f + 1) / 3);\n $h = (19 * $a + $b -$d -$g + 15) % 30;\n $i = floor($c / 4);\n $k = $c % 4;\n $l = (32 + 2 * $e + 2 * $i - $h - $k) % 7;\n $m = (int)7 * floor(($a + 11 * $h + 22 * $l) / 451);\n\n $month = (int)floor(($h + $l - $m + 114) / 31);\n $day = (int)(($h + $l -$m + 114) % 31) + 1;\n\n return array($month, $day);\n }", "function recommends_req_crstut_9_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $course_year = $form_state['values']['crsname'][$i]['courseyear'];\n \n if ($course_year && ($course_year < 2010 || $course_year > 2011)) {\n form_set_error(\"coursenum][$i][courseyear\", 'Enter a valid year.');\n }\n \n }\n}", "public function filterGradYear($gradYears)\n {\n $programsid = Auth::user()->programs_id;\n //filter alumni by gradYear\n $alumni = Alumni::where('programs_id', '=', $programsid)->where('gradYear', '=', $gradYears)->orderBy('gradYear', 'asc')->get();\n \n $industry = Alumni::whereNotNull('industry')->orderBy('industry', 'asc')->pluck('industry')->unique();\n $gradYear = Alumni::whereNotNull('gradYear')->orderBy('gradYear', 'asc')->pluck('gradYear')->unique();\n $company = Alumni::whereNotNull('company')->orderBy('company', 'asc')->pluck('company')->unique();\n \n return view('Coach/alumSearch', compact('alumni', 'industry', 'gradYear', 'company'));\n }", "public function getTrainingInfo($training_id){\n\n\t\t$select = $this->select()\n\t\t->from($this->_name, array('*'))\n\t\t->setIntegrityCheck(false)\n\t// ->join(array('c' => 'course'), \"$this->_name.training_title_option_id = c.id\",'training_title_option_id')\n\t\t->join(array('t' => 'training_title_option'), \"training_title_option_id = t.id\", array('training_title' => 'training_title_phrase'))\n\t\t->joinLeft(array('tl' => 'training_location'), \"$this->_name.training_location_id = tl.id\", 'training_location_name')\n\t\t->joinLeft(array('tg' => 'training_got_curriculum_option'), \"$this->_name.training_got_curriculum_option_id = tg.id\",'training_got_curriculum_phrase')\n\t\t->joinLeft(array('tlvl' => 'training_level_option'), \"$this->_name.training_level_option_id = tlvl.id\", 'training_level_phrase')\n\t\t->joinLeft(array('torg' => 'training_organizer_option'), \"$this->_name.training_organizer_option_id = torg.id\", array('training_organizer' => 'training_organizer_phrase'))\n\t\t//->joinLeft(array('tt' => 'training_topic_option'), \"$this->_name.training_topic_option_id = tt.id\",'training_topic_phrase')\n\t\t->where(\"$this->_name.id = $training_id\");\n\t\t$rowRay = $this->fetchRow($select);\n\t\tif ($rowRay)\n\t\t\t$rowRay = $rowRay->toArray();\n\n\t\t// now get pepfar\n\t\t$select = $this->select()\n\t\t->from('training_to_training_pepfar_categories_option', array())\n\t\t->setIntegrityCheck(false)\n\t\t->join(array('tp' => 'training_pepfar_categories_option'), \"training_to_training_pepfar_categories_option.training_pepfar_categories_option_id = tp.id\",'pepfar_category_phrase')\n\t\t->where(\"training_to_training_pepfar_categories_option.training_id = $training_id\");\n\n\t\t$rows = $this->fetchAll($select);\n\t\tforeach($rows as $r) {\n\t\t\t$pepfar[] = $r->pepfar_category_phrase;\n\t\t}\n\t\tif(!isset($pepfar)) $pepfar = array('n/a');\n\t\t$rowRay['pepfar'] = implode(', ', $pepfar);\n\n\t\t// get training topic(s)\n\t\t$select = $this->select()\n\t\t->from('training_to_training_topic_option', array())\n\t\t->setIntegrityCheck(false)\n\t\t->join(array('tp' => 'training_topic_option'), \"training_to_training_topic_option.training_topic_option_id = tp.id\",'training_topic_phrase')\n\t\t->where(\"training_to_training_topic_option.training_id = $training_id AND training_topic_option_id != 0\");\n\n\t\t$rows = $this->fetchAll($select);\n\t\tforeach($rows as $r) {\n\t\t\t$topic[] = $r->training_topic_phrase;\n\t\t}\n\t\tif(!isset($topic)) $topic = array('n/a');\n\t\t$rowRay['training_topic_phrase'] = implode(', ', $topic);\n\n\t\treturn $rowRay;\n\t}", "public function getYearListAppTr() \n {\t\t\n $this->db->select('to_char(th_date_from,\\'yyyy\\') as \"CM_YEAR\"');\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"th_date_from\");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result();\n }", "function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}", "public static function retrievePotentialEarnedShirts($year, $thresholdSS, $thresholdLS)\n {\n $active_statuses = implode(\"','\", Person::ACTIVE_STATUSES);\n $report = DB::select(\n \"SELECT\n person.id, person.callsign, person.status, person.first_name, person.mi, person.last_name,\n eh.estimated_hours,\n ah.actual_hours,\n person.teeshirt_size_style, person.longsleeveshirt_size_style\n FROM\n person\n LEFT JOIN (\n SELECT\n person_slot.person_id,\n round(sum(((TIMESTAMPDIFF(MINUTE, slot.begins, slot.ends))/60)),2) AS estimated_hours\n FROM\n slot\n JOIN\n person_slot ON person_slot.slot_id = slot.id\n JOIN\n position ON position.id = slot.position_id\n WHERE\n YEAR(slot.begins) = ?\n AND position.count_hours IS TRUE\n GROUP BY person_id\n ) eh ON eh.person_id = person.id\n\n LEFT JOIN (\n SELECT\n timesheet.person_id,\n round(sum(((TIMESTAMPDIFF(MINUTE, timesheet.on_duty, timesheet.off_duty))/60)),2) AS actual_hours\n FROM\n timesheet\n JOIN\n position ON position.id = timesheet.position_id\n WHERE\n YEAR(timesheet.on_duty) = ?\n AND position.count_hours IS TRUE\n GROUP BY person_id\n ) ah ON ah.person_id = person.id\n\n WHERE\n ( actual_hours > 0 OR estimated_hours > 0 )\n AND person.id NOT IN (\n SELECT\n timesheet.person_id\n FROM\n timesheet\n JOIN\n position ON position.id = timesheet.position_id\n WHERE\n YEAR(timesheet.on_duty) = ?\n AND position_id = ?\n )\n AND person.status IN ('\" . $active_statuses . \"')\n ORDER BY\n person.callsign\n \"\n , [$year, $year, $year, Position::ALPHA]\n );\n\n if (empty($report)) {\n return [];\n }\n\n $report = collect($report);\n return $report->map(function ($row) use ($thresholdSS, $thresholdLS) {\n return [\n 'id' => $row->id,\n 'callsign' => $row->callsign,\n 'first_name' => $row->first_name,\n 'middle_initial' => $row->mi,\n 'last_name' => $row->last_name,\n 'estimated_hours' => $row->estimated_hours,\n 'actual_hours' => $row->actual_hours,\n 'longsleeveshirt_size_style' => $row->longsleeveshirt_size_style,\n 'earned_ls' => ($row->actual_hours >= $thresholdLS),\n 'teeshirt_size_style' => $row->teeshirt_size_style,\n 'earned_ss' => ($row->actual_hours >= $thresholdSS), // gonna be true always, but just in case the selection above changes.\n ];\n });\n }", "function dayOfProgrammer($year) {\n if($year <1918 && $year%400!=0 && $year%100==0 ) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"254 days\"));\n return date_format($date,\"d.m.Y\"); \n } else if($year == 1918) {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"268 days\"));\n return date_format($date,\"d.m.Y\");\n } else {\n $date=date_create($year.'-01-01');\n date_add($date,date_interval_create_from_date_string(\"255 days\"));\n return date_format($date,\"d.m.Y\");\n }\n}", "function getLessonDetails($program, $author, $lesson, $diff_date, $diff_start, $step_less, $start_date, $config, $lesson_details_for_quiz, $poz, $nr_lesson, $lessons_per_release){\n\t\t$user = JFactory::getUser();\n\t\t$db = JFactory::getDbo();\n\n\t\t$preview = JFactory::getApplication()->input->get(\"preview\", \"\", \"raw\");\n\n\t\tif($preview == \"true\"){\n\t\t\t$user = JFactory::getUser();\n\t\t\t$view_course = false;\n\n\t\t\tif(intval($user->id) > 0){\n\t\t\t\t$sql = \"select `author` from #__guru_program where `id`=\".intval($program->id);\n\t\t\t\t$db->setQuery($sql);\n\t $author = $db->loadResult();\n\n\t if(isset($author) && trim($author) != \"\"){\n\t \t$author = explode(\"|\", $author);\n\t }\n\n\t if(in_array(intval($user->id), $author)){\n\t \t// user logged is course author\n\t \t$view_course = true;\n\t }\n\t else{\n\t \t// check if user logged is super user\n\t \tif(in_array(8, $user->groups)){\n\t\t \t$view_course = true;\n\t\t }\n\t }\n\n\t if($view_course){\n\t \t$lesson[\"can_open_lesson\"] = \"1\";\n\t \treturn $lesson;\n\t }\n\t\t\t}\n\n\t\t\t$app = JFactory::getApplication();\n\t $app->redirect(JURI::root());\n\t\t}\n\n\t\tif($program->chb_free_courses == 1){// free for\n\t $free_limit = $program->free_limit;\n\n\t if(intval($free_limit) > 0){\n\t $sql = \"select count(*) from #__guru_buy_courses bc, #__guru_order o where o.`status`='Paid' and o.`id`=bc.`order_id` and (bc.`expired_date` >= now() OR bc.`expired_date`='0000-00-00 00:00:00') and bc.`course_id`=\".intval($program->id);\n\t $db->setQuery($sql);\n\t $count_orders = $db->loadResult();\n\n\t if(intval($count_orders) >= intval($free_limit)){\n\t $program->chb_free_courses = 0;\n\t }\n\t }\n\t }\n\t\t\n\t\tif(intval($user->id) == 0){ // not logged user\n\t\t\tif($program->chb_free_courses == 0){ // this course is not free\n\t\t\t\tif($lesson[\"step_access\"] == 2){ // lesson access is guest\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t}\n\n\t\t\t\telse{ // lesson access students or members and is not logged anyone\n\t\t\t\t\tif($lesson[\"step_access\"] == 1){ // members\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t$lesson[\"need_registration\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($program->chb_free_courses == 1){ // this course is free\n\t\t\t\tif($program->step_access_courses == 2){ // free for guests\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t}\n\t\t\t\telse{ // free for students or members and is not logged anyone\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t$lesson[\"need_registration\"] = \"1\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($lesson[\"step_access\"] == \"2\"){\n\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t$lesson[\"need_registration\"] = \"0\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(intval($user->id) != 0){ // logged user\n\t\t\t$sql = \"select bc.expired_date from #__guru_buy_courses bc inner join #__guru_order o on bc.order_id=o.id where bc.course_id=\".intval($program->id).\" and bc.userid=\".intval($user->id).\" and o.status='Paid'\";\n\t\t\t$db->setQuery($sql);\n\t\t\t\n\t\t\t$expired_date = $db->loadResult();\n\t\t\t$license_expired = false;\n\t\t\t\n\t\t\tif(isset($expired_date) && $expired_date != \"0000-00-00 00:00:00\"){\n\t\t\t\t$today = time();\n\t\t\t\t$course_expired_date = strtotime($expired_date);\n\t\t\t\tif($today > $course_expired_date){\n\t\t\t\t\t$license_expired = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check if before this lesson is a quiz that is not finished and can't go on to next lessons\n\t\t\tif(isset($lesson_details_for_quiz) && count($lesson_details_for_quiz) > 0){\n\t\t\t\tfor($i=count($lesson_details_for_quiz)-2; $i>=0; $i--){\n\t\t\t\t\t$previous_lesson = $lesson_details_for_quiz[$i];\n\t\t\t\t\tif(isset($previous_lesson[\"lesson_contains_quiz\"]) && $previous_lesson[\"lesson_quiz_student_failed\"] == '1' && $previous_lesson[\"lesson_quiz_student_go_on\"] == 'false'){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t$lesson[\"lesson_quiz_student_go_on\"] = \"0\";\n\t\t\t\t\t\treturn $lesson;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check if before this lesson is a quiz that is not finished and can't go on to next lessons\n\t\t\t\n\t\t\tif(!$this->finishedAllRequiredCourses($program)){ // not finished required courses\n\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t$lesson[\"finish_required_courses\"] = \"1\";\n\t\t\t}\n\t\t\telseif($program->chb_free_courses == 0){ // this course is not free\n\t\t\t\tif($lesson[\"step_access\"] == 2){ // lesson access is guest\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t}\n\t\t\t\telseif($lesson[\"step_access\"] == 1){ // lesson access is members\n\t\t\t\t\t$groups_access = $lesson[\"groups_access\"];\n\t\t\t\t\t\n\t\t\t\t\tif(!is_array($groups_access)){\n\t\t\t\t\t\t$groups_access = explode(\",\", $groups_access);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!is_array($groups_access) || count($groups_access) == 0){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telseif($this->userInGroups($groups_access) && is_array($groups_access) && count($groups_access) > 0){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(isset($expired_date) && $license_expired === false){\n\t\t\t\t\t\t// has an order, and is not expired\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($lesson[\"step_access\"] == 0){ // lesson access is students\n\t\t\t\t\tif($license_expired){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif($this->isCustomerForCourse($program)){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(isset($expired_date) && $license_expired === false){\n\t\t\t\t\t\t// has an order, and is not expired\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($program->chb_free_courses == 1){ // this course is free\n\t\t\t\tif($lesson[\"step_access\"] == 2){ // lesson access is guest\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t}\n\t\t\t\telseif($lesson[\"step_access\"] == 1){ // lesson access is members\n\t\t\t\t\t$groups_access = $lesson[\"groups_access\"];\n\t\t\t\t\t\n\t\t\t\t\tif(!is_array($groups_access)){\n\t\t\t\t\t\t$groups_access = explode(\",\", $groups_access);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!is_array($groups_access) || count($groups_access) == 0){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telseif($this->userInGroups($groups_access) && is_array($groups_access) && count($groups_access) > 0){\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(isset($expired_date) && $license_expired === false){\n\t\t\t\t\t\t// has an order, and is not expired\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($lesson[\"step_access\"] == 0){ // lesson access is students\n\t\t\t\t\t// check course access details --------------------------------------------\n\t\t\t\t\tif($program->step_access_courses == 2){ // free for guests\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->step_access_courses == 1){ // free for members\n\t\t\t\t\t\t$groups_access = $program->groups_access;\n\t\t\t\t\t\t$user_courses = $this->getUserCourses();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($user_courses[$program->id])){ // user is enrolleed to this curse\n\t\t\t\t\t\t\tif($this->userInGroups($groups_access) && trim($groups_access) != \"\"){\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif(trim($groups_access) == \"\"){\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// if user is not from that user groups but bought this course\n\t\t\t\t\t\t\t\tif($this->isCustomerForCourse($program)){\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{ // user is not enrolled\n\t\t\t\t\t\t\tif(trim($groups_access) == \"\"){\n\t\t\t\t\t\t\t\tif($this->isCustomerForCourse($program)){\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\t$lesson[\"need_enroll\"] = \"1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tif($this->userInGroups($groups_access) && trim($groups_access) != \"\"){\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\t$lesson[\"need_enroll\"] = \"1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// if user is not from that user groups but bought this course\n\t\t\t\t\t\t\tif($this->isCustomerForCourse($program)){\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->step_access_courses == 0){ // free for students\n\t\t\t\t\t\tif($program->selected_course == -1){ // free for students of any courses\n\t\t\t\t\t\t\tif($this->isCustomer()){\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!$this->isCustomerForCourse($program)){\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\t$lesson[\"enroll_to_course\"] = \"1\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{ // free for students of selected courses\n\t\t\t\t\t\t\t$selected_courses = $program->selected_course;\n\t\t\t\t\t\t\t$selected_courses = explode(\"|\", $selected_courses);\n\t\t\t\t\t\t\t$selected_courses = array_filter($selected_courses);\n\t\t\t\t\t\t\t$user_courses = $this->getUserCourses();\n\n\t\t\t\t\t\t\tif(isset($user_courses) && count($user_courses) > 0){\n\t\t\t\t\t\t\t\t$exist = false;\n\t\t\t\t\t\t\t\tforeach($user_courses as $key=>$value){\n\t\t\t\t\t\t\t\t\tif(in_array($key, $selected_courses)){\n\t\t\t\t\t\t\t\t\t\t$exist = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif($exist){\n\t\t\t\t\t\t\t\t\tif($license_expired){\n\t\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\t\t$lesson[\"enroll_to_course\"] = \"0\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t\t\t$lesson[\"enroll_to_course\"] = \"1\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// if user courses exist in list of selected courses, no need for enroll, already enrolled\n\t\t\t\t\t\t\t\t$cid = JFactory::getApplication()->input->get(\"cid\", \"\", \"raw\");\n\t\t\t\t\t\t\t\tif(intval($cid) == $program->id && isset($user_courses[$program->id])){\n\t\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t\t\t$lesson[\"enroll_to_course\"] = \"0\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// check course access details --------------------------------------------\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($program->course_type == 1 && intval($program->lesson_release) != 0){ // Sequential course, bot not all at once\n\t\t\t\tif($step_less != \"\" && $start_date != \"\"){\n\t\t\t\t\t$date_to_display = \"\";\n\t\t\t\t\t$serial_order = false;\n\t\t\t\t\t\n\t\t\t\t\tif($program->lesson_release == 1){\n\t\t\t\t\t\tif($nr_lesson/$lessons_per_release <= 1 ){\n\t\t\t\t\t\t\tif(strpos($start_date, \"-\") === FALSE && strpos($start_date, \":\") === FALSE){\n\t\t\t\t\t\t\t\t$start_date = date(\"Y-m-d H:i:s\", $start_date);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$date_to_display = strtotime ($start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$date_to_display = strtotime ( '+'.(ceil($nr_lesson/$lessons_per_release)-1).' day' , $start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->lesson_release == 2){\n\t\t\t\t\t\tif($nr_lesson/$lessons_per_release <= 1 ){\n\t\t\t\t\t\t\tif(strpos($start_date, \"-\") === FALSE && strpos($start_date, \":\") === FALSE){\n\t\t\t\t\t\t\t\t$start_date = date(\"Y-m-d H:i:s\", $start_date);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$date_to_display = strtotime ($start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$date_to_display = strtotime ( '+'.(ceil($nr_lesson/$lessons_per_release)-1).' week' , $start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->lesson_release == 3){\n\t\t\t\t\t\tif($nr_lesson/$lessons_per_release <= 1 ){\n\t\t\t\t\t\t\tif(strpos($start_date, \"-\") === FALSE && strpos($start_date, \":\") === FALSE){\n\t\t\t\t\t\t\t\t$start_date = date(\"Y-m-d H:i:s\", $start_date);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$date_to_display = strtotime ($start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$date_to_display = strtotime ( '+'.(ceil($nr_lesson/$lessons_per_release)-1).' month' , $start_date);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->lesson_release == 4){\n\t\t\t\t\t\t$date_to_display = strtotime ( '+'.(($nr_lesson - 1) * $program->after_hours).' hour' , $start_date);\n\t\t\t\t\t}\n\t\t\t\t\telseif($program->lesson_release == 5){\n\t\t\t\t\t\t$serial_order = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t$available_div = '';\n\n\t\t\t\t\t$timezone = new DateTimeZone( JFactory::getConfig()->get('offset') );\n\t\t $jnow = new JDate('now');\n\t\t $jnow->setTimezone($timezone);\n\t\t $jnow = $jnow->toSQL(true);\n\n\t\t if($lesson[\"can_open_lesson\"] && $serial_order){\n\t\t \t$db = JFactory::getDbo();\n\t\t\t\t\t\t$sql = \"SELECT `id` FROM `#__guru_days` WHERE `pid`=\".intval($program->id);\n\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t$modules = $db->loadColumn();\n\t\t\t\t\t\t$lesson_access = false;\n\n\t\t\t\t\t\tif(!isset($modules) || count($modules) == 0){\n\t\t\t\t\t\t\t$modules = array(\"0\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql = \"SELECT DISTINCT `media_id` FROM `#__guru_mediarel` WHERE type='dtask' AND `type_id` in (\".implode(',', $modules).\")\";\n\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t$lessons = $db->loadColumn();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($lessons) && count($lessons) > 0){\n\t\t\t\t\t\t\t$sql = \"SELECT `id` FROM `#__guru_task` WHERE `id` in (\".implode(',', $lessons).\") and `published`='1' and `startpublish` <= now() and (`endpublish` >= now() OR `endpublish`='0000-00-00 00:00:00') order by `ordering` ASC\";\n\t\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t\t$lessons = $db->loadColumn();\n\n\t\t\t\t\t\t\tif(isset($lessons) && count($lessons) > 0){\n\t\t\t\t\t\t\t\tforeach($lessons as $key=>$lesson_id){\n\t\t\t\t\t\t\t\t\tif($lesson_id == $lesson[\"id\"] && $key == 0){\n\t\t\t\t\t\t\t\t\t\t// first lesson, should be available\n\t\t\t\t\t\t\t\t\t\t$lesson_access = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$preview_lesson_id = 0;\n\n\t\t\t\t\t\t\t\t\t\tif($lesson_id == $lesson[\"id\"]){\n\t\t\t\t\t\t\t\t\t\t\tif(isset($lessons[$key - 1])){\n\t\t\t\t\t\t\t\t\t\t\t\t$preview_lesson_id = $lessons[$key - 1];\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif(intval($preview_lesson_id) > 0){\n\t\t\t\t\t\t\t\t\t\t\t$sql = \"select count(1) from #__guru_viewed_lesson where `lesson_id` like '%|\".intval($preview_lesson_id).\"|%' and `user_id`=\".intval($user->id).\" and `pid`=\".intval($program->id);\n\t\t\t\t\t\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t\t\t\t\t\t$count_view_preview = (int) $db->loadResult();\n\n\t\t\t\t\t\t\t\t\t\t\tif($count_view_preview > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t$lesson_access = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$lesson_access = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$lesson_access = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($lesson_access && !$license_expired){\n\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\n\t\t\t\t\t\t\tif($program->lessons_show == 1){\n\t\t\t\t\t\t\t\t$available_div = '<div class=\"available_lesson replace_class available pull-left\">\n\t\t\t\t\t\t\t\t\t<span class=\"hidden-phone\">'.JText::_(\"GURU_AVAILABLE\").'</span>\n\t\t\t\t\t\t\t\t\t<i class=\"uk-icon-check uk-text-success wk-icon-check wk-text-success\" title=\"'.JText::_(\"GURU_AVAILABLE\").'\" data-uk-tooltip></i>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t$lesson[\"available_div\"] = $available_div;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t//$available_div = '<div class=\"available_lesson replace_class available pull-left\">'.JText::_(\"GURU_VIEW_PREVIOUS_LESSON\").'</div>';\n\n\t\t\t\t\t\t\t$available_div = '<div class=\"not-available_lesson replace_class available pull-left\">\n\t\t\t\t\t\t\t\t\t<span class=\"hidden-phone\">'.JText::_(\"GURU_VIEW_PREVIOUS_LESSON\").'</span>\n\t\t\t\t\t\t\t\t\t<i class=\"uk-icon-clock-o wk-icon-clock-o hidden-desktop\" title=\"'.JText::_(\"GURU_VIEW_PREVIOUS_LESSON\").'\" data-uk-tooltip></i>\n\t\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t\t$lesson[\"available_div\"] = $available_div;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($program->lessons_show == 2){ // do not show unvailable lessons\n\t\t\t\t\t\t\t\t$lesson[\"not_show_lesson\"] = \"1\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t }\n\t\t elseif(strtotime($jnow) < $date_to_display){\n\t\t\t\t\t\t$date_to_display = date($config->datetype, $date_to_display);\n\t\t\t\t\t\t$available_div = '<div class=\"available_lesson replace_class available pull-left\">\n\t\t\t\t\t\t\t<span class=\"hidden-phone\">'.$date_to_display.'</span>\n\t\t\t\t\t\t\t<i class=\"uk-icon-clock-o wk-icon-clock-o\" title=\"'.$date_to_display.'\" data-uk-tooltip></i>\n\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t\t\t$lesson[\"available_div\"] = $available_div;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($program->lessons_show == 2){ // do not show unvailable lessons\n\t\t\t\t\t\t\t$lesson[\"not_show_lesson\"] = \"1\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif(!$license_expired && isset($expired_date)){\n\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\n\t\t\t\t\t\t\tif($program->lessons_show == 1){\n\t\t\t\t\t\t\t\t$available_div = '<div class=\"available_lesson replace_class available pull-left\">\n\t\t\t\t\t\t\t\t\t<span class=\"hidden-phone\">'.JText::_(\"GURU_AVAILABLE\").'</span>\n\t\t\t\t\t\t\t\t\t<i class=\"uk-icon-check uk-text-success wk-icon-check wk-text-success\" title=\"'.JText::_(\"GURU_AVAILABLE\").'\" data-uk-tooltip></i>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t$lesson[\"available_div\"] = $available_div;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/*if user can see all sequential lessons*/\n\t\t\t\t\tif($this->canSeeSequentialLessons($user->id, $program->id)){\n\t\t\t\t\t\tif(!$license_expired && isset($expired_date)){\n\t\t\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"1\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($program->lessons_show == 1){\n\t\t\t\t\t\t\t\t$available_div = '<div class=\"available_lesson replace_class available pull-left\">\n\t\t\t\t\t\t\t\t\t<span class=\"hidden-phone\">'.JText::_(\"GURU_AVAILABLE\").'</span>\n\t\t\t\t\t\t\t\t\t<i class=\"uk-icon-check uk-text-success wk-icon-check wk-text-success\" title=\"'.JText::_(\"GURU_AVAILABLE\").'\" data-uk-tooltip></i>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\t$lesson[\"available_div\"] = $available_div;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$lesson[\"can_open_lesson\"] = \"0\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $lesson;\n\t}", "public function getTrainingList()\n {\n $umg = $this->username;\n\n $this->db->select(\"th_ref_id,\n th_training_title,\n to_char(th_date_from, 'dd/mm/yyyy') th_date_from2,\n to_char(th_date_to, 'dd/mm/yyyy') th_date_to2\n \");\n $this->db->from(\"ims_hris.training_head\");\n \n $this->db->where(\"th_status = 'ENTRY'\");\n $this->db->where(\"th_dept_code = (select sm_dept_code from ims_hris.staff_main where upper(sm_apps_username) = UPPER('$umg'))\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->order_by(\"th_date_from, th_date_to, th_training_title, th_ref_id\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function getPoliticianBio($search_param, $type)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $Open_Australia_Key;\r\n\t\t\r\n\t\t$politician_list = [];\r\n\t\t$bioNb = 0;\r\n\t\t$dataError = false;\r\n\t\t$mp_senator = \"MP\";\r\n\r\n\t\t\r\n\t\tif(is_null($search_param))\r\n\t\t{\r\n\t\t\tif($type == 0)\r\n\t\t\t\treturnError();\r\n\t\t\telse\r\n\t\t\t\treturnFromPolicyError();\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//check for both MP and senator if fails for MP\r\n\t\tfor($count = 0; $bioNb < 1 && $count < 2; $count++)\r\n\t\t{\t\t\t\r\n\t\t\tif($count == 1)\r\n\t\t\t\t$mp_senator = \"Senator\";\r\n\r\n\t\t\tif($count == 0)\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getRepresentatives\";\r\n\t\t\telse\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getSenators\";\r\n\t\t\t\r\n\t\t\t//if searching by name or postcode\r\n\t\t\tif($type == 0)\r\n\t\t\t\t$data = array('postcode'=>$search_param,'output'=>'js','key'=> $Open_Australia_Key);\r\n\t\t\telse\r\n\t\t\t\t$data = array('search'=>$search_param,'output'=>'js','key'=> $Open_Australia_Key);\r\n\t\t\t\r\n\t\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\t\t//translate fullBio into a usable form\r\n\t\t\t$fullBio = json_decode(file_get_contents($GETurl));\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//check whether there was any actual data \r\n\t\t\tif( (isset($fullBio->error)) || ($fullBio == new StdClass()) )\r\n\t\t\t{\r\n\t\t\t\t$dataError = true;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//fills politician_list with an array of politician data\r\n\t\t\t\t$bioNb = getDataForPerson($fullBio, $politician_list);\r\n\t\t\t\t\r\n\t\t\t\t$dataError = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//DETERMINE IF ERROR AFTER CHECKING BOTH MP AND SENATOR\r\n\t\tif($dataError == true || $bioNb > 2)\r\n\t\t{\r\n\t\t\tif($type == 0)\r\n\t\t\t\treturnErrorPostcode();\r\n\t\t\telse if($type == 1)\r\n\t\t\t\treturnErrorName();\r\n\t\t\telse\r\n\t\t\t\treturnFromPolicyError();\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//IF NO ERROR, THEN RETURN DATA\r\n\t\t//only option of multiple candidates when searching by postcode, not by name\r\n\t\tif($type == 0 || $type == 1)\r\n\t\t{\t\r\n\t\t\t$cards = [];\r\n\t\t\t\r\n\t\t\tif($bioNb > 1)\r\n\t\t\t\taddText(\"There are \".$bioNb.\" possible MPs for your postcode:\", $cards);\r\n\t\t\t\r\n\t\t\tforeach($politician_list as $mp)\r\n\t\t\t{\r\n\t\t\t\tif ($mp[4] != null)\r\n\t\t\t\t\taddImage($mp[4], $cards);\r\n\t\t\t\t\r\n\t\t\t\t//0full name, 1party, 2entered_house, 3constituency, 5titles, 4image_url\r\n\t\t\t\taddText(formatForBot($mp[0], $mp[1], $mp[2], $mp[3],$mp[5], $mp_senator), $cards);\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($bioNb > 1)\r\n\t\t\t{\r\n\t\t\t\tselectMP(\"Poly_Name\", $politician_list[0][0], $politician_list[1][0], $cards);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\taddButton(\"I hope they're doing a good job...\", [[\"Policy Overview\", \"Yeah, me too!\"],[\"PollieBio-NotKnow\", \"Typo! Try again\"]], $cards);\r\n\t\t\t}\r\n\t\t\tcompileChatFuel($cards);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tfromPolicyPrintBio($politician_list[0][0], $politician_list[0][1], $politician_list[0][2], $politician_list[0][3], $politician_list[0][5], $mp_senator);\r\n\t\t}\r\n\t}", "function determineEligibility() {\n if (isset($_REQUEST['eligible_submitted'])) {\n /* eligible if:\n * a woman\n * aged 16-50\n * has ticked one of the 'partner' checkboxes\n */\n $eligibility = false;\n if(isset($_REQUEST['female']) and isset($_REQUEST['age'])) {\n\tif ($_REQUEST['female'] == \"yes\" and $_REQUEST['age'] == \"yes\") {\n\n\t foreach ($_REQUEST as $req=>$value) {\n\t if(strpos( $req , 'partner_' ) !== false) {\n\t $eligibility = true;\n\t }\n\t }\n\t $this->eligible = $eligibility;\n\t $_SESSION[\"eligible\"] = $this->eligible;\n\t}\n }\n if ($this->eligible === true) {\n\t/* eligible go to plain language statement */\n\t$_REQUEST['mode'] = \"introduction\";\n\treturn $this->showIntro();\n }\n else {\n\t/* otherwise, thanks for coming */\n\treturn $this->showIneligible();\n }\n }\n $output = $this->outputBoilerplate('eligibility.html');\n return $output;\n }", "public function setYear($year);", "public function AgeDistribution($genderFilter){\n \n $age25['ageBracket'] = Zf_QueryGenerator::SQLValue(\"18-25\");\n $age35['ageBracket'] = Zf_QueryGenerator::SQLValue(\"26-35\");\n $age50['ageBracket'] = Zf_QueryGenerator::SQLValue(\"36-50\");\n $age51['ageBracket'] = Zf_QueryGenerator::SQLValue(\"51 +\");\n if($genderFilter != \"all\"){\n $age25['gender'] = Zf_QueryGenerator::SQLValue($genderFilter);\n $age35['gender'] = Zf_QueryGenerator::SQLValue($genderFilter);\n $age50['gender'] = Zf_QueryGenerator::SQLValue($genderFilter);\n $age51['gender'] = Zf_QueryGenerator::SQLValue($genderFilter);\n }\n\n\n //Here we explicitly specify the selection rule using the user session details\n $userIdentificationCode = $this->sessionUser;\n $decodedIdentificationCode = Zf_Core_Functions::Zf_DecodeIdentificationCode($this->sessionUser);\n\n if($decodedIdentificationCode[4] == COMPANY_ADMIN){\n\n $age25['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n $age35['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n $age50['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n $age51['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n\n }else if($decodedIdentificationCode[4] == REGIONAL_MANAGER ||$decodedIdentificationCode[4] == SHOP_MANAGER || $decodedIdentificationCode[4] == ASSISTANT_SHOP_MANAGER){\n\n $age25['identificationCode'] = Zf_QueryGenerator::SQLValue($userIdentificationCode);\n $age25['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n\n $age35['identificationCode'] = Zf_QueryGenerator::SQLValue($userIdentificationCode);\n $age35['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n\n $age50['identificationCode'] = Zf_QueryGenerator::SQLValue($userIdentificationCode);\n $age50['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n\n $age51['identificationCode'] = Zf_QueryGenerator::SQLValue($userIdentificationCode);\n $age51['companySerial'] = Zf_QueryGenerator::SQLValue($decodedIdentificationCode[1]);\n\n }\n\n $selectColumns = array('ageBracket');\n\n\n $getAge25 = Zf_QueryGenerator::BuildSQLSelect('ttv_customerData', $age25, $selectColumns);\n $getAge35 = Zf_QueryGenerator::BuildSQLSelect('ttv_customerData', $age35, $selectColumns);\n $getAge50 = Zf_QueryGenerator::BuildSQLSelect('ttv_customerData', $age50, $selectColumns);\n $getAge51 = Zf_QueryGenerator::BuildSQLSelect('ttv_customerData', $age51, $selectColumns);\n\n //echo $getAge25; exit();\n\n $executeAge25 = $this->Zf_AdoDB->Execute($getAge25);\n $executeAge35 = $this->Zf_AdoDB->Execute($getAge35);\n $executeAge50 = $this->Zf_AdoDB->Execute($getAge50);\n $executeAge51 = $this->Zf_AdoDB->Execute($getAge51);\n\n if (!$executeAge25){\n\n echo \"<strong>Query Execution Failed:</strong> <code>\" . $this->Zf_AdoDB->ErrorMsg() . \"</code>\";\n\n }else{\n\n $age25Count = $executeAge25->RecordCount();\n\n }\n\n if (!$executeAge35){\n\n echo \"<strong>Query Execution Failed:</strong> <code>\" . $this->Zf_AdoDB->ErrorMsg() . \"</code>\";\n\n }else{\n\n $age35Count = $executeAge35->RecordCount();\n\n }\n\n if (!$executeAge50){\n\n echo \"<strong>Query Execution Failed:</strong> <code>\" . $this->Zf_AdoDB->ErrorMsg() . \"</code>\";\n\n }else{\n\n $age50Count = $executeAge50->RecordCount();\n\n }\n\n if (!$executeAge51){\n\n echo \"<strong>Query Execution Failed:</strong> <code>\" . $this->Zf_AdoDB->ErrorMsg() . \"</code>\";\n\n }else{\n\n $age51Count = $executeAge51->RecordCount();\n\n }\n\n $strXML = \"\";\n $strXML .= \"<chart bgColor='transparent' bgAlpha='50' showBorder='0' canvasBgColor='transparent'\n canvasBorderColor='efefef' canvasBorderThickness='1' canvasBorderAlpha='80' canvasBorder='0'\n xAxisName='' yAxisName='No. of Customers' showValues='1' formatNumberScale='0'\n paletteColors='ffb848, 28b779, 27a9e3, e7191b, 852b99' paletteThemeColor='ffb848'\n showlegend='1' enablesmartlabels='0' showlabels='0' showpercentvalues='1' pieRadius='100' legendPosition='BOTTOM' >\";\n $strXML .= \"<set label='18 - 25' value=' \".$age25Count.\" ' tooltext=' Age brackets 18 - 25 years{br}Total count: \".$age25Count.\" people,{br}Click for a detailed{br}information ' link=' \".Zf_GenerateLinks::zf_fusionCharts_link('platform_data', 'customer_data', 'age_data/18-25/'.$genderFilter).\" ' />\";\n $strXML .= \"<set label='26 - 35' value=' \".$age35Count.\" ' tooltext=' Age brackets 26 - 35 years{br}Total count: \".$age35Count.\" people,{br}Click for a detailed{br}information ' link=' \".Zf_GenerateLinks::zf_fusionCharts_link('platform_data', 'customer_data', 'age_data/26-35/'.$genderFilter).\" ' />\";\n $strXML .= \"<set label='36 - 50' value=' \".$age50Count.\" ' tooltext=' Age brackets 36 -50 years{br}Total count: \".$age50Count.\" people,{br}Click for a detailed{br}information ' link=' \".Zf_GenerateLinks::zf_fusionCharts_link('platform_data', 'customer_data', 'age_data/36-50/'.$genderFilter).\" ' />\";\n $strXML .= \"<set label='51+' value=' \".$age51Count.\" ' tooltext=' Age brackets over 50 years{br}Total count: \".$age51Count.\" people,{br}Click for a detailed{br}information ' link=' \".Zf_GenerateLinks::zf_fusionCharts_link('platform_data', 'customer_data', 'age_data/51 +/'.$genderFilter).\" ' />\";\n $strXML .= \"\n <styles>\n <definition>\n <style name='myToolTipFont' type='font' font='ProximaNova-Light' size='11' color='87b6d9'/>\n </definition>\n <application>\n <apply toObject='ToolTip' styles='myToolTipFont' />\n </application>\n </styles> \n\n \";\n $strXML .= \"</chart>\";\n\n $zf_chartData = array(\n\n \"chartData\" => \"$strXML\",\n \"chartType\" => \"Pie2D\",\n \"chartId\" => \"customerAge\",\n \"chartWidth\" => \"100%\",\n \"chartHeight\" => 280,\n \"chartDebug\" => \"false\",\n \"registerJavacript\" => \"true\",\n \"chartTransparency\" => \"\"\n\n );\n\n Zf_GenerateCharts::zf_generate_chart($zf_chartData, $chartPosition = \"inline\");\n \n }", "function get_paid_for_students(){\n $financial_year_id=get_datan(\"fid\");\n $paid=get_datan(\"paid\");\n \n $programarea_id= get_programarea();\n\n $year=get_data(\"year\");\n \n if($year==false){\n $year=0;\n }\n \n $scholarship_status=get_data(\"spst\");\n if($scholarship_status==false){\n $scholarship_status=0;\n }\n \n $page=get_data(\"page\");\n if($page===false){\n $page=0;\n $limit=0;\n }else{\n $limit=15;\n }\n \n include_once 'students.php';\n $s=new students();\n \n $result=$s->get_paid_for_students($paid,$financial_year_id,$programarea_id,$year,$scholarship_status,$page, $limit);\n \n if(!$result){\n echo \"{\\\"result\\\":0,\\\"message\\\":\\\"no student paid for in this year\\\"}\";\n return; \n }\n $count=$s->count;\n echo \"{\\\"result\\\":1,\\\"count\\\":$count,\\\"financial_year_id\\\":$financial_year_id, \\\"students\\\":[\";\n $row=$s->fetch();\n while($row){\n echo json($row);\n $row=$s->fetch();\n if($row){\n echo \",\";\n }\n }\n echo \"]}\";\n}", "function shwdtls(){\r\n\t\t\t\t\t\techo \"<h1>Curriculum Vitae</h1>\";\r\n\t\t\t\t\t\techo \"<h2>Personal Details</h2>\";\r\n\t\t\t\t\t\techo \"Name: \".$this->name.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Admn No: \".$this->admnno.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Date of Birth: \".$this->dob.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Nationality: \".$this->nationality.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Gender: \".$this->gender.\"<br><br>\";\r\n\t\t\t\t\t\techo \"E-mail: \".$this->email.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Skype ID: \".$this->skypeid.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Mobile No: \".$this->mobno.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Category: \".$this->category.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Contact Address: \".$this->caddress.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Permanent Address: \".$this->paddress.\"<br><br>\";\r\n\t\t\t\t\t\techo \"<h2>Academic Details</h2>\";\r\n\t\t\t\t\t\techo \"Examination Passed: X<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Examination Passed: XII<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"Examination Passed: Graduation<br><br>\";\r\n\t\t\t\t\t\techo \"Board/University: \".$this->boarduniv.\"<br>\";\r\n\t\t\t\t\t\techo \"Year of Passing: \".$this->year.\"<br>\";\r\n\t\t\t\t\t\techo \"Percentage/CGPA: \".$this->percgpa.\"<br><br>\";\r\n\t\t\t\t\t\techo \"<h2>Experience</h2>\";\r\n\t\t\t\t\t\techo \"Organisation/Institute: \".$this->insti.\"<br>\";\r\n\t\t\t\t\t\techo \"Start Date: \".$this->strdate.\"<br>\";\r\n\t\t\t\t\t\techo \"End Date: \".$this->stpdate.\"<br><br>\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "public function getTotalStudentsYearFilter($yearsData, $typeYears, $dataYear , $supervisors, $departament){\n if ($yearsData == \"Todos\") {\n # code...\n if ($typeYears==1) {\n # code month...\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->count();\n $total_stds_men = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->where('gender',1)->count();\n $total_stds_women = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n $htmlResumenTotal=$total_stds_year.'';\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$this->getMonth($dataYear).'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->get(); \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n }\n } else if ($typeYears==2) {\n # code quarter...\n if ($dataYear==1) {\n # code first quarter...\n $sq_Data = array(1,2,3,4);\n $dsc_data = 'Primer Cuatrimestre';\n } else if($dataYear==2){\n # code second quarter...\n $sq_Data = array(5,6,7,8);\n $dsc_data = 'Segundo Cuatrimestre';\n }else if($dataYear==3){\n # code third quarter\n $sq_Data = array(9,10,11,12);\n $dsc_data = 'Tercer Cuatrimestre';\n }\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::whereIn(DB::raw('month(students.created_at)'),$sq_Data)\n ->count();\n $total_stds_men = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where('gender',1)->count();\n $total_stds_women = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n $htmlResumenTotal=$total_stds_year.'';\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$dsc_data.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get(); \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n }\n } else if ($typeYears==3) {\n # code semeter...\n if ($dataYear==1) {\n # code first semester...\n $sq_Data = array(1,2,3,4,5,6);\n $dsc_data = 'Primer Semestre';\n } else if($dataYear==2){\n # code second semester...\n $sq_Data = array(7,8,9,10,11,12);\n $dsc_data = 'Segundo Semestre';\n }\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::whereIn(DB::raw('month(students.created_at)'),$sq_Data)\n ->count();\n $total_stds_men = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where('gender',1)->count();\n $total_stds_women = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n $htmlResumenTotal=$total_stds_year.'';\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$dsc_data.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get(); \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n }\n } else if ($typeYears==4) {\n # code year...\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = $this->getTotalStds();\n $total_stds_men = $this->getTotalStdsMen();\n $total_stds_women = $this->getTotalStdsWomen();\n $total_stds_year = Student::select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n $htmlResumenTotal = '<h2>Resumen de Estudiantes</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $sbc->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->get(); \n \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n\n \n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n \n }\n } else {\n # code...\n }\n } else {\n # code...\n if ($typeYears==1) {\n # code month...\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->count();\n $total_stds_men = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',1)->count();\n $total_stds_women = Student::where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n $htmlResumenTotal=$total_stds_year.'';\n if($total_stds!=0){\n $dataTable = '<tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>';\n }else{\n $dataTable = '<tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'(%)</td>\n </tr>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$this->getMonth($dataYear).' del año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n '.$dataTable.'\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get(); \n \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n\n \n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('month(students.created_at)'),$dataYear)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n \n \n }\n } else if ($typeYears==2) {\n # code quarter...\n if ($dataYear==1) {\n # code first quarter...\n $sq_Data = array(1,2,3,4);\n $dsc_data = 'Primer Cuatrimestre';\n } else if($dataYear==2){\n # code second quarter...\n $sq_Data = array(5,6,7,8);\n $dsc_data = 'Segundo Cuatrimestre';\n }else if($dataYear==3){\n # code third quarter\n $sq_Data = array(9,10,11,12);\n $dsc_data = 'Tercer Cuatrimestre';\n }\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::whereIn(DB::raw('month(students.created_at)'),$sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->count();\n $total_stds_men = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',1)->count();\n $total_stds_women = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$dsc_data.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n '.$tablesresult.'\n </tr>\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get(); \n \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.' de año: '.$yearsData.' </h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n\n \n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n \n \n }\n } else if ($typeYears==3) {\n # code semeter...\n if ($dataYear==1) {\n # code first semester...\n $sq_Data = array(1,2,3,4,5,6);\n $dsc_data = 'Primer Semestre';\n } else if($dataYear==2){\n # code second semester...\n $sq_Data = array(7,8,9,10,11,12);\n $dsc_data = 'Segundo Semestre';\n }\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::whereIn(DB::raw('month(students.created_at)'),$sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->count();\n $total_stds_men = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',1)->count();\n $total_stds_women = Student::whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->where('gender',2)->count();\n $total_stds_year = Student::select(DB::raw('month(students.created_at) as mes'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de '.$dsc_data.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n '.$tablesresult.'\n </tr>\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($sbc->mes) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get(); \n \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n\n \n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('month(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->whereIn(DB::raw('month(students.created_at)'), $sq_Data)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('month(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Mes</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $this->getMonth($stdp->anio) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n \n \n }\n } else if ($typeYears==4) {\n # code year...\n if ($supervisors==0 && $departament==0) {\n # code...\n $total_stds = Student::where(DB::raw('year(students.created_at)'),$yearsData)->count();\n $total_stds_men = Student::where('gender',1)->where(DB::raw('year(students.created_at)'),$yearsData)->count();\n $total_stds_women = Student::where('gender',2)->where(DB::raw('year(students.created_at)'),$yearsData)->count();\n $total_stds_year = Student::select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n $htmlResumenTotal = '<h2>Resumen de Estudiantes de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">\n <td class=\"color-indico\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_men) .' ('. number_format($total_stds_men * 100 / $total_stds) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_women) .'('. number_format($total_stds_women * 100 / $total_stds) .'%)</td>\n </tr>\n </tbody>\n </table>\n </div>\n \n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($total_stds_year as $sbc) {\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $sbc->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($sbc->men*100/$sbc->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($sbc->women*100/$sbc->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_men) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_women) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else if ($supervisors!=0 && $departament==0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $total_stds_supervisor = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n if( $total_stds_supervisor!=null){\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('departament.departament as dp', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('departament.id_departament','desc')\n ->groupBy('departament.id_departament')\n ->get();\n $stds_by_super_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n if (number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' ('. number_format($total_stds_supervisor[0]->mendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'('. number_format($total_stds_supervisor[0]->womendp * 100 / ($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_supervisor[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_supervisor[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if($stds_by_super_departament!=null && $stds_by_super_cohort!=null){ \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Departamento</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->dp .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n //$htmlResumenTotal = ''.$stds_by_super_departament;\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_supervisor[0]->mendp+$total_stds_supervisor[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n }else{\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else if ($supervisors==0 && $departament!=0) {\n # code...\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get(); \n \n if ($total_stds_departament != null) {\n # code...\n $stds_by_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select('supervisors.name as namesuper', DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->orderBy('supervisors.id_supervisors','desc')\n ->groupBy('supervisors.id_supervisors')\n ->get();\n $stds_by_departament_cohort = Student::join('cohortes', 'students.cohorte','=','cohortes.id')\n ->join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'), DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n \n if (number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' ('. number_format($total_stds_departament[0]->mendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'('. number_format($total_stds_departament[0]->womendp * 100 / ($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_departament[0]->womendp) .'(%)</td>';\n }\n \n $htmlResumenTotal = '<h2>Resumen de Estudiantes departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">';\n $htmlResumenTotal = $htmlResumenTotal.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament != null && $stds_by_departament_cohort!= null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Supervisor</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->namesuper .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women+$stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/($stdp->women+$stdp->men)) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/($stdp->women+$stdp->men)) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n \n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds).'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_departament[0]->mendp+$total_stds_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n\n \n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n \n //$htmlResumenTotal = ''.$stds_by_super_departament;\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else if ($supervisors!=0 && $departament!=0) {\n # code...\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $name_departament = $this->getNameDepartament($departament);\n $total_stds_super_departament = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('COUNT(case when students.gender = 1 then 1 end) as mendp'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as womendp'))\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->get();\n $stds_by_super_departament_cohort = Student::join('headquarters','students.headquarter','=','headquarters.id_headquarters')\n ->join('teams','headquarters.team', '=', 'teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality','teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament','municipality.id_departament', '=', 'departament.id_departament')\n ->select(DB::raw('year(students.created_at) as anio'),DB::raw('COUNT(*) as totalstds'), DB::raw('COUNT(case when students.gender = 1 then 1 end) as men'),DB::raw('COUNT(case when students.gender = 2 then 1 end) as women'))\n ->where('supervisors.id_supervisors',$supervisors)\n ->where('departament.id_departament', $departament)\n ->where(DB::raw('year(students.created_at)'),$yearsData)\n ->groupBy(DB::raw('year(students.created_at)'))\n ->get();\n if ($total_stds_super_departament!= null) {\n # code...\n\n if (number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)!=0) {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' ('. number_format($total_stds_super_departament[0]->mendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'('. number_format($total_stds_super_departament[0]->womendp * 100 / ($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp)) .'%)</td>';\n } else {\n # code...\n $tablesresult = '<td class=\"color-indico\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\">'. number_format($total_stds_super_departament[0]->mendp) .' (%)</td>\n <td class=\"color-orange\">'. number_format($total_stds_super_departament[0]->womendp) .'(%)</td>';\n }\n $htmlResumenTotal = '<h2>Resumen de Estudiantes supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament.' de año: '.$yearsData.'</h2>\n <div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Total Estudiantes</th>\n <th>Hombres</th>\n <th>Mujeres</th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"numbers\">'.$tablesresult.'\n \n </tr>\n </tbody>\n </table>\n </div>';\n if ($stds_by_super_departament_cohort!=null) {\n # code...\n $htmlResumenTotal = $htmlResumenTotal.'<div style=\"margin-bottom: 20px;\" class=\"table-responsive\">\n <table class=\"table\" style=\"width:100%\">\n <thead>\n <tr>\n <th>Año</th>\n <th style=\"text-align:right;\">Hombres</th>\n <th style=\"text-align:right;\">Mujeres</th>\n <th style=\"text-align:right;\">Total</th>\n <th style=\"text-align:right;\">% Hombres</th>\n <th style=\"text-align:right;\">% Mujeres</th>\n </tr>\n </thead>\n <tbody>';\n foreach ($stds_by_super_departament_cohort as $stdp) {\n # code...\n $htmlResumenTotal=$htmlResumenTotal.'\n <tr>\n <td>'. $stdp->anio .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->totalstds) .'</td>\n <td style=\"text-align:right;\">'. number_format($stdp->men*100/$stdp->totalstds) .'%</td>\n <td style=\"text-align:right;\">'. number_format($stdp->women*100/$stdp->totalstds) .'%</td>\n </tr>\n ';\n }\n $htmlResumenTotal = $htmlResumenTotal.'\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($total_stds_super_departament[0]->mendp+$total_stds_super_departament[0]->womendp) .'</td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n <td class=\"color-blue\" style=\"font-size:16px;\"></td>\n </tr>\n </tbody>\n </table>\n </div>';\n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n }\n \n } else {\n # code...\n $htmlResumenTotal='<h2> No existen datos </h2>';\n } \n \n }\n } else {\n # code...\n }\n }\n return $htmlResumenTotal;\n }", "public function run()\n {\n $records = [\n [\n 1,\n \"bibendum ullamcorper. Duis cursus, diam\",\n \"Mary\",\n \"8.52\",\n \"2017-01-27\",\n 5,\n \"O4Z 8B7\",\n 4,\n 1,\n \"Nunc ut\",\n 34,\n 1,\n 3,\n \"2018-07-08\",\n 3,\n \"Stacey\",\n \"2017-12-17\",\n 0,\n \"DLD48QLXRP\",\n 2020,\n 'Town',\n 10.22\n ],\n [\n 2,\n \"eu neque\",\n \"Hilary\",\n \"5.73\",\n \"2017-10-01\",\n 2,\n \"Q8P 7H4\",\n 4,\n 1,\n \"sollicitudin adipiscing ligula.\",\n 139,\n 0,\n null,\n null,\n 1,\n \"Sara\",\n \"2017-01-24\",\n 0,\n \"YMQ15QJ5AZ\",\n 2018,\n 'State',\n 10.22\n ],\n [\n 3,\n \"varius. Nam porttitor scelerisque neque. Nullam\",\n \"Noah\",\n \"2.93\",\n \"2017-07-13\",\n 3,\n \"A6V 2I1\",\n 5,\n 4,\n \"mattis semper, dui lectus\",\n 158,\n 1,\n 1,\n \"2018-02-02\",\n 2,\n \"Griffin\",\n \"2017-01-10\",\n 1,\n \"YWK78JJ5HZ\",\n 2019,\n 'Town',\n 5.22\n ],\n [\n 4,\n \"Etiam ligula\",\n \"Alana\",\n \"6.48\",\n \"2016-12-22\",\n 3,\n \"N0G 9K9\",\n 2,\n 4,\n \"egestas. Fusce\",\n 221,\n 1,\n 1,\n \"2018-02-24\",\n 3,\n \"Georgia\",\n \"2017-04-23\",\n 1,\n \"IUC41XA0JC\",\n 2025,\n 'Town',\n 0.00\n ],\n [\n 5,\n \"arcu. Sed et\",\n \"Avram\",\n \"6.78\",\n \"2017-12-31\",\n 4,\n \"C2M 8V4\",\n 5,\n 3,\n \"scelerisque scelerisque dui.\",\n 160,\n 0,\n null,\n null,\n 2,\n \"Deacon\",\n \"2017-10-22\",\n 1,\n \"AJU13OV8UJ\",\n 2024,\n 'State',\n 50.00\n ],\n [\n 6,\n \"odio a purus. Duis elementum, dui quis\",\n \"Rosalyn\",\n \"2.61\",\n \"2018-02-07\",\n 2,\n \"Z1C 7Z0\",\n 1,\n 3,\n \"sed pede nec ante\",\n 64,\n 1,\n 1,\n \"2018-10-09\",\n 2,\n \"Jasper\",\n \"2017-01-03\",\n 0,\n \"KGE89KI6DU\",\n 2019,\n 'Federal',\n 9.402\n ],\n [\n 7,\n \"magna. Ut tincidunt orci quis lectus. Nullam, est\",\n \"Althea\",\n \"7.57\",\n \"2018-08-16\",\n 5,\n \"L9T 3Y5\",\n 5,\n 1,\n \"lacinia orci, consectetuer euismod est\",\n 128,\n 0,\n null,\n null,\n 2,\n \"Marvin\",\n \"2017-09-20\",\n 1,\n \"GLW83AB1OV\",\n 2025,\n 'Town',\n 6.49\n ],\n [\n 8,\n \"lectus sit\",\n \"Christopher\",\n \"5.74\",\n \"2018-08-26\",\n 1,\n \"U9Y 6H2\",\n 3,\n 2,\n \"tristique neque venenatis\",\n 219,\n 1,\n 2,\n \"2017-08-03\",\n 1,\n \"Amity\",\n \"2018-09-17\",\n 0,\n \"KUU44PCBMV\",\n 2017,\n 'State',\n 7.43\n ],\n [\n 9,\n \"faucibus orci luctus et ultrices posuere; Donec\",\n \"Rogan\",\n \"3.63\",\n \"2018-03-08\",\n 3,\n \"E5P 2S8\",\n 2,\n 4,\n \"neque pellentesque massa lobortis\",\n 127,\n 1,\n 3,\n \"2018-10-12\",\n 3,\n \"Hedwig\",\n \"2017-06-25\",\n 0,\n \"EXV74CV0ZZ\",\n 2021,\n 'Federal',\n 2.32\n ],\n [\n 10,\n \"pede et risus. Quisque\",\n \"Caesar\",\n \"1.58\",\n \"2017-08-26\",\n 4,\n \"F8O 2P4\",\n 2,\n 4,\n \"Donec vitae erat vel\",\n 171,\n 0,\n null,\n null,\n 1,\n \"Emery\",\n \"2017-06-24\",\n 0,\n \"YKN72ZQ6NI\",\n 2018,\n 'State',\n 10.22\n ],\n [\n 11,\n \"sapien imperdiet ornare. In faucibus.\",\n \"Caleb\",\n \"6.85\",\n \"2017-04-16\",\n 1,\n \"N6K 1T6\",\n 2,\n 1,\n \"non, feugiat nec, diam. Duis\",\n 202,\n 0,\n null,\n null,\n 1,\n \"Cora\",\n \"2018-04-05\",\n 1,\n \"UDO93WDR8G\",\n 2020,\n 'State',\n 10.22\n ],\n [\n 12,\n \"Nunc sed orci lobortis\",\n \"Nathan\",\n \"3.95\",\n \"2016-11-24\",\n 2,\n \"Q5Y 8W3\",\n 4,\n 1,\n \"a, malesuada id, erat. Etiam\",\n 81,\n 0,\n null,\n null,\n 2,\n \"Damian\",\n \"2018-05-03\",\n 0,\n \"QM48OHY0NI\",\n 2018,\n 'State',\n 10.22\n ],\n [\n 13,\n \"porttitor interdum. Sed auctor odio a\",\n \"Selma\",\n \"2.10\",\n \"2018-06-05\",\n 4,\n \"X5T 3A1\",\n 1,\n 2,\n \"Nunc mauris. Morbi\",\n 105,\n 0,\n null,\n null,\n 3,\n \"Freya\",\n \"2017-10-30\",\n 0,\n \"EFH52JMO6M\",\n 2019,\n 'State',\n 10.22\n ],\n [\n 14,\n \"Duis cursus, diam at pretium aliquet, metus erat\",\n \"Gloria\",\n \"1.23\",\n \"2017-01-29\",\n 2,\n \"U2V 1A7\",\n 2,\n 4,\n \"dictum mi, ac mattis\",\n 121,\n 0,\n null,\n null,\n 2,\n \"Jerome\",\n \"2018-09-18\",\n 1,\n \"DCT55JIU2C\",\n 2018,\n 'State',\n 10.22\n ],\n [\n 15,\n \"lobortis risus. In mi pede, nonummy ut, molestie\",\n \"Oprah\",\n \"1.76\",\n \"2017-01-31\",\n 3,\n \"D9X 1F4\",\n 4,\n 3,\n \"faucibus leo, in lobortis tellus\",\n 124,\n 0,\n null,\n null,\n 5,\n \"Barclay\",\n \"2018-03-15\",\n 0,\n \"EQH65GTE4L\",\n 2018,\n 'State',\n 10.22\n ],\n [\n 16,\n \"sem. Pellentesque ut ipsum ac mi eleifend egestas.\",\n \"Jade\",\n \"8.02\",\n \"2017-06-20\",\n 5,\n \"U7B 7Q0\",\n 2,\n 4,\n \"id enim. Curabitur massa.\",\n 125,\n 1,\n 1,\n \"2017-12-22\",\n 3,\n \"Bruno\",\n \"2018-09-15\",\n 0,\n \"LAR03LAD1M\",\n 2022,\n 'State',\n 10.22\n ],\n [\n 17,\n \"diam vel arcu. Curabitur ut odio vel est tempor\",\n \"Britanni\",\n \"2.07\",\n \"2016-12-24\",\n 5,\n \"J6Y 6N0\",\n 5,\n 4,\n \"Fusce\",\n 220,\n 0,\n null,\n null,\n 2,\n \"Sybill\",\n \"2017-03-16\",\n 1,\n \"ZLH43DGE0L\",\n 2024,\n 'State',\n 10.22\n ],\n [\n 18,\n \"ut\",\n \"Amal\",\n \"1.27\",\n \"2017-05-17\",\n 4,\n \"G1C 2N9\",\n 1,\n 3,\n \"lobortis\",\n 235,\n 0,\n null,\n null,\n 5,\n \"Risa\",\n \"2018-04-27\",\n 0,\n \"TZD23DXK0U\",\n 2022,\n 'State',\n 10.22\n ],\n [\n 19,\n \"molestie. Sed id risus quis diam luctus lobortis.\",\n \"Nolan\",\n \"2.25\",\n \"2018-08-21\",\n 2,\n \"G1I 9I7\",\n 5,\n 1,\n \"ridiculus\",\n 155,\n 1,\n 3,\n \"2018-06-05\",\n 4,\n \"Eleanor\",\n \"2017-06-13\",\n 0,\n \"IPG08DQI2O\",\n 2022,\n 'State',\n 10.22\n ],\n [\n 20,\n \"rutrum\",\n \"Basil\",\n \"3.25\",\n \"2016-12-25\",\n 5,\n \"Y7H 2K2\",\n 3,\n 3,\n \"mi enim, condimentum eget, volutpat\",\n 195,\n 1,\n 3,\n \"2018-04-28\",\n 5,\n \"Winter\",\n \"2018-08-16\",\n 0,\n \"EAU79FKK8Y\",\n 2023,\n 'State',\n 10.22\n ]\n ];\n\n $count = count($records);\n\n foreach ($records as $key => $record) {\n Asset::insert([\n 'created_at' => Carbon\\Carbon::now()->subDays($count)->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->subDays($count)->toDateTimeString(),\n 'description' => $record[1],\n 'owner' => $record[2],\n 'purchase_price' => $record[3],\n 'purchase_date' => $record[4],\n 'group_id' => $record[5],\n 'serial_number' => $record[6],\n 'location_id' => $record[7],\n 'warranty_id' => $record[8],\n 'notes' => $record[9],\n 'estimated_life_months' => $record[10],\n 'is_out_of_service' => $record[11],\n 'out_of_service_id' => $record[12],\n 'out_of_service_date' => $record[13],\n 'vendor_id' => $record[14],\n 'assigned_to' => $record[15],\n 'assigned_date' => $record[16],\n 'is_computer' => $record[17],\n 'tag' => $record[18],\n 'scheduled_retirement_year' => $record[19],\n 'funding_source' => $record[20],\n 'percent_federal_participation' => $record[21]\n ]);\n $count--;\n }\n }", "public function index()\n {\n $user = Auth::user();\n //Check if user has permission to view academic year\n $isAuthorized = app('App\\Http\\Controllers\\UserPrivilegeController')->checkPrivileges($user->id, Config::get('settings.academic_year_management'), 'read_priv');\n if ($isAuthorized) {\n $academic_years = AcademicYear::all();\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Viewed the list of academic years.',\n 'time' => Carbon::now()\n ]);\n return $academic_years;\n }else {\n //record in activity log\n $activityLog = ActivityLog::create([\n 'user_id' => $user->id,\n 'activity' => 'Attempted to view the list of academic years.',\n 'time' => Carbon::now()\n ]);\n return response()->json([\n 'message' => 'You are not authorized to view academic years records.'\n ],401); //401: Unauthorized\n }\n }", "function getStudentReport( $datetypeselect, $startdate, $enddate, $classyear,\r\n\t\t\t\t $residenceselect, $ethnic, $userselect, $watched, $redflag, $vip,\r\n\t\t\t\t $acpro, $housingwaitlist, $field1, $field2, $field3 ) {\r\n\t\t\r\n\t\t$userid = $_SESSION['userid'];\r\n\t\t\r\n\t\tif( $datetypeselect == 0 ) $left = \"left\";\r\n\t\t\r\n\t\t\r\n\t\tif( $startdate ) $datestuff .= \" and c.datecreated >= '\".getMySqlDate( $startdate ).\" 00:00:00'\";\r\n\t\tif( $enddate ) $datestuff .= \" and c.datecreated <= '\".getMySqlDate( $enddate ).\" 23:59:59'\";\r\n\t\t\r\n\t\t$query = \"\r\n\t\t\tSELECT x.ID,\r\n\t\t\t concat( x.LAST_NAME, ', ', x.FIRST_NAME, ' ', x.MIDDLE_NAME ) as FullName,\r\n\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as AssignedToName,\r\n\t\t\t s.AssignedTo,\r\n\t\t\t x.ENROLL_STATUS,\r\n\t\t\t x.CAMPUS_PHONE,\r\n\t\t\t x.CELL_PHONE,\r\n\t\t\t x.WOOSTER_EMAIL,\r\n\t\t\t x.PRIMARY_EMAIL,\r\n\t\t\t x.CAMPUS_BOX,\r\n\t\t\t x.CLASS_YEAR,\r\n\t\t\t s.AcProbation,\r\n\t\t\t s.HousingWaitList,\r\n\t\t\t s.Field1,\r\n\t\t\t s.Field2,\r\n\t\t\t s.Field3,\r\n\t\t\t s.VIP,\r\n\t\t\t s.RedFlag,\r\n\t\t\t x.HOME_PHONE,\r\n\t\t\t concat( x.HOUSING_BLDG, ' ', x.HOUSING_ROOM ) as HousingAssignment,\r\n\t\t\t x.ETHNIC,\r\n\t\t\t x.ADVISOR\r\n\t\t\tFROM X_PNSY_STUDENT x, students s, users u, contacts c, `contacts-students` cs\r\n\t\t\tWHERE x.ID = s.StudentID AND cs.ContactID = c.ID $datestuff AND cs.StudentID = x.ID\r\n\t\t\tAND s.StudentID IN (SELECT ID FROM X_PNSY_STUDENT WHERE ID = s.StudentID)\r\n\t\t\";\r\n\t\t\r\n\t\tif( $classyear ) $query .= \" and x.CLASS_YEAR = '$classyear'\";\r\n\r\n\t\tif( $residenceselect ) $query .= \" and x.HOUSING_BDLG = '$residenceselect'\";\r\n\t\tif( $userselect ) $query .= \" and s.assignedto = '$userselect'\";\r\n\t\tif( isset($watched) ) $query .= \" and x.ID in (select studentid from studentwatch where userid = '$userid')\";\r\n\t\tif( isset($redflag) ) $query .= \" and s.redflag != ''\";\r\n\t\tif( isset($vip) ) $query .= \" and s.vip != ''\";\r\n\t\tif( isset($acpro) ) $query .= \" and s.acprobation = 1\";\r\n\t\tif( isset($housingwaitlist) ) $query .= \" and s.housingwaitlist = 1\";\r\n\t\tif( isset($field1) ) $query .= \" and s.Field1 = 1\";\r\n\t\tif( isset($field2) ) $query .= \" and s.Field2 = 1\";\r\n\t\tif( isset($field3) ) $query .= \" and s.Field3 = 1\";\r\n\t\t$query .= \" group by x.ID order by x.LAST_NAME\";\r\n\t\t\t\t\r\n\t\t$return = array();\r\n\t\t$result = mysql_query( $query );\r\n\t\twhile( $row = mysql_fetch_assoc( $result ) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\t\r\n\t\tforeach( $return as $rowNumber => $row ) {\r\n\t\t\t\r\n\t\t\t// include the number of contacts\r\n\t\t\t$query = \"select count(*) as NumContacts from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct contactid from `contacts-students` cs\r\n\t\t\t\t\twhere cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContacts'] = $numContactsArray['NumContacts'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContacts'] = false;\r\n\t\t\t\r\n\t\t\t// include the number of contacts in the date range\r\n\t\t\t$query = \"select count(*) as NumContactsInRange from contacts\r\n\t\t\t\t where id in (\r\n\t\t\t\t \tselect distinct c.id from contacts c\r\n\t\t\t\t\tjoin `contacts-students` cs\r\n\t\t\t\t\ton cs.contactid = c.id\r\n\t\t\t\t\tand cs.studentid = '\".$row['ID'].\"'$datestuff\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\tif( $numContactsArray = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\t$return[$rowNumber]['NumContactsInRange'] = $numContactsArray['NumContactsInRange'];\r\n\t\t\t}\r\n\t\t\telse $return[$rowNumber]['NumContactsInRange'] = false;\r\n\t\t\t\r\n\t\t\t// include all the users associated with the contacts\r\n\t\t\t$query = \"select distinct u.ID,\r\n\t\t\t\t\t concat( u.LastName, ', ', u.FirstName, ' ', u.MiddleIn ) as FullName,\r\n\t\t\t\t\t u.Email\r\n\t\t\t\t from users u, `contacts-users` cu, `contacts-students` cs, contacts c\r\n\t\t\t\t where u.id = cu.userid\r\n\t\t\t\t and cu.contactid = cs.contactid\r\n\t\t\t\t and cs.studentid = '\".$row['ID'].\"'\r\n\t\t\t\t and cs.contactid = c.id$datestuff\r\n\t\t\t\t \";\r\n\t\t\t$usersArray = array();\r\n\t\t\t$result = mysql_query( $query );\r\n\t\t\twhile( $userrow = mysql_fetch_assoc( $result ) ) {\r\n\t\t\t\tarray_push( $usersArray, $userrow );\r\n\t\t\t}\r\n\t\t\t$return[$rowNumber]['Users'] = $usersArray;\r\n\t\t\t\r\n\t\t\t$return[$rowNumber]['StartDate'] = $startdate;\r\n\t\t\t$return[$rowNumber]['EndDate'] = $startdate;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "function index()\n {\n $data['sectionTable'] = $this->Main_model->get('sections', 'id');\n\n //get year level \n $data['yearLevelTable'] = $this->Main_model->get('year_level', 'id');\n\n $this->load->view('includes/header');\n $this->load->view('sections', $data);\n $this->load->view('includes/footer');\n }", "private function organizations(){\n $presidents = $this->base_model->getEmployee('President');\n foreach ($presidents as $key => $president) {\n $unders = $presidents[$key]['employeeUnder'] = $this->base_model->getEmployeeUnder($president[\"employeeNumber\"]);\n if(!empty($unders)){\n foreach ($unders as $underkey => $under) {\n $undersUnder = $presidents[$key]['employeeUnder'][$underkey]['employeeUnder'] = $this->base_model->getEmployeeUnder($under[\"employeeNumber\"]);\n foreach ($undersUnder as $undersunderkey => $uu) {\n $presidents[$key]['employeeUnder'][$underkey]['employeeUnder'][$undersunderkey]['employeeUnder'] = $this->base_model->getEmployeeUnder($uu[\"employeeNumber\"]);\n }\n }\n }\n }\n\n $this->response($presidents, REST_Controller::HTTP_OK);\n }", "function main()\n{\n\t$research = ResearchService::getAll();\n\tif (!is_null($research)) {\n\t\thttp_response_code(201);\n\t\tJsonDataObject::createResponse($research);\n\t} else {\n\t\thttp_response_code(200);\n\t\tJsonDataObject::createResponse(['error' => 'That user does not exist']);\n\t}\n}", "public function index(Request $request)\n\t{\n\t\t$title = array(\n\t\t\t'active' => self::active,\n\t\t\t'title' => self::title,\n\t\t\t'slug' => self::slug\n\t\t);\n\t\t/******year loop*********/\n\t\t$years = array();\n\t\t$currentYear = (int)date('Y');\n\t\t$oldYear = $currentYear - 20;\n\t\t$years[''] = 'Select';\n\t\tfor($i=$currentYear;$i>=$oldYear;$i--)\n\t\t{\n\t\t\t$years[$i] = $i;\n\t\t}\t\t\n\t\t/******year loop*********/\n\t\t\n\t\t$search = $request->search;\n\t\t$class_id = $request->class_id;\n\t\t$year = $request->year; \n\t\t$users = User::find(auth()->user()->id);\n\t\t$use = auth()->user();\n\t\t$use->companies->id;\n\t\t\n\t\t$class = Classes::whereCompanyId($use->companies->id)->pluck('name', 'id');\t\n\t\t//echo '<pre>'; print_r($class); exit;\n\t\tif($search||$class_id||$year){\n\t\t\t $query = Students::query();\t\t\n\t\t\t $query = $query->leftJoin('classes_students as c', 'students.id', '=', 'c.student_id');\n\t\t\tif($search){\n\t\t\t\t$query = $query->orWhere('surname', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('first_name', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('middle_name', 'like', '%'.$search.'%')\n\t\t\t\t->orWhere('student_no', 'like', '%'.$search.'%');\n\t\t\t}\n\t\t\tif($class_id){\n\t\t\t\t$query = $query->Where('c.class_id', $class_id);\n\t\t\t}\n\t\t\t\n\t\t\tif($year){\n\t\t\t\t$query = $query->Where('c.year', $year);\n\t\t\t}\n\t\t\t\n\t\t\t $students = $query->Where('companies_id', $users->companies->id)->select(['students.*'])\n\t\t\t->paginate(8);\t\t\t\n\t\t}\n\t\telse{\n\t\t\n\t\t$students = Students::whereCompaniesId($users->companies->id)->paginate(8);\n\t\t}\n\t\t$parent = Parents::all();\n\t\t$parentRel = Parent_relations::all();\n\t\treturn view('admin.students.index', compact('title','students','parent','parentRel','search','class','years','class_id','year'));\n\t}", "public function summaryPaymentPrograms2(Request $request, SystemController $sys)\n\n {\n\n\n\n $array = $sys->getSemYear();\n\n $year = $array[0]->YEAR;\n\n\n\n $sql = Models\\StudentModel::select(\"PROGRAMMECODE\", 'YEAR', 'LEVEL')->where(\"SYSUPDATE\", \"1\");\n\n if ($request->has('school') && trim($request->input('school')) != \"\") {\n\n\n\n $sql->whereHas('departments', function ($q) use ($request) {\n\n\n\n $q->whereHas('school', function ($q) use ($request) {\n\n $q->whereIn('FACCODE', [$request->input('school')]);\n\n });\n\n });\n\n\n\n }\n\n if ($request->has('program') && trim($request->input('program')) != \"\") {\n\n $sql->where(\"PROGRAMMECODE\", $request->input(\"program\", \"\"));\n\n }\n\n if ($request->has('department') && trim($request->input('department')) != \"\") {\n\n $sql->where(\"DEPTCODE\", $request->input(\"department\", \"\"));\n\n }\n\n if ($request->has('type') && trim($request->input('type')) != \"\") {\n\n $sql->where(\"TYPE\", $request->input(\"TYPE\", \"\"));\n\n }\n\n $data = $sql->orderBy(\"PROGRAMMECODE\")->orderBy(\"YEAR\")->groupBy(\"PROGRAMMECODE\")\n\n ->groupBy(\"YEAR\")\n\n ->paginate(10000);\n\n\n\n\n\n return view(\"finance.reports.paymentByPrograms\")\n\n ->with(\"data\", $data)\n\n ->with(\"year\", $year)\n\n ->with('department', $sys->getDepartmentList())\n\n ->with('school', $sys->getSchoolList())\n\n ->with('programme', $sys->getProgramList())\n\n ->with('type', $sys->getProgrammeTypes());\n\n }", "function recommends_req_wizard_next_submit($form, &$form_state) {\n\n $current_step = &$form_state['step'];\n $form_state['step_information'][$current_step]['stored_values'] = $form_state['values'];\n \n/////////////// \nif ($form_state['step'] == 1) {\n \n $format = variable_get('date_format_long', 'l, F j, Y - H:i');\n date_default_timezone_set('America/New_York');\n $date = date(\"c\") ;\n $timestamp = substr($date,0,19); \n \n $form_state['prefix'] = $form_state['values']['prefix'];\n $form_state['firstname'] = $form_state['values']['first_name'] ;\n $form_state['lastname'] = $form_state['values']['last_name'];\n $form_state['initial'] = $form_state['values']['initial'];\n $form_state['suffix'] = $form_state['values']['suffix'] ;\n $form_state['s_email'] = $form_state['values']['email'];\n $form_state['s_school'] = \"Clayton\";\n $form_state['s_req_date'] = $timestamp;\n $form_state['s_master_doc'] = $form_state['values']['reqby'] ;\n $form_state['s_comments'] = $form_state['values']['comments'] ;\n $form_state['s_timestamp'] = $timestamp;\n }\n \n if ($form_state['step'] == 2) {\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n \t\t$form_state['schoolname'][$i] = $form_state['values']['schname'][$i]['schoolname'];\n \t\t$form_state['schoolprogram'][$i] = $form_state['values']['schname'][$i]['schoolprogram'];\n \t\t\n \t\t$form_state['r_school_contact_email'][$i] = $form_state['values']['schname'][$i]['school_contact_email'];\n \t\t$form_state['r_school_contact_postal'][$i] = $form_state['values']['schname'][$i]['school_contact_postal'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['month'] = $form_state['values']['schname'][$i]['r_date_due']['month'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['day'] = $form_state['values']['schname'][$i]['r_date_due']['day'];\n \t\t$form_state['r_date_due'][$i]['year'] = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \t\t\n \t\t\n };\n }\n \n if ($form_state['step'] == 3) {\n if ($form_state['num_courses'] == 0) {\n drupal_goto('recommends_req/wizard/intro');\n }\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n \t\t$pid = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_pid'];\n \t\t\n \t\n \t\t\n \t\tif (in_array($pid, $form_state['entries'])) {\n \t\t\n \t\t\n \t\t $form_state['coursenum'][$i] = $form_state['entries'][$pid]->i_course;\n \t\t $form_state['coursesemester'][$i] = $form_state['entries'][$pid]->i_semester;\n \t\t $form_state['courseyear'][$i] = $form_state['entries'][$pid]->i_year;\n \t\t $form_state['courseother'][$i] = \" \";\n \t\t} else\n \t\t{\n \t\t $form_state['coursenum'][$i] = $form_state['complete form']['crsname'][1]['i_pid']['#options'][$pid];\n \t\t $form_state['coursesemester'][$i] = \"NA\";\n \t\t $form_state['courseyear'][$i] = \"NA\";\n \t\t $form_state['courseother'][$i] = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_other']; \n \t\t}\n \t\t\n \t\t\n };\n }\n \n if ($current_step < count($form_state['step_information'])) {\n $current_step++;\n if (!empty($form_state['step_information'][$current_step]['stored_values'])) {\n $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];\n }\n else {\n $form_state['values'] = array();\n }\n $form_state['rebuild'] = TRUE; // Force rebuild with next step.\n return;\n }\n}", "protected function getYears()\n {\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = mysql_real_escape_string( trim( $kinst ) ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = mysql_real_escape_string( trim( $params ) ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.YEAR\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t}\n\n\t$query .= \" ORDER BY d.YEAR ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "public function loadDataById($doctor_mcr=''){\n\t\t$this->db->select(\"D.description as profile_description,D.ID as doctor_id,D.mcr as doctor_mcr,IF(D.title='Other',D.title_other,D.title) as title,D.name as name,IF(D.position='Other',D.position_other,D.position) as position,D.image,D.primary_specialty_code,DS.name as primary_specialty_name,D.specialty_code,D.professional_exp_year as professional_experience\");\n $this->db->select(\"HL.code as hospital_location_code,HL.name as hospital_location_name\");\n $this->db->from($this->main_table.\" as D\");\n $this->db->join(\"hospital_location as HL\", \"HL.ID=D.hospital_location_id\", \"LEFT\");\n $this->db->join(\"doctor_specialization as DS\", \"DS.code=D.primary_specialty_code\", \"LEFT\");\n $this->db->where(\"D.mcr\",$doctor_mcr);\n\t\t$this->db->where(\"D.show_status\",1);\n $this->db->where(\"D.is_deleted\",0);\n $result=$this->db->get()->row();\n $result_education[]=array();\n $result_experience[]=array();\n if($result){\n $this->db->select(\"from_year,to_year,description\");\n $this->db->from(\"doctor_experience\");\n $this->db->where(\"doctor_id\",$result->doctor_id);\n $this->db->where(\"is_deleted\",0);\n $result_experience=$this->db->get()->result();\n \n $this->db->select(\"from_year,to_year,description\");\n $this->db->from(\"doctor_education\");\n $this->db->where(\"doctor_id\",$result->doctor_id);\n $this->db->where(\"is_deleted\",0);\n $result_education=$this->db->get()->result();\n\n $this->db->select(\"from_year,to_year,description\");\n $this->db->from(\"doctor_others_certificate_awards\");\n $this->db->where(\"doctor_id\",$result->doctor_id);\n $this->db->where(\"is_deleted\",0);\n $result_certificate_awards=$this->db->get()->result();\n \n $result->educations=$result_education;\n $result->experiences=$result_experience;\n $result->certificate_awards=$result_certificate_awards;\n \n unset($result->doctor_id);\n }\n \n return $result;\n }", "public function get_data_avt130($studCom)\n {\n\n $training_org = TrainingOrganisation::first();\n // dd($training_org);\n // $sc = new StudentCompletion;\n // $studCom = $sc->avetmiss_compliant($dateFrom, $dateTo, $reportTo);\n\n $data = [];\n\n foreach($studCom as $val){\n if($val->completion_status_id == 3){\n $data[$val->id] = $val->toArray();\n $data[$val->id]['certificate'] = isset($val->certificate->id) ? $val->certificate->toArray() : null;\n $data[$val->id]['organisation'] = $training_org->toArray();\n }\n }\n\n // dd($data);\n return $data;\n \n // return collect( json_decode( json_encode( DB::select(DB::raw(\"SELECT\n // \t (SELECT `org_identifier` FROM `vrx_organisation_info`) AS train_org_identifier,\n // CONCAT('2019', vrx_student_info.uniq_stud_identifier) AS client_identifier,\n // vrx_courses.code prg_identifier,\n // DATE_FORMAT(`vrx_student_completion_details`.end_date,'%d%m%Y') AS date_prg_completed,\n // DATE_FORMAT(`vrx_student_completion_details`.end_date,'%Y') AS year_prg_completed,\n // 'Y' AS issued_flag\n // -- vrx_party.name AS fullname\n // FROM vrx_student_completion\n // INNER JOIN vrx_student_completion_details ON vrx_student_completion_details.student_completion_id = vrx_student_completion.id\n // -- INNER JOIN vrx_users ON (vrx_training_schedule.trainer_id = vrx_users.id)\n // INNER JOIN vrx_courses ON vrx_courses.code = vrx_student_completion.course_code\n // -- INNER JOIN vrx_stud_train_sched ON (vrx_training_schedule.id = vrx_stud_train_sched.schedule_id)\n // -- INNER JOIN vrx_deals ON (vrx_deals.id = vrx_stud_train_sched.deal_id)\n // INNER JOIN vrx_persons ON vrx_persons.id = vrx_student_completion.persons_id\n // INNER JOIN vrx_party ON vrx_party.id = vrx_persons.party_id\n // INNER JOIN vrx_deals ON vrx_deals.party_id = vrx_party.id\n // INNER JOIN vrx_deal_details ON (vrx_deals.id = vrx_deal_details.deal_id)\n // INNER JOIN vrx_enrolments ON (vrx_deals.id = vrx_enrolments.deal_id)\n // INNER JOIN vrx_student_info ON (vrx_student_info.person_id = vrx_persons.id)\n // -- INNER JOIN vrx_party ON (vrx_party.id = vrx_deals.party_id)\n // -- INNER JOIN vrx_persons ON (vrx_persons.party_id = vrx_party.id)\n // INNER JOIN vrx_address ON (vrx_address.party_id = vrx_party.id)\n // -- INNER JOIN vrx_training_plan ON (vrx_training_plan.deal_id = vrx_deals.id)\n // INNER JOIN vrx_opportunities ON (vrx_opportunities.deal_id = vrx_deals.id)\n // WHERE\n // vrx_student_completion_details.end_date BETWEEN '{$dateFrom}' AND '{$dateTo}'\n // AND vrx_student_info.uniq_stud_identifier IS NOT NULL\n // -- AND vrx_training_schedule.status_id = 6\n // AND vrx_student_completion.completion_date IS NOT NULL\n // AND vrx_student_completion.deleted_at IS NULL\n // AND vrx_student_completion.completion_status_id = 3\n // AND vrx_deals.deleted_at IS NULL\n // AND vrx_courses.code != '1111'\n // -- AND vrx_training_plan.deleted_at IS NULL\n // -- AND vrx_stud_train_sched.stud_stat_id IN (3)\n // GROUP BY\n // vrx_deals.id\n // ORDER BY\n // vrx_student_completion_details.end_date\")) ), true ) );\n }", "public static function generate()\n {\n $data = array();\n foreach (College::all() as $college) {\n # $current = The current year\n # $should = How many actieve assessors there is needed at the end of the year\n # $count = Count of all the active assessors\n $data[$college->id] = array(\n 'current' => date('Y'),\n 'should' => 1 + round(Assessors::where('fk_college', $college->id)->where('status', 1)->count() / 100 * 110),\n 'count' => Assessors::where('fk_college', $college->id)->where('status', 1)->count()\n );\n }\n return $data;\n }", "public function getTrainingData($ExEc = NULL){\r\n $this->db->select('T.*,D.name as designationname,D.cat_id,S.name as subjectname,r.name as rolename,re.name as region,sc.name as school,DATE_FORMAT(T.t_from1,\"%d-%m-%Y\") as t_from1,DATE_FORMAT(T.t_from2,\"%d-%m-%Y\") as t_from2,DATE_FORMAT(T.t_from3,\"%d-%m-%Y\") as t_from3,DATE_FORMAT(T.t_from4,\"%d-%m-%Y\") as t_from4,DATE_FORMAT(T.t_to1,\"%d-%m-%Y\") as t_to1,DATE_FORMAT(T.t_to2,\"%d-%m-%Y\") as t_to2,DATE_FORMAT(T.t_to3,\"%d-%m-%Y\") as t_to3,DATE_FORMAT(T.t_to4,\"%d-%m-%Y\") as t_to4');\r\n $this->db->from('ci_training_details as T');\r\n $this->db->join('designations D', 'D.id=T.designation', 'LEFT');\r\n $this->db->join('subjects S', 'S.id=T.subject', 'LEFT');\r\n $this->db->join('roles r', 'r.id=T.venuetype', 'LEFT');\r\n $this->db->join('regions re', 're.id=T.venueregion', 'LEFT');\r\n $this->db->join('schools sc', 'sc.id=T.venueschool', 'LEFT');\r\n if(!empty($ExEc)){\r\n $this->db->where('T.emp_id', $ExEc);\r\n }\r\n return $this->db->get()->result(); \r\n }", "function getStudentInformation($STID){\n //By default, put nothing in here.\n\t\t$already_completed_parental_application=\"\";\t\t\n $housing_app_completed_in_system=\"\";\n $first_name=\"\";\n $last_name=\"\";\n $middle_name=\"\";\n $student_ID = \"\";\n $student_DATE_OF_BIRTH = \"\";\n $parental_email_address = \"\";\n $student_app_date = \"\";\n\n\n //As long as there is something in the search.\n while($row=oci_fetch_array($STID,OCI_ASSOC)){\n\t\t //Check whether or not they have already completed the Parental Agreement and if they have,\n //use this field to keep them from progressing forward within this application to move forward. (Onward to Page2.php)\n $already_completed_parental_application=$row[\"NC_SH_PRNTL_APPRVL\"];\n //Check whether or not they have a completed housing application on file.\n $housing_app_completed_in_system=$row[\"SS_STAT_INDICATOR\"];\n //Assign first name from the query lookup.\n $first_name = $row[\"FIRST_NAME\"];\n //Assign last name from the query lookup.\n $last_name = $row[\"LAST_NAME\"];\n //Assign middle name from the query lookup.\n $middle_name = $row[\"MIDDLE_NAME\"];\n //Assign the ID from the query lookup.\n $student_ID = $row[\"EMPLID\"];\n //Assign the student DOB to the query lookup.\n $student_DATE_OF_BIRTH = $row[\"BIRTHDATE\"];\n //Assign the email\n $parental_email_address = $row[\"EMAIL_ADDR\"];\n //Assign the application date\n $student_app_date_temp = $row[\"NC_PROCESS_DTTM\"];\n\t\t \n\t\t //For whatever reason, if there is a \" \" (BLANK) in the field, lets write blank, as it \n\t\t //will trigger the condition if the end-user does not have any information within the \"SS_STAT_INDICATOR\" field.\n\t\t //Create a condition that writes the word \"BLANK\" if there is nothing in the field.\n\t\t\t\n\t\t\t//Fields this affects\n\t\t\t//NC_SH_PRNTL_APPRVL (WHETHER THE END USER HAS ALREADY COMPLETED THIS WEB APPLICATION)\n\t\t\t//SS_STAT_INDICATOR (WHETHER THE STUDENT HAS A COMPLETED HOUSING APPLICATION)\n\t\t\t//MIDDLE_NAME (FOR SOME WILD REASON THE QUERY DOES NOT PULL A MIDDLE NAME FOR THE STUDENT).\t\t\t\n\t\t\t\n\t\t\t//Untouched below...\n\t\t\t/*\n\t\t\tif ($already_completed_parental_application==\" \"||$housing_app_completed_in_system==\" \"||$middle_name==\" \"){\n\t\t\t\t $already_completed_parental_application=\"BLANK\"; //Assign the word, BLANK, to whether or not the end user has completed this web application. \n $housing_app_completed_in_system=\"BLANK\";\t//Assign the word, BLANK, to the housing application status in MyPack Portal.\n\t\t\t\t $middle_name=\"BLANK\"; //Assign the word, BLANK, to the middle name pulled (remember to remove this on page3.php when it is displayed back to the user.)\n\t\t }\n\t\t\t*end untouched.\n\t\t\t*/\n\t\t\t//Changes added for the above wrong condition on 02/01/2016.\n\t\t\t//If the field for NC_SH_PRNTL_APPRVL is blank, set the value that's sent back to PAGE1 to BLANK.\n\t\t\tif ($already_completed_parental_application==\" \"){\n\t\t\t$already_completed_parental_application=\"BLANK\"; //Assign the word, BLANK, to whether or not the end user has completed this web application.\n\t\t\t}\n\t\t\t//If the SS_STAT_INDICATOR is blank, set the value that's sent back to PAGE1 to BLANK.\n\t\t\telse if($housing_app_completed_in_system==\" \"){\n\t\t\t$housing_app_completed_in_system=\"BLANK\";\t//Assign the word, BLANK, to the housing application status in MyPack Portal.\n\t\t\t}\n\t\t\t//If the Middle Name is blank, set the value back to Page1 to BLANK.\n\t\t\telse if($middle_name==\" \"){\n\t\t\t\t$middle_name=\"BLANK\";\n\t\t\t}\n\t\t\t//End changes on 02/01/2016.\t\t\n\t\t\t\n\t\t\t\n //End creating a condition...\n\t\t \n\t\t \n\t\t \n }\n\t\t\n\t\t //FORMAT OF NC_PROCESS_DTTM IS DD-MM-YY H:i:s.00000000 AM\n\t\t //Only return a set amount of information.\n\t\t //SHOULD RETURN DD-MM-YY\n\t\t $date_of_application_formatted = substr($student_app_date_temp,0,9);\n\t\t $student_app_date = $date_of_application_formatted;\n\t\t\n\t\t\n //Return information from the database lookup.\n //return $already_completed_parental_application.\" \".$housing_app_completed_in_system.\" \".$first_name.\" \".$last_name.\" \".$middle_name.\" \".$student_ID.\" \".$student_DATE_OF_BIRTH.\" \".$parental_email_address.\" \".$student_app_date;\n\t\t\n\t\t//To prevent empty fields from breaking the communication between this file and the scripts/checkInformation.js that is \n\t\t//used within the /parental_consent/scripts/ let's make the field separator a \",\" (comma) vs an empty field.\n\t\treturn $already_completed_parental_application.\",\".$housing_app_completed_in_system.\",\".$first_name.\",\".$last_name.\",\".$middle_name.\",\".$student_ID.\",\".$student_DATE_OF_BIRTH.\",\".$parental_email_address.\",\".$student_app_date.\",\";\n\t\t\n\t}", "public function loadAllApplicationsApprover($facultyId, $status) {\r\n \r\n $ids = array(\"0\");\r\n\r\n\t\t$q1 = $this->db->query(\"SELECT DISTINCT wf.ID, wf.CAMPUS_ID FROM r_sr_wf wf\r\n INNER JOIN r_sr_wf_line wfl ON wf.ID = wfl.WORKFLOW AND\r\n wfl.FACULTY = ? AND wf.TYPE = ? \", array($facultyId, \"CHANGESUB\"));\r\n \r\n\t\tif($q1->num_rows() > 0) {\r\n \r\n\t\t\tforeach($q1->result() as $rows) {\r\n\t\t\t\t\r\n $q2 = $this->db->query(\"SELECT sr.`ID` FROM t_sr_subject sr \r\n INNER JOIN t_student s ON sr.`STUDENT_NO` = s.`STUDENT_NO`\r\n WHERE s.`CAMPUS_ID` = ? AND (sr.TYPE = ?) AND sr.STATUS = ?\",\r\n array($rows->CAMPUS_ID, 'CHANGESUB', $status));\r\n\t\t\t\t\r\n foreach($q2->result() as $row) {\r\n\t\t\t\t\t$ids[] = $row->ID;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n \r\n $ids = ($ids == \"\") ? \"0\" : $ids;\r\n\t\t$result = array();\r\n \r\n\t\t$queryresult = $this->db->query(\"SELECT LPAD(sr.ID, 5, '0') `ID`, sr.`STATUS`, DATE_FORMAT(sr.`DATE_REQUEST`, '%b %d, %Y') DATE_REQUEST, sr.`REASON`, \r\n GROUP_CONCAT(CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', sem.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ', ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SEPARATOR ',<br>') \r\n SUBJECTS, COUNT(*) SUBJECT_COUNT,\r\n GROUP_CONCAT(CONCAT(UPPER(sub2.`SUBJECT_CODE`), ' - ', UPPER(sub2.`DESCRIPTION`), ' (', sub2.`UNITS`, ' Units) / ', sy2.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f2.`LAST_NAME`), ', ', UPPER(f2.`FIRST_NAME`), ' ', UPPER(IFNULL(f2.`MIDDLE_NAME`, ''))), ' / ',\r\n sc2.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc2.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc2.`END_TIME`, '%h:%i%p')) SEPARATOR ',<br>') `CHANGE`,\r\n CONCAT(pd.`LAST_NAME`, ', ', pd.`FIRST_NAME`, ' ', IFNULL(pd.`MIDDLE_NAME`, '')) STUDENT, sr.`TYPE`\r\n s.CAMPUS_ID, s.PROGRAM_TYPE\r\n FROM t_sr_subject sr\r\n INNER JOIN t_student s ON sr.STUDENT_NO = s.STUDENT_NO\r\n INNER JOIN r_student_personal_data pd ON pd.`STUDENT_NO` = s.`STUDENT_NO`\r\n LEFT OUTER JOIN t_sr_subject_line sl ON sl.`SR` = sr.`ID` AND sr.`TYPE` = sl.`TYPE`\r\n LEFT OUTER JOIN r_schedule sc ON sc.`ID` = sl.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_subject sub ON sub.`SUBJECT_CODE` = sc.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy ON sy.`ID` = sc.`SY`\r\n LEFT OUTER JOIN r_semester sem ON sem.`ID` = sc.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n LEFT OUTER JOIN r_student_class_list cl ON cl.`ID` = sl.`SUBJECT_CODE_CHANGE`\r\n LEFT OUTER JOIN r_subject sub2 ON cl.`SUBJECT_CODE` = sub2.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy2 ON sy2.`ID` = cl.`SY`\r\n LEFT OUTER JOIN r_semester ss ON ss.`ID` = cl.`SEM`\r\n LEFT OUTER JOIN r_schedule sc2 ON sc2.`SECTION_CODE` = cl.`SECTION_CODE` AND sc2.`SY` = cl.`SY` AND sc2.`SEM` = cl.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f2 ON f2.`FACULTY_CODE` = sc2.`FACULTY_CODE`\r\n WHERE sr.ID IN (\".$ids.\")\r\n GROUP BY sr.`ID`\r\n ORDER BY sr.status DESC\"\r\n\t\t);\r\n\r\n\t\tif($queryresult->num_rows() > 0)\r\n\t\t{\r\n\t\t\tforeach($queryresult->result() as $rows)\r\n\t\t\t{\r\n $result[] = array(\r\n 'id' => $row->ID,\r\n 'status' => $row->STATUS,\r\n 'type' => \"Add Subject\",\r\n 'subjectCount' => $row->SUBJECT_COUNT,\r\n 'subjects' => $row->SUBJECTS,\r\n 'approvalLevel' => $this->getCurrentLevel($row->ID),\r\n 'numberOfApprovers' => $this->getNumberOfApprovers($row->CAMPUS_ID, $row->PROGRAM_TYPE),\r\n 'reason' => $row->REASON,\r\n 'dateRequested' => $row->DATE_REQUEST,\r\n );\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn $result;\r\n \r\n }", "public function index()\n {\n $allTrainings = Training::with('participants', 'participants.customer', 'participants.company', 'participants.position', 'participants_fill_in', 'participants_fill_in.customer', 'participants_fill_in.company', 'participants_fill_in.position', 'training_course', 'training_group', 'responsive_users')->where('type', Training::TYPE_PLANNED)->get();\n\n if ($allTrainings) {\n return response()->json($allTrainings, 200);\n } else {\n return response()->json([\n 'message' => 'Expectation Failed',\n 'status' => 417\n ], 417);\n }\n\n }", "public function getMajor(){\n\t\t$this->load->model('School_model');\n\t\t$this->School_model->getSchoolAll();\n\t}", "function tpps_details_study(array &$state) {\n $rows = array();\n\n $species = array();\n for ($i = 1; $i <= $state['stats']['species_count']; $i++) {\n $id = $state['ids']['organism_ids'][$i];\n $species_name = $state['saved_values'][TPPS_PAGE_1]['organism'][$i]['name'];\n $species[] = tpps_entity_link($id, $species_name, 'Organism');\n }\n\n $study_types = array(\n 1 => 'Natural Population (Landscape)',\n 2 => 'Growth Chamber',\n 3 => 'Greenhouse',\n 4 => 'Experimental/Common Garden',\n 5 => 'Plantation',\n );\n\n $files = array();\n $study_file_ids = tpps_details_get_study_file_ids($state);\n // foreach ($state['files'] as $fid) {\n foreach ($study_file_ids as $fid) {\n $file = file_load($fid);\n if ($file) {\n $file_url = check_plain(file_create_url($file->uri));\n if(stripos($file_url, 'core/labs') === FALSE) {\n $files[] = \"<a href='$file_url' target='blank'>$file->filename</a>\";\n }\n \n }\n }\n\n $pub_link = $state['title'];\n $pub_id = db_select('chado.project_pub', 'p')\n ->fields('p', array('pub_id'))\n ->condition('project_id', $state['ids']['project_id'])\n ->execute()->fetchObject()->pub_id;\n if (!empty($pub_id)) {\n $bundle = tripal_load_bundle_entity(array('label' => 'Publication'));\n $pub_id = chado_get_record_entity_by_bundle($bundle, $pub_id);\n $pub_link = \"<a href='$base_url/Publication/$pub_id'>$pub_link</a>\";\n }\n $rows[] = array('Accession', $state['accession']);\n $rows[] = array('Title', $pub_link);\n $rows[] = array('Authors', implode(', ', $state['authors']));\n $rows[] = array('Species', implode('<br>', $species));\n $rows[] = array('Data Type', $state['saved_values'][TPPS_PAGE_2]['data_type']);\n $rows[] = array(\n 'Study Type',\n $study_types[$state['saved_values'][TPPS_PAGE_2]['study_type']],\n );\n $rows[] = array('File Downloads', implode('<br>', $files));\n $rows[] = array('Population Size', $state['stats']['tree_count']);\n if (!empty($state['stats']['phenotype_count'])) {\n $rows[] = array('Phenotype Count', $state['stats']['phenotype_count']);\n }\n if (!empty($state['stats']['unique_phenotypes'])) {\n $rows[] = array('Unique Phenotypes', $state['stats']['unique_phenotypes']);\n }\n // @todo genotype counts.\n // $rows[] = array('Genotype Count', $state['stats']['genotype_count']);\n $vars = array(\n 'header' => array(),\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n return theme('table', $vars);\n}", "function index() {\n if (!$this->authentication->logged_in()) {\n //redirect them to the login page\n redirect('login', 'refresh');\n } else {\n \n //get college list\n $this->db->select(\"*\");\n $this->db->from(\"detail_code\");\n $this->db->where(array(\"master_code\" => 'A001'));\n $this->db->order_by(\"detail_name\", \"ASC\");\n $query = $this->db->get();\n $college_list = $query->result_array();\n \n //get state list\n $this->db->select(\"*\");\n $this->db->from(\"detail_code\");\n $this->db->where(array(\"master_code\" => 'A028'));\n $this->db->order_by(\"detail_name\", \"ASC\");\n $states = $this->db->get();\n $state_list = $states->result_array();\n \n //get gender list\n $this->db->select(\"*\");\n $this->db->from(\"detail_code\");\n $this->db->where(array(\"master_code\" => 'A023'));\n $this->db->order_by(\"detail_name\", \"ASC\");\n $genders = $this->db->get();\n $genders_list = $genders->result_array();\n \n $config = array();\n $config[\"base_url\"] = base_url() . \"university\";\n $config[\"total_rows\"] = $this->university_model->get_count_university();\n $config[\"per_page\"] = 15;\n $config[\"uri_segment\"] = 2;\n \n $this->pagination->initialize($config);\n $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;\n \n $result_array = $this->university_model->fetch_universities($config['per_page'], $page);\n $this->data['all_data'] = $result_array;\n $str_links = $this->pagination->create_links();\n $this->data['state_list'] = $state_list;\n $this->data['college_list'] = $college_list;\n $this->data['genders_list'] = $genders_list;\n $this->data['links'] = explode('&nbsp;',$str_links );\n $this->render();\n\t\t}\n\t}", "public function loadAllApplications($studentNumber, $campusId, $programType, $status) {\r\n \r\n $applications = \"\";\r\n \r\n if ($status == \"\") {\r\n $statusQuery = \"\";\r\n } else if ($status == \"Approved\") {\r\n $statusQuery = \"AND (sr.STATUS = 'Approved' OR sr.STATUS = 'Declined')\";\r\n } else {\r\n $statusQuery = \"AND sr.STATUS = '\" . $status . \"'\";\r\n }\r\n \r\n $queryresult = $this->db->query(\"SELECT LPAD(sr.ID, 5, '0') `ID`, sr.`STATUS`, DATE_FORMAT(sr.`DATE_REQUEST`, '%b %d, %Y') DATE_REQUEST, sr.`REASON`, \r\n GROUP_CONCAT(CONCAT(UPPER(sub.`SUBJECT_CODE`), ' - ', UPPER(sub.`DESCRIPTION`), ' (', sub.`UNITS`, ' Units) / ', sy.`SY_ABBR`, ' - ', sem.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f.`LAST_NAME`), ', ', UPPER(f.`FIRST_NAME`), ' ', UPPER(IFNULL(f.`MIDDLE_NAME`, ''))), ' / ',\r\n sc.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc.`END_TIME`, '%h:%i%p')) SEPARATOR '\\r\\n') \r\n SUBJECTS, \r\n GROUP_CONCAT(CONCAT(UPPER(sub2.`SUBJECT_CODE`), ' - ', UPPER(sub2.`DESCRIPTION`), ' (', sub2.`UNITS`, ' Units) / ', sy2.`SY_ABBR`, ' - ', ss.`SEMESTER`, ' / ', \r\n CONCAT(UPPER(f2.`LAST_NAME`), ', ', UPPER(f2.`FIRST_NAME`), ' ', UPPER(IFNULL(f2.`MIDDLE_NAME`, ''))), ' / ',\r\n sc2.`DAY_OF_WEEK`, ' ', TIME_FORMAT(sc2.`START_TIME`, '%h:%i%p'), ' - ', TIME_FORMAT(sc2.`END_TIME`, '%h:%i%p')) SEPARATOR '\\r\\n') `CHANGE`,\r\n s.CAMPUS_ID, s.PROGRAM_TYPE\r\n FROM t_sr_subject sr\r\n INNER JOIN t_student s ON sr.STUDENT_NO = s.STUDENT_NO\r\n LEFT OUTER JOIN t_sr_subject_line sl ON sl.`SR` = sr.`ID` AND sr.`TYPE` = sl.`TYPE`\r\n LEFT OUTER JOIN r_schedule sc ON sc.`ID` = sl.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_subject sub ON sub.`SUBJECT_CODE` = sc.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy ON sy.`ID` = sc.`SY`\r\n LEFT OUTER JOIN r_semester sem ON sem.`ID` = sc.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f ON f.`FACULTY_CODE` = sc.`FACULTY_CODE`\r\n LEFT OUTER JOIN r_student_class_list cl ON cl.`ID` = sl.`SUBJECT_CODE_CHANGE`\r\n LEFT OUTER JOIN r_subject sub2 ON cl.`SUBJECT_CODE` = sub2.`SUBJECT_CODE`\r\n LEFT OUTER JOIN r_sy sy2 ON sy2.`ID` = cl.`SY`\r\n LEFT OUTER JOIN r_semester ss ON ss.`ID` = cl.`SEM`\r\n LEFT OUTER JOIN r_schedule sc2 ON sc2.`SECTION_CODE` = cl.`SECTION_CODE` AND sc2.`SY` = cl.`SY` AND sc2.`SEM` = cl.`SEM`\r\n LEFT OUTER JOIN r_faculty_profile f2 ON f2.`FACULTY_CODE` = sc2.`FACULTY_CODE`\r\n WHERE sr.`TYPE` = 'CHANGESUB' AND sr.`STUDENT_NO` = ? \" . $statusQuery .\r\n \" GROUP BY sr.`ID`\r\n ORDER BY DATE_REQUEST DESC\", \r\n array($studentNumber));\r\n \r\n if ( $queryresult->num_rows() > 0 ) { \r\n \r\n\t\t\tforeach ( $queryresult->result() as $row ) {\r\n \r\n $applications[] = array(\r\n 'id' => $row->ID,\r\n 'status' => $row->STATUS,\r\n 'type' => /*$row->TYPE*/ \"Change Subject\",\r\n 'subjects' => $row->SUBJECTS,\r\n 'toSubjects' => $row->CHANGE,\r\n 'approvalLevel' => $this->getCurrentLevel($row->ID),\r\n 'numberOfApprovers' => $this->getNumberOfApprovers($row->CAMPUS_ID, $row->PROGRAM_TYPE),\r\n 'reason' => $row->REASON,\r\n 'dateRequested' => $row->DATE_REQUEST,\r\n );\r\n }\r\n }\r\n \r\n\t\treturn $applications;\r\n }", "function Completed_Requests($year = '2014') {\r\n $query2 = $this->db->query(\"SELECT count(id) as total FROM `worksheet_tracking` WHERE date_added like '%$year%' AND stage < 11\");\r\n\r\n return $result = $query2->result();\r\n }", "function censusCitation($year, $page, $idir, $type)\n{\n global $connection;\n global $debug;\n\n if ($type == Citation::STYPE_BIRTH &&\n \t!is_null($idir))\n {\t // citation to birth\n \t// extract keys identifying the specific page of the census\n \t// from the citation string\n \t$prov\t\t = '';\n \t$dist\t \t= 0;\n \t$subdist \t= '';\n \t$div\t \t= '';\n \t$pagenum \t= 0;\n \t$pattern \t= \"/^([A-Z]{2},|) *(dist *([0-9.]+)|).*?, *(subdist ([A-Z0-9]+)|)(.*?)(div *([A-Z0-9]+)|) *page *([0-9]+)/i\";\n \t//$pattern\t= \"/^(([A-Z]{2},|))/i\";\n \t$count\t \t= preg_match($pattern,\n \t\t\t\t \t\t $page,\n \t\t\t\t \t\t $matches);\n \tif ($count == 1)\n \t{\n \t if ($debug)\n \t\t\tprint \"\\\"matches\\\" : \" . print_r($matches, true) . \",\\n\";\n \t if (strlen($matches[1]) == 3)\n \t\t\t$prov\t= substr($matches[1],0,2);\n \t else\n \t\t\t$prov\t= \"''\";\n \t $dist\t = $matches[3];\n \t $subdist\t= $matches[5];\n \t $div\t = $matches[8];\n \t $pagenum\t= $matches[9];\n \t if ($debug)\n \t {\n \t\t\tprint \"\\\"prov\\\" : \" . json_encode($prov) . \",\\n\";\n \t\t\tprint \"\\\"dist\\\" : \" . json_encode($dist) . \",\\n\";\n \t\t\tprint \"\\\"subdist\\\" : \" . json_encode($subdist) . \",\\n\";\n \t\t\tprint \"\\\"div\\\" : \" . json_encode($div) . \",\\n\";\n \t\t\tprint \"\\\"pagenum\\\" : \" . json_encode($pagenum) . \",\\n\";\n \t }\n \t}\n \telse\n \tif ($debug)\n \t print \"\\\"count\\\" : \" . json_encode($count) . \",\\n\";\n\n \t// get information about the individual in a format\n \t// suitable for use in the SQL command\n \t// the individual may be identified in the census by\n \t// birth name, married name, or other alternate name\n\n \tprint \",\\n \\\"alt\\\" : {\\n\";\n \t$nameparms\t = array('idir' => $idir);\n \t$namerecs\t = new RecordSet('Names', $nameparms);\n\n \t$whereName\t = '';\n \t$genderTest\t = '';\n \t$or\t\t = '';\n $sqlParms\t = array();\n \tforeach($namerecs as $idnx => $namerec)\n \t{\n \t $surname\t = $namerec->get('surname');\n \t $givenname\t = $namerec->get('givenname');\n \t $birthsd\t = $namerec->get('birthsd');\n \t $gender\t = $namerec->get('gender');\n \t print \"\\\"row$idnx\\\" : {\\n\";\n \t print \"\\\"idnx\\\" : \" . json_encode($idnx) . \",\\n\";\n \t print \"\\\"surname\\\" : \" . json_encode($surname) . \",\\n\";\n \t print \"\\\"givenname\\\" : \" . json_encode($givenname) . \",\\n\";\n \t print \"\\\"birthsd\\\" : \" . json_encode($birthsd) . \",\\n\";\n \t print \"\\\"gender\\\" : \" . json_encode($gender) . \"\\n\";\n \t print \"}\\n\";\n \t $sqlParms['surname' . $idnx]\t= $surname;\n \t $sqlParms['partGiven' . $idnx]\t= substr($givenname, 0, 2);\n \t if (strlen($genderTest) == 0)\n \t {\t\t // add gender test\n \t\t\tif ($gender == 0)\n \t\t\t\t$genderTest\t= \"SEX='M' AND \";\n \t\t\telse\n \t\t\tif ($gender == 1)\n \t\t\t\t$genderTest\t= \"SEX='F' AND \";\n \t }\t\t // add gender test\n \t $whereName\t.= \"$or(LEFT(SOUNDEX(:surname$idnx),4)=SurnameSoundex AND \" .\n \t\t\t\t\t\t\"LOCATE(:partGiven$idnx, GivenNames) > 0)\";\n \t $or\t\t = ' OR ';\n $birthYear\t= floor($birthsd/10000);\n \t}\t // loop through matching names\n \tprint \"}\";\n\n \tif (strlen($whereName) > 0)\n \t{\t // have at least one name to check\n \t // search the census page for a vague match\n \t $sqlParms['dist']\t\t= $dist;\n \t $sqlParms['subdist']\t= $subdist;\n \t $sqlParms['div']\t\t= $div;\n \t $sqlParms['pagenum']\t= $pagenum;\n \t $sqlParms['birthYear']\t= $birthYear;\n \t if ($year < 1867)\n \t {\n \t\t\t$sqlParms['prov']\t= $prov;\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\" WHERE Province=:prov AND\" .\n \t\t\t\t\t\" District=:dist AND\" .\n \t\t\t\t\t\" SubDistrict=:subdist AND\" .\n \t\t\t\t\t\" Division=:div AND\" .\n \t\t\t\t\t\" Page=:pagenum AND $genderTest\" .\n \t\t\t\t\t\" ($whereName) AND\" .\n \t\t\t\t\t\" ABS(BYear - :birthYear) < 3\";\n \t }\n \t else\n \t\t\t$select\t= \"SELECT Line, Surname, GivenNames FROM Census$year \" .\n \t\t\t\t\t\"WHERE District=:dist AND \" .\n \t\t\t\t\t\"SubDistrict=:subdist AND \" .\n \t\t\t\t\t\"Division=:div AND \" .\n \t\t\t\t\t\"Page=:pagenum AND $genderTest \" .\n \t\t\t\t\t\"($whereName) AND \" .\n \t\t\t\t\t\"ABS(BYear - :birthYear) < 3\";\n \t $sqlParmsText\t= print_r($sqlParms, true);\n \t $stmt\t\t = $connection->prepare($select);\n \t if ($stmt->execute($sqlParms))\n \t {\t // select succeeded\n \t\t\t$sresult\t= $stmt->fetchAll(PDO::FETCH_ASSOC);\n \t\t\t$count\t\t= count($sresult);\n print \",\\n \\\"select\\\" : {\\n\";\n print \" \\\"count\\\" : $count,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \"\\n\";\n print \" }\";\n $comma = \",\\n\";\n \t\t\tforeach($sresult as $row)\n \t\t\t{\t // found match in census\n \t\t\t $line\t = $row['line'];\n \t\t\t $csurname\t = $row['surname'];\n \t\t\t $cgivennames = $row['givennames'];\n\n \t\t\t print \",\\n \\\"row$line\\\" : {\\n\";\n \t\t\t print \"\t \\\"line\\\" : $line,\\n\";\n print \"\t \\\"surname\\\" : \" . \n json_encode($csurname) . \",\\n\";\n print \" \\\"givennames\\\" : \" .\n json_encode($cgivennames) . \"\\n\";\n print \"\\n }\";\n\n \t\t\t if ($count == 1)\n \t\t\t {\t\t// unique match\n \t\t\t\t\tif ($year < 1867)\n \t\t\t\t\t $censusId\t\t= $prov . $year;\n \t\t\t\t\telse\n \t\t\t\t\t $censusId\t\t= 'CA' . $year;\n \t\t\t\t\t$line\t= new CensusLine(array(\n \t\t\t\t\t\t\t\t 'Census'\t=> $censusId,\n \t\t\t\t\t\t\t\t 'District'\t=> $dist,\n \t\t\t\t\t\t\t\t 'SubDistrict'=> $subdist,\n \t\t\t\t\t\t\t\t 'Division'\t=> $div,\n \t\t\t\t\t\t\t\t 'Page'\t\t=> $pagenum),\n \t\t\t\t\t\t\t\t $line);\n \t\t\t\t\t$line->set('idir', $idir);\n $result\t\t= $line->save();\n print \",\\n \\\"sqlcmd\" . __LINE__ . \"\\\" : \" .\n json_encode($line->getLastSqlCmd());\n \t\t\t }\t\t// unique match\n \t\t\t}\t\t // found matches in census\n \t }\t\t // select succeeded\n \t else\n \t {\t // failed to select records\n print \" \\\"select\\\" : {\\n\";\n print \" \\\"failed\\\" : true,\";\n print \" \\\"cmd\\\" : \" .\n json_encode($select) . \",\\n\";\n print \" \\\"parms\\\" : \" .\n json_encode($sqlParmsText) . \",\\n\";\n print \" \\\"msg\\\" : \" .\n json_encode(print_r($stmt->errorInfo(),true)) . \"\\n\";\n print \" },\\n\";\n \t }\t // failed\n \t}\t // have at least one name to check\n }\t\t // citation to birth\n}", "public function HCCNewlyPatientsReEnrolled() {\r\n $query = \"SELECT TOP 1 [code_year_quarter].[year] AS [year],\r\n [code_year_quarter].[quarter] AS [quarter],\r\n CONCAT ([code_year_quarter].[year], ' Q',[code_year_quarter].[quarter]) AS [year_quarter],\r\n [code_hdepartment].[hfacility_id] AS [facility_id],\r\n [code_hfacility].[hfacility_name] AS [facility_name],\r\n (SELECT CONCAT ('Newly - ', [concept].[concept_name]) FROM [dbo].[concept] WHERE [concept].[ID] = [obs].[data_element]) AS [concept_name],\r\n (CAST([obs].[data_value] AS INT)) AS [newly_registered]\r\n FROM [dbo].[obs_dimensions] \r\n LEFT JOIN [dbo].[obs] ON [obs].[obs_dimensions_ID] = [obs_dimensions].[ID] \r\n LEFT JOIN [dbo].[art_clinic_obs] ON [art_clinic_obs].[ID] = [obs_dimensions].[art_clinic_obs_id] \r\n LEFT JOIN [dbo].[code_hdepartment] ON [code_hdepartment].[ID] = [art_clinic_obs].[hdepartment_id]\r\n LEFT JOIN [dbo].[code_year_quarter] ON [code_year_quarter].[ID] = [art_clinic_obs].[year_quarter_id]\r\n LEFT JOIN [dbo].[code_hfacility] ON [code_hfacility].[ID] = [code_hdepartment].[hfacility_id]\r\n\t\t WHERE \r\n [sub_group] = 398\r\n AND [period_report] = 393\r\n AND [obs].[data_element] = 50\r\n AND [art_clinic_obs].[year_quarter_id] = :year_quarter_id\r\n AND [code_hdepartment].[hfacility_id] = :health_facility_id\r\n AND [code_hdepartment].[hservice] = 294\";\r\n //Prepare query statement\r\n $stmt = $this->conn->prepare($query);\r\n //Bind values\r\n $stmt->bindParam(':year_quarter_id', $this->year_quarter);\r\n $stmt->bindParam(':health_facility_id', $this->health_facility_id);\r\n //Execute statement\r\n $stmt->execute();\r\n return $stmt;\r\n }", "public function fs_filter_data($company,$division,$department,$section,$subsection,$location,$classification,$employment,$status,$yy,$mm,$dd,$type,$date_from,$date_to,$payroll_period)\n\t{\n\n\t\t$location_1 = substr_replace($location, \"\", -3 , 3);\n\t\t$location_2 = str_replace(\"-\",\" \",$location_1);\n\t\t$location_final = str_replace(\"ll\",\"v.location=\",$location_2);\n\t\t\n\t\t$classification_1 = substr_replace($classification, \"\", -3 , 3);\n\t\t$classification_2 = str_replace(\"-\",\" \",$classification_1);\n\t\t$classification_final = str_replace(\"cc\",\"v.classification=\",$classification_2);\n\t\t\n\t\t$employment_1 = substr_replace($employment, \"\", -3 , 3);\n\t\t$employment_2 = str_replace(\"-\",\" \",$employment_1);\n\t\t$employment_final = str_replace(\"ee\",\"v.employment=\",$employment_2);\n\n\t\tif($company=='All'){} else { $this->db->where('v.company_id',$company); }\n\t\tif($division=='All'){} else { $this->db->where('v.division_id',$division); }\n\t\tif($department=='All'){} else { $this->db->where('v.department',$department); }\n\t\tif($section=='All'){} else { $this->db->where('v.section',$section); }\n\t\tif($subsection=='All'){} else { $this->db->where('v.subsection',$subsection); }\n\t\t//if($status=='All'){} else { $this->db->where('InActive',$status); }\n\n\t\tif($type=='single')\n\t\t{ //$yy $mm $dd\n\t\t\t$full_date=$yy.\"-\".$mm.\"-\".$dd;\n\t\t\t$dayOfWeek = date(\"l\", strtotime($full_date));\n\n\t\t\t$get_this_data=\"a.system_user,a.date_added,a.last_update,\n\t\t\t\t\tv.employee_id,\n\t\t\t\t\tv.name,\n\t\t\t\t\tv.first_name,\n\t\t\t\t\tv.middle_name,\n\t\t\t\t\tv.last_name,\n\t\t\t\t\tv.name_extension,\n\t\t\t\t\tv.company_id,\n\t\t\t\t\tv.company_name,\n\t\t\t\t\tv.wDivision,\n\t\t\t\t\tv.location_name,\n\t\t\t\t\tv.division_name,\n\t\t\t\t\tv.dept_name,\n\t\t\t\t\tv.section_name,\n\t\t\t\t\tv.subsection_name,\n\t\t\t\t\tv.classification_name as classification,\n\t\t\t\t\tv.taxcode_name,\n\t\t\t\t\tv.civil_status_name,\n\t\t\t\t\tv.employment_name,\n\t\t\t\t\tv.pay_type_name,\n\t\t\t\t\tv.gender_name\";\n\n\t\t\tif($dayOfWeek==\"Monday\"){\n\t\t\t\t$this->db->select('a.mon as the_day,'.$get_this_data.'');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Tuesday\"){\n\t\t\t\t$this->db->select('a.tue as the_day,'.$get_this_data.'');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Wednesday\"){\n\t\t\t\t$this->db->select('a.wed as the_day,'.$get_this_data.'');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Thursday\"){\n\t\t\t\t$this->db->select('a.thu as the_day,'.$get_this_data.'');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Friday\"){\n\t\t\t\t$this->db->select('a.fri as the_day,v.*');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Saturday\"){\n\t\t\t\t$this->db->select('a.sat as the_day,v.*');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}elseif($dayOfWeek==\"Sunday\"){\n\t\t\t\t$this->db->select('a.sun as the_day,v.*');\n\t\t\t\t$where = \"a.thu is NOT NULL\";\n\t\t\t\t$this->db->where($where);\n\n\t\t\t}else{\n\t\t\t\t//\n\t\t\t}\n\n\t\t\t$this->db->where('a.InActive','0');\n\t\t\t$this->db->join(\"admin_emp_masterlist_view v\", \"a.employee_id = v.employee_id\", \"inner\");\n\t\t\t$this->db->from('fixed_working_schedule_members a'); \n\n\t\t}\n\t\telse if($type=='double')\n\t\t{ \n\t\t\t$full_date=$yy.\"-\".$mm.\"-\".$dd;\n\t\t\t$dayOfWeek = date(\"l\", strtotime($full_date));\n\n\t\t\t$get_this_data=\"\n\t\t\t\t\ta.system_user,a.date_added,a.last_update,a.mon,a.tue,a.wed,a.thu,a.fri,a.sat.a.sun,\n\t\t\t\t\tv.employee_id,\n\t\t\t\t\tv.name,\n\t\t\t\t\tv.first_name,\n\t\t\t\t\tv.middle_name,\n\t\t\t\t\tv.last_name,\n\t\t\t\t\tv.name_extension,\n\t\t\t\t\tv.company_id,\n\t\t\t\t\tv.company_name,\n\t\t\t\t\tv.wDivision,\n\t\t\t\t\tv.location_name,\n\t\t\t\t\tv.division_name,\n\t\t\t\t\tv.dept_name,\n\t\t\t\t\tv.section_name,\n\t\t\t\t\tv.subsection_name,\n\t\t\t\t\tv.classification_name as classification,\n\t\t\t\t\tv.taxcode_name,\n\t\t\t\t\tv.civil_status_name,\n\t\t\t\t\tv.employment_name,\n\t\t\t\t\tv.pay_type_name,\n\t\t\t\t\tv.gender_name\";\t\n\n\t\t\t$this->db->where('a.InActive','0');\n\t\t\t$this->db->join(\"admin_emp_masterlist_view v\", \"a.employee_id = v.employee_id\", \"inner\");\n\t\t\t$this->db->from('fixed_working_schedule_members a'); \n\t\t\t\n\t\t}\n\t\telse if($type=='single_pp')\n\t\t{ //$payroll_period\n\t\t\n\t\t}\n\t\t$this->db->where(\"(\".$location_final.\" AND \".$classification_final.\" AND \".$employment_final.\" )\");\n\t\t//$this->db->order_by('date','asc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function run()\n {\n $inquireLists = [\n array(1, '28092020001', '2909200002111001', 'Thiri Myo Paing', 'female', '09964550997', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:29:48', '2020-09-29 06:45:48'),\n\t\t\tarray(2, '29092020001', '2909200002111002', 'Thoon Phyu Soe', 'female', '09972278304', '2020-09-29', '300000', 2, 'Strategy first university (BIT)', 'no', '2020', NULL, 62, 1, 1, NULL, '2020-09-28 17:31:17', '2020-09-29 06:46:04'),\n\t\t\tarray(3, '29092020002', '2909200002111003', 'Thura Sitt Naing', 'male', '09789302539', '2020-09-29', '300000', 2, '09789302539, 09448535240\\r\\nDiploma in Computing lvl 4, 5', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:32:08', '2020-09-29 06:46:16'),\n\t\t\tarray(4, '29092020003', '2909200002111004', 'May see sar', 'male', '09764674688', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:34:54', '2020-09-29 06:46:25'),\n\t\t\tarray(5, '29092020004', '2909200002111005', 'Youn Thiri Naing', 'female', '09971657898', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-28 17:48:23', '2020-09-29 06:46:35'),\n\t\t\tarray(6, '29092020005', '2909200002111006', 'Thet Zin Nyein', 'male', '09895754136', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:49:35', '2020-09-29 06:46:42'),\n\t\t\tarray(7, '29092020006', '2909200002111007', 'Mi Mi Ko', 'female', '09787788471', '2020-09-29', '300000', 2, '09787788471, 09784405865\\r\\nBE(It)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 17:53:35', '2020-09-29 06:46:49'),\n\t\t\tarray(8, '29092020007', '2909200002111008', 'Kyaw Zaw Thu', 'male', '0976510386', '2020-09-29', '300000', 2, 'BSc Business IT (University of Greenwich) KMD', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 17:55:17', '2020-09-29 06:46:59'),\n\t\t\tarray(9, '29092020008', '2909200002111009', 'Htet Zayar', 'male', '09776095077', '2020-09-29', '300000', 2, '3rd year at University of Computer Studies,Yangon', 'no', '2020', NULL, 21, 1, 1, NULL, '2020-09-28 17:56:01', '2020-09-29 06:47:05'),\n\t\t\tarray(10, '29092020009', '2909200002111010', 'Khin Linn Thu', 'female', '09422213057', '2020-09-29', '300000', 2, 'BE(EC), Java', 'no', '2020', NULL, 49, 1, 1, NULL, '2020-09-28 17:58:01', '2020-09-29 06:47:12'),\n\t\t\tarray(11, '29092020010', '2909200002111011', 'Zaw Zaw Win', 'male', '09951613400', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 7, 1, 1, NULL, '2020-09-28 17:58:36', '2020-09-29 06:47:19'),\n\t\t\tarray(12, '29092020011', '2909200002111012', 'Myat Noe Thu', 'female', '09454821554', '2020-09-29', '300000', 2, 'Level 5 Diaploma in Computing', 'no', '2020', NULL, 58, 1, 1, NULL, '2020-09-28 17:59:11', '2020-09-29 06:52:27'),\n\t\t\tarray(13, '29092020012', '2909200002111013', 'Thu Zar Aung', 'female', '09250772846', '2020-09-29', '300000', 2, 'BE(Electronic)', 'no', '2020', NULL, 49, 1, 1, NULL, '2020-09-28 18:00:27', '2020-09-29 06:52:34'),\n\t\t\tarray(14, '29092020013', '2909200002111014', 'Kyaw Zin Win', 'male', '09252676345', '2020-09-29', '300000', 2, 'BE EC (Technological Universiyt)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 18:01:20', '2020-09-29 06:52:42'),\n\t\t\tarray(15, '29092020014', '2909200002111015', 'Hein Htet Zaw', 'male', '09698006087', '2020-09-29', '300000', 2, 'KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:01:45', '2020-09-29 06:52:48'),\n\t\t\tarray(16, '29092020015', '2909200002111016', 'Kyi Kyi Swe', 'female', '09769506744', '2020-09-29', '300000', 2, 'B.C.Sc (Computer University,Banmaw)', 'no', '2020', NULL, 5, 1, 1, NULL, '2020-09-28 18:03:32', '2020-09-29 06:52:56'),\n\t\t\tarray(17, '29092020016', '2909200002111017', 'Khin Sandar Soe', 'female', '09253237634', '2020-09-29', '300000', 2, 'BE(It)', 'no', '2020', NULL, 51, 1, 1, NULL, '2020-09-28 18:04:17', '2020-09-29 06:53:08'),\n\t\t\tarray(18, '29092020017', '2909200002111018', 'Thant Mon Naing', 'female', '09793449588', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 11, 1, 1, NULL, '2020-09-28 18:04:56', '2020-09-29 06:53:15'),\n\t\t\tarray(19, '29092020018', '2909200002111019', 'Poe Thiri Htun', 'female', '09789802133', '2020-09-29', '300000', 2, '-', 'no', '2020', NULL, 14, 1, 1, NULL, '2020-09-28 18:05:30', '2020-09-29 06:53:21'),\n\t\t\tarray(20, '29092020019', '2909200002111020', 'Aung Khant Kyaw', 'male', '09976505982', '2020-09-29', '300000', 2, 'KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:05:57', '2020-09-29 06:53:28'),\n\t\t\tarray(21, '29092020020', '2909200002111021', 'Hein Min Htet', 'male', '09761867358', '2020-09-29', '300000', 2, 'BSc (Hons) Computing (University of Greenwich)', 'no', '2020', NULL, 58, 1, 1, NULL, '2020-09-28 18:06:34', '2020-09-29 06:53:35'),\n\t\t\tarray(22, '29092020021', '2909200002111022', 'Rumar Dawi', 'female', '09259173954', '2020-09-29', '300000', 2, 'Bachelor of Engineering (EC)', 'no', '2020', NULL, 41, 1, 1, NULL, '2020-09-28 18:07:22', '2020-09-29 06:53:41'),\n\t\t\tarray(23, '29092020022', '2909200002111023', 'Phone Myint Thaw', 'male', '09796907817', '2020-09-29', '300000', 2, 'BE(Mechatronic)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-28 18:08:34', '2020-09-29 06:53:53'),\n\t\t\tarray(24, '29092020023', '2909200002111024', 'Cho Mi Mi Tun', 'female', '09262077380', '2020-09-29', '300000', 2, 'Diploma in IT, B.A (English)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-28 18:09:05', '2020-09-29 06:53:58'),\n\t\t\tarray(25, '29092020024', '2909200002111025', 'Moe Thazin Aung', 'female', '09250464368', '2020-09-29', '300000', 2, 'B.C.Sc', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:17:54', '2020-09-29 06:54:04'),\n\t\t\tarray(26, '29092020025', '2909200002111026', 'May Thazin', 'female', '09786161601', '2020-09-29', '300000', 2, 'BE(EC),KMD Diploma', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:18:36', '2020-09-29 06:54:09'),\n\t\t\tarray(27, '29092020026', '2909200002111027', 'Wanna Min Paing', 'male', '09799703132', '2020-09-29', '300000', 2, 'CU 4th year(Hinthada)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:19:16', '2020-09-29 06:54:15'),\n\t\t\tarray(28, '29092020027', '2909200002111028', 'Aung Khant Kyaw', 'male', '09251569702', '2020-09-29', '300000', 2, 'KMD(Diploma in Web Development)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:19:52', '2020-09-29 06:54:21'),\n\t\t\tarray(29, '29092020028', '2909200002111029', 'Myo Htet', 'male', '095051302', '2020-09-29', '300000', 2, 'Diploma in Computer Science (Gusto University 2nd Year)', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-29 05:20:17', '2020-09-29 06:54:27'),\n\t\t\tarray(30, '29092020029', '2909200002111030', 'Yadanar Hlaing', 'male', '09968670885', '2020-09-29', '300000', 2, '4th year EC(MIT) basic ရှိ', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:21:12', '2020-09-29 06:54:40'),\n\t\t\tarray(31, '29092020030', '2909200002111031', 'Aung Htun Win', 'male', '09772320874', '2020-09-29', '300000', 2, 'BE-EC(University of Technology Yatanarpon Cyber City)', 'no', '2020', NULL, 79, 1, 1, NULL, '2020-09-29 05:21:39', '2020-09-29 06:54:46'),\n\t\t\tarray(32, '29092020031', '2909200002111032', 'Min Hein Khant', 'male', '09690807688', '2020-09-29', '300000', 2, '2nd yr (ucsy)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:22:15', '2020-09-29 06:54:53'),\n\t\t\tarray(33, '29092020032', '2909200002111033', 'Kaung Kyaw Htin', 'male', '09764778927', '2020-09-29', '300000', 2, 'C++ လေ့လာထား', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:22:47', '2020-09-29 06:55:02'),\n\t\t\tarray(34, '29092020033', '2909200002111034', 'Nay Aung Win', 'male', '09976902969', '2020-09-29', '300000', 2, 'Emajor 3rd year distance, 2nd yr,have studied PHP', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:23:25', '2020-09-29 06:55:10'),\n\t\t\tarray(35, '29092020034', '2909200002111035', 'Nyi Nyi', 'male', '09455205805', '2020-09-29', '300000', 2, 'HND Computing Diploma', 'no', '2020', NULL, 56, 1, 1, NULL, '2020-09-29 05:23:58', '2020-09-29 06:55:17'),\n\t\t\tarray(36, '29092020035', '2909200002111036', 'Thu Thu', 'female', '09968670885', '2020-09-29', '300000', 2, '4th year EC(MIT) basic ရှိ', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:24:31', '2020-09-29 06:55:23'),\n\t\t\tarray(37, '29092020036', '2909200002111037', 'Htike Min Swan', 'male', '09773245631', '2020-09-29', '300000', 2, 'B.C.Sc /M.C.Sc(coursework)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:25:20', '2020-09-29 06:55:28'),\n\t\t\tarray(38, '29092020037', '2909200002111038', 'Ma Thaw Zin Wai', 'female', '09250529546', '2020-09-29', '300000', 2, 'Technological University Mandalay (EC)', 'no', '2020', NULL, 36, 1, 1, NULL, '2020-09-29 05:28:41', '2020-09-29 06:55:34'),\n\t\t\tarray(39, '29092020038', '2909200002111039', 'Shwe Yee Eain', 'male', '09761154661', '2020-09-29', '300000', 2, '3rd CU Meiktila\\r\\nUCSMTLA (third yr)', 'no', '2020', NULL, 1, 1, 1, NULL, '2020-09-29 05:31:26', '2020-09-29 06:55:39'),\n\t\t\tarray(40, '29092020039', '2909200002111040', 'Thinzar Nwe', 'female', '09958603192', '2020-09-29', '300000', 2, 'HND Diploma in Computing(KMD)', 'no', '2020', NULL, 55, 1, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45')\n\n\t\t\t// array(41, '29092020040', '2909200002111041', 'Nwe Ni Kyaw', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(42, '29092020041', '2909200002111042', 'Seint Let Let Hninn', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(43, '29092020042', '2909200002111043', 'Thiri Shwe Sin', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(44, '29092020043', '2909200002111044', 'Eaint Htay Thi', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(45, '29092020044', '2909200002111045', 'Aye Thet Mon', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(46, '29092020045', '2909200002111046', 'Hla Wai Tun', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(47, '29092020046', '2909200002111047', 'Myat Min Thant', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(48, '29092020047', '2909200002111048', 'Naung Naung Tun', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(49, '29092020048', '2909200002111049', 'Lai Lai Phyo', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(50, '29092020049', '2909200002111050', 'Yin Wai Aung', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(51, '29092020050', '2909200002111051', 'Kaung Shine', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(52, '29092020051', '2909200002111052', 'Thurein Htet', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(53, '29092020052', '2909200002111053', 'Phyu Phyu San', 'female', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(54, '29092020053', '2909200002111054', 'Kyaw Khant Zin', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n\n\t\t\t// array(55, '29092020054', '2909200002111055', 'Nan Sang Mo Naom', 'male', '0987654321', '2020-09-29', '1450000', 2, '-', 'no', '2020', NULL, 1, 3, 1, NULL, '2020-09-29 05:32:03', '2020-09-29 06:55:45'),\n ];\n\n foreach ($inquireLists as $inquireList) \n {\n $inquire = new Inquire;\n $inquire->inquireno = $inquireList[1];\n $inquire->receiveno = $inquireList[2];\n $inquire->name = $inquireList[3];\n $inquire->gender = $inquireList[4];\n $inquire->phone = $inquireList[5];\n $inquire->installmentdate = $inquireList[6];\n $inquire->installmentamount = $inquireList[7];\n $inquire->status = $inquireList[8];\n $inquire->knowledge = $inquireList[9];\n $inquire->camp = $inquireList[10];\n $inquire->acceptedyear = $inquireList[11];\n $inquire->message = $inquireList[12];\n $inquire->education_id = $inquireList[13];\n $inquire->batch_id = $inquireList[14];\n\n $inquire->user_id = 1;\n $inquire->save();\n }\n }", "function getFieldPriorEducation($val_stat = null, $value_array = null){\n\t\tinclude('axcelerate_link_array_list.php');\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_PriorEducationStatus');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_PriorEducationStatus');\n\t\t$tooltip = setToolTipNotification(\"PriorEducationStatus\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('prior_ed') === 'prior_ed' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br>\";\n\t\t\t$form_ret .= '<input name=\"PriorEducationStatus\" id=\"priorEducationRadio1\" '.($value_array ? 'checked' : '').' value=\"Y\" type=\"radio\"><label for=\"priorEducationRadio1\">&nbsp;Yes</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t$form_ret .= '<input name=\"PriorEducationStatus\" id=\"priorEducationRadio0\" '.(!$value_array ? 'checked' : '').' class=\"priorEducationnull\" value=\"N\" type=\"radio\"><label for=\"priorEducationRadio0\">&nbsp;No</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t$form_ret .= '<input name=\"PriorEducationStatus\" id=\"priorEducationRadio@\" class=\"priorEducationnull\" value=\"\" type=\"radio\"><label for=\"priorEducationRadio@\">&nbsp;Not Specified</label></br>';\n\t\t\t$form_ret .= \"<div id='PriorEducation' style='display:\".($value_array ? 'block' : 'none').\";'>\";\n\t\t\t$form_ret .= '<table id=\"priorEducationTable\" style=\"margin-top: 1em; display: table;\">';\n\t\t\t$form_ret .= '<thead><tr><th>Title'.(get_axl_req_fields('prior_ed') === 'prior_ed' ? '<span class=\"red\">*</span>' : '').'</th><th>Recognition ID'.(get_axl_req_fields('prior_ed') === 'prior_ed' ? '<span class=\"red\">*</span>' : '').'</th></tr></thead>';\n\t\t\t$prioredcount = 0;\n\t\t\tforeach ($priorEducationTitle as $key => $value) {\n\t\t\t\t$priodEdID = '';\n\t\t\t\t$priorRecog = '';\n\t\t\t\tif($value_array){\n\t\t\t\t\tforeach ($value_array as $key_l) {\n\t\t\t\t\t\t$k_val = $key_l[0].$key_l[1].$key_l[2];\n\t\t\t\t\t\tif($k_val == $key){\n\t\t\t\t\t\t\t$priodEdID = $key;\n\t\t\t\t\t\t\tif($key_l[3]){\n\t\t\t\t\t\t\t\t$priorRecog = $key_l[3];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$prioredcount++;\n\t\t\t\t$form_ret .= '<tbody><tr><td>';\n\t\t\t\t$form_ret .= '<label><input name=\"priorEducationCheck[]\" data-variable=\"'.$key.'\" value=\"'.$key.$priorRecog.'\" '.($priodEdID == $key ? 'checked' : '').' type=\"checkbox\" id=\"prioredcheck'.$prioredcount.'\" class=\"priorEducationCheck\" data-value=\"'.$value.'\">&nbsp;&nbsp;'.$value.'</label>';\n\t\t\t\t$form_ret .= '</td><td>';\n\t\t\t\t$form_ret .= '<select class=\"priorEducationRecog\" id=\"prioredselect'.$prioredcount.'\">';\n\t\t\t\t$form_ret .= '<option class=\"noData\" value=\"\"> -- Not specified -- </option>';\n\t\t\t\tforeach ($priorEducationRecog_list as $key1 => $value1) {\n\t\t\t\t\t$form_ret .= '<option value=\"'.$key1.'\" '.($priorRecog == $key1 ? 'selected' : '').'>'.$value1.'</option>';\n\t\t\t\t}\n\t\t\t\t$form_ret .= '</select>';\n\t\t\t\t$form_ret .= '</td></tr>';\n\t\t\t\t$form_ret .= '</tbody>';\n\t\t\t\t$form_ret .= '<script>';\n\t\t\t\t$form_ret .= 'jQuery(document).ready(function(){';\n\t\t\t\t\t$form_ret .= 'var prioredcheckval'.$prioredcount.' = jQuery( \"#prioredcheck'.$prioredcount.'\" ).attr(\"data-variable\");';\n\t\t\t\t\t$form_ret .= 'jQuery( \"#prioredselect'.$prioredcount.'\" ).on(\"change\", function() {';\n\t \t\t\t$form_ret .= 'jQuery( \"#prioredcheck'.$prioredcount.'\" ).val(prioredcheckval'.$prioredcount.' + jQuery(this).val());';\n\t\t\t\t\t$form_ret .= '});';\n\t\t\t\t$form_ret .= '});';\n\t\t\t\t$form_ret .= '</script>';\n\t\t\t}\n\t\t\t$form_ret .= '<input type=\"hidden\" id=\"prioredcount\" value=\"'.$prioredcount.'\">';\n\t\t\t$form_ret .= '</table>';\n\t\t\t$form_ret .= \"</div>\";\n\t\t}\n\t\treturn $form_ret;\n\t}" ]
[ "0.6223644", "0.53187007", "0.53092265", "0.52474815", "0.52237827", "0.5216263", "0.5115766", "0.50811625", "0.5071113", "0.4988595", "0.49541777", "0.49491763", "0.49457964", "0.49439424", "0.49324158", "0.4928264", "0.4917653", "0.48897353", "0.48842284", "0.48779628", "0.48752287", "0.48680854", "0.48607317", "0.4856309", "0.48556393", "0.4852165", "0.4844146", "0.48428875", "0.48371613", "0.4831452", "0.48308733", "0.48165572", "0.48157343", "0.47727746", "0.47715378", "0.47597298", "0.47590527", "0.4751456", "0.47427657", "0.47367013", "0.47237167", "0.47218207", "0.4713713", "0.47136146", "0.47130963", "0.47042018", "0.47020665", "0.46989027", "0.46968105", "0.46961722", "0.46913", "0.46874553", "0.4684599", "0.46790397", "0.4669552", "0.46588922", "0.465806", "0.46544415", "0.46536934", "0.4651179", "0.4650291", "0.4642817", "0.4638487", "0.4638401", "0.46281898", "0.4625412", "0.46108976", "0.46065468", "0.46045825", "0.46003217", "0.45876488", "0.4587116", "0.45811537", "0.45807835", "0.45764884", "0.45718193", "0.45709231", "0.45648763", "0.4559909", "0.45592198", "0.4556325", "0.45553032", "0.45511338", "0.45496804", "0.45483536", "0.45456588", "0.45455104", "0.45322618", "0.4529169", "0.4523555", "0.45227018", "0.45226884", "0.45208994", "0.45202732", "0.45153862", "0.45135683", "0.45104423", "0.4506966", "0.449516", "0.44889048" ]
0.5841433
1
Register any authentication / authorization services.
public function boot() { $this->registerPolicies(); // 注册CasUserProvider \Auth::provider('cas', function($app, array $config) { return new \Xjtuana\Cas\Auth\CasUserProvider($config['model']); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices() {\n // Modules\n $this->addService('modules', 'MyTravel\\Core\\Service\\Modules::setService');\n // Routing\n $this->addService('routing', 'MyTravel\\Core\\Service\\Routing::setService');\n // Event dispatcher\n $this->serviceContainer\n ->register('events', 'Symfony\\Component\\EventDispatcher\\EventDispatcher');\n // Database\n $this->addService('db', 'MyTravel\\Core\\Service\\Db::setService');\n // Access\n $this->addService('access', 'MyTravel\\Core\\Service\\Access::setService');\n }", "protected function registerServices(): void\n {\n $this->registerKernels();\n $this->registerFactories();\n $this->registerMicroServices();\n }", "public function registerAuth()\n {\n $this->container->make(DingoAuth\\Auth::class)->extend('jwt', function($app) {\n return new DingoAuth\\Provider\\JWT($app[\\Antares\\Modules\\Api\\Providers\\Auth\\JWT::class]);\n });\n }", "public function registerAuthServices(Container $container)\n {\n static $provider = null;\n\n if ($provider === null) {\n $provider = new AuthServiceProvider();\n }\n\n $provider->register($container);\n }", "public function registerServices() {\n\t\t$services = $this->getServices();\n\t\t$services = array_map( [ $this, 'instantiateServices' ], $services );\n\t\t\n\t\tarray_walk( $services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "public static function register_services()\n {\n foreach ( self::get_services() as $class )\n {\n $service = self::instantiate( $class );\n if( method_exists( $service, 'register' ) )\n $service->register();\n }\n }", "public static function register_services()\n {\n foreach ( self::get_services() as $class ) {\n $service = self::instantiate( $class );\n if ( method_exists( $service, 'register' ) ) {\n $service->register();\n }\n }\n }", "public static function register_services()\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($service, 'register')) {\n $service->register();\n }\n }\n }", "public function register_services() {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( ! empty( $this->services ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$classes = $this->get_service_classes();\n\n\t\t$this->services = array_map(\n\t\t\t[ $this, 'instantiate_service' ],\n\t\t\t$classes\n\t\t);\n\n\t\tarray_walk( $this->services, function ( Service $service ) {\n\t\t\t$service->register();\n\t\t} );\n\t}", "protected function registerServices()\r\n\t{\r\n\r\n\t\t$di = new FactoryDefault();\r\n\r\n\t\t$loader = new Loader();\r\n\r\n\t\t/**\r\n\t\t * We're a registering a set of directories taken from the configuration file\r\n\t\t */\r\n\t\t$loader->registerDirs(\r\n\t\t\tarray(\r\n\t\t\t\t__DIR__ . '/../apps/library/',\r\n\t\t\t\t__DIR__ . '/../apps/plugins/'\r\n\t\t\t)\r\n\t\t)->register();\r\n\r\n\r\n\r\n\t\t//Registering a router\r\n\t\t$di->set('router', function(){\r\n\r\n\t\t\t$router = new Router();\r\n\r\n\t\t\t$router->setDefaultModule(\"frontend\");\r\n\t\t\t$router->setDefaultController(\"index\");\r\n\t\t\t$router->setDefaultAction(\"index\");\r\n\r\n $router->add(\"/register/recoveryPassword\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'recoveryPassword',\r\n ));\r\n $router->add(\"/register/index\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'register',\r\n 'action' => 'index',\r\n ));\r\n\r\n $router->add(\"/help/about\", array(\r\n 'module' => 'frontend',\r\n 'controller' => 'help',\r\n 'action' => 'about',\r\n ));\r\n\r\n\t\t\t\r\n\t\t\t$router->add(\"/ajax/getlast\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 'ajax',\r\n\t\t\t\t'action' => 'getlast',\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$router->add(\"/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'frontend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/:controller/:action/:params\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 1,\r\n\t\t\t\t'action' => 2,\r\n\t\t\t\t'params'=>3\r\n\t\t\t));\r\n\r\n// $router->add(\"/admin/register\", array(\r\n// 'module' => 'backend',\r\n// 'controller' => 'register',\r\n// 'action' => 'index',\r\n// ));\r\n\r\n\t\t\t$router->add(\"/admin\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\t\t\t$router->add(\"/admin/login\", array(\r\n\t\t\t\t'module' => 'backend',\r\n\t\t\t\t'controller' => 'login',\r\n\t\t\t\t'action' => 'index',\r\n\t\t\t));\r\n\r\n\r\n\r\n//\t\t\t$router->notFound(array(\r\n//\t\t\t\t\"controller\" => \"index\",\r\n//\t\t\t\t\"action\" => \"page404\",\r\n//\t\t\t));\r\n\r\n\t\t\treturn $router;\r\n\r\n\t\t});\r\n\r\n\t\t$this->setDI($di);\r\n\t}", "public static function register_services(): void\n {\n foreach (self::get_services() as $class) {\n $service = self::instantiate($class);\n if (method_exists($class, 'register')) {\n $service->register();\n }\n }\n }", "public function register()\n {\n $this->registerAuthenticator();\n }", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function registerServices(DiInterface $di)\n {\n self::acl($di);\n }", "public function registerServices(){\n }", "protected function registerServiceProviders()\n {\n foreach ($this->providers as $provider) {\n $this->app->register($provider);\n }\n }", "protected function registerServices()\n {\n\n $di = new FactoryDefault();\n\n /**\n * Read services\n */\n include CORE_PATH . \"/config/services.php\";\n\n /**\n * Get config service for use in inline setup below\n */\n $config = $di->getConfig();\n\n\n include CORE_PATH . '/config/loader.php';\n\n \n\n $this->setDI($di);\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n API::error(function (AuthorizationException $exception)\n {\n //如果出现权限异常,请先检查策略是否有再服务提供者中进行绑定\n abort(403, $exception->getMessage());\n });\n\n API::error(function (AuthenticationException $exception)\n {\n abort(401, $exception->getMessage());\n });\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function registerServices()\n {\n $this->app->bind('helpers.lib', function($app) {\n return new LibHelper;\n });\n $this->app->bind('helpers.theme', function($app) {\n return ThemeHelper::instance();\n });\n $this->app->bind('helpers.acf', function($app) {\n $helper = AcfHelper::instance();\n $helper->setThemeHelper($this->app['helpers.theme']);\n $helper->setLib($this->app['helpers.lib']);\n\n return $helper;\n });\n }", "protected function registerServiceProviders()\n {\n if ($this->active()->has('providers')) {\n $providers = $this->active()->get('providers');\n\n foreach ($providers as $provider) {\n App::register($provider);\n }\n }\n }", "public function registerDefaultServices()\n {\n /*\n * Add Paths to container\n */\n $this['basePath'] = $this->basePath();\n $this['storagePath'] = $this->basePath().'/storage';\n $this['appPath'] = $this->appPath();\n\n $this->register(new DefaultServices($this));\n\n $this->register(new ErrorHandlerService($this));\n\n // Enable debug based on user configuration\n if (true === $this->app->config->get('app')['debug']) {\n Debug::enable();\n }\n\n /*\n * retister View Provider\n */\n $this->register(new ViewServiceProvider($this));\n\n /*\n * Register Route Provider\n */\n $this->register(new RouteServiceProvider($this));\n\n /*\n * Register Database Provider\n */\n $this->register(new DatabaseServiceprovider($this));\n }", "public function registerServices()\n {\n /**\n * @var $container Container\n */\n $container = $this->getContainer();\n\n $services = $container->settings['services'];\n\n if (is_array($services) && !empty($services)) {\n foreach ($services as $service) {\n /**\n * @var $instance ServiceInterface\n */\n $instance = new $service();\n\n $container[$instance->name()] = $instance->register();\n\n unset($instance);\n }\n }\n\n unset($container, $services, $service);\n }", "public function register_services(): void {\n\t\t// Bail early so we don't instantiate services twice.\n\t\tif ( \\count( $this->service_container ) > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the injector as the very first service.\n\t\t$this->service_container->put(\n\t\t\tstatic::SERVICE_PREFIX . static::INJECTOR_ID,\n\t\t\t$this->injector\n\t\t);\n\n\t\t$services = $this->get_service_classes();\n\n\t\tif ( $this->enable_filters ) {\n\t\t\t/**\n\t\t\t * Filter the default services that make up this plugin.\n\t\t\t *\n\t\t\t * This can be used to add services to the service container for\n\t\t\t * this plugin.\n\t\t\t *\n\t\t\t * @param array<string, string> $services Associative array of identifier =>\n\t\t\t * class mappings. The provided\n\t\t\t * classes need to implement the\n\t\t\t * Service interface.\n\t\t\t */\n\t\t\t$filtered_services = apply_filters(\n\t\t\t\tstatic::HOOK_PREFIX . static::SERVICES_FILTER,\n\t\t\t\t$services\n\t\t\t);\n\n\t\t\t$services = $this->validate_services( $filtered_services );\n\t\t}\n\n\t\twhile ( null !== key( $services ) ) {\n\t\t\t$id = $this->maybe_resolve( key( $services ) );\n\n\t\t\t$class = $this->maybe_resolve( current( $services ) );\n\n\t\t\t// Delay registering the service until all requirements are met.\n\t\t\tif (\n\t\t\t\tis_a( $class, HasRequirements::class, true )\n\t\t\t) {\n\t\t\t\tif ( ! $this->requirements_are_met( $id, $class, $services ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->schedule_potential_service_registration( $id, $class );\n\n\t\t\tnext( $services );\n\t\t}\n\t}", "public function boot()\n\t{\n\t\t$this->registerPolicies();\n\n\t\tAuth::provider('api_token', function($app, array $config) {\n\t\t\treturn new ApiTokenUserProvider();\n\t\t});\n\n\t\tAuth::extend('api_token', function ($app, $name, array $config) {\n\t\t\t$guard = new ApiTokenGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'api_token',\n\t\t\t\t$config['storage_key'] ?? 'api_token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\n\t\tAuth::provider('firebase', function($app, array $config) {\n\t\t\treturn new FirebaseUserProvider();\n\t\t});\n\n\t\tAuth::extend('firebase', function ($app, $name, array $config) {\n\t\t\t$guard = new FirebaseGuard(\n\t\t\t\tAuth::createUserProvider($config['provider']),\n\n\t\t\t\t$app['request'],\n\t\t\t\t$config['input_key'] ?? 'token',\n\t\t\t\t$config['storage_key'] ?? 'token',\n\t\t\t\t$config['hash'] ?? true\n\t\t\t);\n\n\t\t\treturn $guard;\n\t\t});\n\t}", "public function register()\n {\n $this->registerServices();\n }", "protected function registerBaseServices()\n {\n $container = $this->getContainer();\n\n $container->share('logger', function () use ($container) {\n return new Logger($container->get('config'));\n });\n\n $this->registerService(new Providers\\ConfigProvider());\n $this->registerService(new Providers\\FileSystemProvider());\n $this->registerService(new Providers\\ParserManagerProvider());\n $this->registerService(new Providers\\BackendProvider());\n }", "public function register()\n\t{\n\t\t$this->registerAuthInstall();\n\t}", "public function registerServices() {\n\t\t$services = Config::inst()->get('FakeManager', 'services');\n\t\tif($services) {\n\t\t\tforeach($services as $origName => $fakeName) {\n\t\t\t\t$fakeObj = Injector::inst()->create($fakeName);\n\t\t\t\tif($this->db && $fakeObj instanceof FakeDatabaseConsumerInterface) {\n\t\t\t\t\t$fakeObj->setDb($this->db);\n\t\t\t\t}\n\t\t\t\t$this->services[$origName] = $fakeObj;\n\t\t\t\tInjector::inst()->registerService($fakeObj, $origName);\n\t\t\t}\n\t\t}\n\t}", "public function boot(): void\n {\n $this->registerPolicies();\n\n Auth::provider('null', fn (Application $app, array $config) => new NullUserProvider($config['model'] ?? IAPUser::class));\n\n Auth::provider('list', fn (Application $app, array $config) => new ListUserProvider($config['model'] ?? IAPUser::class, $config['list'] ?? []));\n\n Auth::provider('group', fn (Application $app, array $config) => new GroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n Auth::provider('identity-group', fn (Application $app, array $config) => new IdentityGroupUserProvider($config['model'] ?? IAPUser::class, $config['group'] ?? ''));\n\n $this->viaRequest('firebase', [Guard\\Firebase_Guard::class, 'validate']);\n\n $this->viaRequest('gae-internal', [Guard\\AppEngine_Guard::class, 'validate']);\n $this->viaRequest('gae-iap', [Guard\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-oidc', [Guard\\OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-oauth2', [Guard\\OAuth2_Guard::class, 'validate']);\n\n $this->viaRequest('gae-combined-iap', [Guard\\Combined\\IAP_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc', [Guard\\Combined\\IAP_OIDC_Guard::class, 'validate']);\n $this->viaRequest('gae-combined-iap-oidc-oauth2', [Guard\\Combined\\IAP_OIDC_OAuth2_Guard::class, 'validate']);\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n\t{\n\t\t$this->registerCommands();\n\t\t$this->registerHybridAuth();\n\t}", "public function register(): void\n {\n $this->configure();\n $this->registerServices();\n }", "public function boot()\n {\n $this->registerPolicies();\n $this->registerPassport();\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function boot()\n {\n require __DIR__ . '/helpers.php';\n\n $this->app['auth']->extend('custom', function ($app, $name, array $config) {\n $guard = new Guard($name, $app['auth']->createUserProvider($config['provider']), $app['session.store']);\n $guard->setCookieJar($app['cookie']);\n $guard->setDispatcher($app['events']);\n $guard->setRequest($app->refresh('request', $guard, 'setRequest'));\n\n return $guard;\n });\n\n $this->app['auth']->provider('custom', function ($app) {\n return new EloquentUserProvider(\n $app[Hasher::class],\n $app[UserRepository::class],\n $app[TeamRepository::class]\n );\n });\n\n $this->registerPolicies();\n }", "public function registerServices($di)\n\t{\n\n\t\t//Registering a dispatcher\n\t\t$di->set(Services::DISPATCHER, function () {\n\t\t\t$eventsManager = new EventsManager;\n\n\t\t\t/**\n\t\t\t * Check if the user is allowed to access certain action using the SecurityPlugin\n\t\t\t */\n\t\t\t$eventsManager->attach('dispatch:beforeDispatch', new APISecurityPlugin);\n\n\t\t\t$dispatcher = new \\Phalcon\\Mvc\\Dispatcher();\n\t\t\t$dispatcher->setDefaultNamespace(\"Multiple\\\\API\\\\Controllers\");\n\t\t\t$dispatcher->setEventsManager($eventsManager);\n\n\t\t\treturn $dispatcher;\n\t\t});\n\n\t\t/**\n\t\t * Setting up the view component\n\t\t */\n\t\t//Registering a shared view component\n\t\t$di->set(Services::VIEW, function() {\n\t\t\t$view = new \\Phalcon\\Mvc\\View();\n\t\t\t$view->setViewsDir(APP_PATH.'app/modules/api/views/');\n\t\t\t$view->registerEngines(array(\".volt\" => 'volt'));\n\t\t\treturn $view;\n\t\t});\n\n\t\t/**\n\t\t * Setting up volt\n\t\t */\n\t\t$di->set(Services::VOLT, function($view, $di) {\n\t\t\t$volt = new VoltEngine($view, $di);\n\n\t\t\t$volt->setOptions(array(\n\t\t\t\t\"compiledPath\" => APP_PATH . \"cache/api/\"\n\t\t\t));\n\n\t\t\t$compiler = $volt->getCompiler();\n\t\t\t$compiler->addFunction('is_a', 'is_a');\n\n\t\t\treturn $volt;\n\t\t}, true);\n\n\n\t\t$di->setShared(Services::AUTH_MANAGER, function () use ($di) {\n\n\t\t\t$authManager = new AuthenticateManager(60000);\n\t\t\t$authManager->registerAdaptor(MobileAdaptor::NAME, new MobileAdaptor());\n\t\t\t$authManager->registerTokenParser(new TokenParser(\"mysecret\"));\n\n\t\t\treturn $authManager;\n\t\t});\n\n\t\t/**\n\t\t * @description PhalconRest - \\League\\Fractal\\Manager\n\t\t */\n\t\t$di->setShared(Services::FRACTAL_MANAGER, function () {\n\n\t\t\t$fractal = new \\League\\Fractal\\Manager;\n\t\t\t$fractal->setSerializer(new CustomSerializer());\n\n\t\t\treturn $fractal;\n\t\t});\n\n\t\t/** @var \\Phalcon\\Http\\ResponseInterface $response */\n\t\t$response = $di->get('response');\n\t\t$response->setHeader('Access-Control-Allow-Origin', '*')\n\t\t\t->setContentType('application/json', 'utf-8');\n\n\t}", "protected function registerServices()\n {\n $this->singleton('request', function ($app) {\n return new Request($app);\n });\n\n $this->singleton('response', function ($app) {\n return new Response($app);\n });\n\n $this->singleton('route', function ($app) {\n return new Route($app);\n });\n\n $this->singleton('view', function ($app) {\n return new View($app);\n });\n\n $this->singleton('exception', function ($app) {\n return new Exception($app, $app->exception);\n });\n\n $this->singleton('crypt', function ($app) {\n return new Crypt($app->getSecret());\n });\n\n $this->singleton('cookie', function ($app) {\n return new Cookie($app, $app->getConfig('state')['cookie']);\n });\n\n $this->singleton('session', function ($app) {\n return new Session(new SessionDatabaseHandler($app, $app->getConfig('state')['session']));\n });\n\n return $this->factory();\n }", "protected function registerServiceProviders()\n {\n $this->register(\\Illuminate\\Events\\EventServiceProvider::class);\n if(is_array($providers = $this['config']['providers'])){\n foreach ($providers as $alias => $provider) {\n if (!is_int($alias)) {\n $this->services[$alias] = $provider;\n } else {\n $this->register($provider);\n }\n }\n }\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n\n $this->registerPermissionMerger();\n\n $this->registerPermissionChecker();\n\n $this->registerHasher();\n\n $this->registerTokenRepository();\n\n $this->registerUserProvider();\n\n $this->registerLoginValidator();\n\n $this->registerGroupRepository();\n\n $this->registerGroupManager();\n\n $this->registerUserRepository();\n\n $this->app->singleton('auth.driver', function($app)\n {\n return $app['auth']->guard();\n });\n\n }", "protected function registerServices()\n {\n $this->app->singleton('components', function($app) {\n $path = $app['config']->get('components.paths.components');\n\n return new Repository($app, $path);\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n $headerParser = new AuthHeaders();\n auth()->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Device');\n auth('device')->parser()->setChain([$headerParser]);\n $this->app->forgetInstance('tymon.jwt.parser');\n $this->app->forgetInstance('tymon.jwt');\n $headerParser = new AuthHeaders();\n $headerParser->setHeaderPrefix('Authorizer');\n auth('authorizer')->parser()->setChain([$headerParser]);\n\n Gate::before(function (Authorizable $user, string $ability) {\n if ($user instanceof AuthorizableInterface) {\n return $user->hasPermissionTo($ability) ?: null;\n }\n });\n }", "protected function registerAuthenticator()\n {\n $this->app->singleton('auth', function ($app) {\n return new AuthManager($app);\n });\n }", "protected function loadServices()\n {\n $di = $this->getDI();\n\n // Register the dispatcher setting a Namespace for controllers\n $di->setShared('dispatcher', function () {\n\n\n $dispatcher = new Dispatcher();\n $dispatcher->setDefaultNamespace('Phalcana\\Controllers');\n\n $listener = new Dispatch;\n $events = new Manager();\n $events->attach('dispatch', $listener);\n $dispatcher->setEventsManager($events);\n\n return $dispatcher;\n });\n\n $di->setShared('router', $this->loadRoutes(new Router(false)));\n }", "public function register()\n {\n $this->app->when(PaypalController::class)\n ->needs(PaymentInterface::class)\n ->give(PaypalService::class);\n\n $this->app->when(StripeController::class)\n ->needs(PaymentInterface::class)\n ->give(StripeService::class);\n\n $this->app->when(SquarePayController::class)\n ->needs(PaymentInterface::class)\n ->give(SquarePayService::class);\n }", "private function providers()\n {\n $this->register(new CorsServiceProvider());\n $this->register(new HmacServiceProvider());\n }", "protected function registerServices()\n {\n $this->app->singleton('adminmenu', function () {\n return new Builder();\n });\n }", "private function registerAll()\n {\n $this->registerApp();\n $this->registerPsr();\n $this->registerRequests();\n $this->registerResponses();\n $this->registerPlugins();\n $this->registerCallables();\n $this->registerViews();\n $this->registerUtils();\n }", "public function boot()\n {\n $this->app->singleton('api.auth', function ($app) {\n return new AuthManager(new RequestTokenStorage($app->make('request')));\n });\n }", "public function boot()\n {\n $this->app->bind(\n AuthorizationInterface::class,\n User::class\n );\n }", "public function register()\n {\n // Bind Credential Contract with Service\n $this->app->bind(Credentials::class, function ($app){\n return new CredentialsManger($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n\n // Bind Caption Contract with Service\n $this->app->bind(Configuration::class, function ($app){\n return new ConfigurationManager($app->make('filesystem.disk'));\n });\n\n // Inject dependencies into Auth Service.\n $this->app->singleton(Post::class, function ($app){\n return new PostService(new Instagram(true, true), $app->make(Credentials::class));\n });\n\n // Inject Guzzle Into Reddit Service\n $this->app->singleton(Scraper::class, function ($app){\n return new ScraperService(new Client(['base_uri' => 'http://www.reddit.com']), $app->make(Configuration::class), $app->make('filesystem.disk'));\n });\n\n $this->app->bind(Caption::class, function ($app){\n return new CaptionManager($app->make('filesystem.disk'), $app->make('encrypter'));\n });\n }", "public function boot()\n {\n $this->app['auth']->extend('jwt', function ($app) {\n $bearerToken = $app['request']->server->getHeaders()['AUTHORIZATION'] ?? '';\n $tokenService = new TokenService();\n $guard = new JwtGuard($bearerToken, $tokenService);\n return $guard;\n });\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "protected function registerServiceProviders()\n\t{\n\t\t// Core Bus\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Bus\\BusServiceProvider');\n\n\t\t// Core Event\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Events\\EventsServiceProvider');\n\n\t\t// Repositories\n\t\t// -----------------------------------------------------------------------------\n\t\t$this->app->register('Congraph\\Core\\Repositories\\RepositoriesServiceProvider');\n\t}", "public function register()\n\t{\n $this->registerApi();\n\t}", "public function boot()\n {\n Passport::routes(function ($router) {\n $router->forAuthorization();\n $router->forAccessTokens();\n //$router->forTransientTokens(); // the tokens we issue are permanent\n //$router->forClients(); // we don't want external applications using our oauth flows\n //$router->forPersonalAccessTokens(); // we don't have a user-facing API yet\n });\n\n $this->registerPolicies();\n\n Gate::define('use-permission', function ($user, $permission) {\n if ($user->hasRole('privacc') && config()->get('app.env') != 'production') {\n return true;\n }\n\n try {\n return auth()->user()->hasPermissionTo($permission);\n } catch (PermissionDoesNotExist $e) {\n return false;\n }\n });\n\n $this->serviceAccessGates();\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new RouteServiceProvider($this));\n }", "public function register()\n {\n $this->app->bind('redhotmayo\\auth\\AuthorizationService', AuthorizationService::SERVICE);\n $this->app->bind('AuthorizationService', AuthorizationService::SERVICE);\n\n // Register 'api_authorizer' instance container to our ApiAuthorizer object\n $this->app['api_authorizer'] = $this->app->share(function($app)\n {\n $service = App::make('AuthorizationService');\n return new ApiAuthorizer($service);\n });\n\n // Shortcut so developers don't need to add an Alias in app/config/app.php\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('ApiAuthorizer', 'redhotmayo\\api\\auth\\ApiAuthorizer');\n });\n }", "public function register(): void\n\t{\n\t\t$this->mergeConfigFrom(__DIR__.'/../../config/larauthkit.php', 'larauthkit');\n\t\tif (config('larauthkit.authn.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthkitEventServiceProvider::class);\n\t\t\t$this->app->register(AuthnServiceProvider::class);\n\t\t}\n\n\t\tif (config('larauthkit.authz.enable'))\n\t\t{\n\t\t\t$this->app->register(AuthzServiceProvider::class);\n\t\t}\n\t}", "public function __construct()\n {\n $this->userService = Core::getService(UserService::class);\n $this->applicationService = Core::getService(ApplicationService::class);\n $this->libraryService = Core::getService(LibraryService::class);\n $this->middleware('auth');\n }", "protected function registerServices()\n {\n $this->app->singleton(\n 'adminmenu',\n function () {\n return new Builder();\n }\n );\n }", "public function register()\n {\n $this->registerBindings(collect($this->bindings));\n $this->registerFactories(collect($this->factories));\n $this->registerProviders(collect($this->providers));\n $this->registerSeeders(collect($this->seeders));\n }", "protected function registerBaseServiceProviders()\n {\n $this->register(new EventServiceProvider($this));\n $this->register(new LogServiceProvider($this));\n $this->register(new RoutingServiceProvider($this));\n }", "public function register(): void\n {\n $this->registerMultipleConfig();\n\n $this->registerProviders([\n Providers\\AuthServiceProvider::class,\n Providers\\RouteServiceProvider::class,\n ]);\n\n $this->registerCommands([\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeExtensionGrant(), Passport::tokensExpireIn()\n );\n\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeQRCodeGrant(), Passport::tokensExpireIn()\n );\n\n Passport::routes();\n\n Passport::tokensCan([\n 'create-dragons' => 'Create dragons',\n 'create-trees' => 'Create trees',\n 'create-child-accounts' => 'Create child accounts',\n 'update-child-accounts' => 'Update child accounts',\n 'update-profile' => 'Update profile',\n ]);\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'StartMeUp\\Services\\Registrar'\n\t\t);\n\n\t\t$repositories = [\n\t\t\t'Company',\n\t\t];\n\t\tforeach ($repositories as $repository) {\n\t\t\t$this->bindRepository($repository);\n\t\t}\n\n\t}", "public function register()\n {\n $this->loadConfigs(['assets.php', 'permissions.php']);\n $this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');\n\n $this->app->bind(Authentication::class, SentinelAuthentication::class);\n }", "public function boot(): void\n {\n $this->registerPolicies();\n }", "public function boot() {\n\t\t$this->registerPolicies();\n\n\t\tPassport::routes();\n\t\tPassport::tokensExpireIn(Carbon::now()->addMinutes(30));\n\t\tPassport::refreshTokensExpireIn(carbon::now()->addDays(30));\n\t\tPassport::personalAccessTokensExpireIn(Carbon::now()->addMonths(2));\n\n\t\t//Register implicit grant type\n\t\tPassport::enableImplicitGrant();\n\n\t\t//Scopes for api\n\t\tPassport::tokensCan(['purchase-product' => 'Create transactions for products',\n\t\t\t'manage-product' => 'Create, read, delete, update products',\n\t\t\t'manage-account' => 'Read account data if verified or is admin modify data but can not remove account',\n\t\t\t'read-general' => 'Read general information like purcahsing categories, selling proucts, your transactions etc',\n\t\t]);\n\t}", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes(null, [\n 'prefix' => 'oauth'\n ]);\n\n Gate::define('upload_budgets', function ($user) {\n return $user->permissions()->where('key', 'upload_budgets')->count();\n });\n\n Gate::define('manage_categories', function ($user) {\n return $user->permissions()->where('key', 'manage_categories')->count();\n });\n\n Gate::define('manage_citizens', function ($user) {\n return $user->permissions()->where('key', 'manage_citizens')->count();\n });\n\n Gate::define('manage_shop-keepers', function ($user) {\n return $user->permissions()->where('key', 'manage_shop-keepers')->count();\n });\n\n Gate::define('manage_budgets', function ($user) {\n return $user->permissions()->where('key', 'manage_budgets')->count();\n });\n\n Gate::define('manage_vouchers', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers')->count();\n });\n\n Gate::define('manage_admins', function ($user) {\n return $user->permissions()->where('key', 'manage_admins')->count();\n });\n\n Gate::define('manage_permissions', function ($user) {\n return $user->permissions()->where('key', 'manage_permissions')->count();\n });\n\n Gate::define('manage_vouchers_transactions', function ($user) {\n return $user->permissions()->where('key', 'manage_vouchers_transactions')->count();\n });\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Auth::extend('custom', function ($app, $name, array $config) {\n $guard = new CustomGuard($name, Auth::createUserProvider($config['provider']), $app['session.store']);\n\n if (method_exists($guard, 'setCookieJar')) {\n $guard->setCookieJar($this->app['cookie']);\n }\n\n if (method_exists($guard, 'setDispatcher')) {\n $guard->setDispatcher($this->app['events']);\n }\n\n if (method_exists($guard, 'setRequest')) {\n $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));\n }\n\n return $guard;\n });\n }", "public function register()\n {\n $this->app->routeMiddleware([\n 'auth' => Authenticate::class,\n ]);\n\n $this->app->router->group(['prefix' => 'api/xblock/auth', 'namespace' => 'XBlock\\Auth'], function ($router) {\n $router->post('/login', [\n 'uses' => 'Login@index',\n ]);\n $router->get('/user', [\n 'uses' => 'Login@getLoginUser',\n 'middleware' => 'auth'\n ]);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('migrations'),\n ], 'xblock');\n $this->registerMigrations();\n $this->commands([\n CreateKey::class\n ]);\n }\n\n }", "public function boot()\n {\n $this->configureAuthorization();\n }", "public function boot()\n {\n app(AuthorizationServer::class)->enableGrantType(\n $this->makeFirebaseGrant(), Passport::tokensExpireIn()\n );\n }", "public function boot()\n {\n $this->app['auth']->viaRequest('api', function ($request) {\n if ($request->header('Authorization')) {\n $key = explode(' ',$request->header('Authorization'));\n\n $client = new Client();\n $response = $client->get(env('SERVICE_ADDRESS_USER').'/users/validate/'.$key[(count($key)-1)]);\n return $response->getStatusCode()==200;\n }\n });\n }", "public function register()\n {\n $this->app->singleton('forrest', function ($app) {\n\n // Config options\n $settings = config('forrest');\n $storageType = config('forrest.storage.type');\n $authenticationType = config('forrest.authentication');\n\n // Dependencies\n $httpClient = $this->getClient();\n $input = new LaravelInput(app('request'));\n $event = new LaravelEvent(app('events'));\n $encryptor = new LaravelEncryptor(app('encrypter'));\n $redirect = $this->getRedirect();\n $storage = $this->getStorage($storageType);\n\n $refreshTokenRepo = new RefreshTokenRepository($encryptor, $storage);\n $tokenRepo = new TokenRepository($encryptor, $storage);\n $resourceRepo = new ResourceRepository($storage);\n $versionRepo = new VersionRepository($storage);\n $instanceURLRepo = new InstanceURLRepository($tokenRepo, $settings);\n $stateRepo = new StateRepository($storage);\n\n $formatter = new JSONFormatter($tokenRepo, $settings);\n\n switch ($authenticationType) {\n case 'OAuthJWT':\n $forrest = new OAuthJWT(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'WebServer':\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPassword':\n $forrest = new UserPassword(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n case 'UserPasswordSoap':\n $forrest = new UserPasswordSoap(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n default:\n $forrest = new WebServer(\n $httpClient,\n $encryptor,\n $event,\n $input,\n $redirect,\n $instanceURLRepo,\n $refreshTokenRepo,\n $resourceRepo,\n $stateRepo,\n $tokenRepo,\n $versionRepo,\n $formatter,\n $settings);\n break;\n }\n\n return $forrest;\n });\n }", "public function boot(): void\n {\n $adapter = $this->app->make(AdapterInterface::class);\n\n /* @phpstan-ignore-next-line */\n $this->app['auth']->viaRequest(\n 'remote-token-auth',\n fn (Request $request): Authenticatable => $adapter->authorize($request)\n );\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "private function initializeServices()\n {\n $this->emailManager = $this->getService('mycp.service.email_manager');\n $this->translatorService = $this->getService('translator');\n $this->securityService = $this->getService('Secure');\n $this->router = $this->getService('router');\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "private function registerAuthenticationRoutes(){\n $prefix = config('web-call-center.prefix');\n \\Route::group((!empty($prefix)? compact('prefix') : []) + ['namespace' => $this->namespace, 'middleware' => 'web'],\n __DIR__.'/../../routes/auth.php');\n }", "public function register()\n {\n $this->registerServices();\n $this->setupStubPath();\n $this->registerProviders();\n }", "protected function registerServiceProviders()\n {\n foreach($this->providers as $provider)\n {\n // check if the provider class exists\n if (class_exists($provider))\n {\n // register this service provider, and Instantiate it.\n $service = new $provider($this);\n\n // check if the service provider has a boot method.\n if (method_exists($service, 'register')) {\n $service->register();\n }\n\n // save the active provider so that we can call it later.\n $this->activeProviders[$provider] = $service;\n }\n }\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function boot()\n {\n \n // Aqui você pode definir como deseja que os usuários sejam autenticados para o seu Lumen\n // application. O retorno de chamada que recebe a instância de solicitação recebida\n // deve retornar uma instância do usuário ou nulo. Você é livre para obter\n // a instância do usuário por meio de um token de API ou qualquer outro método necessário.\n\n $this->app['auth']->viaRequest('api', function ($request) {\n return \\App\\Aluno::where('email',$request->input('email'))->first();\n });\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n /**\n * Sets third party service providers that are only needed on local environments\n */\n if ($this->app->environment() == 'local') {\n /**\n * Loader for registering facades\n */\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n /**\n * Load third party local providers and facades\n */\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n\n $this->app->register(\\Laracasts\\Generators\\GeneratorsServiceProvider::class);\n }\n $this->app->bind('soaClient', function ($app,$params) {\n $cloud = SOA::getInstance($params[0]);\n if($cloud->getEnv()){\n return $cloud;\n }\n $cloud->setEncodeType(true, true);\n $config = config('soa.'.$params[0]);\n $cloud->putEnv('app', $config['app']);\n $cloud->putEnv('appKey', $config['appKey']);\n $cloud->setServers($config['hosts']);\n return $cloud;\n });\n $this->app['request']->server->set('HTTPS', $this->app->environment() != 'local');\n }", "protected function registerGuard()\n {\n Auth::extend('passport', function ($app, $name, array $config) {\n return tap($this->makeGuard($config), function ($guard) {\n $this->app->refresh('request', $guard, 'setRequest');\n });\n });\n }", "public function register()\n {\n $this->app->bind(ClientRepositoryInterface::class, function() {\n return new ClientRepository();\n });\n\n $this->app->bind(AccessTokenRepositoryInterface::class, function() {\n return new AccessTokenRepository();\n });\n\n $this->app->bind(ScopeRepositoryInterface::class, function() {\n return new ScopeRepository();\n });\n\n $this->app->bind(ResourceServer::class, function() {\n $accessTokenRespository = new AccessTokenRepository();\n $publicKey = base_path('public.key');\n return new ResourceServer($accessTokenRespository, $publicKey);\n });\n\n $this->app->bind(AuthorizationServer::class, function() {\n\n $clientRepository = new ClientRepository();\n $scopeRepository = new ScopeRepository();\n $accessTokenRepository = new AccessTokenRepository();\n $authCodeRepository = new AuthCodeRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n\n\n $privateKey = base_path('private.key');\n $publicKey = base_path('public.key');\n $userRepository = new UserRepository();\n $refreshTokenRepository = new RefreshTokenRepository();\n $intervaloPadrao = new \\DateInterval('P12M');\n\n\n $server = new AuthorizationServer($clientRepository, $accessTokenRepository, $scopeRepository, $privateKey, $publicKey);\n $server->enableGrantType(new ClientCredentialsGrant(), $intervaloPadrao);\n $server->enableGrantType(new PasswordGrant($userRepository, $refreshTokenRepository), $intervaloPadrao);\n\n $authGrant = new AuthCodeGrant($authCodeRepository, $refreshTokenRepository, $intervaloPadrao);\n $authGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n \n \n $refreshGrant = new \\League\\OAuth2\\Server\\Grant\\RefreshTokenGrant($refreshTokenRepository);\n $refreshGrant->setRefreshTokenTTL(new \\DateInterval('P12M'));\n\n $server->enableGrantType($authGrant, $intervaloPadrao);\n $server->enableGrantType($refreshGrant, $intervaloPadrao);\n\n\n\n return $server;\n\n });\n\n }", "public function register()\n {\n // dynamically set the rootview based on whether the route is backend or frontend \n // can also be done in a middleware that wraps all admin routes\n if(request()->is('test-react/*')){\n Inertia::setRootView('react.app');\n } elseif(request()->is('test')){\n Inertia::setRootView('vue.app');\n } else {\n // some other\n }\n\n if ($this->app->environment() == 'local') {\n $this->app->register(\\Reliese\\Coders\\CodersServiceProvider::class);\n }\n $this->registerInertia();\n $this->registerWebSockets();\n }", "public function register()\n {\n\n $this->app->register(HookProvider::class);\n $this->app->register(RouteProvider::class);\n// $this->app->register(InstallModuleProvider::class);\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }", "public function boot()\n {\n $this->registerPolicies();\n\n Passport::routes();\n }" ]
[ "0.7238336", "0.71634316", "0.70841175", "0.6916285", "0.6882426", "0.68549484", "0.6853438", "0.6812384", "0.6786827", "0.6771727", "0.6648215", "0.66145295", "0.6606313", "0.6571872", "0.65712136", "0.65602577", "0.65544224", "0.65215147", "0.65081686", "0.64967656", "0.6473557", "0.6465625", "0.6440537", "0.6437382", "0.6419586", "0.63912356", "0.6371695", "0.6331455", "0.63311565", "0.6329123", "0.63267297", "0.6325765", "0.63092077", "0.6308683", "0.6301807", "0.62803197", "0.6268785", "0.62419224", "0.6224927", "0.62247604", "0.62150115", "0.62082845", "0.6207118", "0.6200618", "0.6199985", "0.6199563", "0.61966515", "0.61902905", "0.61892736", "0.61820686", "0.6179434", "0.6158386", "0.61570966", "0.61423475", "0.61418444", "0.6128293", "0.6118749", "0.61166286", "0.6112297", "0.6104109", "0.6099709", "0.60972136", "0.6073358", "0.60715634", "0.60552776", "0.60526836", "0.60454774", "0.6043968", "0.604386", "0.6043709", "0.6040946", "0.6038717", "0.60383916", "0.60350347", "0.60292214", "0.6003098", "0.599686", "0.5995341", "0.59874433", "0.598662", "0.5982651", "0.5974995", "0.5973818", "0.59618443", "0.59618413", "0.59617674", "0.59532464", "0.59489155", "0.5946842", "0.59463835", "0.5943532", "0.59256464", "0.5916127", "0.59147394", "0.5912967", "0.59065604", "0.5904983", "0.5903013", "0.5897574", "0.5897574", "0.5897574" ]
0.0
-1
'/' or '.' works but '.' makes it look more object oriented
public function getHome() { $posts = Post::all(); return view('pages.home')->withPosts($posts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slashify($str)\n{\n return unslashify($str).'/';\n}", "function wd_convert_slash($string){\n return str_replace(\"\\\\\", \"/\", $string);\n}", "function dots_to_path($dots)\n{\n return '/' . str_replace('.', '/', $dots);\n}", "public function testLiteralSlash()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /\\\\// \");\n $this->assertEquals(array(\"/\"), $grammar1->parse(\"/\"));\n }", "function _alpha_slash_dot($field)\r\n\t{\r\n\t\treturn ( ! preg_match('/^([\\.\\/-a-z0-9_-])+$/i', $this->{$field})) ? FALSE : TRUE;\r\n\t}", "function _WDF($d){\n return str_replace('\\\\', '/', $d);\n}", "function formatPath($f)\n{\n\t$f = preg_replace('/[\\\\\\\\\\/]+/', '/', $f);\n\t$f = preg_replace('`[^/]+/\\.\\./`', '', $f);\n\t$f = preg_replace('`(^|/)\\K\\./`', '', $f);\n\treturn $f;\n}", "function slashes($string)\n{\n\treturn str_replace('\\\\', '/', $string);\n}", "function path_escape($v) {\n\treturn preg_replace('/(\\/\\.\\/)|[\\/\\\\\\]|(\\.\\.)/', '', $v);\n}", "public function addSlash(){\n $this->firstname = addslashes($this->firstname);\n $this->lastname = addslashes($this->lastname);\n $this->company = addslashes($this->company);\n $this->country = addslashes($this->country);\n $this->place = addslashes($this->place);\n $this->street = addslashes($this->street);\n $this->description = addslashes($this->description); \n }", "function wp_slash($value)\n {\n }", "public function addSlashes( $t );", "function trailingslashit($value)\n {\n }", "function levelingDirSeperators($dir) {\n return str_replace('\\\\', '/', $dir);\n}", "function notation_autoriser(){}", "function convertSlash($string) {\n\t\t$string = trim($string,\"/\");\n\t\t$string = preg_replace('/\\/\\//', '/', $string);\n\t\t$string = str_replace('/', '_', $string);\n\t\treturn $string;\n\t}", "function dot_to_underscore (string $dotted)\n{\n return str_replace('.', '_', $dotted);\n}", "function twoParts($part1,$part2){\r\n $partone=str_replace('/','',$part1);\r\n $parttwo=str_replace('/','',$part2);\r\n $wholepart = $partone.'/'.$parttwo; \r\n return\"Path:\".$wholepart;\r\n\r\n }", "function addSlash($_country, $_langCode, $_descr, $_warn, $_arrive, $_cook, $_myth, $_countryName) {\n\tglobal $country, $langCode, $descr, $warn, $arrive, $cook, $myth, $countryName;\n\t\n\t$country = addslashes( $_country );\n\t$langCode = addslashes( $_langCode );\n\t$descr = addslashes($_descr);\n\t$warn = addslashes($_warn);\n\t$arrive = addslashes($_arrive);\n\t$cook = addslashes($_cook);\n\t$myth = addslashes($_myth);\n\t$countryName = addslashes($_countryName);\n}", "function addslash($dir) {\n\treturn (($dir[ strlen($dir)-1 ] == '/') ? $dir : $dir.'/');\n}", "public function addSlashes(&$value){\nreturn $value = \"'$value'\";\n}", "function wp_slash_strings_only($value)\n {\n }", "public static function normalizeURI($uri)\n{\nreturn str_replace('\\\\','/',$uri);\n}", "static function normalize( $path )\n {\n if( strtoupper( substr( PHP_OS, 0, 3 ) ) == \"WIN\" ){\n $path = preg_replace( '/([^\\\\\\])\\\\\\([^\\\\\\])/', \"$1/$2\", $path );\n if( substr( $path, -1 ) == \"\\\\\" ) $path = substr( $path, 0, -1 );\n if( substr( $path, 0, 1 ) == \"\\\\\" ) $path = \"/\" . substr( $path, 1 );\n }\n\n $path = preg_replace( '/\\/+/s', \"/\", $path );\n\n $path = \"/$path\";\n if( substr( $path, -1 ) != \"/\" )\n $path .= \"/\";\n\n $expr = '/\\/([^\\/]{1}|[^\\.\\/]{2}|[^\\/]{3,})\\/\\.\\.\\//s';\n while( preg_match( $expr, $path ) )\n $path = preg_replace( $expr, \"/\", $path );\n\n $path = substr( $path, 0, -1 );\n $path = substr( $path, 1 );\n return $path;\n }", "public static function buildPath( array $segs ) {\n\t\tif ( empty( $segs ) ) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\treturn \n\t\t\\strtr( \n\t\t\timplode( '/', $segs ), \n\t\t\t[ '//' => '/', '..' => '' ] \n\t\t);\n\t}", "function string_to_path($str)\n{\n\t$str = preg_replace('`(?:^\\.?/|/\\./|/$)`', '', trim($str));\n\tif(empty($str) || $str == '.') return '';\n\treturn $str;\n}", "function wp_normalize_path( $path ) {\n\t\t$path = str_replace( '\\\\', '/', $path );\n\t\t$path = preg_replace( '|/+|','/', $path );\n\t\treturn $path;\n\t}", "public function standardizePath()\n {\n $arrPath = func_get_args();\n\n if (count($arrPath) == 0 || $arrPath == null || $arrPath == \"\")\n {\n return \"\";\n }\n\n $strVar = \"\";\n\n foreach ($arrPath as $itPath)\n {\n $itPath = str_replace(array(TL_ROOT, \"\\\\\"), array(\"\", \"/\"), $itPath);\n $itPath = explode(\"/\", $itPath);\n\n foreach ($itPath as $itFolder)\n {\n if ($itFolder == \"\" || $itFolder == \".\" || $itFolder == \"..\")\n {\n continue;\n }\n\n $strVar .= \"/\" . $itFolder;\n }\n }\n\n return preg_replace(\"/^\\//i\", \"\", $strVar);\n }", "public static function dotted($word)\n {\n return str_replace('\\\\','.',self::lower($word));\n }", "function mDIVIDE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DIVIDE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:673:3: ( '/' ) \n // Tokenizer11.g:674:3: '/' \n {\n $this->matchChar(47); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function parsePath() {\n\t}", "public function __construct() {\n\t\t$this->set_format( '/.*/', 'replace' );\n\t}", "public function testLiteralBackslash()\n {\n $grammar1 = $this->grammar->parse(\" S ::= /\\\\\\\\/ \");\n $this->assertEquals(array(\"\\\\\"), $grammar1->parse(\"\\\\\"));\n\n }", "public function str_singular()\n {\n throw new Exception('Not implemented');\n }", "private function parseDotNotation($property)\n {\n $values = explode('.', $property);\n $this->parts = $values;\n }", "function frac($frac){\n\t$frac = explode(\"/\",trim($frac));\n\treturn $frac[0]/$frac[1];\n}", "public function validPathStrInvalidCharactersDataProvider() {}", "public static function uri($mnt,$path)\n{\nreturn self::baseURI($mnt).ltrim($path,'/');\n}", "function untrailingslashit($value)\n {\n }", "abstract public function getDirectorySeparator() : string;", "function add_leading_slash( $string ) {\n\t$string = ltrim( $string, '\\/' );\n\n\treturn '/' . $string;\n}", "function backslashit($value)\n {\n }", "function wp_unslash($value)\n {\n }", "function normalizePath($path) {\n\t $val=str_replace(array('///','//','\\\\','\\\\\\\\',\"\\n\",\"\\r\"),'/',$path);\n\t $val=str_replace(array(\"\\n\",\"\\r\"),'',$val);\n\t if (PHP_OS=='WINNT') {\n\t \t$val=preg_replace('/\\/+([a-zA-Z]{1}:)/','$1',$val);\n\t\t}\n\t return $val;\n\t //return $path = ereg_replace('(\\\\\\\\*)|(\\/*/)', '/', $path); //only forward-slash\n\t}", "function normalizePath($path) {\n\t $val=str_replace(array('///','//','\\\\','\\\\\\\\',\"\\n\",\"\\r\"),'/',$path);\n\t $val=str_replace(array(\"\\n\",\"\\r\"),'',$val);\n\t if (PHP_OS=='WINNT') {\n\t \t$val=preg_replace('/\\/+([a-zA-Z]{1}:)/','$1',$val);\n\t\t}\n\t return $val;\n\t //return $path = ereg_replace('(\\\\\\\\*)|(\\/*/)', '/', $path); //only forward-slash\n\t}", "function _dir($string)\n {\n return str_replace('/', DIRECTORY_SEPARATOR, $string);\n }", "public function Slasher($var) {\n\n //si magic_quot est on on enleve les slash\n if (get_magic_quotes_gpc()) {\n $var=stripslashes($var);\n }\n return $var;\n }", "function drive()\r\n {\r\n $r='';\r\n foreach (range(\"A\", \"Z\") as $val) {\r\n if(is_dir($val.\":\".DIRECTORY_SEPARATOR))\r\n {\r\n \r\n $ad=$val.\":\".DIRECTORY_SEPARATOR;\r\n $r=$r.=\"<a href='?act=file&dir=$ad'>$val:\".DIRECTORY_SEPARATOR.\"</a> \";\r\n }\r\n }\r\n return $r;\r\n }", "function sanitize( $value ) {\n\t\tif(!$value) \n\t\t\treturn $value;\n\t\treturn preg_quote($value, \"/\");\n\t}", "function str_forward_slash($string)\n {\n return str_replace('\\\\', '/', $string);\n }", "function check_path_segment(string $path)\n{\n $trailingslashed = trailingslashit($path);\n\n // Don't want a leading slash.\n $frontchecked = ltrim($trailingslashed, '\\\\/');\n return $frontchecked;\n}", "public function getFrontPath()\n {\n // we use trim() instead of empty() on string elements\n // to allow for string-zero values.\n return (empty($this->path) ? '' : $this->_pathEncode($this->path))\n . (trim($this->format) === '' ? '' : '.' . urlencode($this->format));\n }", "abstract function normalizedName();", "function converteData($data){\n return (preg_match('/\\//',$data)) ? implode('-', array_reverse(explode('/', $data))) : implode('/', array_reverse(explode('-', $data)));\n}", "public static function convertToDotNotation($string)\n {\n return str_replace(['/','\\\\'], '.', $string);\n }", "function unslashify($str)\n{\n return preg_replace('/\\/$/', '', $str);\n}", "public function __toString()\n\t{\n\t\t$parts = $this->parts;\n\t\tif(count($parts) == 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$name = '';\n\t\tif($this->absolute) {\n\t\t\t$name = $parts[0];\n\t\t\t$parts = array_slice($parts, 1);\n\t\t}\n\t\t$path = '';\n\t\tif(count($parts)) {\n\t\t\t$path = sprintf('[%s]', implode('][', $parts));\n\t\t}\n\n\t\treturn $name . $path;\n\t}", "function input($in) {\n $out = htmlentities(stripslashes($in));\n $out = str_replace(array('/','\\\\'), '', $out);\n return $out;\n }", "function removeDoubleForwardSlash($string = '')\n {\n return preg_replace('#/+#', '/', $string);\n }", "public function getSchemaSeparatorSymbol()\n {\n // if \"i5 naming\" is on, use '/' to separate schema and table. Otherwise use '.'\n if (array_key_exists('i5_naming', $this->driverOptions) && $this->driverOptions['i5_naming']) {\n\n // \"i5 naming\" mode requires a slash\n return '/';\n\n } else {\n // SQL naming requires a dot\n return '.';\n }\n }", "function delSlash($text)\t{\n\n $text = trim($text);\n if(substr($text, strlen($text) - 1, 1) == '/')\n return substr($text, 0, strlen($text) - 1);\n else\n return $text;\n }", "public static function slashing($text, $flags = 0) {\n\t\t// Backslash.\n\t\tif ($flags & static::slashingBackslash) {\n\t\t\t$sSep = '\\\\';\n\t\t\t$text = str_replace('/', $sSep, $text);\n\t\t}\n\t\t// Forward slash.\n\t\telse {\n\t\t\t$sSep = '/';\n\t\t\t$text = str_replace('\\\\', $sSep, $text);\n\t\t}\n\t\t// Trim.\n\t\tif ($flags & static::slashingTrimBoth || $flags & static::slashingAddBoth) {\n\t\t\t$text = trim($text, \"{$sSep} \");\n\t\t}\n\t\telseif ($flags & static::slashingTrimLeft || $flags & static::slashingAddLeft) {\n\t\t\t$text = ltrim($text, \"{$sSep} \");\n\t\t}\n\t\telseif ($flags & static::slashingTrimRight || $flags & static::slashingAddRight) {\n\t\t\t$text = rtrim($text, \"{$sSep} \");\n\t\t}\n\t\t// Add.\n\t\tif ($flags & static::slashingAddBoth) {\n\t\t\t$text = $sSep . $text . $sSep;\n\t\t}\n\t\telseif ($flags & static::slashingAddLeft) {\n\t\t\t$text = $sSep . $text;\n\t\t}\n\t\telseif ($flags & static::slashingAddRight) {\n\t\t\t$text = $text . $sSep;\n\t\t}\n\t\t\n\t\treturn preg_replace(\"/\\\\{$sSep}+/\", $sSep, $text);\n\t}", "protected function _normalizePath($path) { \n $p= preg_replace('#//#', '/', $path);\n $p= preg_replace('#/\\./#', '/', $p);\n $p= preg_replace('#[^/]+/\\.\\./#', '', $p);\n $p= preg_replace('#//#', '/', $p);\n $p= preg_replace('#/$#', '', $p);\n return $p;\n }", "function EraseDubleSlash($sInputPath)\n{\n\treturn preg_replace(\"/[\\/]{2,}/\", \"/\", $sInputPath);\n}", "public static function normalPaths() {\n\t\t$paths = implode(DS, func_get_args());\n\t\t// Retain a single leading slash; otherwise remove all leading, trailing\n\t\t// and duplicate slashes.\n\t\treturn ((substr($paths, 0, 1) === DS) ? DS : '') .\n\t\t\timplode(DS, array_filter(explode(DS, $paths)));\n\t}", "public function preventAddSlashes( $fields=array() );", "public function validPathStrDataProvider() {}", "function getPathParser();", "function fromexp(){return \"`{$this->entity->name}`\"; }", "private function slashPath(string $path) : string\n {\n return trim($path, '/');\n }", "public function testParsingWithTrailingPeriodAndParseExtensions(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "private function _makepath() {\n $params = func_get_args();\n $path = '';\n\n foreach ($params as $value) {\n $path .= $value;\n\n if (!empty($value)) $path .= PS;\n }\n\n return $path;\n }", "public function test_FName__Weirdos(): void\n {\n $filename = '..';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','..','','..'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //single dot is a filename without extension (body only)\n $filename = '.';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','.','','.'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //lots of dots is still considered a filename without extension (body only)\n $filename = '......';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','......','','......'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //lots of dots as body with an added extension - last dot is always consumed when separating the extension\n $filename = '......ext';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing(['','.....','ext','......ext'], [$f->path, $f->body, $f->ext, $f->filename]);\n\n //Multiple dots in filename\n $filename = '/var/www/whatever/manci...neni.meg.a.madarak...ext';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing\n (\n ['/var/www/whatever/','manci...neni.meg.a.madarak..','ext','manci...neni.meg.a.madarak...ext'],\n [$f->path, $f->body, $f->ext, $f->filename]\n );\n\n //Unicode madness...\n $filename = '/var/w™ww/whateverḊḋḞ/very😎😏...ne🌎🌏ni.meg.a.mУФХadarak...ぴふべ';\n $f = new FName($filename);\n $this->assertEqualsCanonicalizing\n (\n ['/var/w™ww/whateverḊḋḞ/','very😎😏...ne🌎🌏ni.meg.a.mУФХadarak..','ぴふべ','very😎😏...ne🌎🌏ni.meg.a.mУФХadarak...ぴふべ'],\n [$f->path, $f->body, $f->ext, $f->filename]\n );\n }", "function magicSlashes($element) {\r\n if (is_array($element))\r\n return array_map(array(\"INIT\", \"magicSlashes\"), $element);\r\n else\r\n return addslashes($element);\r\n }", "public function abspath()\n {\n }", "function ajoutpoint($text) // good\r\n {\r\n if(!preg_match_all('#[.?!]#', $text))\r\n {\r\n $text=$text.' . ';\r\n echo ucfirst($text);\r\n }\r\n else{ echo ucfirst($text);}\r\n // return $text;\r\n }", "function _alpha_dash_dot($field)\r\n\t{\r\n\t\treturn ( ! preg_match('/^([\\.-a-z0-9_-])+$/i', $this->{$field})) ? FALSE : TRUE;\r\n\t}", "function str_backslash($string)\n {\n return str_replace('/', '\\\\', $string);\n }", "function replace($str){\n $newstring=str_replace(\"/\",\" \", $str);\n return $newstring;\n\n }", "public function singular() {\n return substr($this->tipoEntidad,strrpos($this->tipoEntidad,'\\\\')+1);\n }", "function printCleanString($string) {\n\t\t$string = str_replace(\"../../\", \"/\", $string);\n\t\t$string = stripslashes($string);\n\t\treturn $string;\n\t}", "public static function psr0(string $str): string {\n\t\t\t$str = trim($str, \"/\\\\ \");\n\t\t\t$pos = strrpos($str, \"\\\\\");\n\t\t\t$class = substr($str, $pos ? $pos + 1 : 0);\n\t\t\t$class = str_replace(\"_\", \"/\", $class);\n\t\t\treturn ($pos ? substr($str, 0, $pos).\"/\" : \"\").$class;\n\t\t}", "public function testParsingWithTrailingPeriod(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "function __construct($item) {\n\t\tif (preg_match('/^\\/[a-zA-Z\\/]+$/', $item)) {\n\t\t\t$this->currentPath = $item;\n\t } else {\n\t \techo 'Path format is invalid. It has to start with a slash, use slash as a separator and it should contain only lowercase and uppercase letters';\n\t }\n\t}", "public static function slashes($string, $end = 0, $beginning = 0) {\n\n\t\tif ($beginning == 1 && substr($string, 0, 1) != '/') {\n\t\t\t$string = '/'.$string;\n\t\t} elseif ($beginning == -1 && substr($string, 0, 1) == '/') {\n\t\t\t$string = substr($string, 1);\n\t\t}\n\n\t\tif ($end == 1 && substr($string, -1) != '/') {\n\t\t\t$string = $string.'/';\n\t\t} elseif ($end == -1 && substr($string, -1) == '/') {\n\t\t\t$string = substr($string, 0, -1);\n\t\t}\n\n\t\treturn $string;\n\t}", "function DelFirstSlash($str){\n $str = strval($str);\n if($str[0]==\"/\")\n return substr($str,1);\n else\n return $str;\n}", "public function intended($default = '/');", "private function _dotConcatenation($str1, $str2)\n {\n return $str1 . '.' . $str2;\n }", "protected function quote_char()\n {\n }", "public function testNotationWithPercentSign()\n {\n $this->runDtdTestFull(\"notationWithPercentSign.zip\", 14, \"Please upload a document without using the percent sign\");\n }", "function get_literal_display($value)\n{\n\t$literal = '';\n\t\n\tif ($literal == '')\n\t{\n\t\tif (is_string($value))\n\t\t{\n\t\t\t$literal = $value;\n\t\t}\n\t}\n\t\n\tif ($literal == '')\n\t{\n\t\tif (is_array($value))\n\t\t{\n\t\t\t$strings = array();\n\t\t\tforeach ($value as $k => $v)\n\t\t\t{\n\t\t\t\t$strings[] = $v;\n\t\t\t}\n\t\t\t$literal = join('/', $strings);\n\t\t}\n\t}\t\n\t\n\treturn $literal;\n}", "function pathName($string) {\r\n\r\n\t$lower = strtolower($string);\r\n\t$result = \"\";\r\n \r\n\tfor ($i=0;$i<strlen($lower);$i++) {\r\n\t\r\n\t\t$char = substr($lower,$i,1);\r\n\t\tif ((($char >= \"a\") && ($char <= \"z\")) || (($char >= \"0\") && ($char <= \"9\"))) $result .= $char;\r\n\t\r\n\t}\r\n\t\r\n\treturn $result;\r\n\t\r\n}", "protected function get_normalized_rest_base() {\n\t\treturn preg_replace( '/\\(.*\\)\\//i', '', $this->rest_base );\n\t}", "private function stuffDots($data)\n {\n return str_replace(\"\\r\\n.\", \"\\r\\n..\", $data);\n }", "function BDC_NormalizePath($p_Path) {\n $canonical = str_replace('\\\\', '/', $p_Path);\n // ensure ending slash\n $canonical = rtrim($canonical, '/');\n $canonical .= '/';\n return $canonical;\n}", "function trailingslashit( $string ) {\n\treturn untrailingslashit( $string ) . '/';\n}", "public function char($name)\n \t{\n \t\tif ($name[0] == '/') throw new Exception(\"Unable to get '$name' for '{$this->_path}': Expecting a relative path.\");\n \t\treturn Fs::char(\"{$this->_path}/$name\");\n \t}", "private function normalizeExtension()\n {\n $explodedUri = WingedLib::explodePath(static::$uri);\n $dir = WingedLib::normalizePath();\n $beforeConcatDir = WingedLib::normalizePath();\n if ($explodedUri) {\n foreach ($explodedUri as $key => $uriPart) {\n $dir .= $uriPart;\n $dir = WingedLib::normalizePath($dir);\n if (is_directory(WingedLib::clearPath(DOCUMENT_ROOT . $dir) . '/')) {\n unset($explodedUri[$key]);\n $beforeConcatDir = $dir;\n }\n }\n static::$parent = $beforeConcatDir;\n $beforeConcatDir = WingedLib::clearPath($beforeConcatDir);\n\n static::$parentUri = WingedLib::clearPath(WingedLib::clearPath(str_replace($beforeConcatDir, '', static::$uri)));\n if (!static::$parentUri) {\n static::$parentUri = './';\n } else {\n static::$parentUri = './' . static::$parentUri . '/';\n }\n\n if (static::$uri != static::$parentUri) {\n $explodedUri = WingedLib::explodePath(static::$parentUri);\n }\n\n static::$httpsParent = static::$https . $beforeConcatDir . '/';\n static::$httpParent = static::$http . $beforeConcatDir . '/';\n static::$protocolParent = static::$protocol . $beforeConcatDir . '/';\n\n if (static::$freeGet != '') {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri) . '?' . static::$freeGet;\n } else {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri);\n }\n if (count7($explodedUri) == 0) {\n static::$controllerName = 'IndexController';\n static::$controllerAction = 'actionIndex';\n static::$isIndex = true;\n } else {\n $explodedUri = array_values($explodedUri);\n $page = $explodedUri[0];\n unset($explodedUri[0]);\n $uriParameters = [];\n foreach ($explodedUri as $key => $value) {\n array_push($uriParameters, $value);\n }\n static::$controllerName = Formater::camelCaseClass($page) . 'Controller';\n if (count($uriParameters) > 0) {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($uriParameters[0]);\n } else {\n static::$controllerAction = 'actionIndex';\n }\n static::$isIndex = true;\n static::$uriParameters = $uriParameters;\n }\n } else {\n static::$parentUri = './';\n static::$httpsParent = static::$https;\n static::$httpParent = static::$http;\n static::$protocolParent = static::$protocol;\n if (static::$freeGet != '') {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri) . '?' . static::$freeGet;\n } else {\n static::$fullUrlProvider = static::$protocol . WingedLib::clearPath(static::$pureUri);\n }\n static::$isIndex = true;\n static::$controllerName = 'IndexController';\n static::$controllerAction = 'actionIndex';\n static::$parent = './';\n }\n return $this;\n }", "function addslashes_strings_only($value)\n {\n }", "private function _getPathNormalized( $sPath ) {\r\n $sPath = str_replace( '\\\\', '/', $sPath );\r\n $sPath = preg_replace( '|(?<=.)/+|', '/', $sPath );\r\n if ( ':' === substr( $sPath, 1, 1 ) ) {\r\n $sPath = ucfirst( $sPath );\r\n }\r\n return $sPath;\r\n }", "public static function ps(){\n return PATH_SEPARATOR;\n }" ]
[ "0.6055817", "0.6031303", "0.5940822", "0.5903254", "0.58931917", "0.58736074", "0.5868559", "0.5854755", "0.5682011", "0.56171644", "0.5561824", "0.5546333", "0.5532732", "0.55253744", "0.5436991", "0.54176116", "0.5412539", "0.5393956", "0.5344364", "0.53403556", "0.53359187", "0.53208935", "0.52971196", "0.52779347", "0.5274485", "0.5274363", "0.52633685", "0.5242869", "0.5231882", "0.5227907", "0.5209172", "0.5208793", "0.51911044", "0.51905954", "0.5188582", "0.51782787", "0.5177061", "0.51727587", "0.51723707", "0.51713943", "0.51685995", "0.5165938", "0.5163661", "0.5162755", "0.5162755", "0.5161038", "0.51589763", "0.51469636", "0.5114111", "0.5108865", "0.50800306", "0.5077596", "0.5077568", "0.5066291", "0.5050803", "0.5050493", "0.5049676", "0.50421256", "0.50416464", "0.5040529", "0.50359565", "0.50297445", "0.5023697", "0.5010981", "0.5009849", "0.50056773", "0.5000065", "0.49950296", "0.49668002", "0.4947601", "0.4923656", "0.49219677", "0.49178517", "0.49163663", "0.49157053", "0.49126327", "0.4909675", "0.49036142", "0.4902203", "0.48979548", "0.4893156", "0.4890743", "0.4890506", "0.48832077", "0.4881715", "0.48793918", "0.48723763", "0.4869693", "0.48667294", "0.48579234", "0.485678", "0.4854331", "0.4853135", "0.48437235", "0.48412547", "0.48412362", "0.48319876", "0.48308733", "0.4826867", "0.4823825", "0.48135066" ]
0.0
-1
Loads the name of an user given its email
public function findNameByEmail($email){ $stmt = $this->db->prepare("SELECT * FROM users WHERE email=?"); $stmt->execute(array($email)); $user = $stmt->fetch(PDO::FETCH_ASSOC); if($user != null) { return new User( $user["email"], $user["completeName"]); } else { return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadUserByEmail($email)\n { \n $user = $this->_em->getRepository('Entity\\User\\User')->findOneBy(array('email' => $email));\n\n if($user != null)\n return $user;\n\n throw new UsernameNotFoundException(\"Compte introuvable\");\n }", "function getUserNameFromEmail( $email ) {\n $d = loadDB();\n\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"email\"] == $email) {\n return $value[\"name\"];\n }\n }\n return \"unknown\";\n }", "public function getUser($email);", "function get_user_by_email($email)\n {\n }", "function get_username_by_email($h, $email){\n \n $sql = \"SELECT user_username FROM \" . TABLE_USERS . \" WHERE user_email=%s LIMIT 1\";\n $query = $h->db->prepare($sql, $email);\n \n\treturn $username= $h->db->get_var($query);\n }", "public function get_user_name($email_id) {\r\n $this->db->select('*');\r\n $where = \"(user_email='$email_id')\";\r\n $this->db->where($where);\r\n $query = $this->db->get('users');\r\n $data = $query->result();\r\n\r\n return $data;\r\n }", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "public function loadFromEmail(){\r\n\t\t$em = $this -> getEmail();\r\n\t\tif(!empty($em))\r\n\t\t $this -> loadFromQuery(\"select * from UserTab where User_email='\".$em.\"'\");\r\n\t }", "public function loadUserByUsername($email) {\n /* @var $user \\App\\Entity\\User */\n $user = $this->repository->findOneByEmail($email);\n\n if( ! $user ) {\n throw new UsernameNotFoundException(sprintf('Account with email %s was not found!', $email));\n }\n \n if( $user->getIsAdmin() ) {\n $user->addRole('ROLE_DEVELOPER');\n }\n else {\n $user->addRole('ROLE_USER');\n }\n\n return $user;\n }", "public function getUserByEmail($email);", "public function get_user($email){\n\t\t$email_md5_hash = md5($email); \n\t\t$endpoint = '/lists/'. LIST_ID . '/members/'. $email_md5_hash;\n\t\t$result = $this->mc->get($endpoint);\n\t\tif($result['status'] == '404'){\n\t\t\tprint 'user does not exist';\n\t\t}else{\n\t\t\tprint '<pre>'; print_r($result); print '</pre>';\n\t\t}\n\t\t\n\t}", "public function retrieveUser ($email) {\n return $this->usersDB->retrieve($email);\n }", "public function fetchUserByEmail($email);", "public function getUserByEmail()\n {\n $db = init_db();\n $req = $db->prepare(\"SELECT * FROM user WHERE email = ?\");\n $req->execute(array($this->getEmail()));\n $db = null;\n\n return $req->fetch();\n }", "function getuser($email)\n\t\t{\n\t\t\t$email = \"'\".$email.\"'\";\n\t\t\t$sql = $this->conn_id->query(\"select * from users where email = \".$email );\n\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\treturn $r;\n\t\t}", "public function retrieve($email){\n $conn_manager = new ConnectionManager();\n $pdo = $conn_manager->getConnection();\n \n $sql = \"select * from user where email=:email\";\n $stmt = $pdo->prepare($sql);\n // $stmt->bindParam(\":name\",$name,PDO::PARAM_STR);\n $stmt->bindParam(\":email\",$email,PDO::PARAM_STR);\n $stmt->execute();\n \n $user = null;\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n if($row = $stmt->fetch()){\n $user = new User($row[\"email\"],$row['first_name'],$row['last_name'],$row[\"hashed_password\"]);\n }\n \n $stmt = null;\n $pdo = null;\n return $user;\n }", "function get_user_name() {\n return $this->call('get_user_name', array(), TRUE);\n }", "function getUserByEmail($userEmail){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT firstname, lastname, email, phone FROM User WHERE email='\" . $userEmail . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\treturn \"NO_USER_BY_EMAIL\";\n\t\t}else{\n\t\t\treturn $result->fetch_assoc();\n\t\t}\n\t}", "public function loadUser($email) {\r\n\r\n\t\t//TODO: Look at bookmark class for sample try/catch block around DB code\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$query = \"SELECT id AS uc_id, first, last, email, username, sex FROM v_returnShortUserProfile WHERE email='{$email}';\";\r\n\r\n\t\t$sqlObj->DoQuery($query);\r\n\t\t$result = $sqlObj->GetData();\r\n\r\n\t\t//Let's make sure we're only returning one result\r\n\t\tif (count($result) == 1) {\r\n\t\t\t$result = $result[0]; //break the multi-dimensional array since this should only be 1 record\r\n\t\t} elseif (count($result) > 1) {\r\n\t\t\t$result = NULL;\r\n\t\t\tthrow new MyException('ERROR: We have duplicate records for User Credential email: {$email}.');\r\n\t\t} else {\r\n\t\t\t$result = NULL;\r\n\t\t}\r\n\r\n\t\t$sqlObj->destroy();\r\n\r\n\t\treturn $result;\r\n\t}", "function getUsername($mail) {\n\t global $db;\n\t $username;\n\t try {\n\t\t $stmt = $db->prepare('SELECT username FROM User WHERE mail = ?');\n\t\t $stmt->execute(array($mail)); \n\t\t \n\t\t $res = $stmt->fetch();\n\t} catch (PDOException $e) {\n\t\techo $e->getMessage();\n\t}\n\t\n\t\n\treturn $res['username'];\n }", "public function getUserName()\n {\n return substr($this->email, 0, strpos($this->email, '@'));\n }", "public function getUser(string $email) {\n\t\t$queryString = \"SELECT * \n\t\t\t\t\t\tFROM users \n\t\t\t\t\t\tWHERE email='{$email}';\";\n\t\t$userArray = $this->queryForUser($queryString);\n\t\treturn $this->makeUserFromArray($userArray);\n\t}", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsernameByForgotKey(){\n $key = $this->key;\n\n //get email\n $user_forgot = new \\Filebase\\Database([\n 'dir' => $this->getDataSourceForgot()\n ]);\n\n $item = $user_forgot->get($key);\n $email = $item->email;\n\n //get username\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource(),\n 'cache' => $this->cache,\n 'cache_expires' => $this->cache_expires\n ]);\n\n $list = $user->query()->where('email','=',$email)->limit(1)->results();\n if(!empty($list)){\n if(!empty($list[0]['username'])){\n return $list[0]['username'];\n }\n }\n return '';\n }", "public function getUserByEmail($email) {\n //create user query by email\n $user_query_by_email = Doctrine_Query::create()\n ->select('sgu.id')\n ->from('sfGuardUser sgu')\n ->where('sgu.email_address =?', $email);\n return $user_query_by_email->fetchOne();\n }", "public function findUserByMail(string $email)\n {\n $users = $this->doctrine->getUserRepository()->findBy(['email' => $email]);\n\n if ($user = reset($users)) {\n return $user;\n }\n\n return null;\n }", "public function getUsername(): string\n {\n return $this->email;\n }", "public function getUsername(): string\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUniqueUsernameFromEmail($email);", "function get_user_by_email($email) {\n // read db and put into variable\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if email is found, return user\n foreach ($data as $user){\n if ($user[\"email\"] == $email){\n return $user;\n }\n }\n return false;\n}", "public function getUserDisplayName();", "public function getUserByEmail($email) {\n $stmt = $this->conn->prepare(\"SELECT name, email, api_key, created_at FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n if ($stmt->execute()) {\n $user = $stmt->get_result()->fetch_assoc();\n $stmt->close();\n return $user;\n } else {\n return NULL;\n }\n }", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "public function getUsername()\n {\n return $this->email;\n }", "function get_user($email) {\n // Build the query\n $query = \"SELECT * FROM UserAccount WHERE email = ?\";\n // Execute the query\n\t $result = $this->db->query($query, $email);\n // Check if any results are returned from the query\n if ($result->num_rows() > 0) {\n // Build the data array\n foreach ($result->result_array() as $row) {\n \t\t\t$data[] = array(\n \t\t\t\t'email' => $row['email'],\n \t\t\t\t'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'is_enabled' => $row['is_enabled'],\n 'is_admin' => $row['is_admin']\n \t\t\t);\n \t\t}\n } else {\n $data = \"User does not exist.\";\n }\n // Pass back the data\n \treturn $data;\n }", "public function getExternalUserName();", "function getUser($email) {\r\n\t\t\tif (is_numeric($email))\r\n\t\t\t\t$sql = \"SELECT users.user_id, users.student_id, users.email, users.password, users.society_id, users.active, societies.society_name FROM `users`, `societies` WHERE societies.society_id=users.society_id AND user_id=%s\";\r\n\t\t\telse\r\n\t\t\t\t$sql = \"SELECT users.user_id, users.student_id, users.email, users.password, users.society_id, users.active, societies.society_name FROM `users`, `societies` WHERE societies.society_id=users.society_id AND UPPER(users.email)=UPPER('%s')\";\r\n\t\t\t$result = $this->query($sql, $email);\r\n\t\t\tif (mysql_num_rows($result) == 0) return false;\r\n\t\t\treturn mysql_fetch_object($result);\r\n\t\t}", "public function getUsername(): string\n {\n return $this->getEmail();\n }", "public function getByEmail($email) {\n //Requête d'un objet user à partir de son email\n $reqEmail = $this->db->prepare(\"\n SELECT id, firstname, lastname, pseudo, email, password, level_id \n FROM user WHERE email=:email\n \");\n\n $reqEmail->execute(array(\n 'email' => $email,\n ));\n \n $data = $reqEmail->fetch(PDO::FETCH_ASSOC);\n\n if ($data) {\n \n return new User($data);\n }\n return $data;\n }", "public function findUserByEmail($email)\r\n {\r\n $user = $this->DB->fetchAssoc('select * from user where email = ?',array($email));\r\n $user = $this->reformatUserData($user);\r\n return $user;\r\n }", "public function load_user($email){\r\n $TDG = new UserTDG();\r\n $res = $TDG->get_by_email($email);\r\n\r\n if(!$res)\r\n {\r\n $TDG = null;\r\n return false;\r\n }\r\n\r\n $this->id = $res['userId'];\r\n $this->email = $res['email'];\r\n $this->username = $res['username'];\r\n $this->password = $res['password'];\r\n $this->image = $res['image'];\r\n \r\n $TDG = null;\r\n return true;\r\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "public function getUsername(): string\n {\n return (string)$this->email;\n }", "function getUsernameFromEmail($emailAddress)\n {\n foreach ($this->getUsers() as $user) {\n if ($user->email == $emailAddress) {\n return $user->username;\n }\n }\n return null;\n }", "public function getUsername()\n {\n return $this->getEmail();\n }", "public function getUsername()\n {\n return $this->getEmail();\n }", "public function getUsername()\n {\n return $this->getEmail();\n }", "public function searchUserByMail($email)\n {\n $reqmail = $this->db->prepare(\"SELECT * FROM users WHERE email = ?\");\n $reqmail->execute(array($email));\n $user = $reqmail->fetchAll(PDO::FETCH_CLASS, User::class);\n\n return $user[0];\n }", "protected function getUser($email)\n {\n return User::findByEmail($email) ? User::findByEmail($email) : false;\n\n }", "public function retrieveUserByEmail($email)\n {\n return $this->start()->uri(\"/api/user\")\n ->urlParameter(\"email\", $email)\n ->get()\n ->go();\n }", "public function getUsername() {\n return $this->email;\n }", "public function getUser($email) {\n $db = $this->getAdapter();\n $select = $db->select()\n ->from($this->_name, '*')\n ->where('email = ?', $email);\n $value = $db->fetchAll($select);\n return $value;\n }", "public function getUsername() {}", "public function getUserByEmail($email)\n {\n return $this->model->where('email', $email)->first();\n }", "public function findUserByEmail($email);", "public function findUserByEmail($email);", "public function findUserByEmail($email);", "function get_profile_email($email){\r\n\t\r\n}", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }", "public function getUsername(): string\n {\n return (string) $this->email;\n }" ]
[ "0.7470118", "0.7409108", "0.7289771", "0.70845586", "0.6977614", "0.69411457", "0.6923764", "0.689882", "0.6886406", "0.68858427", "0.68018734", "0.67706674", "0.6748977", "0.6733427", "0.6714101", "0.6670983", "0.66457134", "0.66178656", "0.65951985", "0.65804493", "0.655011", "0.6548146", "0.6507691", "0.65075743", "0.649263", "0.6478785", "0.6477061", "0.6477061", "0.6471525", "0.6463727", "0.646264", "0.6452536", "0.644949", "0.6443664", "0.6443664", "0.6443664", "0.6443664", "0.6443664", "0.64435834", "0.64435834", "0.64435834", "0.64435834", "0.64435834", "0.64435834", "0.64435834", "0.6441457", "0.643774", "0.6420127", "0.63942146", "0.6392232", "0.63898957", "0.6381715", "0.6375895", "0.6375895", "0.6375895", "0.6375895", "0.6375895", "0.6375895", "0.6375895", "0.6375895", "0.63737184", "0.6365233", "0.6365233", "0.6365233", "0.63511777", "0.63495255", "0.6346045", "0.6341884", "0.6327607", "0.6324978", "0.6320173", "0.63199824", "0.63199824", "0.63199824", "0.6309811", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727", "0.63066727" ]
0.7462196
1
Saves a User into the database
public function save($user) { $stmt = $this->db->prepare("INSERT INTO users values (?,?,?)"); $stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "public function saving(User $user)\n {\n //\n }", "public function save(User $user){\n return $user->save();\n }", "public static function save(User $user)// statiska funkcija, lai nevajadzetu taisit klases objektu\n {\n }", "public function saveUser($user) {\n if(empty($user->user_id)){\n $this->dao->insertUser($user);\n } else {\n $this->dao->updateUser($user, $user->user_id); \n }\n }", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "public function saved(User $user)\n {\n //\n }", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function save(User $user): void\n {\n $em = DoctrineManager::entityManager();\n $em->persist($user);\n $em->flush();\n }", "public function save(User $user) {\n $userData = array(\n 'user_email' => $user->getEmail(),\n 'user_salt' => $user->getSalt(),\n 'user_password' => $user->getPassword(),\n 'user_role' => $user->getRole(),\n 'user_lastname' => $user->getLastname(),\n 'user_firstname' => $user->getFirstname(),\n 'user_address' => $user->getAddress(),\n 'user_town' => $user->getTown(),\n 'user_zipcode' => $user->getZipcode()\n );\n\n if ($user->getId()) {\n $this->getDb()->update('user', $userData, array('user_id' => $user->getId()));\n } else {\n // The user has never been saved : insert it\n $this->getDb()->insert('user', $userData);\n // Get the id of the newly created user and set it on the entity.\n // $id = $this->getDb()->lastInsertId();\n $user->setEmail($user->getEmail());\n }\n }", "public function saveUser()\n {\n $this->_initUser();\n\n $this->generateSecurePassword();\n\n return $this->save(\n [\n 'username' => $this->username,\n 'password' => $this->password,\n 'salt' => $this->_salt,\n 'email' => $this->email,\n 'name' => $this->name,\n 'lastname' => $this->lastname,\n 'sw_active' => 1\n ], true\n );\n }", "public function save($user){\n $this->validate();\n if(sizeof($this->errors)==0){\n\n $password_hash=password_hash($user->getPassword(),PASSWORD_DEFAULT);\n $sql=\"INSERT INTO user(name,email,password) VALUES(?,?,?)\";\n $stmt=static::getDB()->prepare($sql);\n $stmt->execute(array($user->getUsername(),$user->getEmail(),$password_hash));\n \n }else{\n print_r($this->errors) ;\n }\n\n // return false;\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }", "function saveUser($user)\n {\n //1. Define the query\n $sql = \"INSERT INTO users (username, nickname, userlocation, archive, usertype, password, email) \n VALUES (:username, :nickname, :userlocation, :archive, :usertype, :password, :email)\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':username', $user->getUserName(), PDO::PARAM_STR);\n $statement->bindParam(':nickname', $user->getNickname(), PDO::PARAM_STR);\n $statement->bindParam(':userlocation', $user->getLocation(), PDO::PARAM_STR);\n $statement->bindParam(':password', $user->getPassword(), PDO::PARAM_STR);\n $statement->bindParam(':email', $user->getEmail(), PDO::PARAM_STR);\n\n // set account type and archive if admin\n if ($user instanceof Admin) {\n $userType = \"admin\";\n $archive = 1;\n } else {\n $userType = \"standard\";\n $archive = 0;\n }\n\n $statement->bindParam(':archive', $archive, PDO::PARAM_STR);\n $statement->bindParam(':usertype', $userType, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }", "public function save(){\n\t\tif($this->validateForms(Input::all()) === true){\n\t\t\t$user = new User();\n\t\t\t$user->username = Input::get('username');\n\t\t\t$user->password = Hash::make(Input::get('password'));\t\n\t\t\t$user->email = Input::get('email');\n\t\t\t$user->role_id = Input::get('rol');\n\t\t\t$user->enable = 1;\n\n\t\t\t$useradmin = new UsuarioAdmin();\n\t\t\t$useradmin->nombres = Input::get('nombres');\n\t\t\t$useradmin->apellidos = Input::get('apellidos');\n\t\t\t$useradmin->cargo = Input::get('cargo');\n\n\t\t\t$user->save();\n\t\t\t$user->usuarioadmin()->save($useradmin);\n\n\t\t\tSession::flash('message', 'Usuario Agregado');\n\t\t\treturn Redirect::back();\n\n\t\t}else{\n\t\t\treturn Redirect::back()->withErrors($this->validateForms(Input::all()))->withInput();\n\t\t}\n\t}", "public function save(User $model);", "function saveuser(){\n \t\t\tif (isset($_POST['UserID'])){\n \t\t\t\t$UserID = base64_decode($_POST['UserID']);\n \t\t\t\t$this->Users->UpdateUser($UserID);\n \t\t\t}else{\n \t\t\t\t$UserID = $this->Users->AddNewUser();\n \t\t\t\t$this->Users->AddUserToCompany($UserID);\n \t\t\t}\n \t\t\t$this->Flash->error(__('UserSaved', true));\n \t\t\t$this->Redirect('/users/edituser/'.base64_encode($UserID));\n \t\t}", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE USERS SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", FIRST_NAME = \"%s\", LAST_NAME = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive,\n $this->id);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO USERS (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, FIRST_NAME, LAST_NAME, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %d)',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "function saveUser(UserEntity $user, string $hashedPwd);", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "public function saveUser($user)\n {\n $sql = \"UPDATE `\".DB::TBL_USERS.\"` \".\n \"SET `fio`=?,`login`=?,`loginHash`=?,`phone`=?,\".\n \"`email`=?, `emailHash`=?,`pass`=?,`photo`=? \".\n \"WHERE `id`=?\";\n $st = $this->MySQL->getConn()->prepare($sql);\n $st->execute([\n $user->fio, $user->login, $user->loginHash,\n $user->phone, $user->email, $user->emailHash,\n $user->pass, $user->photo, $user->id,\n ]);\n }", "public function save ( $isNewUser = false ) {\n $db = new DB();\n \n // If the user is already registered, just update their info\n if ( !$isNewUser ) {\n $data = array (\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\"\n );\n $db->update($_SESSION[userTable], $data, \"id = '\".$this->id.\"'\");\n }\n // else register the user\n else {\n $data = array (\n 'username' => \"'$this->username'\",\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\",\n 'joindate' => \"'\".date(\"Y-m-d H:i:s\").\"'\"\n );\n $this->id = $db->insert($_SESSION['userTable'], $data);\n $this->joindate = time();\n }\n }", "public function saved(User $user)\n {\n // $his->name = \"mr.\".$user->name;\n // $his->save();\n }", "public function save(CreateUserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $pass = $this->get_password($request);\n $user = User::create([\n 'name' => $request->input('name'),\n 'phone_number' => $request->input('phone_number'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($pass),\n 'role_id' => $request->input('role_id', 3)\n ]);\n\n $user->notify(new AdminUserCreated($user, $pass));\n\n return redirect()->route('active_user', $user->id);\n }", "public function save(User $user) {\n\t\tif (!empty($user->getGroup())){\n\t\t\t$groupId = $user->getGroup()->getId();\n\t\t} else {\n\t\t\t$groupId = NULL;\n\t\t}\n\n\t\t$userData = array(\n\t\t\t'txtUserName' => $user->getUsername(),\n\t\t\t'txtUserMail' => $user->getMail(),\n\t\t\t'txtUserRole' => $user->getRole(),\n\t\t\t'idGroup' => $groupId\n\t\t);\n\n\t\t// Si le password est fourni, il faut l'inclure dans la modification\n\t\tif (!empty($user->getPassword())){\n\t\t\t$userData['txtUserPassword'] = $user->getPassword();\n\t\t\t$userData['txtUserSalt'] = $user->getSalt();\n\t\t}\n\n\t\t// Si un avatar est fourni\n\t\tif (!empty($user->getPassword())){\n\t\t\t$userData['txtUserImgPath'] = $user->getImgPath();\n\t\t}\n\t\t\n\t\tif ($user->getId()) {\n\t\t\t// The user has already been saved : update it\n\t\t\t$this->getDb()->update('t_user', $userData, array('idUser' => $user->getId()));\n\t\t} else {\n\t\t\t// The user has never been saved : insert it\n\t\t\t$this->getDb()->insert('t_user', $userData);\n\t\t\t// Get the id of the newly created user and set it on the entity.\n\t\t\t$id = $this->getDb()->lastInsertId();\n\t\t\t$user->setId($id);\n\t\t}\n\t}", "public function save(UserInterface $user)\n {\n $this->_em->persist($user);\n $this->_em->flush($user);\n }", "public function save()\n {\n $user_id = Yii::$app->session->getFlash('validatedUserId');\n if ($this->validate() && ( $user = User::findOne($user_id)) !== null ) {\n // Hashing user password before saving it to the DB\n // http://www.yiiframework.com/doc-2.0/guide-security-passwords.html\n $user->password = Yii::$app->getSecurity()->generatePasswordHash($this->password);\n $user->active = '1';\n // Generates a new auth key to avoid the previous one from being used\n $user->auth_key = Yii::$app->security->generateRandomString();\n // Save DB record\n return $user->save();\n }\n return false;\n }", "public function store()\n {\n $attributes = request()->validate([\n 'name' => 'required|max:255',\n 'username' => 'required|unique:users,username',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required',\n ]);\n $user = User::create($attributes);\n\n // Auth facades\n auth()->login($user);\n }", "public function save(User $user) {\n $userData = array(\n 'user_name' => $user->getUsername(),\n 'user_salt' => $user->getSalt(),\n 'user_password' => $user->getPassword(),\n 'user_role' => $user->getRole()\n );\n\n if ($user->getId()) {\n // Si l'utilisateur existe déjà : Mise à jour\n $this->getDb()->update('utilisateurs', $userData, array('user_id' => $user->getId()));\n } else {\n // Sinon : Insertion (création)\n $this->getDb()->insert('utilisateurs', $userData);\n // On récupére le dernier identifiant enregistré\n $id = $this->getDb()->lastInsertId();\n $user->setId($id);\n }\n }", "public static function saveUser ($data) {\n\t\t// DB::insert(\"INSERT INTO users (email, password, username) VALUES(?, ?, ?)\", [$data['email'], \\Hash::make($data['pass']), $data['username']]);\n\t\t\n\t\t$user = new User;\n\t\t$user->email = $data['email'];\n\t\t$user->username = $data['username'];\n\t\t$user->password = $data['pass'];\n\t\t$user->save();\n\t}", "public function store()\n\t{\n\t\t// Validate the form input\n\t\t$this->userUpdateForm->validate(Input::all());\n\n\t\textract(Input::only('username', 'email', 'password', 'first_name', 'last_name'));\n\n\t\t$user = $this->execute(\n\t\t\tnew RegisterUserCommand($username, $email, $password, $first_name, $last_name)\n\t\t);\n\n\t\tFlash::success($user->username . ' was successfully created');\n\t\treturn Redirect::back();\n\t}", "public function store(Requests\\UserRequest $request, User $user)\n { \n $data = $request->all();\n $user->name = $data['name'];\n $user->role_id = $data['role_id'];\n $user->password = Hash::make($data['password']);\n $user->email = $data['email'];\n $user->save();\n return redirect(route('user.index'))->with('save_msg','User Saved Successfully');\n }", "public function store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "public function store(UserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $input = $request->all();\n\n $person = Person::create($input);\n $input['person_id'] = $person->id;\n\n $user = User::create($input);\n\n if ($request->has('center')) {\n $center = Center::abbreviation($request->get('center'))->first();\n if ($center) {\n $user->setCenter($center);\n }\n }\n if ($request->has('role')) {\n $role = Role::find($request->get('role'));\n if ($role) {\n $user->roleId = $role->id;\n }\n }\n if ($request->has('active')) {\n $user->active = $request->get('active') == true;\n }\n if ($request->has('require_password_reset')) {\n $user->requirePasswordReset = $request->get('require_password_reset') == true;\n }\n $user->save();\n\n return redirect('admin/users');\n }", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "public function save(User $user) : User\n {\n $checkUser = $this->findByUsername($user->getUsername());\n\n if (isset($checkUser)) {\n $sql = \"UPDATE users SET username = :username, name = :name, email = :email, password = :password WHERE username = :username\"; \n } \n else {\n $sql = \"INSERT INTO users (username, name, email, password) VALUES (:username, :name, :email, :password)\";\n }\n\n $stmt = $this->conn->prepare($sql);\n\n try {\n $stmt->execute([\n ':username' => $user->getUsername(),\n ':name' => $user->getName(),\n ':email' => $user->getEmail(),\n ':password' => $user->getPassword(),\n ]);\n\n } catch (PDOException $e) {\n throw new InvalidArgumentException($e->getMessage(), 500);\n }\n\n return $user;\n }", "public function store(User $user)\n {\n\n\n $user->user_id = request('id');\n $user->fname = request('fname');\n $user->lndame = request('lname');\n $user->user_cin = request('cin');\n $user->user_role = 'etudiant';\n $user->email = request('email');\n $user->password = request('password');\n $user->dob = request('dob');\n\n\n $user->save();\n return redirect('admin/std');\n }", "public function save($user)\n {\n $userData = array(\n 'first_name' => $user->getFirstName(),\n 'last_name' => $user->getLastName(),\n 'password' => $user->getPassword(),\n 'phone' => $user->getphone(),\n 'mail' => $user->getMail(),\n 'birthdate' => $user->getBirthdate(),\n 'address_street_1' => $user->getAddressStreet1(),\n 'address_street_2' => $user->getAddressStreet2(),\n 'city' => $user->getCity(),\n 'zip' => $user->getZip(),\n 'gender' => $user->getGender(),\n 'photo' => $user->getPhoto(),\n 'sponsor_id' => $user->getSponsor(),\n 'comment' => $user->getComment(),\n 'failed_logins' => $user->getFailedLogins(),\n 'last_seen' => $user->getLastSeen(),\n 'last_ip' => $user->getLastIP(),\n 'deleted_at' => $user->getDeletedAt()\n );\n\n if ($user->getId()) {\n $this->db->update('users', $userData, array('id' => $user->getId()));\n\n if ($user->getUserLevel()) {\n $this->db->delete('users_access', array('user_id' => $user->getId()));\n $this->db->insert('users_access', array('user_id' => $user->getId(), 'user_level' => $user->getUserLevel()));\n }\n } else {\n $this->db->insert('users', $userData);\n $user->setId($this->db->lastInsertId());\n\n if ($user->getUserLevel()) {\n $this->db->insert('users_access', array('user_id' => $user->getId(), 'user_level' => $user->getUserLevel()));\n }\n }\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->first_name = trim($request->input('first_name'));\n $user->last_name = trim($request->input('last_name'));\n $user->username = trim($request->input('username'));\n $user->active = ($request->input('active') == \"on\") ? 1 : 0;\n $user->password = bcrypt(trim($request->input('password')));\n $user->email = trim($request->input('email'));\n $user->mobile = trim($request->input('mobile'));\n if ($user->save()) {\n createSessionFlash('User Create', 'SUCCESS', 'User create successfully');\n } else {\n createSessionFlash('User Create', 'FAIL', 'Error in User create');\n }\n return redirect('admin/users');\n }", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function save() {\n\n if( isset( $_POST ) ) {\n // Set user id for add\n $id = null;\n // Set null if empty value\n $_POST['email'] = replace_empty_with_null( $_POST['email'] );\n // Update mode\n if( $_POST['userId'] != '' ) {\n // Set user id for update\n $id = $_POST['userId'];\n // Check if update password form is trigger\n if( isset( $_POST['password'] ) ) {\n $_POST['password'] = $this->user_model->hash( $_POST['password'] ); \n unset( $_POST['confirm_password'] ); \n } else {\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n }\n } else {\n\n $_POST['password'] = $this->user_model->hash( $_POST['password'] );\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n\n }\n \n $this->user_model->save( $_POST, $id );\n echo \"true\";\n } else {\n echo \"error\";\n }\n\n }", "private function saveUser(){\n\n if( ! $this->checkEmail() ){\n $password = password_hash($this->_userPassword, PASSWORD_DEFAULT);\n $request = $this->_connexion->prepare(\"INSERT INTO Users (user_name, user_email, user_password) VALUES (?, ?, ?)\");\n $request->execute(array($this->_userName, $this->_userEmail, $password));\n\n return $response = json_encode([\n 'status' => 'ok',\n 'message' => 'successfuly add'\n ]);\n }\n else{\n return $response = json_encode([\n 'status' => 'failed',\n 'message' => 'this email allready exist'\n ]);\n }\n\n }", "public function store(Request $request, StoreUserPost $user) {\n $this->model->addUser($request->all());\n Controller::FlashMessages('The user has been added', 'success');\n return redirect('/users');\n }", "public function saveAction() {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $user = Users::findFirstByid($id);\n if (!$user) {\n $this->flash->error(\"user does not exist \" . $id);\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }\n\n $user->id = $this->request->getPost(\"id\");\n $user->name = $this->request->getPost(\"name\");\n $user->email = $this->request->getPost(\"email\", \"email\");\n $user->password = $this->request->getPost(\"password\");\n $user->mustChangePassword = $this->request->getPost(\"mustChangePassword\");\n $user->status = $this->request->getPost(\"status\");\n\n\n if (!$user->save()) {\n\n foreach ($user->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"edit\",\n \"params\" => array($user->id)\n ));\n }\n\n $this->flash->success(\"user was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"users\",\n \"action\" => \"index\"\n ));\n }", "public function save(Application_Model_User $users)\r\n {\r\n $data = array(\r\n 'login' => $users->getLogin(),\r\n 'pass' => $users->getPass()\r\n );\r\n\r\n if (null === ($id = $users->getId())) {\r\n unset($data['id']);\r\n $this->getDbTable()->insert($data);\r\n } else {\r\n $this->getDbTable()->update($data, array('id = ?' => $id));\r\n }\r\n }", "public function save(User $user) : User\n {\n $this->em->persist($user);\n $this->em->flush();\n\n return $user;\n }", "public function addUserToDatabase($user) {\n $name = $user->getName();\n $password = $user->getHashedPassword();\n $sql = \"INSERT INTO users (name, password) VALUES (:name, :password)\";\n $insertToDb = $this->connection->prepare($sql);\n $insertToDb->bindParam(':name', $name);\n $insertToDb->bindParam(':password', $password);\n $insertToDb->execute();\n $this->registerStatus = true;\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "function save_user_object($user){\r\n\r\n}", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "public function save($isNewUser = false) {\n // Create a new database object.\n $db = new DB();\n $username = $db->mysqli->real_escape_string($this->username );\n $email = $db->mysqli->real_escape_string($this->email );\n $firstName = $db->mysqli->real_escape_string($this->firstName );\n $lastName = $db->mysqli->real_escape_string($this->lastName );\n\n // If just modifying a current user.\n if(!$isNewUser) {\n // set the data array\n $data = array(\"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\"\n );\n // Modify the user in the database\n $db->modify('User', $data, \"'id = $this->id'\");\n\n } else {\n // If this is a new user being registered.\n $data = array(\"user_id\" => \"NULL\",\n \"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\",\n \"user_joinDate\" => \"\".date(\"Y-m-d H:i:s\")\n );\n\n $this->id = $db->insert('User', $data);\n $this->joinDate = time();\n }\n return true;\n }", "public function save(): bool\r\n {\r\n if (!$this->user_id)\r\n throw new Exception(\"Couldn't save User: The user id hasn't been set.\");\r\n\r\n $sql = \"UPDATE `users` SET `email`=:email,`password`=:password,`rank`=:rank,`last_login`=:last_login,`last_login_2`=:last_login_2 WHERE `user_id`=:user_id\";\r\n $statement = $this->pdo->prepare($sql);\r\n $statement->bindValue(':email', $this->data['email']);\r\n $statement->bindValue(':password', $this->data['password']);\r\n $statement->bindValue(':rank', $this->data['rank']);\r\n $statement->bindValue(':last_login', $this->data['last_login']);\r\n $statement->bindValue(':last_login_2', $this->data['last_login_2']);\r\n $statement->bindValue(':user_id', $this->user_id);\r\n if (!$statement->execute()) {\r\n throw new Exception(\"Error saving User data\");\r\n if ($this->logger) $this->logger->error(\"Error saving User data at User::save()\", $this->data);\r\n }\r\n\r\n if ($this->logger) $this->logger->info(\"Save User data \", $this->data);\r\n\r\n return true;\r\n }", "public function store(CreateUserRequest $request)\n {\n DB::beginTransaction();\n try{\n $user = new User($request->only('full_name','dni','phone','user','bank_account_number','role','group_id','sponsor_id'));\n $user->password= bcrypt($request->password);\n\n if(env('APP_DEBUG')){\n $user->created_at = session('day');\n }\n if(Auth::user()->role == 'admin'){\n $user->admin_id = Auth::user()->id;\n }\n if(Auth::user()->role == 'sponsored'){\n $user->admin_id = Auth::user()->admin_id;\n }\n $user->save();\n DB::commit();\n return response(['message' => 'Se ha creado el usuario corrrectamente','redirect'=>route('user.index')]);\n }catch(QueryException $e){\n DB::rollBack();\n return response(['message'=> 'QueryException :'.$e->getMessage(),'type' => 'error']);\n }catch(Exception $e){\n DB::rollBack();\n return response(['message'=> 'Exception :'.$e->getMessage(),'type' => 'error']);\n }\n }", "public function store(UserRegisterFormRequest $request)\r\n {\r\n \r\n $user = new User;\r\n $user->firstname = ucwords(strtolower(preg_replace('/\\s+/', ' ', $request->all()['firstname']))); \r\n $user->lastname = ucwords(strtolower(preg_replace('/\\s+/', ' ', $request->all()['lastname']))); \r\n $user->email = $request->all()['email']; \r\n $user->password = Hash::make($request->all()['password']); \r\n $user->save();\r\n return redirect('users');\r\n }", "public function store()\n {\n $validator = Validator::make(Input::all(), User::rules(), [], User::attributes());\n\n if ($validator->fails()) {\n return Redirect::action('Admin\\UserController@create')->withErrors($validator)->withInput();\n }\n\n $model = new User;\n $model->title = Input::get('title');\n $model->content = Input::get('content');\n $model->audit = Input::get('audit');\n if($model->save()){\n Request::session()->flash('info', '系统用户创建成功!');\n }\n return Redirect::action('Admin\\UserController@index');\n }", "public function store(UserRequest $request)\n {\n $item = new User();\n $item->username = $request->input('username');\n $item->password = bcrypt($request->input('password'));\n $item->full_name = $request->input('full_name');\n $item->contact = $request->input('contact');\n $item->active = 1;\n $item->type = $request->input('type');\n if ($item->save()) {\n return redirect(route('manageUsers'))->with('success', 'เพิ่มข้อมูลผู้ใช้แล้ว');\n } else {\n return back()->withErrors('เพิ่มข้อมูลผู้ใช้ล้มเหลว');\n }\n }", "public function save_user($u)\n\t{\n\t\n\t\tif($u['id'])\n\t\t{\n\t\t\t$sql=\"UPDATE waf_users SET email='\".$this->db->Q($u['email'],1).\"', \"\n\t\t\t.((!empty($u['pass']))?\"pass='\".md5($u['pass']).\"', \":\"\")\n\t\t\t.\"editor=\".(isset($u['editor'])?1:0).\", \"\n\t\t\t. \"status=\".(isset($u['status'])?1:0).\" \"\n\t\t\t. \"WHERE id=\".$this->db->Q($u['id']);\n\t\t}else{\n\t\t\t$sql=\"INSERT INTO waf_users (email,pass,editor,status) VALUES ('\".$this->db->Q($u['email'],1).\"','\".md5($u['pass']).\"',\".(isset($u['editor'])?1:0).\",\".(isset($u['status'])?1:0).\")\";\n\t\t}\n\t\t$this->db->QUERY($sql);\n\t}", "public function store(UserRequest $request)\n {\n\n $user = new User($request->all());\n $user->password = bcrypt($request->password);\n $user->save();\n\n Flash::success('User: '.$user->name.' was created!');\n return redirect()->route('admin.users.index');\n\n }", "public function save(UserRequest $request){\r\n \t$view = self::checkLoginAdmin();\r\n \tif(isset($view))\r\n \t\treturn $view;\r\n \t$user = new User();\r\n \t$user->name = $request->input('name');\r\n \t$user->email = $request->input('email');\r\n \t$user->admin = $request->input('admin') || 0;\r\n $user->moderator = $request->input('moderator') || 0;\r\n $user->author = $request->input('author') || 0;\r\n $password = env(\"USER_DEFAULT_PASSWORD\", str_random(12));\r\n \t$user->password = Hash::make($password);\r\n\t\tif(User::where('email', $user->email)->count() > 0)\r\n\t\t\treturn redirect()->back()->withErrors(['O Email já esta em uso']);\r\n\t\t$user->save();\r\n EmailUtils::sendWelcomeMail($user->name, $user->email, $password);\r\n Session::flash('success', 'Usuário criado com sucesso'); \r\n \treturn redirect()->route('admin');\r\n }", "public function store(FormUserCreateRequest $request)\n {\n $user = new User();\n $user->name = $request->name;\n $user->surname = $request->surname;\n $user->email = $request->email;\n $user->role = $request->role;\n $user->department_id = $request->department;\n $user->active = $request->active;\n $user->password = Hash::make($request->password);\n $saved = $user->save();\n if($saved)\n return response()->json(['success' => true, 'message' => 'Usuario registrado exitosamente.'], 200);\n }", "public function saveAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n\n try {\n //Get parameters\n $request = $this->get('request');\n $id = $request->get('id');\n $name = $request->get('name');\n $lastname = $request->get('lastname');\n $username = $request->get('username');\n $email = $request->get('email');\n $cellPhone = $request->get('cellPhone');\n $isActive = $request->get('isActive');\n $isCreating = false;\n\n $translator = $this->get(\"translator\");\n\n if( isset($id) && isset($name) && trim($name) != \"\"\n && isset($lastname) && trim($lastname) != \"\"\n && isset($username) && trim($username) != \"\") {\n $em = $this->getDoctrine()->getManager();\n $entity = new User();\n if($id != 0) { //It's updating, find the user\n $entity = $em->getRepository('TecnotekAsiloBundle:User')->find($id);\n }\n if( isset($entity) ) {\n $entity->setName($name);\n $entity->setLastname($lastname);\n $entity->setUsername($username);\n $entity->setCellPhone($cellPhone);\n $entity->setEmail($email);\n $entity->setIsActive( ($isActive==\"true\")? 1:0);\n $rawPassword = $this->generateStrongPassword();\n if($id == 0) { // If it's new must generates a new password\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);\n $entity->setPassword($encoder->encodePassword($rawPassword, $entity->getSalt()));\n $isCreating = true;\n }\n\n if($em->getRepository(\"TecnotekAsiloBundle:User\")\n ->checkUniqueUsernameAndEmail($username, $email, $id) ) {\n\n $em->persist($entity);\n $em->flush();\n if($isCreating) { // If it's new must email the new account email including the password\n $roleEmployee = $em->getRepository('TecnotekAsiloBundle:Role')->findOneByRole(\"ROLE_EMPLOYEE\");\n $entity->getUserRoles()->add($roleEmployee);\n $em->persist($entity);\n $em->flush();\n $logger->info(\"Send Email for new Account with password: \" . $rawPassword);\n $this->sendEmailForNewAccount($entity, $rawPassword);\n }\n return new Response(json_encode(array(\n 'error' => false,\n 'msg' => $translator->trans('catalog.save.success'))));\n } else {\n return new Response(json_encode(array(\n 'error' => true,\n 'msg' => $translator->trans('user.username.and.email.must.be.uniques'))));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 2\")));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 1\")));\n }\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::saveAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'msg' => $info)));\n }\n }", "public function store(UserRequest $request){\n // Recuperar todos los datos del formulario en un ojbeto User\n $user=new User($request->all());\n // Usar bcrypt para encriptar password\n $user->password=bcrypt($user->password);\n // Persistir usuario\n $user->save();\n // Preparar el mensaje ha mostrar\n flash('Se ha guardado '.$user->name.' exitosamente.')->success();\n // Redireccionar al listado de usuarios\n return redirect()->route('admin.user.index');\n }", "public function store(UserRequest $request User $user)\n {\n $user->create($request->all());\n return redirect()->route('admin.users.index');\n }", "public function save(User $usuario){\n $sql = \"INSERT INTO users\n (name,\n email,\n password\n )\n VALUES\n ('\".$usuario->getName().\"', \n '\".$usuario->getEmail().\"',\n '\".$usuario->getPassword().\"')\";\n\n $stmt = $this->cnx->prepare($sql);\n //print $sql;\n $result = $stmt->execute();\n if(!$result){\n throw new Exception(\"Ocorreu um erro ao inserir o registro em usuario!\");\n }\n }", "public function store(UserRequest $request)\n {\n $user = User::create(array_merge($request->only('email', 'name'), [\n 'password' => bcrypt($request->get('new_password')),\n 'password_expired_at' => $request->has('password_expired') ? now() : null,\n ]));\n\n //權限\n $user->roles()->sync($request->input('role'));\n\n return redirect()->route('user.index')->with('success', '會員已建立');\n }", "public function store(UserRequest $request)\n {\n User::query()->create($request->validated());\n return redirect(route('users.index'));\n }", "public function store(UserRequest $request)\n {\n return $this->userService->save($request->validated());\n }", "public function testSave()\n {\n $user = factory(\\App\\User::class)->make();\n\n $this->assertTrue($user->save());\n }", "public function store(\n\t\tUserCreateRequest $request\n\t\t)\n\t{\n//dd($request);\n\t\t$this->user->store($request->all());\n\t\tFlash::success( trans('kotoba::account.success.create') );\n\t\treturn redirect('admin/users');\n\t}", "function createUser()\n{\n $userCheck = UsersQuery::create()->findOneByUsername($_POST['username']);\n if ($userCheck == \"\") {\n // next add user to db\n $user = new Users();\n $user->setUsername($_POST['username']);\n $user->setPassword($_POST['password']);\n $user->setName($_POST['name']);\n $user->setEmail($_POST['email']);\n $user->setStatus(\"active\");\n $user->setPicture(\"none\");\n $user->setCreated(time());\n $user->setModified(time());\n\n $user->save();\n\n if ($user != null) {\n echo \"user added successfully\";\n }\n } else {\n echo \"user already registered\";\n }\n}", "public function save()\n {\n $this->validate();\n if(empty($this->errors)) {\n $qb = new QB;\n $qb->conn = static::getDB();\n $columns = ['name', 'email', 'password_hash'];\n $password_hash = password_hash($this->password, PASSWORD_BCRYPT);\n $values = [\n $this->name,\n $this->email,\n $password_hash\n ];\n $qb->insert('users', $columns, $values);\n return true;\n }else{\n return false;\n }\n }", "public function saveNewUser(\\Model\\User $user) {\n $newMember = (object)array();\n $newMember->username = $user->getUsername();\n $newMember->password = $this->hashPassword($user->getPassword());\n $this->saveMemberToFile($newMember);\n }", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "public function store(UserCreateRequest $request)\n {\n $user=$request['nombre'];\n $u=strtoupper($user[0]).strtolower($request['apellido']);\n User::create([\n 'nombre' => trim(strtoupper($request['nombre'])),\n 'apellido' => trim(strtoupper($request['apellido'])),\n 'ci' => $request['ci'],\n 'telef1' => $request['telef1'],\n 'telef2' => $request['telef2'],\n 'direccion' => trim(strtoupper($request['direccion'])),\n 'email' => trim(strtoupper($request['email'])),\n 'password' => bcrypt($u),\n 'name_user' => $u,\n 'rol' => $request['rol'],\n ]);\n Session::flash('message', 'Los datos se guardaron exitosamente');\n return Redirect::to('/usuario');\n }", "public function store(UserRequest $request)\n {\n $user = new User();\n $user->name = $request->get('name');\n $user->lastname = $request->get('lastname');\n $user->email = $request->get('email');\n $user->password = bcrypt($request->get('password'));\n $user->id_estado = $request->get('id_estado');\n $user->save();\n\n $sedes = $request->input('sedes')? $request->input('sedes') : [];\n $user->sedes()->sync($sedes);\n\n $roles = $request->input('roles') ? $request->input('roles') : [];\n $user->assignRole($roles);\n\n return response([\n 'msg' => 'Usuario registrado correctamente.',\n 'title' => '¡Registro exitoso!'\n ], 200)// 200 Status Code: Standard response for successful HTTP request\n ->header('Content-Type', 'application/json');\n }", "public function save()\n\t{\n\t\t// Verifier le login\n\t\t$login = $this->getValue('login');\n\t\t$id = $this->getValue('id');\n\t\tif ( $this->checkLogin($login, $id) )\n\t\t{\n\t\t\t$this->_error(LOC_MSG_LOGIN_EXIST . '(' . $login . ')');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Enregistrer les donnees\n\t\t$where = 'user_id=' . $id;\n\t\t$id = $this->update('users', 'user_', $this->getValues(), $where);\n\t\treturn $id;\n\t}", "public function writeNewUser () {\n if (! $this->Writeable()){\n throw new Exception('User object is not writeable, cannot write to DB');\n }\n\n if ($this->exists($this->loginId)) {\n throw new Exception('User already exists, cannot be created');\n }\n\n $i = new folksoDBinteract($this->dbc);\n if ($i->db_error()) {\n throw new Exception('DB connect error: ' . $i->error_info());\n }\n\n $i->sp_query(\n sprintf(\"call create_user(\"\n .\"'%s', '%s', '%s', '%s', '', %d, '%s', '%s', '%s')\",\n $i->dbescape($this->nick),\n $i->dbescape($this->firstName),\n $i->dbescape($this->lastName),\n $i->dbescape($this->email),\n $i->dbescape($this->loginId),\n $i->dbescape($this->institution),\n $i->dbescape($this->pays),\n $i->dbescape($this->fonction)));\n\n if ($i->result_status == 'DBERR') {\n throw new Exception('DB query error on create FB user: ' . $i->error_info());\n }\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'username' => 'required|between:3,20',\n\t\t\t'email' => 'required|email|confirmed|unique:users,email',\n\t\t\t'password' => 'required|min:6|alpha_num|confirmed'\n\t\t);\n\n\t\t$validation = Validator::make(Input::all(), $rules);\n\n\t\tif($validation->fails()) {\n\t\t\treturn Redirect::back()->withErrors($validation);\n\t\t}\n\n\t\t$user = new User;\n\t\t$user->username = Input::get('username');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Hash::make(Input::get('password'));\n\n\t\tif($user->save()){\n\t\t\tAuth::login($user);\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn Redirect::to('user/'.$user->id);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn Redirect::back()->with('flash_error', \"Impossible de connecter l'utilisateur\");\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn Redirect::back()->with('flash_error', \"Impossible d'enregistrer l'utilisateur\");\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$request = Request::input();\t\n\t\t$user = new User;\n\t\t$user->username = $request['username'];\n\t\t$user->password = Hash::make($request['password']);\n\t\t$user->email = $request['email'];\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('/user');\n\n\t}", "public function store(UserRequest $request)\n {\n try {\n\n DB::beginTransaction();\n //upload profile pic\n $path = \"profiles/default.png\";\n $data = [\n 'name' => $request->name,\n 'email' => $request->email,\n 'role' => 'user',\n 'password' => !empty($request->password) ? bcrypt($request->password) : \"\",\n 'org_password' => !empty($request->password) ? $request->password : \"\",\n 'profile_photo_path' => empty($path) ? 'defaul.png' : $path,\n 'phone' => !empty($request->phone) ? $request->phone : \"\",\n 'address' => !empty($request->address) ? $request->address : \"\",\n 'gender' => !empty($request->gendr) ? $request->gendr : \"\",\n ];\n User::Create($data);\n DB::commit();\n return redirect(route('users.index'))->with('success', 'Record has been updated.');\n } catch ( \\Exception $e) {\n DB::rollBack();\n return Redirect::back()->withErrors(['error', 'Sorry Record not inserted.']);\n }\n }", "public function store(UserRequest $request)\n {\n\n $data = $request->all();\n\n if (isset($request->status)) {\n $data['status'] = 1;\n }\n\n $data['password'] = Hash::make($request->password);\n\n $this->user->create($data);\n\n flash('Usuário criado com sucesso!')->success();\n\t return redirect()->route('admin.users.index');\n\n }", "public function save(UpdateUserRequest $request, User $user) {\n $original = [\"user\" => $user->getOriginal(), \"role\" => $user->role];\n $request->commit($user);\n\n //Trigger user edited event\n event(new UserEdited($user, $original));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User saved'\n ]);\n }", "public function store(Request $request, User $user)\n\t{\t\n\t\t$user->create($request->all());\n\t\t$user->save();\n\t\t$user->attachRole($request->input('role'));\n\t}", "function addUser ($user) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"INSERT INTO user (_user_FirstName, _user_Email, _user_Password) VALUES (?, ?, ?)\";\n $query = $conn->prepare($sql);\n $query->execute(array($user->_user_FirstName, $user->_user_Email, $user->_user_Password));\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n }", "public function store(Request $request, User $user)\n {\n \tif(Auth::user()->type == 1){\n $user->create($request->merge(['password' => Hash::make($request->get('password'))])->all());\n \tsession()->flash('mensagem', 'Usuário inserido com sucesso!');\n \t\n return redirect()->route('users.index');\n \t}\n else\n return redirect()->route('login'); \n }", "public function store(MakeUserRequest $request)\n {\n $input = $request->all();\n $input['name'] = trim($input['name']);\n $input['surname'] = trim($input['surname']);\n $input['email'] = trim($input['email']);\n $input['is_active'] = 1;\n $input['confirmed'] = 1;\n $input['confirmation'] = '';\n $input['password'] = bcrypt($input['password']);\n User::create($input);\n Session::flash('complete', 'Ο χρήστης έχει δημιουργηθεί.');\n return redirect('admin/users');\n\n }", "public function store()\n\t{\n\t\t//create rules \n\t\t$rules = array(\n\t\t\t'user_email' => 'required|email|unique:user',\n\t\t\t'user_password' => 'required|confirmed',\n\t\t\t'user_first' \t=> 'required',\n\t\t\t'user_last' \t=> 'required',\n\t\t\t'user_access' \t=> 'required'\n\t\t);\n\n\t\t//validate posted data\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\t\n\t\t//check if data is ok\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::to('user/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t} else {\n\n\t\t\t$userTypeId = Input::get('user_access');\n\t\t\t$existsUserType = UserType::where('id', '=', $userTypeId)->first();\n\t\t\tif(!$existsUserType) {\n\t\t\t\treturn Redirect::to('user/create')\n\t\t\t\t->with('error', 'User Type doesnt exists')\n\t\t\t\t->withInput(Input::except('password'));\n\t\t\t}\n\n\t\t\t$user = new User;\n\t\t\t$user->user_email = Input::get('user_email');\n\t\t\t$user->user_password = Hash::make(Input::get('user_password'));\n\t\t\t$user->user_first \t = Input::get('user_first');\n\t\t\t$user->user_last \t = Input::get('user_last');\n\t\t\t$user->user_middle\t = Input::get('user_middle');\n\t\t\t$user->user_access\t = Input::get('user_access');\n\t\t\t$user->active\t \t = true;\n\t\t\t$user->save();\n\n\t\t\tSession::flash('message', 'User successfully added');\n\t\t\tif(Input::get('save')) {\n\t\t\t\treturn Redirect::to('user/' . $user->id . '/edit');\n\t\t\t}\n\n\t\t\tif(Input::get('save_and_close')) {\n\t\t\t\treturn Redirect::to('user');\n\t\t\t}\n\n\t\t\tif(Input::get('save_and_new')) {\n\t\t\t\treturn Redirect::to('user/create');\n\t\t\t}\n\t\t}\n\t}", "public function saveToDatabase() {\n if($this->id != 0) {\n $dbResult = System::database()->query('update :table_users \n set `role_id` = :role_id, \n `login` = :login, \n `password` = :password, \n `auth_key` = :auth_key, \n `auth_expire` = :auth_expire, \n `last_login` = :last_login\n where `id` = :id');\n \n $dbResult->bindInt(':id', $this->id);\n $dbResult->bindValue(':auth_key', $this->authKey);\n $dbResult->bindInt(':auth_expire', $this->authExpired);\n $dbResult->bindInt(':last_login', $this->lastLoginTime);\n } else {\n $dbResult = System::database()->query('insert into :table_users (`role_id`, `login`, `password`)\n values (:role_id, :login, :password);');\n }\n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindInt(':role_id', $this->role['id']);\n $dbResult->bindValue(':login', $this->login);\n $dbResult->bindValue(':password', $this->password);\n\n $dbResult->execute();\n }", "public function store(Request $request)\n {\n $user = new User();\n\n $random_quote = str_random(10);\n\n $user->firstname = Request::input('firstname');\n $user->lastname = Request::input('lastname');\n $user->idrol = 2;\n $user->email = Request::input('email');\n $user->password = Hash::make($random_quote);\n $user->repassword = $random_quote;\n $user->dni = Request::input('dni');\n $user->position = Request::input('position');\n $user->company_id = Request::input('company_id');\n $user->branch_office = Request::input('branch_office');\n $user->is_active = Request::input('is_active');\n\n $user->save();\n\n return Response::json([\n 'Success' => [\n 'message' => 'Record Save Exits',\n 'status_code' => 200\n ]\n ], 200);\n }", "function save_user() {\n $this -> load -> library(array('form_validation', 'session'));\n $this -> form_validation -> set_rules('user_firstname', 'nombre', \"required|trim\");\n $this -> form_validation -> set_rules('user_lastname', 'apellido', \"required|trim\");\n $this -> form_validation -> set_rules('user_email', 'email', \"required|trim|valid_email\");\n $this -> form_validation -> set_rules('user_email2', 'confirmar email', \"required|trim|valid_email|matches[user_email]\");\n $this -> form_validation -> set_rules('user_password', 'contraseña', (!$this -> input -> post('user_id') ? 'required|' : '') . \"trim|min_length[4]\");\n $this -> form_validation -> set_rules('user_password2', 'confirmar contraseña', (!$this -> input -> post('user_id') || trim($this -> input -> post('user_password')) != '' ? 'required|' : '') . \"trim|matches[user_password]\");\n\n if ($this -> form_validation -> run() == TRUE) {\n if (trim($this -> input -> post('user_password')) == '')\n unset($_POST['user_password']);\n unset($_POST['user_password2']);\n unset($_POST['user_email2']);\n if (!$this -> input -> post('user_id'))\n $_POST['user_created'] = date('Y-m-d G:i:s');\n $data = $this -> basic -> save('users', 'user_id', $this -> input -> post());\n $response['js'] = 'window.top.location.href=\"' . site_url('front_login/perfil') . '\"';\n } else {\n $response['html'] = validation_errors();\n $response['error'] = '1';\n }\n\n echo json_encode($response);\n }", "public function store(UserRequest $request)\n {\n $user = new User;\n\n $user->username = $request->input('username');\n $user->password = $request->input('password');\n $user->firstname = $request->input('firstname');\n $user->lastname = $request->input('lastname');;\n\n try {\n\n $this->userRepository->create($user);\n\n return Response::json(array('success' => true));\n\n } catch (\\Exception $e) {\n return $e;\n } \n }", "public function store(UserRequest $request){\n //dd($request->all());\n $user = new User($request->all());\n //Encriptando password\n $user->password=bcrypt($request->password);\n //dd('REGISTRO EXITOSO');\n $user -> save();\n\n Flash::success(\"Se ha registrado \".$user->name.\" de forma exitosa\");\n\n return redirect()->route('users.index');\n }", "public function store(UserRequest $request)\n {\n $this->user = new User;\n return $this->props($request)\n ->save()\n ->redirect($request,'Created');\n }" ]
[ "0.79587907", "0.77736866", "0.7708109", "0.7707836", "0.7703543", "0.76558113", "0.76016927", "0.7571912", "0.75581414", "0.7402825", "0.7399722", "0.739042", "0.73269767", "0.7292358", "0.7276313", "0.7225437", "0.721875", "0.7218055", "0.7195012", "0.71814644", "0.71694463", "0.71504515", "0.71381915", "0.7132326", "0.7126802", "0.71163815", "0.7112709", "0.71014917", "0.7082874", "0.7075887", "0.70536005", "0.70521986", "0.7036941", "0.7032986", "0.7025335", "0.7020586", "0.6964506", "0.6936064", "0.6932129", "0.69299686", "0.68863124", "0.6881828", "0.68785363", "0.68737864", "0.68614924", "0.6860774", "0.68593174", "0.6848936", "0.6835862", "0.68274325", "0.682663", "0.68100035", "0.67966247", "0.67954755", "0.6794702", "0.67938656", "0.67614186", "0.6758889", "0.67568785", "0.67551947", "0.6750037", "0.67411", "0.6739799", "0.6731597", "0.6730499", "0.67180294", "0.67167866", "0.67138237", "0.6713768", "0.6713513", "0.67073613", "0.67057896", "0.6698817", "0.668518", "0.66841084", "0.66768223", "0.66759205", "0.6671766", "0.6669001", "0.66677487", "0.6654764", "0.6644257", "0.6635717", "0.6633006", "0.6624855", "0.6623823", "0.662069", "0.6615945", "0.66141963", "0.66109806", "0.6605822", "0.6600036", "0.6596039", "0.6591116", "0.65830976", "0.6581637", "0.6580043", "0.6578241", "0.65744233", "0.65744025" ]
0.7893134
1
Checks if a given email is already in the database
public function usernameExists($email) { $stmt = $this->db->prepare("SELECT count(email) FROM users where email=?"); $stmt->execute(array($username)); if ($stmt->fetchColumn() > 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emailExists($email)\n {\n $e = \"'\".$email.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', 'email')\n ->where('email', '=', $e)\n ->all();\n if(count($results) > 0){\n $this->errors[] = \"Sorry! This email has already been taken.\";\n }\n }", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "public function checkIfEmailExists($email);", "function email_exists($email)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE email = \" . $this->db->escape($email) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "function email_exists($db, $email)\n{\n\t$sql = 'SELECT * FROM users where email=:email';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function emailExists($email){\r\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\r\n $count = $this->q($sql)->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "function isExistingEmail($email)\n\t{\n\t\t$this->db->from($this->account);\n\t\t$this->db->where('email',$email);\n\t\t$query = $this->db->get();\n\n\t\t$result = $query->result();\n\n\t\tif(!empty($result)){\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function doesEmailExist($email) {\r\n IO::console_log(\"Checking if email exists...\");\r\n \r\n if (!Validator::hasErrors()) {\r\n $query = \"SELECT * FROM users WHERE email = :email\";\r\n if (!empty( $this->run_query($query, [[':email', $email, PDO::PARAM_STR]]) ))\r\n Validator::newError('Email does already exist'); \r\n }\r\n }", "public function checkEmailExisting($email)\r\n\t{\r\n\t\t\r\n\t\t$query=mysql_query(\"SELECT 1 FROM tbl_users WHERE email='$email' and oauth_provider='DReview'\") or die(mysql_error());\r\n\t\t$emailCount = mysql_fetch_row($query);\r\n\t\r\n if ($emailCount >= 1)\r\n \treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\r\n\t}", "private function check_If_Email_Exists($email){\r\n\r\n // Prepare query\r\n $query = \"SELECT * FROM `users` WHERE (Fuid = '' AND Guid = '' AND email = '{$email}')\";\r\n\r\n // Send query into server\r\n $this->_db->get_Rows($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function email_exists($email){\n\t\t$emailexistsql = \"SELECT email FROM users WHERE email = :email\";\n\n\t\t$stmt = $database->prepare();\n\n\t\t$stmt->bindParam(':email', $email);\n\n\t\t$stmt->execute();\n\n\t\tif ($stmt->rowCount() > 0){\n\t\t\techo(\"Email Exists\");\n\t\t\treturn true;\n\t\t}\n\t}", "public static function email_exists($email) {\n $connection = DatabaseConnection::connection();\n $sql = \"SELECT user_id FROM users WHERE email=:email\";\n $statement = $connection->prepare($sql);\n $statement->execute(['email' => $email]);\n $count = count($statement->fetchAll());\n if($count == 1)\n return TRUE;\n else\n return FALSE;\n }", "public function Check($email)\n {\n $db = new DB();\n //Check whether user data already exists in database\n $querySelect = \"SELECT \n * \n FROM \n \".$this->userTbl.\" \n WHERE\n email = '\".$email.\"'\";\n $result = $db->prepare($querySelect);\n $result->execute();\n if($result->rowCount() > 0)\n {\n return false;\n }\n else\n {\n return true;\n }\n\n }", "function checkUniqueEmail($email)\n {\n // will be null for insert operations\n $sql = \"SELECT * FROM $this->table WHERE email=:email LIMIT 1\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute([':email' => $email]);\n return $stmt->rowCount() >= 1;\n }", "public function exists($email) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere email=?\nSQL;\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($email));\n if($statement->rowCount() != 0) {\n return true;\n }\n return false;\n }", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function check_email_exists($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t}", "private function emailExists($email)\n {\n $query = \"SELECT manager_password,manager_name,is_accepted,admin_id\n FROM \" . $this->table . \"\n WHERE manager_email = ?\n LIMIT 0,1\";\n\n // prepare the query\n $stmt = $this->conn->prepare($query);\n $this->manager_email = $email;\n $this->manager_email = htmlspecialchars(strip_tags($this->manager_email));\n // bind value\n $stmt->bindParam(1, $this->manager_email);\n // execute the query\n $stmt->execute();\n // get number of rows\n $num = $stmt->rowCount();\n if ($num > 0) {\n //set password\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->manager_password = $row['manager_password'];\n $this->manager_name = $row['manager_name'];\n $this->is_accepted = $row['is_accepted'];\n // return true because email exists in the database\n\n return true;\n }\n // return false if email does not exist in the database\n return false;\n }", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "function emailExists($email)\n\t{\n\t\tglobal $db,$db_table_prefix;\n\t\n\t\t$sql = \"SELECT Active FROM \".$db_table_prefix.\"Users\n\t\t\t\tWHERE\n\t\t\t\tEmail = '\".$db->sql_escape(sanitize($email)).\"'\n\t\t\t\tLIMIT 1\";\n\t\n\t\tif(returns_result($sql) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\t\n\t}", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "function email_exists($email) {\n $email = sanitize($email);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}", "public function emailExists($email)\n {\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"select * from users where email = :email\");\n $statement->bindParam(\":email\", $email);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n return true;\n }\n else {\n return false;\n }\n }", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "public static function isEmailAlreadyInUse($email)\n {\n $db = Base::getConnection();\n $stmt = $db->prepare(\"SELECT COUNT(*) AS count_emails FROM users WHERE email = :email\");\n $stmt->bindParam(\":email\", $email, PDO::PARAM_STR);\n $stmt->execute();\n\n $result = $stmt->fetch();\n $stmt->closeCursor();\n\n return $result['count_emails'] > 0;\n }", "public function emailExists($email) {\n\n\t $app = getApp();\n\n\t $sql = 'SELECT ' . $app->getConfig('security_email_property') . ' FROM ' . $this->table .\n\t ' WHERE ' . $app->getConfig('security_email_property') . ' = :email LIMIT 1';\n\n\t $dbh = ConnectionModel::getDbh();\n\t $sth = $dbh->prepare($sql);\n\t $sth->bindValue(':email', $email);\n\n\t if($sth->execute()) {\n\t $foundUser = $sth->fetch();\n\t if($foundUser){\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "private function check_for_email($email)\r\n\t{\r\n\t\t//We make use of the global dbCon that we've created in the config file\r\n\t\tglobal $dbCon;\r\n\r\n\t\t//SQL statement where we Count the occurances (it's faster!)\r\n\t\t$sql = \"SELECT COUNT(id) AS students FROM student WHERE email = ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $email);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($students); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($students > 0)\r\n\t\t{\r\n\t\t\treturn \"Email is already in system. Try to log in!\";\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function has_unique_email($connection, $email)\n{\n try {\n $sql = \"SELECT email FROM users WHERE email=?\";\n $statement = runQuery($connection, $sql, array($email));\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n if($row) {\n return false;\n } else {\n return true;\n }\n } catch (PDOException $e) {\n die( $e->getMessage() );\n }\n\n}", "public function emailExists($email){\n $query = $this->conn->query(\"SELECT id FROM user WHERE email = '$email'\");\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n if($result){\n return true;\n }\n }", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "public function isUserEmilExisted($email) {\n $result = mysql_query(\"SELECT * from users WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user email existed \n return true;\n } else {\n // user email not existed\n return false;\n }\n }", "function email_unique_check($email)\r\n\t{\r\n\t\t$isUnique = true;\r\n\r\n\t\t//Skapar anslutning till databasen.\r\n\t\t$db=new Database();\r\n\r\n\t\t//Hämtar de rader som har samma email.\r\n\t\t$result = $db->getUser($email);\r\n\r\n\t\t//Om det blev resultat.\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t//Finns det en rad betyder detta att ett konto med samma email redan existerar i databasen, och inget nytt konto ska skapas.\r\n\t\t\tif($row = mysqli_fetch_row($result))\r\n\t\t\t{\r\n\t\t\t\t//Email är ej unikt.\r\n\t\t\t\t$isUnique = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Avslutar anslutning till databasen.\r\n\t\t$db->close();\r\n\r\n\t\treturn $isUnique;\r\n\t}", "public static function checkEmailExists($email)\r\n {\r\n // Connect to Db \r\n $db = Db::getConnection();\r\n\r\n // Test Db\r\n $sql = 'SELECT COUNT(*) FROM user WHERE email = :email';\r\n\r\n // Take Result\r\n $result = $db->prepare($sql);\r\n $result->bindParam(':email', $email, PDO::PARAM_STR);\r\n $result->execute();\r\n\r\n if ($result->fetchColumn())\r\n return true;\r\n return false;\r\n }", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "protected function emailAlreadyInUse($email)\n {\n return (bool)self::select(['id'])->\n where('email', '=', $email)->\n count();\n }", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function isUserExistsByEmail($email) {\n $query = \"select * from user_profile_details WHERE email='{$email}' \";\n $result_set = mysql_query($query);\n if(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t}\t\n}", "public function userExists($email){\r\n\r\n\t\t$this->stmt = $this->db->prep(\"SELECT email FROM Users WHERE email=:email\");\r\n\t\t$this->stmt->bindParam(':email', $email);\r\n\t\t$this->stmt->execute();\r\n\t\t$email_check = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t//comparing given email to what was fetched from the database\r\n\t\tif($email == $email_check[\"email\"]){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function doesEmailExist($email) {\n global $db;\n\n $query = \"SELECT * FROM user WHERE email=:email\";\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email); \n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return (count($results) > 0);\n}", "function emailExist($dbx, string $targetEmail){\n // debug($dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]));\n return $dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]);\n}", "public function isUserExisted($email) {\r\n $result = mysqli_query($this->con,\"SELECT email from users WHERE email = '$email'\");\r\n $no_of_rows = mysqli_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function isEmailExist() {\n $query = $this->conn->prepare(\"SELECT * FROM subscribers WHERE email = :email\");\n $query->execute([\"email\" => $this->email]);\n $res = $query->fetch(PDO::FETCH_OBJ);\n return $res ? true : false;\n }", "function email_exists($email){\n $sql = \"SELECT id FROM users WHERE email='$email'\";\n $result = query($sql);\n\n if(row_count($result)==1){\n return true;\n }else{\n return false;\n }\n}", "public function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users2 WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function MailExists($email) {\n\n\t$query = \"SELECT email FROM usuarios WHERE email = '$email'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public function email_exists($email) {\n\n\t\t\t$query = $this->db->prepare(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email`= ?\");\n\t\t\t$query->bindValue(1, $email);\n\t\t\n\t\t\ttry{\n\n\t\t\t\t$query->execute();\n\t\t\t\t$rows = $query->fetchColumn();\n\n\t\t\t\tif($rows == 1){\n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t} catch (PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t}", "public function emailExists ($email){\n $con = connectPDO();\n $query = $con->prepare(\"SELECT COUNT(id) FROM users WHERE email = ?\");\n $query->execute(array($email));\n $rowcount = $query->fetchColumn();\n if ($rowcount > 0) {\n return true;\n }else{\n return false;\n }\n }", "public function user_if_email_exists($email)\n\t{\n\t\t$sql = \"SELECT id FROM \".$this->table.\" WHERE email = ?\";\n\t\t$data = array($email);\n\t\t$query = $this->db->query($sql, $data);\n\t\treturn $query->num_rows();\n\t}", "public function emailExists( $email )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"SELECT userID FROM user WHERE email = :email\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':email', $email);\n Core::dbClose();\n \n try\n {\n if( $stmt->execute()) \n\t\t\t{\n $row = $stmt->fetch();\n if( $stmt->rowCount() > 0 ) {\t\t\t\t\n \treturn true;\n\t\t\t\t}\n }\n } catch ( PDOException $e ) {\n echo \"Search for email failed!\";\n }\n\t\t\n\t\treturn false;\n\t}", "private function isUserExists($email)\n {\n $stmt = $this->conn->prepare(\"SELECT id FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function emailExists($email)\n {\n global $db_conn;\n $sql = \"SELECT id FROM users WHERE email = '{$email}'\";\n $result = $db_conn->query($sql);\n\n if ($result->num_rows > 0) {\n $_SESSION['error_msg'][]\n = 'Escolha outro E-mail, este já encontra-se em uso.';\n return true;\n }\n\n return false;\n }", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function admin_check_email_exists($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\n\t\t$query = \"SELECT `admin_Idn` FROM `administrator` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t}", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "private function emailExists( $email ) {\n global $wpdb;\n $query = \"select author_email from \" . $wpdb->prefix . \"roni_images where author_name='\" . $email . \"';\";\n if( empty($wpdb->query( $query ) ) ) {\n return true;\n } else {\n return false;\n }\n }", "public function isAlreadyExist(){\n \n $query = \"SELECT *\n FROM \" . $this->table . \" \n WHERE email='\".$this->email.\"'\";\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n // execute query\n $stmt->execute();\n if($stmt->rowCount() > 0){\n return true;\n }else{\n return false;\n }\n }", "function existsByEmail( $email, $oid=null);", "public function doesThisEmailExist($email) {\n\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t$sql = \"SELECT email FROM users WHERE email=:email\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t$statement->bindValue(':email', $email);\n\n\t\t$statement->execute();\n\n\t\tif( $statement->rowCount() == 1) {\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function check_email_exist($email)\n\t{\n\t\t$query = $this->db->get_where('users', array('email' => $email));\n\t\tif($query->num_rows() > 0) \n { \n return true; \n } \n else \n { \n return false; \n } \n\t}", "public function checkDuplicateEmail( $email )\n {\n include(\"config/database.php\");\n try {\n $sql = \"SELECT email FROM students where email='$email'\";\n $result = $pdoCon->prepare($sql);\n $result->execute();\n $rows = $result->rowCount();\n } catch (Exception $e) {\n echo \"Unable to retrieved results\";\n exit;\n }\n return $rows;\n }", "function email_check($email)\r\n\t{\r\n\t\tif ( $user = $this->generic_model->get_where_single_row('users', array('email' => $email))) \r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('email_check', 'This %s is already registered.');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse { return true; }\r\n\t}", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "function isUniqueEmail($email,$mysqli){\n\t$sql = \"SELECT * FROM all_users WHERE Email_address='$email'\";\n\t$result = $mysqli->query($sql);\n\tif ($result->num_rows>0){\n\t\treturn false;\n\t}\n\telse return true;\n}", "public static function checkUniqueEmail($email){\n if(UsersQuery::create()->findOneByEmail($email)){\n return false;\n }\n else{\n return true;\n }\n }", "function isEmailRegistered ($email) {\n $connect = $GLOBALS['connect'];\n \n $queryCheck = \"SELECT * FROM user WHERE email = '$email'\";\n \n $mysqlQueryCheck = mysqli_query ($connect,$queryCheck);\n \n if (!mysqli_affected_rows ($connect)){\n \n // Save to database\n \n return true;\n \n }\n else {\n \n echo false;\n \n }\n}", "private function isUserExists($email) {\n\t\t$stmt = $this->conn->prepare(\"SELECT user_id from tb_user WHERE user_email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\treturn $num_rows > 0;\n\t}", "private function isUserExists($email) {\n $query = mysql_query(\"SELECT UserId FROM user WHERE Email = '$email'\");\n $no_of_rows = mysql_num_rows($query);\n return $no_of_rows > 0;\n }", "public function email_exists($email){\n\t\t$query = $this->db->prepare(\"SELECT count(`user_email`) FROM `nw_users` WHERE `user_email`= ?\");\n\t\t$query->bindValue(1, $email);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$rows = $query->fetchColumn();\n\n\t\t\tif($rows == 1){\n\n\t\t\t\treturn true;\n\n\t\t\t}else{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "public function isUserExisted($email) {\n $stms = $this->conn->prepare(\"SELECT email from users WHERE email = ?\");\n \n $stms->bind_param(\"s\", $email);\n \n $stms->execute();\n \n $stms->store_result();\n \n if ($stms->num_rows > 0) {\n // user existed \n $stms->close();\n return true;\n } else {\n // user not existed\n $stms->close();\n return false;\n }\n }", "public function isUserExisted($email)\n {\n $Dbcon = new Dbcon();\n $stmt = $Dbcon->select_one_row(\"SELECT email from users WHERE email = '\" . $email . \"' and active='1'\");\n\n if ($stmt) {\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function iN_CheckEmailExistForRegister($email) {\n\t\t$email = mysqli_real_escape_string($this->db, $email);\n\t\t$checkEmail = mysqli_query($this->db, \"SELECT i_user_email FROM i_users WHERE i_user_email = '$email'\") or die(mysqli_error($this->db));\n\t\tif (mysqli_num_rows($checkEmail) == 1) {\n\t\t\treturn true;\n\t\t} else {return false;}\n\t}", "public static function exists($email)\n {\n $conn = new MySqlConnect();\n $isFound = FALSE;\n\n // query the db for the value comparison\n $result = $conn -> executeQueryResult(\"SELECT userId FROM users WHERE emailAddress = '{$email}'\");\n\n // get a row count to verify only 1 row is returned\n $count = mysql_num_rows($result);\n if ($count > 0)\n {\n $isFound = TRUE;\n }\n $conn -> freeConnection();\n return $isFound;\n }", "public function Check_Email_Exists($email)\n\t\t{\n\t\t\tglobal $connection;\n\t\t\t$sql = \"call users_email_check('$email')\";\t\t\t\t\t\n\t\t\t$connection->next_result();\n\t\t\tif($retrieved = $connection->query($sql))\n\t\t\t{\t\t\t\n\t\t\t\tif($retrieved->num_rows)\n\t\t\t\t{\n\t\t\t\t\treturn 0 ; // email in use\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 1; // email not found\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\n\t\t\t\treturn 1 ; \n\t\t\t}\n\t\t}", "function validate_email_unique($email, $dbc) {\n\t$q = \"SELECT * from users WHERE email = '$email'\";\n\t$r = mysqli_query($dbc, $q);\n\tif (mysqli_num_rows($r) == 1) {\n\t\treturn FALSE;\n\t} else return TRUE;\n}", "function check_exists_email($email){\n /* Select 'users' table on database */\n $this->db->select('email');\n $this->db->from('users');\n $this->db->where('email', $email);\n $result = $this->db->get();\n \n if($result->num_rows() >0){\n /*Username Exists*/\n return TRUE;\n } else {\n /*Username does not exist*/\n return FALSE;\n }\n }", "public function validateEmailInDb($email)\n {\n $query = \"SELECT login_id FROM login WHERE email = '$email'\";\n if ($result = $this->connect->query($query)) {\n if ($result->num_rows > 0) {\n return 1;\n }\n return 0;\n }\n }", "public function userExists($email) {\r\n $query = 'SELECT 1 FROM usermanagement.users WHERE email=\\'' . pg_escape_string($email) . '\\'';\r\n $results = $this->dbDriver->fetch($this->dbDriver->query($query));\r\n return !empty($results);\r\n }", "public function is_email_existed($email)\n {\n $query = $this->db->get_where('users', array('email' => $email));\n return ($query->num_rows() > 0);\n }", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isUserExisted($email) {\n $stm = $this->db->prepare(\"SELECT email FROM users WHERE email=?\");\n $stm->execute(array($email));\n $user=$stm->fetch(PDO::FETCH_OBJ);\n if($user!=null){\n return true;\n }else{\n false;\n }\n }", "public static function email_exists($email) {\r\n\t\tif ($email) {\r\n\t\t\t$mysqli = Database::connection();\r\n\t\t\t$email = Database::sanitize($email);\r\n\t\t\t$sql = \"SELECT user_id FROM users WHERE email = '$email' AND type != 0\";\r\n\t\t\t$result = $mysqli->query($sql)\r\n\t\t\tor die ($mysqli->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function check_email_duplicate(){\n $this->SQL = \"SELECT email FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n return $this->results;\n \n }", "Public Function emailExists($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(sizeOf($Result) == 0 || !$Result)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function emailExists($email='') {\n\t\t$checkEmail = check($email) ? $email : $this->_email;\n\t\tif(!check($checkEmail)) return;\n\t\t$result = $this->db->queryFetchSingle(\"SELECT \"._CLMN_EMAIL_.\" FROM \"._TBL_MI_.\" WHERE \"._CLMN_EMAIL_.\" = ?\", array($checkEmail));\n\t\tif(!is_array($result)) return;\n\t\treturn true;\n\t}", "private function isEmailDuplicate($email) {\n $existing = $this->getListFromDB('participant_contact', array(\"email\" => $email));\n if (! empty($existing)) {\n $email_exists = true;\n }\n else {\n $email_exists = false;\n }\n return $email_exists;\n }", "private function emailExists($email)\n\t{\n\t\t$stmt = $this->dbh->prepare('SELECT `email` FROM `users` WHERE `email` = :email');\n\t\t$stmt->execute(array(':email' => $email));\n\n\t\tif ($stmt->rowCount() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "private function emailInUse( $email, $id )\n\t{\n\t\t$stmt = $this->connection->prepare('SELECT id FROM ' . Configure::get('database/prefix') . 'accounts WHERE email_hash = :email LIMIT 1');\n\t\t$stmt->bindValue(':email', $email, PDO::PARAM_STR);\n\t\t$stmt->execute();\n\t\t$data = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt->closeCursor();\n\n\t\tif( !empty($data) && $data['id'] != $id )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkExistingEmail($clientEmail){\n $db = acmeConnect();\n $sql = 'SELECT clientEmail FROM clients WHERE clientEmail = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $clientEmail, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n }\n}", "public function emailExist($email)\n {\n $sql = \" SELECT `email` FROM customer WHERE `customer_email` = '$email'\";\n\n return $this->db_query($sql);\n\n }", "function email_exist($email) {\n\n $sql = \"SELECT id FROM users WHERE email = '$email'\";\n\n $result = query($sql);\n \n if(row_count($result) == 1) {\n return true;\n } else {\n return false;\n }\n}", "function emailExists(){\n\t\t\t\t \n\t\t\t\t // query to check if email exists\n\t\t\t\t $query = \"SELECT rep_id, rep_name, rep_surname, rep_pwd, rep_email\n\t\t\t\t FROM \" . $this->table . \"\n\t\t\t\t WHERE rep_email = :rep_email\n\t\t\t\t LIMIT 0,1\";\n\t\t\t\t \n\t\t\t\t // prepare the query\n\t\t\t\t $stmt = $this->conn->prepare($query);\n\t\t\t\t \n\t\t\t\t // sanitize\n\t\t\t\t $this->rep_email=htmlspecialchars(strip_tags($this->rep_email));\n\t\t\t\t \n\t\t\t\t // bind given email value\n\t\t\t\t $stmt->bindParam(':rep_email', $this->rep_email);\n\t\t\t\t \n\t\t\t\t // execute the query\n\t\t\t\t $stmt->execute();\n\t\t\t\t \n\t\t\t\t // get number of rows\n\t\t\t\t $num = $stmt->rowCount();\n\t\t\t\t \n\t\t\t\t // if email exists, assign values to object properties for easy access and use for php sessions\n\t\t\t\t if($num>0){\n\t\t\t\t \n\t\t\t\t // get record details / values\n\t\t\t\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t \n\t\t\t\t // assign values to object properties\n\t\t\t\t $this->rep_id = $row['rep_id'];\n\t\t\t\t $this->rep_name = $row['rep_name'];\n\t\t\t\t $this->rep_surname = $row['rep_surname'];\n\t\t\t\t $this->rep_pwd = $row['rep_pwd'];\n\t\t\t\t $this->rep_email = $row['rep_email'];\n\t\t\t\t \n\t\t\t\t // return true because email exists in the database\n\t\t\t\t return true;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t // return false if email does not exist in the database\n\t\t\t\t return false;\n\t\t\t\t}", "public function email_exists() {\n\t\t\n\t\t$email = $this->input->post('users_email');\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array (\n\t\t\t'users_email' => trim ( $email )\n\t\t);\n\n\t\tif ($edit_id != \"\") {\n\n\t\t\t$where = array_merge ( $where, array (\n\t\t\t\t\t\"users_id !=\" => $edit_id \n\t\t\t) );\n\t\n\t\t} \n\n\t\t$result = $this->Mydb->get_record( 'users_id', $this->table, $where );\n\t\t\n\t\tif ( !empty ( $result ) ) {\n\t\t\t$this->form_validation->set_message ( 'email_exists', get_label ( 'user_email_exist' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function check_email($email){\r\n $this->db->where('email', $email);\r\n $query = $this->db->get('users');\r\n if($query->num_rows() != 0){\r\n return false;\r\n }else{\r\n return true;\r\n }\r\n }", "function check_if_email_is_in_use($email){\n\n $query = $this->db->get_where('tbl_doctor_account', array('dacc_email' => $email));\n return $query->num_rows();\n\n }" ]
[ "0.8202079", "0.7969514", "0.7944797", "0.78966063", "0.7866526", "0.7865067", "0.7858271", "0.7813238", "0.78005385", "0.77982724", "0.77777886", "0.7774719", "0.7771386", "0.7756169", "0.7745175", "0.7740838", "0.77061975", "0.7704356", "0.7703569", "0.76663727", "0.76529455", "0.7628722", "0.7621153", "0.7616995", "0.7595123", "0.7592409", "0.757049", "0.75640994", "0.75553113", "0.75470835", "0.7545471", "0.7533103", "0.752498", "0.7518358", "0.75116044", "0.75100434", "0.7500341", "0.7499817", "0.74972314", "0.7490463", "0.74784166", "0.74762106", "0.74625623", "0.7457127", "0.7453428", "0.74499214", "0.7445262", "0.7441279", "0.7440815", "0.7431077", "0.742471", "0.74206865", "0.7418468", "0.7413757", "0.74127406", "0.741086", "0.74101174", "0.7402843", "0.7402247", "0.73978835", "0.73964834", "0.73934054", "0.7388564", "0.7386765", "0.73845005", "0.73787194", "0.73753947", "0.7372638", "0.7362588", "0.7362416", "0.7355303", "0.7354336", "0.73525274", "0.73450255", "0.7342603", "0.7338059", "0.7334976", "0.7329336", "0.73270494", "0.73269314", "0.73252404", "0.732344", "0.732324", "0.7316687", "0.7315574", "0.73130083", "0.7306877", "0.7305864", "0.7305542", "0.73031414", "0.7301394", "0.730054", "0.7297529", "0.7290898", "0.72894406", "0.7288585", "0.72810286", "0.72741127", "0.7268019", "0.726708", "0.7265253" ]
0.0
-1
Deletes an User into the database
public function delete($currentUser){ $stmt = $this->db->prepare("DELETE FROM users WHERE email=?"); $stmt->execute(array($currentUser->getEmail())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUser()\n {\n $this->delete();\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }", "public function delete_user($user);", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function deleteFromDb($user) {\n $sql = \"DELETE FROM users WHERE username = ?\";\n $stmt = $this->dbh->prepare($sql);\n $succ = $stmt->execute(array($user->getUsername()));\n }", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public static function delete(Users $user)\n {\n $email=$user->Email;\n DB::delete(\"user\",\"Email='$email' AND IsDeleted=0\");\n \n //$conn->close();\n header('location: DeleteUser.php');\n\n }", "protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n debug('User deleted');\n }", "public function deleteUser(User $user): void\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n }", "function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function deleteUser(request $request){\n \n $afi = User::find($request->id);\n $afi->delete();\n \n }", "public function delete()\n {\n $pdo = static::getDB();\n\n $sql = \"DELETE FROM users WHERE user_id = :user_id\";\n\n $result = $pdo->prepare($sql);\n\n return $result->execute([$this->user_id]);\n }", "private function deleteUser()\n {\n try \n {\n $request = $_REQUEST;\n\n if(!isset($request['userid']) || $request['userid']==\"\")\n throw_error_msg(\"user id not provided\");\n else if(!is_numeric($request['userid']))\n throw_error_msg(\"invalid user id\");\n else\n $userid = (int)$request['userid'];\n\n global $userquery;\n $user = $userquery->delete_user($userid);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'user deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function deleteUser()\n {\n $user = User::find(Auth::id());\n $user->delete();\n return redirect('/');\n }", "public function deleteAction() {\n $uid = $this->getInput('uid');\n $info = Admin_Service_User::getUser($uid);\n if ($info && $info['groupid'] == 0) $this->output(-1, '此用户无法删除');\n if ($uid < 1) $this->output(-1, '参数错误');\n $result = Admin_Service_User::deleteUser($uid);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }", "public function deleteUser($id)\n {\n $user = User::find($id);\n $user->delete();\n }", "public function deleteUser($userId);", "public function userDeleted()\n\t{\n\t\tself::authenticate();\n\n\t\t$userId = FormUtil::getPassedValue('user', null, 'GETPOST');\n\t\tif(!is_string($userId)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$user = $this->entityManager->getRepository('Owncloud_Entity_DeleteUser')->findOneBy(array('uname' => $userId));\n\t\tif(!($user instanceof Owncloud_Entity_DeleteUser)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\t\t$this->entityManager->remove($user);\n\t\t$this->entityManager->flush();\n\n\t\treturn self::ret(true);\n\t}", "function delete_user($user_id = 0)\n\t{\n\t\t//delete user\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->delete('ci_users');\n\t}", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function delUser($user_id) {\n $db = $this->dbConnect();\n $req = $db->prepare('DELETE FROM `p5_users` WHERE USER_ID = ?');\n $req->execute(array($user_id));\n $req->closeCursor();\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "public function userDeleteAction(Request $request)\n {\n $id = $request->get('id');\n\n $userRepo = $this->get('doctrine')->getManager()->getRepository('AppBundle:User');\n $user = $userRepo->find($id);\n\n // delete user\n $userManager = $this->getDoctrine()->getManager();\n $userManager->remove($user);\n $userManager->flush();\n \n return $this->redirectToRoute('app_users');\n }", "public function test_it_deletes_a_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $response = $this->call('DELETE', sprintf('/users/%d', $user->id));\n\n $this->assertEquals(204, $response->status());\n $this->assertEquals(0, User::count());\n }", "public function destroy(User $user)\n {\n //TODO: montar excluir usuário\n }", "public function delete(User $user)\n {\n $this->authorize('delete', User::class);\n $user->delete();\n return redirect()->route('users_path')->withSuccess('Usuario eliminado correctamente!!');\n }", "public function deleteUser($idUser){\n $query = \"DELETE FROM final_usuario WHERE idUser=\".$idUser;\n return $this->con->action($query);\n }", "public function deleteAction(Request $request, User $user)\n {\n $form = $this->createDeleteForm($user);\n $form->handleRequest($request);\n\n //if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n\n $this->get('Services')->setFlash('danger', $this->get('translator')->trans('User deleted!'));\n //}\n\n return $this->redirectToRoute('user_index');\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}", "private function deleteUser()\r\n {\r\n if (isset($_GET['id'])) {\r\n\r\n $id_user = $_GET['id'];\r\n UserDAO::deleteUser($id_user);\r\n $_SESSION['deleteUser'] = '';\r\n header('Location:' . BASE_URL . \"users\");\r\n exit();\r\n }\r\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }", "public function executeDeleteUser(HTTPRequest $request)\n {\n $this->managers->getManagerOf('Users')->delete($request->getData('id'));\n\n $this->app->user()->setFlash('L\\'utilisateur a bien été supprimé, merci !');\n \n $this->app->httpResponse()->redirect('/admin/new-user.html');\n }", "public function delete_user($id)\n\t{\n\n\t\t/**\n\t\t * Update the user table referent to the id\n\t\t */\n\t\t$this->db->where(\"id\", $id);\n\t\t$this->db->delete(\"users\");\n\n\t}", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function delete($id) {\n\t\t// Delete the user\n\t\t$this->getDb()->delete('t_user', array('idUser' => $id));\n\t}", "public function deleteUser(){\n\t\t$id = $_POST[\"id\"];\n\t\ttry {\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\t\t\t$result = $db->query('SELECT * FROM users WHERE id=\"'.$id.'\"');\n\n\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif(!$row == 0){\n\t\t\t\t\t$statement = $db->query('DELETE FROM users WHERE id=\"'.$id.'\" ');\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"No data present.\");\n\t\t\t\t}\t\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}", "public static function delete($conn, User $user) {\n\t\t$query = $conn->prepare('DELETE FROM users WHERE id = ?;');\n\t\t$query->bind_param(\"i\", $user->id);\n\t\treturn $query->execute();\n\t}", "public function delete_user() {\n $query = 'DELETE FROM ' . $this->table_name . ' WHERE vendor_id = :vendor_id';\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean data\n\n // Bind data\n $stmt->bindParam(':vendor_id', $this->vendor_id);\n\n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n //Error $stmt->error;\n return false;\n }", "function delete_user ($user_id) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from users where user_id = '\".$user_id.\"'\";\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }", "public function delete(User $user)\n {\n $db = $this->database->connect();\n $statement = $db->prepare(\"DELETE FROM users WHERE id = :id\");\n $statement->bindParam(':id', $user->getId());\n $statement->execute();\n if ($statement->rowCount()) {\n return true;\n }\n return false;\n }", "public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}", "public function delete(){\n\t\t$user_id = $this->input->post(\"user_id\");\n\t\t$username = $this->input->post(\"username\");\n\n\t\t$condition = array(\n\t\t\t\"user_id\" => $user_id\n\t\t);\n\n\t\t$this->load->model(\"User_model\", \"users\", true);\n\n\t\t$this->users->delete($condition);\n\n\t\t$toast = array('state' => true, 'msg' => $username.' is Deleted Successfully!');\n\t\t$this->session->set_flashdata('toast', $toast);\n\n\t\techo \"success\";\n\t}", "public function delete($user){\n }", "public function delete($id) {\n // Delete the user\n $this->getDb()->delete('user', array('user_email' => $id));\n }", "public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }", "public function deleteUser($userId = FALSE) {\n\n if ($userId) {\n $this->db->delete('user', array('usr_id' => $userId));\n }\n }", "public function destroy(User $user)\n {\n \n }", "public function deleteUser($id) {\n $database = new Database();\n\n $queryUser = 'DELETE FROM user WHERE id=:id';\n\n $database->prepareQuery($queryUser, 'id', $id, TRUE, FALSE);\n\n $queryUserPlan = 'DELETE FROM user_plan WHERE User_Id=:id';\n\n $database->prepareQuery($queryUserPlan, 'id', $id, TRUE, FALSE);\n }", "public function delUser($user_id)\n {\n $user = User::findOrFail($user_id);\n if ($user) {\n $user->delete();\n return redirect()->back();\n }else{\n\n return redirect()->back();\n }\n }", "function deleteUser($username)\r\n {\r\n $this->querySimpleExecute('delete from t_user where useUsername = ' . $username);\r\n }", "public function delete($user)\n {\n\n }", "public function delete($params) {\n $token = $this->require_authentication();\n $userid = $token->getUser()->getUserId();\n\n // delete user object, redirect to homepage\n try {\n $res = User::delete($this->getDBConn(), $userid);\n } catch (\\PDOException $dbErr) {\n $this->addFlashMessage('Database error on deleting user:<br>'.$dbErr->getMessage(), self::FLASH_LEVEL_SERVER_ERR);\n $this->redirect(\"/\");\n }\n\n // make sure user is logged out after deletion\n session_unset();\n session_destroy();\n session_start();\n\n $this->addFlashMessage(\"Deleted user.\", self::FLASH_LEVEL_INFO);\n\n if ($res) {\n error_log(\"Deleted user \".$userid);\n $this->redirect(\"/\");\n } else {\n $this->error404('/users/delete/' . $userid);\n }\n }", "public function deleteUser($appUserID)\n {\n $this->sdb->query('delete from appuser where id=$1', array($appUserID));\n $this->sdb->query('delete from appuser_role_link where uid=$1', array($appUserID));\n }", "public function destroy(User $user)\n {\n $this->authorize('add', User::class);\n $user->delete();\n }", "public function destroy(User $user)\n {\n $this->authorize('delete', [User::class, $user]);\n\n // Delete the user...\n }", "public function deleteUser($user) {\n \n $userDAO = new UserDAO();\n if ($userDAO->deleteUser($user) > 0)\n return true;\n \n return false;\n \n }", "public function destroy($id)\n {\n // delete user\n }", "public function destroy( $user_id ) {\n\n if ( empty( $user_id ) ) {\n return ResponseHelper::logAndErrorResponse( 'No id passed to destroy request' );\n }\n\n $user = new User();\n\n $user_from_db = $user->where( 'user_id', $user_id )->first();\n\n if ( empty( $user_from_db ) ) {\n return ResponseHelper::logAndErrorResponse( 'User does not exist in the database', 404 );\n }\n\n $user_from_db->delete();\n\n Log::info( sprintf( 'User %s removed from database', $user_id ) );\n return response( 'User removed from database' );\n }", "function delete_user()\n {\n\n //return true if successful\n }", "public function destroy(User $user)\n {\n $currentUser = Auth::user();\n \n if ($user->id !== $currentUser->id) {\n \n $user->save();\n $user->delete();\n\n Alert::success('Success', 'User deleted successfully');\n return redirect('users');\n }\n Alert::error('Error', 'User not deleted');\n return back()->with('error');\n }", "public function testDeleteUser()\n {\n $user = factory(User::class)->create();\n $this->assertTrue($user->delete());\n $this->assertEmpty(User::query()->find($user->id));\n }", "public function deleteuser($user_id)\n {\n $user = User::findOrfail($user_id);\n $user->delete();\n\n Session::flash('status_delete_utilisateur', 'Employé supprimé avec succès.');\n return redirect()->route('admin');\n }", "public function destroy(User $user)\n {\n // $this->model->delete($user);\n\n // return redirect('users')->with('success', 'User deleted successfully');\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function destroy(User $user)\n {\n //\n }", "static public function delete(){\n\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/DeleteRequest.php');\n\n\t\t$requests = new DeleteRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\tif(count($errors) > 0){\n\n\t\t\t//Verifica se id não existe no banco ou deixar enviar, força o redirecionamento para pagina /users\n\t\t\tif( isset($errors['id']) ){\n\n\t\t\t\t$back = '/users?errors=' . json_encode(['id' => $errors['id']]);\n\n\t\t\t}else{\n\n\t\t\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users';\n\t\t\t\t$back .= '?id='.$_POST['id'].'&errors=' . json_encode($errors);\n\n\t\t\t}\n\n\t\t\theader('Location: ' . $back);\n\n\t\t}else{\n\n\t\t\t//Caso não houver nenhum impedimento, faz o delete do usuario\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\t$crud->delete($_POST['id']);\n\n\t\t\t//Redireciona para pagina de /users\n\t\t\theader('Location: /users?success=Usuário deletado com sucesso');\n\t\t\t\n\t\t}\n\n\t}", "public function deleting(User $user)\n {\n\n $user->user_eraser_id = \\Auth::id();\n $user->timestamps = false;\n $user->save();\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }" ]
[ "0.88151145", "0.8533186", "0.84308434", "0.81461143", "0.8137568", "0.80815923", "0.80253214", "0.78665024", "0.7844636", "0.7815263", "0.7811698", "0.7811698", "0.7811698", "0.78048235", "0.7757751", "0.77310455", "0.76691645", "0.7664442", "0.76448727", "0.76446456", "0.7630062", "0.7624726", "0.7619318", "0.7613562", "0.75964105", "0.758888", "0.75842077", "0.75809187", "0.75629026", "0.75033796", "0.7502071", "0.75002366", "0.7474024", "0.74472463", "0.74311614", "0.7430072", "0.74267745", "0.7422981", "0.7417776", "0.74013966", "0.7387732", "0.7384853", "0.7384853", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.73803097", "0.7365888", "0.73585624", "0.7355597", "0.7344908", "0.7344908", "0.7340214", "0.7332934", "0.7324698", "0.7322925", "0.7319338", "0.7305752", "0.72948974", "0.72922635", "0.72916687", "0.72883713", "0.7287138", "0.72747797", "0.727294", "0.727275", "0.7272246", "0.7266763", "0.72660303", "0.72516376", "0.7251607", "0.7251256", "0.72471035", "0.7242391", "0.72292954", "0.7229196", "0.7219521", "0.7218112", "0.7214847", "0.7214054", "0.72006106", "0.7198378", "0.7196283", "0.71924025", "0.7188999", "0.7186722", "0.7186722", "0.7186722", "0.7186722", "0.7186722", "0.7186722", "0.7186722" ]
0.0
-1
Saves an Anonymous User into the database
public function saveAnonymousUser($completeName) { $stmt = $this->db->prepare("INSERT INTO anonymous_users(completeName) values (?)"); $stmt->execute(array($completeName)); return $this->db->lastInsertId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAnonymous()\n {\n // if we already have an anonymous user, exit\n $anonUser = $this->_userDao->getUser(1);\n if ($anonUser !== false) {\n if ($anonUser['username'] != 'anonymous') {\n throw new Exception('Anonymous user is not anonymous anymore. Database logical corrupted, unable to continue');\n } // if\n\n return;\n } // if\n\n // DB connection\n $dbCon = $this->_dbCon;\n\n // Create an Spotweb API key. It cannot be used but should not be empty\n $apikey = md5('anonymous');\n\n // Create the dummy 'anonymous' user\n $anonymous_user = [\n // 'userid'\t\t=> 1,\t\t<= Must be 1 for the anonymous user\n 'username'\t\t => 'anonymous',\n 'firstname'\t\t=> 'Jane',\n 'passhash'\t\t => '',\n 'lastname'\t\t => 'Doe',\n 'mail'\t\t\t => '[email protected]',\n 'apikey'\t\t => $apikey,\n 'lastlogin'\t\t=> 0,\n 'lastvisit'\t\t=> 0,\n 'deleted'\t\t => 0, ];\n $this->_userDao->addUser($anonymous_user);\n\n // Manually update the userid so we can be sure anonymous == userid 1\n $currentId = $dbCon->singleQuery(\"SELECT id FROM users WHERE username = 'anonymous'\");\n $dbCon->exec(\"UPDATE users SET id = 1 WHERE username = 'anonymous'\");\n $dbCon->exec('UPDATE usersettings SET userid = 1 WHERE userid = :userid', [':userid' => [$currentId, PDO::PARAM_INT]]);\n }", "public function saveOrderAnonymousUser($request)\n {\n $this->saveNewOrderData(0, $request, true);\n\n //Save order products\n $this->saveNewOrderProducts($request->order);\n\n return;\n\n }", "public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }", "function saveuser(){\n \t\t\tif (isset($_POST['UserID'])){\n \t\t\t\t$UserID = base64_decode($_POST['UserID']);\n \t\t\t\t$this->Users->UpdateUser($UserID);\n \t\t\t}else{\n \t\t\t\t$UserID = $this->Users->AddNewUser();\n \t\t\t\t$this->Users->AddUserToCompany($UserID);\n \t\t\t}\n \t\t\t$this->Flash->error(__('UserSaved', true));\n \t\t\t$this->Redirect('/users/edituser/'.base64_encode($UserID));\n \t\t}", "public function Save()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$sql = \"INSERT INTO tbl_users (naam, voornaam, email, wachtwoord)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sFirstname).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sEmail).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_sPassword).\"'\r\n\t\t\t)\";\r\n\t\t\t$db->conn->query($sql);\r\n\r\n\t\t\t//user_id van de geregistreerde gebruiker in de session variabele opslaan\r\n\t\t\t$user_id = $db->conn->insert_id;\r\n\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t}", "public function SaveAsUser()\r\n\t\t{\r\n\t\t\t$db = new Db();\r\n\t\t\t$id = $_SESSION['a_restaurant_id'];\r\n\t\t\t$sql = \"INSERT INTO tbl_reservaties (klantnaam, aantalpersonen, datum, uur, tafel_id)\r\n\t\t\tVALUES ('\".$db->conn->real_escape_string($this->m_sName).\"',\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_iPersonen).\"',\r\n\t\t\t\t\tSTR_TO_DATE('\".$db->conn->real_escape_string($this->m_dDate).\"', '%e-%m-%Y'),\r\n\t\t\t\t\t'\".$db->conn->real_escape_string($this->m_iUur).\"',\r\n\t\t\t\t\t(SELECT tafel_id FROM tbl_tafels WHERE tafelnr = \".$db->conn->real_escape_string($this->m_iTable).\" AND restaurant_id = $id\r\n\t\t\t))\";\r\n\t\t\t$db->conn->query($sql);\r\n\t\t\t\r\n\t\t}", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n \n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d H:i:s');\n\n // Save the record to the database\n UserModel::load()->store($user);\n }", "public function saveNewUser() {\n\t\t$db = $this->getDatabaseConnection();\n\n\t\t// Prepare the SQL\n\t\t$sql =\"INSERT INTO users (email, password, first_name, last_name, username)\n\t\t\t\tVALUES (:email, :password, :first_name, :last_name, :username)\";\n\n\t\t$statement = $db->prepare($sql);\n\n\t\t// Bind the form data to the SQL query\n\t\t$statement->bindValue(':email', $_POST['email']);\n\t\t$statement->bindValue(':password', $_POST['password']);\n\t\t$statement->bindValue(':first_name', $_POST['first_name']);\n\t\t$statement->bindValue(':last_name', $_POST['last_name']);\n\t\t$statement->bindValue(':username', $_POST['username']);\n\n\t\t// Run the query\n\t\t$result = $statement->execute();\n\n\t\t//Confirm tht it worked\n\t\tif( $result == true) {\n\t\t\t// Yay!\n\n\t\t\t$_SESSION['user_id'] = $db->lastInsertID();\n\t\t\t$_SESSION['privilege'] = 'user';\n\t\t\t$_SESSION['first_name'] = $_POST['first_name'];\n\t\t\t$_SESSION['last_name'] = $_POST['last_name'];\n\t\t\t$_SESSION['username'] = $_POST['username'];\n\t\t\t$_SESSION['email'] = $_POST['email'];\n\n\t\t\theader('Location: index.php?page=account');\n\t\t} else {\n\t\t\t// Uh oh...\n\t\t}\n\n\t\t//If it did, log the user in and redirect to their \n\t\t// new account page\n\t}", "private function _savePendingUserIdentity($userId)\n {\n $userData = new stdClass();\n $userData->{User::COLUMN_USERID} = $userId;\n $userData->sessionId = session_id();\n $userData->lastLogin = date('Y-m-d H:i:s');\n Zend_Auth::getInstance()->getStorage()->write($userData);\n }", "public function save()\n {\n if ($this->uid)\n {\n $query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive,\n $this->userId);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO %sUSER (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", %d)',\n DB_TBL_PREFIX,\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->uid = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function save ( $isNewUser = false ) {\n $db = new DB();\n \n // If the user is already registered, just update their info\n if ( !$isNewUser ) {\n $data = array (\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\"\n );\n $db->update($_SESSION[userTable], $data, \"id = '\".$this->id.\"'\");\n }\n // else register the user\n else {\n $data = array (\n 'username' => \"'$this->username'\",\n 'password' => \"'$this->hashedPassword'\",\n 'email' => \"'$this->email'\",\n 'joindate' => \"'\".date(\"Y-m-d H:i:s\").\"'\"\n );\n $this->id = $db->insert($_SESSION['userTable'], $data);\n $this->joindate = time();\n }\n }", "public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }", "public function save()\n {\n if ($this->id)\n {\n $query = sprintf('UPDATE USERS SET USERNAME = \"%s\", ' .\n 'PASSWORD = \"%s\", EMAIL_ADDR = \"%s\", FIRST_NAME = \"%s\", LAST_NAME = \"%s\", IS_ACTIVE = %d ' .\n 'WHERE USER_ID = %d',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive,\n $this->id);\n mysql_query($query, $GLOBALS['DB']);\n }\n else\n {\n $query = sprintf('INSERT INTO USERS (USERNAME, PASSWORD, ' .\n 'EMAIL_ADDR, FIRST_NAME, LAST_NAME, IS_ACTIVE) VALUES (\"%s\", \"%s\", \"%s\", \"%s\", \"%s\", %d)',\n mysql_real_escape_string($this->username, $GLOBALS['DB']),\n mysql_real_escape_string($this->password, $GLOBALS['DB']),\n mysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n mysql_real_escape_string($this->firstName, $GLOBALS['DB']),\n mysql_real_escape_string($this->lastName, $GLOBALS['DB']),\n $this->isActive);\n mysql_query($query, $GLOBALS['DB']);\n\n $this->id = mysql_insert_id($GLOBALS['DB']);\n }\n }", "public function saveUser()\n {\n $this->_initUser();\n\n $this->generateSecurePassword();\n\n return $this->save(\n [\n 'username' => $this->username,\n 'password' => $this->password,\n 'salt' => $this->_salt,\n 'email' => $this->email,\n 'name' => $this->name,\n 'lastname' => $this->lastname,\n 'sw_active' => 1\n ], true\n );\n }", "public function writeNewUser () {\n if (! $this->Writeable()){\n throw new Exception('User object is not writeable, cannot write to DB');\n }\n\n if ($this->exists($this->loginId)) {\n throw new Exception('User already exists, cannot be created');\n }\n\n $i = new folksoDBinteract($this->dbc);\n if ($i->db_error()) {\n throw new Exception('DB connect error: ' . $i->error_info());\n }\n\n $i->sp_query(\n sprintf(\"call create_user(\"\n .\"'%s', '%s', '%s', '%s', '', %d, '%s', '%s', '%s')\",\n $i->dbescape($this->nick),\n $i->dbescape($this->firstName),\n $i->dbescape($this->lastName),\n $i->dbescape($this->email),\n $i->dbescape($this->loginId),\n $i->dbescape($this->institution),\n $i->dbescape($this->pays),\n $i->dbescape($this->fonction)));\n\n if ($i->result_status == 'DBERR') {\n throw new Exception('DB query error on create FB user: ' . $i->error_info());\n }\n }", "function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }", "public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}", "function save_user_object($user){\r\n\r\n}", "public function save(User $model);", "public function postUser($params)\n {\n // make sure we don't overwrite an existing user record\n if(isset($params['password']) && empty($params['password']))\n unset($params['password']);\n $res = $this->db->put_attributes($this->domainUser, $this->owner, $params, true);\n $this->logErrors($res);\n return $res->isOK();\n }", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function saveUserAccessCode($user_id, $access_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// not really sure what to do about ANONYMOUS_USER_ID\n\t\t\n\t\t$next_id = $ilDB->nextId('svy_anonymous');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_anonymous (anonymous_id, survey_key, survey_fi, user_key, tstamp) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text', 'integer', 'text', 'integer'),\n\t\t\tarray($next_id, $access_code, $this->getSurveyId(), md5($user_id), time())\n\t\t);\n\t}", "private function saveUser(){\n\n if( ! $this->checkEmail() ){\n $password = password_hash($this->_userPassword, PASSWORD_DEFAULT);\n $request = $this->_connexion->prepare(\"INSERT INTO Users (user_name, user_email, user_password) VALUES (?, ?, ?)\");\n $request->execute(array($this->_userName, $this->_userEmail, $password));\n\n return $response = json_encode([\n 'status' => 'ok',\n 'message' => 'successfuly add'\n ]);\n }\n else{\n return $response = json_encode([\n 'status' => 'failed',\n 'message' => 'this email allready exist'\n ]);\n }\n\n }", "function master_add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password, $user_picture){\n //encrypt email\n $user_email = encrypt_user_email($user_email);\n //encrypt password\n $user_password = encrypt_user_password($user_password);\n\n if($this->user->add_user($conn, $user_id, $user_firstname, $user_lastname, $user_email, $user_password,\n upload_user_profile_picture()) == true){\n // alert user not added\n //add user details to session\n }\n else{\n //alert user not added\n //allow user to try or ask if pass is forgotten\n }\n }", "public function save() {\n\t\t$data = array(\n\t\t\t\t\"user\" => array(\n\t\t\t\t\t\t\"email\" => $this->_data[\"email\"],\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t// kontrola zmeny hesla\n\t\tif (in_array(\"password\", $this->_changed)) $data[\"user\"][\"password\"] = $this->_data[\"password\"];\n\t\t\n\t\t// odeslani dat\n\t\t$response = $this->_connection->sendRequest(self::OBJECT, \"put\", $this->_data[$this->_identifier], $data, \"post\");\n\t}", "function saveUser($aa_inst_id,$user)\n {\n $session_key=generateSessionKey($aa_inst_id);\n $session=new Zend_Session_Namespace($session_key);\n $session->facebook=array();\n\n $session->facebook['user']=$user;\n\n $this->saveToDatabase($user);\n return true;\n }", "public function saveUser($user) {\n if(empty($user->user_id)){\n $this->dao->insertUser($user);\n } else {\n $this->dao->updateUser($user, $user->user_id); \n }\n }", "public function save($userid)\n {\n }", "public function saving(User $user)\n {\n //\n }", "public function store()\n {\n // Save post data in $user var\n $user = $_POST;\n\n if ($user['country'] == \"\"){$user['country'] = 156;}\n\n // Create a password, set created_by ID and set the date of creation\n $user['password'] = password_hash('Gorilla1!', PASSWORD_DEFAULT);\n $user['created_by'] = Helper::getUserIdFromSession();\n $user['created'] = date('Y-m-d');\n\n // Save the record to the database\n UserModel::load()->store($user);\n return view::redirect('/');\n }", "public function save() {\n\n if( isset( $_POST ) ) {\n // Set user id for add\n $id = null;\n // Set null if empty value\n $_POST['email'] = replace_empty_with_null( $_POST['email'] );\n // Update mode\n if( $_POST['userId'] != '' ) {\n // Set user id for update\n $id = $_POST['userId'];\n // Check if update password form is trigger\n if( isset( $_POST['password'] ) ) {\n $_POST['password'] = $this->user_model->hash( $_POST['password'] ); \n unset( $_POST['confirm_password'] ); \n } else {\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n }\n } else {\n\n $_POST['password'] = $this->user_model->hash( $_POST['password'] );\n $_POST['firstName'] = ucfirst( $_POST['firstName'] );\n $_POST['surname'] = ucfirst( $_POST['surname'] );\n $_POST['initials'] = ucfirst( $_POST['initials'] );\n\n }\n \n $this->user_model->save( $_POST, $id );\n echo \"true\";\n } else {\n echo \"error\";\n }\n\n }", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "public function save(CreateUserRequest $request)\n {\n $this->authorize('create', User::class);\n\n $pass = $this->get_password($request);\n $user = User::create([\n 'name' => $request->input('name'),\n 'phone_number' => $request->input('phone_number'),\n 'email' => $request->input('email'),\n 'password' => bcrypt($pass),\n 'role_id' => $request->input('role_id', 3)\n ]);\n\n $user->notify(new AdminUserCreated($user, $pass));\n\n return redirect()->route('active_user', $user->id);\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function saved(User $user)\n {\n //\n }", "public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }", "public function getAnonymousUserId()\n {\n return $this->auser_id;\n }", "public function save()\n {\n $user_id = Yii::$app->session->getFlash('validatedUserId');\n if ($this->validate() && ( $user = User::findOne($user_id)) !== null ) {\n // Hashing user password before saving it to the DB\n // http://www.yiiframework.com/doc-2.0/guide-security-passwords.html\n $user->password = Yii::$app->getSecurity()->generatePasswordHash($this->password);\n $user->active = '1';\n // Generates a new auth key to avoid the previous one from being used\n $user->auth_key = Yii::$app->security->generateRandomString();\n // Save DB record\n return $user->save();\n }\n return false;\n }", "public function store()\n {\n $attributes = request()->validate([\n 'name' => 'required|max:255',\n 'username' => 'required|unique:users,username',\n 'email' => 'required|email|max:255|unique:users,email',\n 'password' => 'required',\n ]);\n $user = User::create($attributes);\n\n // Auth facades\n auth()->login($user);\n }", "public function store()\n\t{\n $user = new User();\n $user->name = Input::get('name');\n $user->email = Input::get('email');\n $user->mobile = Input::get('mobile');\n $user->save();\n echo json_encode(array('msg' => 'success', 'id' => $user->id));\n\t}", "public static function save(User $user)// statiska funkcija, lai nevajadzetu taisit klases objektu\n {\n }", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "public function Save() {\n// \t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n \t\t$this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n\t $this->session->SetAuthenticatedUser($this->profile);\n \treturn $this->db->RowCount() === 1;\n \t}", "public function save_user($u)\n\t{\n\t\n\t\tif($u['id'])\n\t\t{\n\t\t\t$sql=\"UPDATE waf_users SET email='\".$this->db->Q($u['email'],1).\"', \"\n\t\t\t.((!empty($u['pass']))?\"pass='\".md5($u['pass']).\"', \":\"\")\n\t\t\t.\"editor=\".(isset($u['editor'])?1:0).\", \"\n\t\t\t. \"status=\".(isset($u['status'])?1:0).\" \"\n\t\t\t. \"WHERE id=\".$this->db->Q($u['id']);\n\t\t}else{\n\t\t\t$sql=\"INSERT INTO waf_users (email,pass,editor,status) VALUES ('\".$this->db->Q($u['email'],1).\"','\".md5($u['pass']).\"',\".(isset($u['editor'])?1:0).\",\".(isset($u['status'])?1:0).\")\";\n\t\t}\n\t\t$this->db->QUERY($sql);\n\t}", "public function save($user) {\n\n\t\t$stmt = $this->db->prepare(\"INSERT INTO users values (?,?,?)\");\n\t\t$stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd()));\n\t}", "public function loggedIn()\n {\n $user = new User([\n 'first_name' => 'Janez',\n 'last_name' => 'Novak',\n 'birth_date' => Carbon::create(2000, 1, 1, 0, 0, 0),\n 'gender' => Code::MALE()->id,\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'phone_number' => '123456789',\n 'post' => Postcode::wherePostcode(1000)->first()->id,\n 'address' => 'Dunajska',\n 'zz_card_number' => str_random(30),\n ]);\n $user->confirmEmail();\n $user->save();\n\n Auth::attempt([\n 'email' => $user->email,\n 'password' => 'password',\n ]);\n }", "public function Save() {\n $this->db->ExecuteQuery(self::SQL('update profile'), array($this['name'], $this['email'], $this['id']));\n $this->session->SetAuthenticatedUser($this->profile);\n return $this->db->RowCount() === 1;\n }", "protected static function persistCurrentUser()\n {\n // Black hole\n trigger_error(\n \"Method for remembering the current user isn't implemented. \" .\n \"You can use the Jasny\\Auth\\Sessions trait to store the current user in a session\",\n E_USER_NOTICE\n );\n }", "public function store()\n {\n $objUser = new User;\n \n $objUser->doSave($_POST);\n \n return Redirect::to('/admin/manage_user');\n }", "public function save(Authenticatable $model);", "public function save() {\n\n $result = parent::save();\n\n // if this user has a new email we send an email to confirm\n if($this->new_email) {\n $this->email_verified = 'False';\n $this->sendConfirmEmail();\n }\n\n // make sure the user has the login role\n $login_role = new Model_Role(array('name' =>'login'));\n if(!$this->has('roles', $login_role)) {\n $this->add('roles',$login_role);\n }\n return $result;\n }", "function save_user() {\n $this -> load -> library(array('form_validation', 'session'));\n $this -> form_validation -> set_rules('user_firstname', 'nombre', \"required|trim\");\n $this -> form_validation -> set_rules('user_lastname', 'apellido', \"required|trim\");\n $this -> form_validation -> set_rules('user_email', 'email', \"required|trim|valid_email\");\n $this -> form_validation -> set_rules('user_email2', 'confirmar email', \"required|trim|valid_email|matches[user_email]\");\n $this -> form_validation -> set_rules('user_password', 'contraseña', (!$this -> input -> post('user_id') ? 'required|' : '') . \"trim|min_length[4]\");\n $this -> form_validation -> set_rules('user_password2', 'confirmar contraseña', (!$this -> input -> post('user_id') || trim($this -> input -> post('user_password')) != '' ? 'required|' : '') . \"trim|matches[user_password]\");\n\n if ($this -> form_validation -> run() == TRUE) {\n if (trim($this -> input -> post('user_password')) == '')\n unset($_POST['user_password']);\n unset($_POST['user_password2']);\n unset($_POST['user_email2']);\n if (!$this -> input -> post('user_id'))\n $_POST['user_created'] = date('Y-m-d G:i:s');\n $data = $this -> basic -> save('users', 'user_id', $this -> input -> post());\n $response['js'] = 'window.top.location.href=\"' . site_url('front_login/perfil') . '\"';\n } else {\n $response['html'] = validation_errors();\n $response['error'] = '1';\n }\n\n echo json_encode($response);\n }", "public function save()\n\t{\n\t\t$data['password'] = $this->input->post('new_password');\n\t\t$this->db->where('id', $this->input->post('id'));\n\t\t$this->db->update('users', $data);\n\n\t\theader(\"Content-type:application/json\");\n\t\techo json_encode('success');\n\t}", "public function publishuser(){\n $post = User::where('id', \\request(\"id\"))->first();\n $post->approved = $post->approved==\"pending\"?\"approved\":\"pending\";\n $post->save();\n return redirect(route('voyager.users.index'));\n }", "function saveUser(UserEntity $user, string $hashedPwd);", "function saveUser($user)\n {\n //1. Define the query\n $sql = \"INSERT INTO users (username, nickname, userlocation, archive, usertype, password, email) \n VALUES (:username, :nickname, :userlocation, :archive, :usertype, :password, :email)\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //3. Bind the parameters\n $statement->bindParam(':username', $user->getUserName(), PDO::PARAM_STR);\n $statement->bindParam(':nickname', $user->getNickname(), PDO::PARAM_STR);\n $statement->bindParam(':userlocation', $user->getLocation(), PDO::PARAM_STR);\n $statement->bindParam(':password', $user->getPassword(), PDO::PARAM_STR);\n $statement->bindParam(':email', $user->getEmail(), PDO::PARAM_STR);\n\n // set account type and archive if admin\n if ($user instanceof Admin) {\n $userType = \"admin\";\n $archive = 1;\n } else {\n $userType = \"standard\";\n $archive = 0;\n }\n\n $statement->bindParam(':archive', $archive, PDO::PARAM_STR);\n $statement->bindParam(':usertype', $userType, PDO::PARAM_STR);\n\n $lastId = $this->_dbh->lastInsertId();\n\n //4. Execute the query\n $result = $statement->execute();\n\n //5. Process the results\n return $result;\n }", "public function save(Application_Model_User $users)\r\n {\r\n $data = array(\r\n 'login' => $users->getLogin(),\r\n 'pass' => $users->getPass()\r\n );\r\n\r\n if (null === ($id = $users->getId())) {\r\n unset($data['id']);\r\n $this->getDbTable()->insert($data);\r\n } else {\r\n $this->getDbTable()->update($data, array('id = ?' => $id));\r\n }\r\n }", "public function save( $params ) {\n $query = \"INSERT INTO stat SET user = ?, answer_id=?\";\n $this->db->execute( $query, array($params['user'], $params['answer_id']) );\n\n $this->id = $this->db->getLastId();\n $this->init();\n\n }", "public function storeMember()\n {\n\n $this->authorize('create', Project::class);\n\n $project = Project::findOrFail(request('id'));\n $project->users()->sync(request('project_user'));\n }", "public function store()\n\t{\n\t\t$activate_data = array(\n\t\t\t\"activate\" => 1,\n\t\t\t\"activated_at\" => $this->datetime->format(\"Y-m-d H:i:s\")\n\t\t);\n\n\t\t$user = $this->user->create(array_merge(Input::all(), $activate_data));\n\n\t\tif($user)\n\t\t{\n\t\t\treturn Redirect::route(\"users.index\");\n\t\t}\n\n\t\treturn Redirect::back()->withInput()->withErrors($this->user->errors());\n\t}", "public function save(UserRequest $request){\r\n \t$view = self::checkLoginAdmin();\r\n \tif(isset($view))\r\n \t\treturn $view;\r\n \t$user = new User();\r\n \t$user->name = $request->input('name');\r\n \t$user->email = $request->input('email');\r\n \t$user->admin = $request->input('admin') || 0;\r\n $user->moderator = $request->input('moderator') || 0;\r\n $user->author = $request->input('author') || 0;\r\n $password = env(\"USER_DEFAULT_PASSWORD\", str_random(12));\r\n \t$user->password = Hash::make($password);\r\n\t\tif(User::where('email', $user->email)->count() > 0)\r\n\t\t\treturn redirect()->back()->withErrors(['O Email já esta em uso']);\r\n\t\t$user->save();\r\n EmailUtils::sendWelcomeMail($user->name, $user->email, $password);\r\n Session::flash('success', 'Usuário criado com sucesso'); \r\n \treturn redirect()->route('admin');\r\n }", "public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}", "public static function setNewUser($request){\r\n \t//Post vars\r\n\t \t$postVars = $request->getPostVars();\r\n\t\t$nome = $postVars['nome'] ?? '';\r\n\t\t$email = $postVars['email'] ?? '';\r\n\t\t$senha = $postVars['senha'] ?? '';\r\n\r\n\t\t//Valida email\r\n\t\t$obUser = EntityUser::getUserByEmail($email);\r\n\t\tif($obUser instanceof EntityUser){\r\n\r\n\t\t\t$request->getRouter()->redirect('/admin/users/new?status=duplicated');\r\n\t\t}\r\n\r\n\t\t//NOVA INSTANCIA DE FEEDBACK\r\n\t\t$obUser = new EntityUser;\r\n\t\t$obUser->nome = $nome;\r\n\t\t$obUser->email = $email;\r\n\t\t$obUser->senha = password_hash($senha,PASSWORD_DEFAULT);\r\n\t\t$obUser->cadastrar();\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users/'.$obUser->id.'/edit?status=created');\r\n\r\n\t}", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function storeSocial(NewSocialUser $requestUser)\n {\n //\n $user = new Admin;\n $user->email = $requestUser->email;\n $user->user = $requestUser->email;\n $user->privileges = 1;\n $user->name = $requestUser->name;\n $user->site = 0;\n $user->save();\n return redirect()->route('users.index');\n }", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "public function store($user_id, Request $request)\n {\n //\n }", "function AllowAnonymousUser() {\n\t\tswitch (EW_PAGE_ID) {\n\t\t\tcase \"add\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"edit\":\n\t\t\tcase \"update\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"delete\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"view\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"search\":\n\t\t\t\treturn FALSE;\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t}\n\t}", "public function Save()\n\t{\n\t\tinclude(\"Connection.php\");\n\t\tif(!$link->connect_error)\n\t\t{\n\t\t\t\t$saveUserSql = \"INSERT INTO Gebruiker (Naam, Paswoord, Email) \n\t\t\t\tVALUES ('\".$link->real_escape_string($this->Name).\"',\n\t\t\t\t'\".$link->real_escape_string(md5($this->Pass)).\"',\n\t\t\t\t'\".$link->real_escape_string($this->Email).\"'\n\t\t\t\t);\";\n\t\t\t\t\n\t\t\t\tif($link->query($saveUserSql))\n\t\t\t\t{\n\t\t\t\t\t//get the user ID from the user that was just saved\n\t\t\t\t\t$id = $link->insert_id;\n\t\t\t\t\t$_SESSION[\"UserID\"] = $id;\n\t\t\t\t\t$_SESSION[\"UserName\"] = $link->real_escape_string($this->Name);\n\t\t\t\t\tthrow new Exception(\"Alright! Je hebt een account!\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('Whoops, probleem bij het opslaan');\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//no connection with db\n\t\t\tthrow new Exception('Whoops, er is iets fout gelopen met de databank');\n\t\t}\n\t\t//return the user ID to use in a session\n\t\treturn $rResult;\n\t\tmysqli_close($link);\n\t}", "public function save($isNewUser = false) {\n // Create a new database object.\n $db = new DB();\n $username = $db->mysqli->real_escape_string($this->username );\n $email = $db->mysqli->real_escape_string($this->email );\n $firstName = $db->mysqli->real_escape_string($this->firstName );\n $lastName = $db->mysqli->real_escape_string($this->lastName );\n\n // If just modifying a current user.\n if(!$isNewUser) {\n // set the data array\n $data = array(\"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\"\n );\n // Modify the user in the database\n $db->modify('User', $data, \"'id = $this->id'\");\n\n } else {\n // If this is a new user being registered.\n $data = array(\"user_id\" => \"NULL\",\n \"user_username\" => \"$username\",\n \"user_password\" => \"$this->hashpass\",\n \"user_email\" => \"$email\",\n \"user_firstName\" => \"$firstName\",\n \"user_lastName\" => \"$lastName\",\n \"user_joinDate\" => \"\".date(\"Y-m-d H:i:s\")\n );\n\n $this->id = $db->insert('User', $data);\n $this->joinDate = time();\n }\n return true;\n }", "function Save($username = \"\", $password = \"\", $firstname = \"\", $surname = \"\", $access = array(), $email = \"\")\n\t{\t//$accessnumber = (int)array_sum($access);\n\t\t$accessnumber = implode(',', array_keys($access));\n\t\t$setstr = \"ausername='$username', firstname='$firstname', surname='$surname', useraccess='$accessnumber', email='$email'\";\n\t\tif($password)\n\t\t{\t$setstr .= \", upassword=MD5('$password')\";\n\t\t}\n\t\tif($this->userid)\n\t\t{\t$sql = \"UPDATE adminusers SET $setstr WHERE auserid=$this->userid\";\n\t\t\tif($result = $this->db->Query($sql))\n\t\t\t{\tif($this->db->AffectedRows())\n\t\t\t\t{\t$this->GetUserInfo();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else // must be new user\n\t\t{\t$sql = \"INSERT INTO adminusers SET $setstr\";\n\t\t\tif($result = $this->db->Query($sql))\n\t\t\t{\tif($this->db->AffectedRows())\n\t\t\t\t{\t$this->userid = $this->db->InsertID();\n\t\t\t\t\t$this->GetUserInfo();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function save_member( $params ){\n\t\tif( $params['password'] != $params['verify_password'] ) {\n\t\t\techo json_encode(array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'code' => 600,\n\t\t\t\t'message' => 'Password Does Not Matched.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// unset verify password from the parameters\n\t\tunset( $params['verify_password'] );\n\n\t\t// set deprecated password to the array\n\t\t$params['password'] = $this->set_password( $params['password'] );\n\t\t\n\t\t// try to login user if the user is already registered or new member\n\t\tif( $this->login_user( $params ) ){\n\t\t\techo json_encode(array(\n\t\t\t\t'status' => 'error',\n\t\t\t\t'code' => 600,\n\t\t\t\t'message' => 'User Already Registered.'\n\t\t\t));\n\t\t\treturn;\n\t\t}else{\n\t\t\t// insert to database if the user is not registered\n\t\t\t$this->insert( 'users', $params );\n\t\t\techo json_encode(array(\n\t\t\t\t'status' => 'ok',\n\t\t\t\t'code' => 200,\n\t\t\t\t'message' => 'User Successfully Registered.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\t}", "public function store(Request $request)\n {\n $objUser = new User();\n $objUser->name=$request->name;\n $objUser->password=$request->password;\n $objUser->email=$request->email;\n $objUser->save();\n redirect('/login')->with('You are registered successfully. You can logged in after verification');\n }", "public function save()\n {\n date_default_timezone_set(\"Asia/Ho_Chi_Minh\");\n $usid = $this->input->post('id');\n $id = 0;\n $data = $this->admin_model->array_from_post(array(\n 'user_role','user_firstname', 'user_lastname', \n 'user_username', 'user_password',\n 'user_email'));\n //$email = $data['email'];\n //$result = $this->admin_m->get($this->table, array('where' => \"email='$email'\", 'result' => 0));\n $password = $data['user_password'];\n if($data['user_password'] == NULL) {\n unset($data['user_password']);\n } else {\n $data['user_password'] = md5(md5($data['user_password']));\n }\n $id = $this->admin_model->save(array(\n 'table' => $this->table_name,\n 'data' => $data,\n 'primary' => $this->primary,\n 'id' => (isset($id) ? $id : NULL)\n ));\n redirect('admin/user');\n }", "public function store()\n\t{\n\t\t$request = Request::input();\t\n\t\t$user = new User;\n\t\t$user->username = $request['username'];\n\t\t$user->password = Hash::make($request['password']);\n\t\t$user->email = $request['email'];\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('/user');\n\n\t}", "private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }", "public function save()\n\t{\n\t\t// Verifier le login\n\t\t$login = $this->getValue('login');\n\t\t$id = $this->getValue('id');\n\t\tif ( $this->checkLogin($login, $id) )\n\t\t{\n\t\t\t$this->_error(LOC_MSG_LOGIN_EXIST . '(' . $login . ')');\n\t\t\treturn false;\n\t\t}\n\n\t\t// Enregistrer les donnees\n\t\t$where = 'user_id=' . $id;\n\t\t$id = $this->update('users', 'user_', $this->getValues(), $where);\n\t\treturn $id;\n\t}", "function _saveWechatUser()\n {\n if (!empty(\\Yii::$app->params['wechatMember'])) {\n $this->openid = \\Yii::$app->params['wechatMember']['id'];\n $fan = Fans::find()->select('member_id')->where(['openid' => $this->openid])->one();\n if (!$fan) {\n $fan = new Fans();\n $fan->openid = $this->openid;\n $fan->nickname = \\Yii::$app->params['wechatMember']['nickname'];\n $fan->head_portrait = \\Yii::$app->params['wechatMember']['avatar'];\n $fan->sex = \\Yii::$app->params['wechatMember']['original']['sex'];\n $fan->country = \\Yii::$app->params['wechatMember']['original']['country'];\n $fan->province = \\Yii::$app->params['wechatMember']['original']['province'];\n $fan->city = \\Yii::$app->params['wechatMember']['original']['city'];\n $fan->save();\n } elseif ($fan->member_id) {\n $this->memberId = $fan->member_id;\n $user = MemberInfo::findOne(['id' => $fan->member_id]);\n if ($user) {\n \\Yii::$app->session->set('user_info', $user->toArray());\n }\n $vips = MemberVipInfos::findOne(['member_id' => $fan->member_id]);\n if ($vips) {\n $time = time();\n $this->isVip = true;\n \\Yii::$app->params['vipEndTime'] = $vips->vipend_at;\n if ($time > $vips->vipstart_at && $time < $vips->vipend_at) {\n $this->vipEnable = true;\n }\n }\n }\n }\n }", "public function save(){\n\t\t\tif($this->uid){\n\t\t\t\t$query = sprintf('UPDATE %sUSER SET USERNAME = \"%s\",PASSWORD =\"%s\", EMAIL_ADDR =\"%s\", IS_ACTIVE = %d WHERE USER_ID = %d',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive, $this->userId);\n\t\t\t\t\t return mysql_query($query, $GLOBALS['DB']);\n\t\t\t}else{\n\t\t\t\t// if the user has not registered yet\n\t\t\t\t$query = sprintf('INSERT INTO %USER (USERNAME, PASSWORD, EMAIL_ADDR, IS_ACTIVE) VALUES ( \"%s\",\"%s\", \"%s\", %d)',DB_TBL_PREFIX,\n\t\t\t\t\t\tmysql_real_escape_string($this->username, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->password, $GLOBALS['DB']),\n\t\t\t\t\t\tmysql_real_escape_string($this->emailAddr, $GLOBALS['DB']),\n\t\t\t\t\t\t$this->isActive);\n\t\t\t\t\t\tif(mysql_query($query, $GLOBALS['DB'])){\n\t\t\t\t\t\t\t$this->uid = mysql_insert_id($GLOBALS['DB']);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function saveToDatabase() {\n if($this->id != 0) {\n $dbResult = System::database()->query('update :table_users \n set `role_id` = :role_id, \n `login` = :login, \n `password` = :password, \n `auth_key` = :auth_key, \n `auth_expire` = :auth_expire, \n `last_login` = :last_login\n where `id` = :id');\n \n $dbResult->bindInt(':id', $this->id);\n $dbResult->bindValue(':auth_key', $this->authKey);\n $dbResult->bindInt(':auth_expire', $this->authExpired);\n $dbResult->bindInt(':last_login', $this->lastLoginTime);\n } else {\n $dbResult = System::database()->query('insert into :table_users (`role_id`, `login`, `password`)\n values (:role_id, :login, :password);');\n }\n $dbResult->bindTable(':table_users', TABLE_USERS);\n $dbResult->bindInt(':role_id', $this->role['id']);\n $dbResult->bindValue(':login', $this->login);\n $dbResult->bindValue(':password', $this->password);\n\n $dbResult->execute();\n }", "function createUser() {\n $data = array(\n 'userName' => $this->input->post('username'),\n 'email' => $this->input->post('email'),\n 'status' => 0,\n 'roleID' => 5,\n 'password' => md5($this->input->post('password').SALT),\n );\n $this->db->insert('user', $data);\n }", "protected function save() {\n $factory = I2CE_FormFactory::instance();\n if ($this->creatingNewUser()) {\n if ( !$this->hasPermission('task(users_can_edit)')) {\n return false;\n }\n if (!$this->userObj instanceof I2CE_User_Form || !($username = $this->userObj->username) ) {\n return false;\n }\n $accessMech = I2CE::getUserAccess();\n if ($accessMech->userExists($username,false)) {\n I2CE::raiseError(\"Trying to recreate existing user : \" .$username);\n return false;\n }\n if (I2CE_User::hasDetail('creator')) {\n $this->userObj->creator = $this->user->username;\n }\n }\n\n $username = $this->userObj->username;\n $password = $this->userObj->password;\n $parent = $this->userMapObj->getField(\"parent\")->getValue();\n $personObj = $factory->createContainer($parent);\n $personObj->populate();\n $emails = LBBoards_Module_Qualify::getPersonEmail($parent);\n $emails = implode(\",\", $emails);\n $fname = $personObj->getField(\"firstname\")->getValue();\n $body = \"Hi $fname<br> We have created your account on the License Board online system, your username is $username and your password is $password. Please change your password after first login\";\n $subject = \"Account For License Board Online System\";\n LBBoards_Module_Qualify::sendEmail($emails, $subject, $body);\n return parent::save();\n }", "public function store() \n\t{\n\t\t$input = Input::all();\n\t\t$validation = $this->validator->on('create')->with($input);\n\n\t\tif ($validation->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles(\"orchestra::users/create\"))\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($validation);\n\t\t}\n\n\t\t$user = App::make('orchestra.user');\n\t\t$user->status = User::UNVERIFIED;\n\t\t$user->password = $input['password'];\n\n\t\t$this->saving($user, $input, 'create');\n\n\t\treturn Redirect::to(handles('orchestra::users'));\n\t}", "public function doUserSubmit() {\n\t\tif (@isset( $_REQUEST ['id'] )) {\n\t\t\t$user = new User($_REQUEST['id']);\n\t\t\tif ($_REQUEST['a_password'] != '') {\n\t\t\t\t$user->setPassword($_REQUEST['a_password']);\n\t\t\t}\n\t\t} else {\n\t\t\t$user = new User();\n\t\t\t$user->setPassword($_REQUEST['a_password']);\n\t\t\t\t\n\t\t}\n\t\t$user->setUsername($_REQUEST['a_username']);\n\t\t$user->setName($_REQUEST['a_name']);\n\t\t$user->setEmail($_REQUEST['a_username']);\n\t\t$user->setJoinNewsletter(@$_REQUEST['a_join_newsletter']);\n\t\tif (isset($_REQUEST['a_group'])) {\n\t\t\t$user->setAuthGroup($_REQUEST['a_group']);\n\t\t} else {\n\t\t\t$user->setAuthGroup(2);\n\t\t}\n\t\tif (isset($_REQUEST['a_status'])) {\n\t\t\t$user->setActiveStatus($_REQUEST['a_status']);\n\t\t} else {\n\t\t\t$user->setActiveStatus(1);\n\t\t}\n\t\t$user->save();\n\n\t\t$this->setupMainList();\n\t\t$this->template = 'admin/user_table.tpl';\n\t}", "public function saveUser($nome,$email,$senha){\n \t$id = time();\n $nome = parent::escapeString($nome);\n $senha = md5(parent::escapeString($senha));\n $email = parent::escapeString($email);\n \t//fazer uma validação para ver se o usuario já não está cad\n \t$sql = \"insert into `usuarios` ( `id`,`nome`, `email`, `senha` ) values ('$id','$nome', '$email', '$senha')\"; \n return parent::executaQuery($sql);\n }", "public function saveOrderAuthUser($request)\n {\n $this->saveNewOrderData(Auth::user()->id, $request);\n\n //Save order products\n $this->saveNewOrderProducts($request->order);\n\n return;\n\n }", "public function saveAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n\n try {\n //Get parameters\n $request = $this->get('request');\n $id = $request->get('id');\n $name = $request->get('name');\n $lastname = $request->get('lastname');\n $username = $request->get('username');\n $email = $request->get('email');\n $cellPhone = $request->get('cellPhone');\n $isActive = $request->get('isActive');\n $isCreating = false;\n\n $translator = $this->get(\"translator\");\n\n if( isset($id) && isset($name) && trim($name) != \"\"\n && isset($lastname) && trim($lastname) != \"\"\n && isset($username) && trim($username) != \"\") {\n $em = $this->getDoctrine()->getManager();\n $entity = new User();\n if($id != 0) { //It's updating, find the user\n $entity = $em->getRepository('TecnotekAsiloBundle:User')->find($id);\n }\n if( isset($entity) ) {\n $entity->setName($name);\n $entity->setLastname($lastname);\n $entity->setUsername($username);\n $entity->setCellPhone($cellPhone);\n $entity->setEmail($email);\n $entity->setIsActive( ($isActive==\"true\")? 1:0);\n $rawPassword = $this->generateStrongPassword();\n if($id == 0) { // If it's new must generates a new password\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);\n $entity->setPassword($encoder->encodePassword($rawPassword, $entity->getSalt()));\n $isCreating = true;\n }\n\n if($em->getRepository(\"TecnotekAsiloBundle:User\")\n ->checkUniqueUsernameAndEmail($username, $email, $id) ) {\n\n $em->persist($entity);\n $em->flush();\n if($isCreating) { // If it's new must email the new account email including the password\n $roleEmployee = $em->getRepository('TecnotekAsiloBundle:Role')->findOneByRole(\"ROLE_EMPLOYEE\");\n $entity->getUserRoles()->add($roleEmployee);\n $em->persist($entity);\n $em->flush();\n $logger->info(\"Send Email for new Account with password: \" . $rawPassword);\n $this->sendEmailForNewAccount($entity, $rawPassword);\n }\n return new Response(json_encode(array(\n 'error' => false,\n 'msg' => $translator->trans('catalog.save.success'))));\n } else {\n return new Response(json_encode(array(\n 'error' => true,\n 'msg' => $translator->trans('user.username.and.email.must.be.uniques'))));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 2\")));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 1\")));\n }\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::saveAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'msg' => $info)));\n }\n }", "public function save()\n {\n\t$this->validate();\n\t\n\tif(empty($this->errors)){\n\t\t$password_hash = password_hash($this->password, PASSWORD_DEFAULT);\n\n\t\t$token = new Token();\n\t\t$hashed_token = $token->getHash();\n\t\t$this->activation_token = $token->getValue();\n\t\t\n\t\t$sql = 'INSERT INTO users (name, email, password_hash, activation_hash)\n\t\t\t\tVALUES (:name, :email, :password_hash, :activation_hash)';\n\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\n\t\t$stmt->bindValue(':name', $this->name, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':email', $this->email, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':password_hash', $password_hash, PDO::PARAM_STR);\n\t\t$stmt->bindValue(':activation_hash', $hashed_token, PDO::PARAM_STR);\n\n\t\treturn $stmt->execute();\n\t\t//PDO::execute returns true on success\n\t}\n\treturn false;\n }", "public function save()\n\t{\n\t\tif (!$this->validate())\n\t\t\treturn false;\n\n\t\t$this->user->password = $this->password;\n\n\t\t// Verify that this activation key can't be used again\n\t\t$this->user->activated = 1;\n\t\t$this->user->activation_key = NULL;\n\n\t\tif ($this->user->save())\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function addNewUser($username, $password, $RealName){\n global $conn;\n $q = \"INSERT INTO users VALUES ('$username', '$password', '$RealName', NULL, NULL)\";\n \n $_SESSION['username']=$username;\n return mysql_query($q,$conn);\n}", "function saveUser() {\n\n //datos desde el formulario\n $nombres = $this->input->post('nombres');\n $apellidos = $this->input->post('apellidos');\n $email = $this->input->post('email');\n $marca_favorita = $this->input->post('marca_favorita');\n $modelo_favorito = $this->input->post('modelo');\n $profesion = $this->input->post('profesion');\n $pais = $this->input->post('pais');\n $telefono = $this->input->post('telefono');\n\n //re-verificamos si el user existe\n $exi = $this->Secure_model->checkEmail($email);\n if ($exi == TRUE) {\n redirect(base_url() . 'index.php/site/aviso/2');\n }\n //se enviara a usuario\n //$temp_clave = \"hola\";\n $temp_clave = $this->Secure_model->generateClave($nombres);\n $clave = md5(utf8_encode($temp_clave));\n $tipo_usuario = '2';\n $estado = md5($email);\n $datos = array(\n 'nombres' => $nombres,\n 'apellidos' => $apellidos,\n 'email' => $email,\n 'pais' => $pais,\n 'clave' => $clave,\n 'tipo_usuario' => $tipo_usuario,\n 'estado' => $estado,\n 'primium' => '0',\n 'fecha_registro' => date('Y-m-d'),\n );\n //$this->session->set_userdata('temp_data',$datos);\n // GUARDAMOS QUE ACABAMOS DE CREAR Y OBTENEMOS EL ULTIMO ID\n $last_id = $this->savedata_model->guardar('cq_usuario', $datos);\n //Guardamos numero de telefono\n $dato_tel = array(\n //'id_telefono' => '',\n 'id_usuario' => $last_id,\n 'telefono' => $telefono,\n 'codigo_pais' => $pais\n );\n\n $this->savedata_model->guardar('cq_telefonos', $dato_tel);\n\n // EVIAMOS NOTIFICACION DE CORREO\n $nombre = $nombres . \" \" . $apellidos;\n\n $datos = array('tipo' => 'registro',\n 'to' => $email,\n 'clave' => $temp_clave,\n 'nombre' => $nombre);\n\n\n if ($this->function_model->enviarMail($datos)) {\n\n redirect(base_url() . 'index.php/site/aviso/1');\n } else {\n redirect(base_url() . 'index.php/site/aviso/3');\n }\n }", "public function store(UserEntryRequest $request)\n {\n $user = new User();\n\n $user->email = $request->email;\n $user->password = $request->password;\n $user->name1 = $request->name1;\n $user->name2 = $request->name2;\n $user->message_key = md5(uniqid(rand(), true)); // チャットメッセージの発信元を特定するキー\n\n $user->save();\n\n return redirect()->route('user.complete');\n }", "public function store(UserFormRequest $request)\n {\n $data = $request->all();\n $data['password'] = bcrypt($request->password);\n $data['status'] = 0;\n $this->userRepository->create($data);\n Alert::success(trans('Register Member Successfully'), trans('Please Wait Active'));\n\n return redirect('/login');\n }", "public function store(Request $request)\n {\n $user = new User;\n $user->first_name = $request->first_name;\n $user->last_name = $request->last_name;\n $user->age = $request->age;\n $user->city = $request->city;\n $user->state = $request->state;\n $user->country = $request->country;\n $user->about = $request->about;\n\n $user->save();\n //\n }", "public function save()\n\t{\n\t\tif ($this->modified) {\n\t\t\t$user = $this->guard->user();\n\t\t\t$userId = -1;\n\n\t\t\tif ($user !== null) {\n\t\t\t\t$userId = $user->getAuthIdentifier();\n\t\t\t}\n\n\t\t\treturn $this->flush($userId);\n\t\t}\n\n\t\treturn false;\n\t}" ]
[ "0.67389923", "0.6651957", "0.6368132", "0.6297084", "0.6276602", "0.6267826", "0.6215301", "0.62045", "0.61606944", "0.6147802", "0.60747766", "0.6034158", "0.6007421", "0.599423", "0.5985208", "0.59788287", "0.5965607", "0.59478635", "0.59432596", "0.59344226", "0.592449", "0.59215415", "0.591182", "0.5906074", "0.58609635", "0.58477163", "0.5846682", "0.5834903", "0.5812293", "0.58086467", "0.5786916", "0.57768047", "0.5772317", "0.5760197", "0.5758498", "0.5720079", "0.57129496", "0.5706533", "0.56714725", "0.56676847", "0.5651572", "0.5648413", "0.56404394", "0.56387067", "0.5629992", "0.5625942", "0.5622054", "0.56185436", "0.56175256", "0.5616746", "0.56154114", "0.5614856", "0.5613144", "0.56034076", "0.5602071", "0.55953914", "0.5593824", "0.55935717", "0.55888504", "0.5572766", "0.55646586", "0.5563494", "0.55301094", "0.55199254", "0.5518006", "0.5518006", "0.5518006", "0.5518006", "0.5510267", "0.55101895", "0.550987", "0.5506639", "0.5505573", "0.55021137", "0.5500326", "0.5499655", "0.54914", "0.5488881", "0.54876524", "0.54874295", "0.5487193", "0.54855615", "0.5482699", "0.5481907", "0.5478695", "0.5469157", "0.5467495", "0.5466861", "0.54620016", "0.5460044", "0.5452317", "0.54484266", "0.5447085", "0.54414546", "0.5438677", "0.5436191", "0.5432082", "0.542011", "0.541276", "0.5411602" ]
0.62937003
4
Checks if a given pair of email/password exists in the database
public function isValidUser($email, $passwd) { $stmt = $this->db->prepare("SELECT count(email) FROM users where email=? and passwd=?"); $stmt->execute(array($email, $passwd)); if ($stmt->fetchColumn() > 0) { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function email_and_password_exists($db, $email, $password)\n{\n\t$password = md5($password);\n\t$sql = \"SELECT * FROM users where email=:email and password=:password\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email, ':password'=>$password));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function isEmailAndPasswordRegistered ($email,$password) {\n $connect = $GLOBALS['connect'];\n $password = md5 ($password);\n $queryCheck = \"SELECT * FROM user WHERE email = '$email' AND password = '$password'\";\n \n $mysqlQueryCheck = mysqli_query ($connect,$queryCheck);\n \n if (mysqli_affected_rows ($connect)){\n \n // Save to database\n \n return true;\n \n }\n else {\n \n echo false;\n \n }\n}", "function checkLoginDetails($email, $password) {\r\n\t\t\t$sql = \"SELECT * FROM `users` WHERE UPPER(email)=UPPER('%s') AND password='%s'\";\r\n\t\t\t$result = $this->query($sql, $email, sha1($password));\r\n\t\t\tif (mysql_num_rows($result) == 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}", "function DB_check_if_user_exist($usersPass, $usersEmail){\n\n $connection = DB_get_connection();\n $usersPass = md5($usersPass);\n $query = \"SELECT * FROM `users` WHERE Email='$usersEmail' AND password='$usersPass'\";\n $result = mysqli_query($connection, $query);\n if(mysqli_num_rows($result) === 1)\n return true;\n else return false;\n\n}", "function memberEmailExists($email, $password)\r\n { \r\n $select = 'SELECT member_id, username, firstname, lastname, email, password, image FROM atlas_members WHERE email=:email && password=:password';\r\n \r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':email', $email, PDO::PARAM_STR);\r\n $statement->bindValue(':password', $password, PDO::PARAM_STR);\r\n $statement->execute();\r\n \r\n $row = $statement->fetch(PDO::FETCH_ASSOC);\r\n\n return !empty($row);\r\n }", "function check_password($email, $password)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id, password, salt\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. If no record exists, we can stop here.\n if (!$record = mysqli_fetch_assoc($result))\n {\n return FALSE;\n }\n\n // 6. We can check that the password matches what is on record.\n $password = $record['salt'].$password;\n if (!password_verify($password, $record['password']))\n {\n return FALSE;\n }\n\n // 7. all is fine\n return $record['id'];\n }", "function valid_credentials($email, $password){\n\n\t$pass = sha1($password);\n\n\t$link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `email_address` = \n '{$email}' AND `pass_word` = '{$pass}' \";\n \n $result = mysqli_query($link, $sql);\n \n\treturn (mysqli_result($result, 0) == '1') ? true : false;\n\n}", "function check($data)\n\t\t{\n\t\t\t$email = \"'\".$data['email'].\"'\";\n\t\t\t$password = \"'\".$data['password'].\"'\";\n\t\t\t$sql = $this->conn_id->query(\"select * from users where email = \".$email .\" and passwd = \".$password);\n\t\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\tif(!empty($r))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn FALSE;\n\t\t}", "function existe($email, $password) {\n\t\t\t$utilisateur = $this->find(array(\n\t\t\t\t'conditions' => 'email = \"' . $email . '\" AND password = \"' . md5(SECRET_KEY.$password) . '\"'\n\t\t\t));\n\t\t\tif(count($utilisateur) != 0)\n\t\t\t\treturn true;\n\t\t\t\n\t\t\treturn false;\n\t\t}", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "public function checkCredentials(string $email, string $password):bool;", "public function exists($email, $password){\n\t\t$query = $this->_db->prepare('SELECT COUNT(*) FROM utilisateur WHERE email=:email AND password=:password');\n\t\t$query->execute(array(':email' => $email, ':password' => sha1($password)));\n\t\t//get result\n\t\treturn (bool) $query->fetchColumn();\n\t}", "function memberUserExists($email, $password)\r\n { \r\n $select = 'SELECT member_id, username, firstname, lastname, email, password, image FROM atlas_members WHERE email=:email && password=:password';\r\n \r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':email', $email, PDO::PARAM_STR);\r\n $statement->bindValue(':password', $password, PDO::PARAM_STR);\r\n $statement->execute();\r\n \r\n $row = $statement->fetch(PDO::FETCH_ASSOC);\r\n \r\n return !empty($row);\r\n \r\n }", "public function loginIsValid( $email, $password ) {\r\n \r\n $password = sha1($password);\r\n $db = $this->getDB();\r\n if ( NULL != $db ) {\r\n $stmt = $db->prepare('select * from users where email = :emailValue and password = :passwordValue limit 1');\r\n $stmt->bindParam(':emailValue', $email, PDO::PARAM_STR);\r\n $stmt->bindParam(':passwordValue', $password, PDO::PARAM_STR);\r\n $stmt->execute();\r\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n if ( is_array($result) && count($result) ) return true;\r\n }\r\n return false;\r\n }", "static function check_login_data($email, $password) {\n global $con;\n\n // generate password hash by password and salt stored in the user table\n $password_hash = sha1(self::get_salt_by_email($email) . $password);\n unset($password); // delete password variable after useage\n \n // check how many table entries fit the email and password\n // password hash comparison with \"LIKE BINARY\" to make sure both are exactly equal\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `password` LIKE BINARY '\".$password_hash.\"' AND `active` = 1;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) { \n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `active` = 1;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n return 3;\n }\n return 0;\n } else { // an entry which fits email and password exists\n // check if the user has already confirmed their email address\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `password` LIKE BINARY '\".$password_hash.\"' AND `active` = 1 AND `email_confirmed` = 0;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 1) { // email has not been confirmed\n return 2;\n } else { // email has been confirmed\n return 1;\n }\n }\n }", "function validateLogin($email, $password)\n\t{\n\n\t\t$connection = new Connection;\n\t\t$query = \"select email,password from user where email = '$email' and password = '$password'\";\n\t\t$result = $connection->runQuery($query, $connection->connection());\n\t\treturn $result;\n\t}", "function checkLogin($db, $email, $password){\n\n\t\t// Prepare a query.\n\t\t$salt_query = $db->prepare(\"SELECT salt FROM user WHERE Email = :email\");\n\t\t$params = array(\":email\" => htmlspecialchars($email));\n\t\t$salt_query->execute($params);\n\t\n\t\t// See if anything was returned. Display an error if anything is.\n\t\tif($salt = $salt_query->fetch()){\n\t\t\n\t\t\t// Generate a hash to compare to what's in the database.\n\t\t\t$hash = hash('sha256', $salt[0] . htmlspecialchars($_POST['password']));\n\t\t\t\n\t\t\t// Compare the generated hash to the one in the database.\n\t\t\t$login_query = $db->prepare(\"\n\t\t\t\tSELECT Username FROM user\n\t\t\t\tWHERE\n\t\t\t\t\tEmail = :email\n\t\t\t\tAND\n\t\t\t\t\thash = :hash\n\t\t\t\");\n\t\t\t\n\t\t\t$params = array(\":email\" => htmlspecialchars($email),\n\t\t\t\t\t\t\t\":hash\" => $hash);\n\t\t\t\n\t\t\t// Retrieve the username.\n\t\t\t$login_query->execute($params);\n\t\t\tif($username = $login_query->fetch()){\n\t\t\t\treturn $username;\n\t\t\t}\n\t\t\t// Incorrect password.\n\t\t\telse{\n\t\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t\t$returnInfo[\":data\"] = \"Password is incorrect.\";\n\t\t\t\tdie(json_encode($returnInfo));\n\t\t\t}\n\t\t}\n\t\t// User doesn't exist.\n\t\telse{\n\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t$returnInfo[\":data\"] = \"There is no user associated with that email.\";\n\t\t\tdie(json_encode($returnInfo));\n\t\t}\n\t}", "public static function userExists($email, $pass){\n $md5pass = md5($pass);\n \n //unir los datos con las variables temporales\n $query = 'SELECT * FROM users WHERE email = :email AND password = :pass';\n\n self::getConexion();\n\n $resultado = self::$cnx->prepare($query);\n\n $resultado->bindParam(\":email\", $email);\n $resultado->bindParam(\":pass\", $pass);\n\n $resultado->execute();\n\n //si hay filas regresa true si no false\n if($resultado->rowCount()){\n return true;\n }else{\n return false;\n }\n }", "public static function check_credentials($email_or_username, $password)\n {\n\n\n $password = Security::encrypt($password);\n\n $email_or_username = e($email_or_username);\n\n\n $sql = \"SELECT\n id, user_type\n FROM\n users\n WHERE\n password = '{$password}'\n AND(\n email = '{$email_or_username}'\n OR\n username = '{$email_or_username}')\n AND\n deleted = 0\n LIMIT\n 1\";\n\n\n return DB::query($sql);\n\n\n }", "public function isValidLogin($email, $password);", "function email_exists($db, $email)\n{\n\t$sql = 'SELECT * FROM users where email=:email';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function is_user_exists($cellphone,$password)\n {\n\n $query=$this->db->query(\"SELECT * FROM xl_account WHERE cellphone='{$cellphone}' AND password='{$password}' AND register_user=1\");\n\n if ($query->num_rows()>0) {\n #if exist return true\n return TRUE;\n }\n\n return FALSE; \n }", "function validateUserCredential($userEmail, $password){\n\n\t\tglobal $conn;\n\n\t\t$md5Password = md5($password);\n\n\t\t$query = \"SELECT COUNT(*) AS Valid FROM User WHERE email='\" . $userEmail . \"' AND password='\" . $md5Password . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $userEmail . \" details\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Valid'];\n\t\t}\n\n\t}", "public function login_check($email, $password) {\n\n $query = $this -> conn -> prepare('SELECT * FROM users WHERE email = :email');\n $query -> execute(array(':email' => $email));\n $data = $query -> fetchObject();\n $salt = $data -> salt;\n $db_user_password = $data -> user_password;\n\n if ($this -> verify_hash_pass($password.$salt,$db_user_password) ) {\n\n\n $user[\"name\"] = $data -> name;\n $user[\"email\"] = $data -> email;\n $user[\"unique_id\"] = $data -> unique_id;\n return $user;\n\n } else {\n\n return false;\n }\n\n }", "public function check_user($email,$password)\n\t{\n\t\t$query=\"SELECT * FROM users \n\t\t\t\tWHERE users.email=? \n\t\t\t\tAND users.password=?\";\n\t\t$values=array($email,md5($password));\n\t\t$check=$this->db->query($query,$values)->row_array();\n\t\tif(empty($check))\n\t\t{\n\t\t\t//*no user has been found. ok to create//\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function validate_cred($email_local = null, $password_local = null){\n global $email;\n global $pwd;\n if ($email_local != null && $password_local != null){\n \n }\n else{\n $email_local = isset($_REQUEST[$email]) ? $_REQUEST[$email] : null;\n $password_local = isset($_REQUEST[$pwd]) ? $_REQUEST[$pwd] : null;\n \n }\n\n if ($email_local != null && $password_local != null){\n $conn = open_db_connection('localhost', ['new_user','Redbirdp1'], 'login');\n if ($conn ->connect_errno){\n echo('connection failed: ' . $conn->connect_error);\n }\n $statement = new Statement();\n // $statement->select([\"*\"])->from()->table(\"members\")->where(\"username\")->equals($email_local);\n $statement->select([\"*\"])->from()->table(\"members\");\n //echo $statement->get_statement();\n $result = query_db($conn, $statement);\n \n if ($result != null)\n {\n if ($result->num_rows > 0) {\n // output data of each row\n $flag = false;\n while($row = $result->fetch_row()) {\n //echo \"<br>\". $row;\n //echo \"<br>\" . $email_local . \" \" . $password_local;\n //echo \"<br>\" . $row[0];\n //echo \"<br>\" . $row[1];\n if ($row[0] == $email_local && $row[1] == $password_local){\n $flag = true;\n break;\n }\n }\n if ($flag){\n return true;\n }\n else{\n return false;\n }\n } else {\n echo \"0 results\";\n }\n return true;\n }\n echo '<br>Authentificaiton failed not a valid user';\n return true;\n }\n\n return false;\n\n}", "public function getUserByEmailAndPassword($email, $password) {\n\t\t\n\t\t$query = \" \n SELECT * from users WHERE email = :email;\n \"; \n\t\t\n\t\ttry \n { \n $stmt = $this->_db->prepare($query); \n\t\t\t$stmt->bindValue(':email',$email);\n $stmt->execute(); \n\t\t\t$result = $stmt->fetch();\n } \n catch(PDOException $ex) \n { \n\t\t\t$h = $ex->getMessage ();\n die($h); \n }\n\t\t\n\t\tif(!(empty($result))){\n\t\t\t\n\t\t\t$salt = $result['salt'];\n\t\t\t$encrypted_password = $result['password'];\n\t\t $hash = $this->checkhashSSHA($salt, $password);\n\t\t\t\n\t\t if ($encrypted_password == $hash) {\n // user authentication details are correct\n return $result;\n }\n } else {\n // user not found\n return false;\n }\n\t\t\n }", "function CheckCreds($email, $password)\n{\n global $db;\n $query = \"SELECT email FROM users WHERE email=:email AND password=SHA2(:password, 256);\";\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email);\n\t$statement->bindValue(':password', $password);\n $statement->execute();\n $results = $statement->fetchColumn();\n $statement->closeCursor();\n\treturn $results;\n}", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "function doesEmailExist($email) {\n global $db;\n\n $query = \"SELECT * FROM user WHERE email=:email\";\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email); \n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return (count($results) > 0);\n}", "public function email_exists(){\n $email = $this->input->post('email');\n $query = $this->db->query(\"SELECT email, password FROM user WHERE email='$email'\"); \n if($row = $query->row()){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "public function getUserByEmailAndPassword($email, $password) {\n\t\n\t\n $result = mysql_query(\"SELECT * FROM users2 WHERE email = '$email'\") or die(mysql_error());\n // check for result\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n $result = mysql_fetch_array($result);\n // check for password equality\n if ($password == $password) {\n // user authentication details are correct\n return $result;\n }\n } else {\n // user not found\n return false;\n }\n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "public function Check($email)\n {\n $db = new DB();\n //Check whether user data already exists in database\n $querySelect = \"SELECT \n * \n FROM \n \".$this->userTbl.\" \n WHERE\n email = '\".$email.\"'\";\n $result = $db->prepare($querySelect);\n $result->execute();\n if($result->rowCount() > 0)\n {\n return false;\n }\n else\n {\n return true;\n }\n\n }", "function authenticate($sEmail, $sPwd)\r\n {\r\n // Create query\r\n $sSQL = \"SELECT 1 FROM \".users.\" WHERE \".email.\"=\".sFix($sEmail).\" AND \".pwd.\"=\".sFix($sPwd);\r\n $selection = mysql_query($sSQL);\r\n if($row = mysql_fetch_array($selection))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getUserByEmailAndPassword($email, $password) {\r\n $result = mysql_query(\"SELECT * FROM users WHERE email = '$email'\") or die(mysql_error());\r\n // check for result \r\n $no_of_rows = mysql_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n $result = mysql_fetch_array($result);\r\n $salt = $result['salt'];\r\n $encrypted_password = $result['encrypted_password'];\r\n $hash = $this->checkhashSSHA($salt, $password);\r\n // check for password equality\r\n if ($encrypted_password == $hash) {\r\n // user authentication details are correct\r\n return $result;\r\n }\r\n } else {\r\n // user not found\r\n return false;\r\n }\r\n }", "function userLogin($email, $pass)\n\t{\n\t\t$password = md5($pass);\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ? AND password = ?\");\n\t\t$stmt->bind_param(\"ss\", $email, $password);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "public static function validateUser($email, $password)\n {\n $conn = new MySqlConnect();\n $isValid = FALSE;\n $dbHash = null;\n $userId = null;\n $name = null;\n $userType = null;\n\n // hash the submitted password to to verify against the value in the db\n $hash = Users::encodePassword($password);\n\n //$email = $conn -> sqlCleanup($email);\n // query the db for the value comparison\n $result = $conn -> executeQueryResult(\"SELECT userId, password, fName, lName, userType FROM users WHERE emailAddress = '{$email}'\");\n\n // get a row count to verify only 1 row is returned\n $count = mysql_num_rows($result);\n if ($count == 1)\n {\n var_dump($result);\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // access the password value in the db\n $userId = trim($row['userId']);\n $dbHash = trim($row['password']);\n $userType = trim($row['userType']);\n $name = \"{$row['fName']} {$row['lName']}\";\n }\n\n // compare the input password hash with the db hash, and set as valid if\n // they match\n if ($hash == $dbHash)\n {\n $isValid = TRUE;\n session_start();\n // register the userId, name, and userType in the $_SESSION\n $_SESSION['userId'] = $userId;\n $_SESSION['name'] = $name;\n $_SESSION['userType'] = $userType;\n $_SESSION['email'] = $email;\n $_SESSION['timeout'] = time();\n // clear any tempPassKey record that may or may not exist in the user\n // record that that has been validated\n Users::clearTempPassKey($userId);\n }\n }\n $conn -> freeConnection();\n return $isValid;\n }", "public function isUserExisted($email) {\n \t\t\n\t\t$query = \" \n SELECT * from users WHERE email = :email;\n \"; \n\t\t\n\t\ttry \n { \n $stmt = $this->_db->prepare($query); \n\t\t\t$stmt->bindValue(':email',$email);\n $stmt->execute(); \n\t\t\t$result = $stmt->fetch();\n } \n catch(PDOException $ex) \n { \n\t\t\t$h = $ex->getMessage ();\n die($h); \n }\n\t\t\n\t\tif (!(empty($result))) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n\t\t\t\n }", "public function userExists($email){\r\n\r\n\t\t$this->stmt = $this->db->prep(\"SELECT email FROM Users WHERE email=:email\");\r\n\t\t$this->stmt->bindParam(':email', $email);\r\n\t\t$this->stmt->execute();\r\n\t\t$email_check = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t//comparing given email to what was fetched from the database\r\n\t\tif($email == $email_check[\"email\"]){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function exists($email, $token);", "public function userCheckMailLogin($email,$password)\n {\n $query=\"select user_id from bimp_user where email='\".$email.\"' and password='\".$password.\"'\";\n $user= Yii::app()->db->createCommand($query)->queryAll();\n $count=count($user);\n if($count==1){\n return true;\n }else{\n return false;\n }\n }", "function email_exists($email){\n\t\t$emailexistsql = \"SELECT email FROM users WHERE email = :email\";\n\n\t\t$stmt = $database->prepare();\n\n\t\t$stmt->bindParam(':email', $email);\n\n\t\t$stmt->execute();\n\n\t\tif ($stmt->rowCount() > 0){\n\t\t\techo(\"Email Exists\");\n\t\t\treturn true;\n\t\t}\n\t}", "function user_exists($username){\n\n $sql = \"SELECT Username, Password, Email, Id FROM Users\"; //WHERE\n //Username={$username}\";\n $result = mysqli_query(Db::$conn, $sql);\n //check results return true if >0\n if(mysqli_num_rows($result)>0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $temp_user = $row[\"Username\"];\n $temp_pass = $row[\"Password\"];\n if ($username == $row[\"Username\"]) {\n return true;\n }\n }\n }\n\n return false;\n\n}", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "function check_app_email($connection, $school_key, $app_email){\n $query = \"SELECT email FROM applicants WHERE email = '$app_email' AND school_email = '$school_key'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n if ($rows < 1) {\n return false;\n }\n else{\n return true;\n }\n}", "private function checkUserEmailAvailability($username, $email) {\n $query1 = \"call getUsername(:username)\";\n $query2 = \"call getEmailAddress(:email)\";\n try {\n if (self::$connection == NULL) {\n require 'php/credentials.php';\n self::connectionInit($dbconn);\n }\n $stmt = self::$connection->prepare($query1);\n $stmt->bindParam(':username', $username);\n $stmt->execute();\n $q1 = $stmt->fetch();\n\n $stmt = self::$connection->prepare($query2);\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $q2 = $stmt->fetch();\n // if any of them exists, return false\n return !($q1 || $q2);\n } catch (PDOException $e) {\n echo \"<div style='color: red;'>**${query1}**<br>**${query2}</div> \" . $e->getMessage();\n exit();\n }\n }", "public function isUserExisted($email) {\n $stms = $this->conn->prepare(\"SELECT email from users WHERE email = ?\");\n \n $stms->bind_param(\"s\", $email);\n \n $stms->execute();\n \n $stms->store_result();\n \n if ($stms->num_rows > 0) {\n // user existed \n $stms->close();\n return true;\n } else {\n // user not existed\n $stms->close();\n return false;\n }\n }", "function has_unique_email($connection, $email)\n{\n try {\n $sql = \"SELECT email FROM users WHERE email=?\";\n $statement = runQuery($connection, $sql, array($email));\n $row = $statement->fetch(PDO::FETCH_ASSOC);\n if($row) {\n return false;\n } else {\n return true;\n }\n } catch (PDOException $e) {\n die( $e->getMessage() );\n }\n\n}", "function check_user_existance($data, $mail, $passwd = null) {\n if ($data === false)\n return false;\n\tforeach ($data as $user) {\n\t\tif ($user['user'] === $mail) {\n\t\t\tif ($passwd !== null) {\n\t\t\t\tif (password_verify($passwd, $user['passwd']) == true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "private function emailExists($email)\n {\n $query = \"SELECT manager_password,manager_name,is_accepted,admin_id\n FROM \" . $this->table . \"\n WHERE manager_email = ?\n LIMIT 0,1\";\n\n // prepare the query\n $stmt = $this->conn->prepare($query);\n $this->manager_email = $email;\n $this->manager_email = htmlspecialchars(strip_tags($this->manager_email));\n // bind value\n $stmt->bindParam(1, $this->manager_email);\n // execute the query\n $stmt->execute();\n // get number of rows\n $num = $stmt->rowCount();\n if ($num > 0) {\n //set password\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->manager_password = $row['manager_password'];\n $this->manager_name = $row['manager_name'];\n $this->is_accepted = $row['is_accepted'];\n // return true because email exists in the database\n\n return true;\n }\n // return false if email does not exist in the database\n return false;\n }", "private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "public function verify(string $email, string $password) : bool{\r\n\r\n\r\n\t\t$sth = $this->db->prepare('SELECT password FROM users WHERE email = :email');\r\n $sth->bindParam(':email', $email);\r\n\r\n if (false === $sth->execute()) {\r\n return false;\r\n }\r\n\r\n $result = $sth->fetch(PDO::FETCH_ASSOC);\r\n\r\n if (false === $result || empty($result)) {\r\n return false;\r\n }\r\n return password_verify($password, $result['password']);\r\n\t\t\t\t\r\n\t}", "function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "function check_login($email,$pass)\n {\n $this->db->where('email', $email);\n $this->db->or_where('username', $email);\n $query = $this->db->get('users');\n if( $query->num_rows() > 0 ){ return True; } else { return False; }\n }", "function checkIfUserExists($conn,$data)\n {\n $sql = \"SELECT * FROM tbl_users \n WHERE email='\".$data['email'].\"' AND username='\".$data['username'].\"'\";\n $result = $conn->query($sql);\n return ($result->num_rows>0 ? true : false);\n }", "public function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users2 WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function valid_passwd($uid, $passwd) {\n $dbh = DB::connect();\n\n $q = \"SELECT salt, passwd \";\n $q.= \"FROM Users \";\n $q.= \"WHERE id = \" . $dbh->quote($uid);\n $result = $dbh->query($q);\n\n if (!$result) {\n return false;\n }\n\n $row = $result->fetch(PDO::FETCH_NUM);\n $salted_hash = hash(\"sha256\", $row[0] . $passwd);\n\n if ($salted_hash == $row[1]) {\n return true;\n } else {\n return false;\n }\n}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "function emailExists(){\r\n \r\n // query to check if email exists\r\n $query = \"SELECT id, fname, lname, password,role\r\n FROM user\r\n WHERE email = ?\r\n LIMIT 0,1\";\r\n \r\n // prepare the query\r\n $stmt = $this->conn->prepare( $query );\r\n \r\n // sanitize\r\n $this->email=htmlspecialchars(strip_tags($this->email));\r\n $this->password =htmlspecialchars(strip_tags($this->password));\r\n // bind given email value\r\n $stmt->bindParam(1, $this->email);\r\n \r\n // execute the query\r\n $stmt->execute();\r\n \r\n // get number of rows\r\n $num = $stmt->rowCount();\r\n \r\n // if email exists, assign values to object properties for easy access and use for php sessions\r\n if($num>0){\r\n \r\n // get record details / values\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // assign values to object properties\r\n $this->id = $row['id'];\r\n $this->fname = $row['fname'];\r\n $this->lname = $row['lname'];\r\n $this->password = $row['password'];\r\n $this->user_type = $row['user_type'];\r\n \r\n // return true because email exists in the database\r\n return true;\r\n }\r\n \r\n // return false if email does not exist in the database\r\n return false;\r\n }", "public function check_user_exist_android($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from androidusers WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "public function isUserExisted($email) {\r\n $result = mysqli_query($this->con,\"SELECT email from users WHERE email = '$email'\");\r\n $no_of_rows = mysqli_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function isUserExistsByEmail($email) {\n $query = \"select * from user_profile_details WHERE email='{$email}' \";\n $result_set = mysql_query($query);\n if(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t}\t\n}", "public function canLogin()\n {\n $email = $this->getEmail();\n $password = $this->getPassword();\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n $statement->bindValue(\":email\", $email);\n $statement->execute();\n $user = $statement->fetch();\n $hash = $user[\"password\"];\n\n if (!$user) {\n return false;\n }\n\n // use password_verify() to verify your user\n // this function should return true or false and nothing else\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }", "public function emailExists($email)\n {\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"select * from users where email = :email\");\n $statement->bindParam(\":email\", $email);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n return true;\n }\n else {\n return false;\n }\n }", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "function checkIfUserExist($username, $email) {\n $query = getQuery(\"checkIfUserExist.query\", $username, \"\", $email);\n $result = mysql_query($query);\n\n return (mysql_result($result, 0) >= 1);\n}", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function isUserExisted($email){\n\t\t$stmt = $this->conn->prepare(\"SELECT email FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\",$email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\tif($stmt->num_rows > 0){\n\t\t\t$stmt->close();\n\t\t\treturn true;\n\t\t}\n\n\t\telse{\n\t\t\t$stmt->close();\n\t\t\treturn false;\n\t\t}\n\t}", "public static function authenticate($password, $email){\n $password = md5($password);//this encodes the password\n $sql = \"SELECT * FROM \".static::$table_name.\" WHERE email = '{$email}' AND password = '$password' LIMIT 1\";//user id is the first item on the array hence it will be popped\n $user = static::findBySql($sql);//Use the above sql query to find user\n // echo $sql;\n return ($user) ? array_shift($user) : false;//array_shift = pop in python\n }", "function verify_login($email, $password)\n{\n\t// 1 => good to go\n\t// -1 => account not found or verification bad\n\t$pw_verify = db_query('SELECT AES_DECRYPT(password, \"%s\") AS secret FROM users WHERE email=\"%s\" AND verified=\"1\" LIMIT 1', $_POST['password'], $_POST['email']);\n\tif (count($pw_verify) == 0)\n\t\treturn -1;\n\telse if ($pw_verify[0]['secret'] !== BLOWFISH_SECRET)\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "public function check() {\n\t\tglobal $config;\n\t\t\n\t\t$email = $this->data['email'];\n\t\t$password = hash('whirlpool',$this->SALT.$this->data['password']);\n\t\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE email = '$email'\n\t\t\t\tAND password = '$password'\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\tif($result->num_rows){\n\t\t\t$row = $result->fetch_row();\n\t\t\treturn $row[0];\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "function isPassCorrect($request){\n $name = $request[\"name\"];\n $pass = $request[\"pass\"];\n global $dbName, $dbPass;\n $mysqli = mysqli_connect(\"localhost\", $dbName, $dbPass, \"[Redacted]\") \n or die(mysql_error());\n $query = mysqli_query($mysqli, \"SELECT hash FROM Users WHERE name='$name' \");\n \n if (mysqli_num_rows($query) > 0) {\n if(password_verify($pass,mysqli_fetch_assoc($query)[\"hash\"])){\n return [True, \"$name\"];\n }else {\n return [False, \"Doesn't match\"];\n }\n } else {\n return [False, \"No user\"];\n }\n}", "function isPersonInDBase($userName, $password){\n try {\n $conn = connectToDBase();\n $statement = $conn->prepare(\"select cred from users where user= :userName\");\n $statement->execute(array(':userName' => $userName ));\n $pwd = $statement->fetch();\n $hash = $pwd[0];\n\n $getSalt = $conn->prepare(\"SELECT security FROM users where user= :userName\");\n $getSalt->execute(array(':userName' => $userName ));\n $salty = $getSalt->fetch();\n $pass = $password . $salty[0];\n\n if ( password_verify( $pass, $hash) ){\n $personIDSetup = $conn->prepare(\"SELECT active FROM users where user= :userName AND cred= :hash\");\n $personIDSetup->execute(array(':userName' => $userName, ':hash' =>$hash ));\n $personID = $personIDSetup->fetchAll();\n\n if ( count($personID) == 1){\n return $personID[0];\n }else{\n return 0;\n }\n }\n }\n catch(PDOException $ex){\n //person doesn't exist\n return \"Something went wrong in while retreiving person.\";\n }\n closeDBase($conn);\n}", "private function check_email( $email, $password = '' ) {\n\t\t$email = addslashes( $email );\n\t\t$password = ( $password == '' ? '' : \"AND PASSWORD = '\".md5( addslashes( $password ) ).\"'\" );\n\t\t$query = collect( \\DB::select( \"\n\t\t\tSELECT \n\t\t\t\tCOUNT( 1 ) AS COUNT\n\t\t\tFROM \n\t\t\t\tTM_USER \n\t\t\tWHERE \n\t\t\t\tEMAIL = '{$email}'\n\t\t\t\t{$password}\n\t\t\" ) )->first();\n\t\treturn $query;\n\t}", "function logincheck($u_mail,$u_pass)\n{\n\t$sql=\"select * from user_table where u_mail='$u_mail' and u_pass='$u_pass'\";\n\t$key=0; \n\tforeach($GLOBALS['db']->query($sql) as $row)\n\t\t$key++;\n\tif($key==1)\n\t\treturn $row['u_id'];\n\telse\n\t\techo \"<center>Username or Password is incorrect</center>\";\n}", "function CheckIfUserExists($input_email)\n{\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare(\"SELECT u.user_id, u.admin, u.password FROM `user` u WHERE u.email = ? \");\n\t$query->execute(array($input_email));\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "public function testCheckCredentials(){\r\n $db = new database;\r\n $db->connectToDatabase();\r\n $result = $db->checkCredentials(\"[email protected]\",\"owner\");\r\n $this->assertEquals(\"[email protected]\",$result[\"emailId\"]);\r\n }", "function isEnteredCorrectPassword($email, $password, $db) {\r\n\t$customerResult = $db->findCustomer($email);\r\n\tif ($customerResult->getRowCount() < 1) {\r\n\t\tdie (\"Couldn't find customer when checking password.\");\r\n\t} else if ($customerResult->getRowCount() > 1) {\r\n\t\tdie(\"More than one customer when checking password\");\r\n\t} else {\r\n\t\t$customer = $customerResult->getFirstRow();\r\n\t\t$correctPassword=$customer['password'];\r\n\t\tif ($correctPassword === $password) {\r\n\t\t\t$factory = new CustomerFactory($db);\r\n\t\t\t$customerObject = $factory->getCustomer($email);\r\n\t\t\t$_SESSION['customer'] = $customerObject;\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tdie(\"Wrong password entered!\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "public function hasPwIsExist(){\n return $this->_has(2);\n }", "function login() {\n\n // Validate user input\n $this->s_email = testInput($this->s_email);\n $this->s_password = testInput($this->s_password);\n\n // Fetch data from db with given email\n $result = $this->conn->query(\"SELECT * FROM $this->tableName WHERE s_email LIKE '$this->s_email'\");\n\n // Check that student exists in database\n if ($result->rowCount() === 1) {\n\n // Fetch user record from result\n $user = $result->fetch();\n\n // Check password match\n if (password_verify($this->s_password, $user[\"s_password\"])) {\n return true;\n }\n // Passwords do not match\n else {\n return false;\n }\n }\n // User with given email not in database\n else {\n return false;\n }\n }", "public function loginValidate($email, $password)\n {\n\n $pdo = DB::connect();\n $stmt = $pdo->prepare(\"SELECT password FROM users WHERE email = :email\");\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $result = $stmt->fetch();\n if (password_verify($password, $result['password'])) {\n return true;\n } else {\n return false;\n }\n }", "function user_exist($uname)\n {\n $this->removeOldTemps();\n \n $res = $this->query(\"SELECT * FROM `{$this->userTable}` WHERE `{$this->tbFields1['email']}` = '\".$uname.\"'\");\n $res2 = $this->query(\"SELECT * FROM `{$this->userTempTable}` WHERE `{$this->tbTmpFields['email']}` = '\".$uname.\"'\"); \n \n if((!$res && !$res2) || (mysql_num_rows($res) == 0 && mysql_num_rows($res2) == 0)){ // no records \n return false;\n }\n return true; \n }", "function checkForAccount($email, $db) {\n $sql = 'SELECT email FROM users WHERE email = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n \n }\n }", "function dbloginCheck($user_login, $pwd)\n{\n $sql=\"SELECT * FROM ra_company WHERE _email = :email AND _password=:passwword\";\n $q = $this->conn->prepare($sql);\n $q->execute(array(':email'=>$user_login, ':passwword'=>md5($pwd))) or die(print_r($q->errorInfo()));\n $totalrow=$q->rowCount();\n if($totalrow==1){\n $data = $q->fetch(PDO::FETCH_ASSOC);\n return $data;\n}\n else{\n return 0;\n }\n}", "public function check_user_exist($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from users WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "function selectByEmailAndPassword($email, $password) {\n $connection = openDb();\n $email = escape($email, $connection);\n $password = escape($password, $connection);\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users WHERE EMAIL = ? AND PASSWORD = ? AND DATE_APPROVED IS NOT NULL\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"ss\",$email,$password);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "private function isUserExists($email) {\n\t\t$stmt = $this->conn->prepare(\"SELECT user_id from tb_user WHERE user_email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\treturn $num_rows > 0;\n\t}", "public function verify() {\r\n $stmp = $this->_db->prepare(\"SELECT `id`,`email` FROM `anope_db_NickCore` WHERE `display`= ? AND `pass` = ?;\");\r\n $stmp->execute(array($this->_username,$this->_password));\r\n \r\n if ($stmp->rowCount() == \"1\") {\r\n $row = $stmp->fetch(PDO::FETCH_ASSOC);\r\n $this->_id = $row['id'];\r\n $this->_email = $row['email'];\r\n return $this->_id;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "function emailExists(string $email, object $pdo): bool\n{\n $statement = $pdo->prepare('SELECT * FROM users WHERE email = :email');\n $statement->bindParam(':email', $email, PDO::PARAM_STR);\n $statement->execute();\n\n $user = $statement->fetch(PDO::FETCH_ASSOC);\n\n if ($user) {\n return true;\n }\n\n return false;\n}", "public static function email_exists($email) {\n $connection = DatabaseConnection::connection();\n $sql = \"SELECT user_id FROM users WHERE email=:email\";\n $statement = $connection->prepare($sql);\n $statement->execute(['email' => $email]);\n $count = count($statement->fetchAll());\n if($count == 1)\n return TRUE;\n else\n return FALSE;\n }" ]
[ "0.8153009", "0.73193043", "0.7214219", "0.7147674", "0.7136603", "0.707552", "0.7045792", "0.70453393", "0.7044942", "0.70435375", "0.7006923", "0.69233257", "0.691535", "0.68759084", "0.6843585", "0.6841256", "0.68296635", "0.6825138", "0.6804891", "0.6799548", "0.676124", "0.6757081", "0.67535466", "0.67424196", "0.6725736", "0.67119217", "0.6710692", "0.6698935", "0.6696715", "0.6685156", "0.6676105", "0.66655624", "0.66457164", "0.6632226", "0.65990895", "0.65977365", "0.6583072", "0.6570978", "0.6564428", "0.6563756", "0.6563456", "0.656226", "0.65559256", "0.654719", "0.6541836", "0.65364397", "0.6536255", "0.65324616", "0.65162295", "0.6516114", "0.6493701", "0.6490462", "0.648346", "0.6477953", "0.6473438", "0.6471927", "0.64650667", "0.6464052", "0.6463158", "0.6454946", "0.6454123", "0.6453611", "0.64506096", "0.64422363", "0.6441391", "0.6432652", "0.6421745", "0.6421081", "0.6420537", "0.64145005", "0.6406609", "0.6406575", "0.6397201", "0.6397201", "0.63958895", "0.63954896", "0.6393281", "0.6391646", "0.63901293", "0.6385139", "0.63826966", "0.6372951", "0.6369621", "0.63677084", "0.63660014", "0.6361841", "0.6352709", "0.63510925", "0.63485855", "0.6346991", "0.63465875", "0.6344406", "0.6336826", "0.6331385", "0.63263977", "0.63251483", "0.6324053", "0.6314881", "0.63080597", "0.6306339" ]
0.6404352
72
mail validation function function to put data to csv
function savefile($fname, $val){ $fp = fopen($fname, 'a'); fputcsv($fp, $val); fclose($fp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_csv_data() {\n $imap_from = IMAP_FROM;\n $imap_subject = IMAP_SUBJECT;\n $search_string = \"UNSEEN FROM \\\"{$imap_from}\\\" SUBJECT \\\"{$imap_subject}\\\"\";\n $email_id = imap_search(self::$imap_conn, $search_string);\n\n //Should only be one message to process.\n if (!is_array($email_id) || count($email_id) != 1) {\n fprintf(STDERR, \"Expected one valid datasheet via IMAP mail.\\nMessage IDs found (\\\"false\\\" means none):\\n%s\\n\", var_export($email_id, true));\n return false;\n }\n\n //Open CSV for writing.\n if (!$this->open_csv()) {\n return false;\n }\n\n //Locate file attachment via email structure parts.\n $structure = imap_fetchstructure(self::$imap_conn, $email_id[0]);\n foreach($structure->parts as $part_index=>$part) {\n //Is there an attachment?\n if ($part->ifdisposition === 1 && $part->disposition === \"attachment\") {\n\n //Scan through email structure and validate attachment.\n $ifparams_list = array($part->ifdparameters, $part->ifparameters); //indicates if (d)paramaters exist.\n $params_list = array($part->dparameters, $part->parameters); //(d)parameter data, parrallel array to $ifparams_list.\n foreach($ifparams_list as $ifparam_index=>$ifparams) {\n if ((boolean)$ifparams) {\n foreach($params_list[$ifparam_index] as $params) {\n if (strpos($params->attribute, \"name\") !== false && $params->value === IMAP_ATTACHMENT) {\n //Get attachment data.\n switch($part->encoding) {\n //7 bit is ASCII. 8 bit is Latin-1. Both should be printable without decoding.\n case ENC7BIT:\n case ENC8BIT:\n fwrite(self::$csv_fh, imap_fetchbody(self::$imap_conn, $email_id[0], $part_index+1));\n //Set SEEN flag on email so it isn't re-read again in the future.\n imap_setflag_full(self::$imap_conn, (string)$email_id[0], \"\\SEEN\");\n return true;\n //Base64 needs decoding.\n case ENCBASE64:\n fwrite(self::$csv_fh, imap_base64(imap_fetchbody(self::$imap_conn, $email_id[0], $part_index+1)));\n //Set SEEN flag on email so it isn't re-read again in the future.\n imap_setflag_full(self::$imap_conn, (string)$email_id[0], \"\\SEEN\");\n return true;\n //Quoted Printable needs decoding.\n case ENCQUOTEDPRINTABLE:\n fwrite(self::$csv_fh, imap_qprint(imap_fetchbody(self::$imap_conn, $email_id[0], $part_index+1)));\n //Set SEEN flag on email so it isn't re-read again in the future.\n imap_setflag_full(self::$imap_conn, (string)$email_id[0], \"\\SEEN\");\n return true;\n default:\n fprintf(STDERR, \"Unexpected character encoding: %s\\n(2 = BINARY, 5 = OTHER)\\n\", $part->encoding);\n break;\n }\n }\n }\n }\n }\n }\n }\n\n // If we're down here, something has gone wrong.\n fprintf(STDERR, \"Unexpected error while trying to write CSV.\\n%s\\n\", error_get_last());\n return false;\n }", "function send_csv_mail($csvData, $body, $to = '[email protected]', $subject = 'Website Report Visitor Age Information', $from = '[email protected]') {\n\n\t\t\t$multipartSep = '-----'.md5(time()).'-----';\n\t\t\t// Arrays are much more readable\n\n\t\t\t$headers = array(\n\t\t\t\t\"From: $from\",\n\t\t\t\t\"Reply-To: $from\",\n\t\t\t\t\"Content-Type: multipart/mixed; boundary=\\\"$multipartSep\\\"\"\n\t\t\t);\n\n\n\t\t\t// Make the attachment\n\n\t\t\t$attachment = chunk_split(base64_encode(create_csv_string($csvData))); \n\n\t\t\t// Make the body of the message\n\n\t\t\t$body = \"--$multipartSep\\r\\n\"\n\t\t\t\t. \"Content-Type: text/plain; charset=ISO-8859-1; format=flowed\\r\\n\"\n\t\t\t\t. \"Content-Transfer-Encoding: 7bit\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$body\\r\\n\"\n\t\t\t\t. \"--$multipartSep\\r\\n\"\n\t\t\t\t. \"Content-Type: text/csv\\r\\n\"\n\t\t\t\t. \"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t. \"Content-Disposition: attachment; filename=\\\"Website-Report-Age-Information\" . date(\"F-j-Y\") . \".csv\\\"\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$attachment\\r\\n\"\n\t\t\t\t. \"--$multipartSep--\";\n\n\t\t\t// Send the email, return the result\n\n\t\t\treturn @mail($to, $subject, $body, implode(\"\\r\\n\", $headers)); \n\n\t\t}", "function send_csv_mail($csvData, $body, $to = '[email protected]', $subject = 'Website Report Visitor Age Information', $from = '[email protected]') {\n\n\t\t\t$multipartSep = '-----'.md5(time()).'-----';\n\t\t\t// Arrays are much more readable\n\n\t\t\t$headers = array(\n\t\t\t\t\"From: $from\",\n\t\t\t\t\"Reply-To: $from\",\n\t\t\t\t\"Content-Type: multipart/mixed; boundary=\\\"$multipartSep\\\"\"\n\t\t\t);\n\n\n\t\t\t// Make the attachment\n\n\t\t\t$attachment = chunk_split(base64_encode(create_csv_string($csvData))); \n\n\t\t\t// Make the body of the message\n\n\t\t\t$body = \"--$multipartSep\\r\\n\"\n\t\t\t\t. \"Content-Type: text/plain; charset=ISO-8859-1; format=flowed\\r\\n\"\n\t\t\t\t. \"Content-Transfer-Encoding: 7bit\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$body\\r\\n\"\n\t\t\t\t. \"--$multipartSep\\r\\n\"\n\t\t\t\t. \"Content-Type: text/csv\\r\\n\"\n\t\t\t\t. \"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t. \"Content-Disposition: attachment; filename=\\\"Website-Report-Age-Information\" . date(\"F-j-Y\") . \".csv\\\"\\r\\n\"\n\t\t\t\t. \"\\r\\n\"\n\t\t\t\t. \"$attachment\\r\\n\"\n\t\t\t\t. \"--$multipartSep--\";\n\n\t\t\t// Send the email, return the result\n\n\t\t\treturn @mail($to, $subject, $body, implode(\"\\r\\n\", $headers)); \n\n\t\t}", "function _webform_csv_data_email($data) {\r\n return empty($data['value']['0']) ? '' : $data['value']['0'];\r\n}", "function ravis_newsletter_add_email()\n{\n\tglobal $wpdb;\n\t$user_email = $_POST['email'];\n\t$result = array();\n\n\t// filter the variable\n\tif (filter_var($user_email, FILTER_VALIDATE_EMAIL))\n\t{\n\t\t$table_name = $wpdb->prefix .'ravis_newsletter';\n\t\t$check_query = $wpdb->get_results(\n\t\t\t\t\t\t\t$wpdb->prepare(\"\n\t\t\t\t\t\t\t\tSELECT id FROM $table_name\n\t\t\t\t\t\t\t\tWHERE email = %s\n\t\t\t\t\t\t\t\t\",\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t$user_email\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\tif($check_query)\n\t\t{\n\t\t\t$result['message'] = esc_html__( \"You have already subscribed.\", 'pinar');\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$wpdb->insert( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'email' => $user_email,\n\t\t\t\t),\n\t\t\t\tarray('%s')\n\t\t\t);\n\t\t\tif($wpdb->insert_id)\n\t\t\t{\n\t\t\t\t$result['message'] = esc_html__( \"Thanks for your subscription.\", 'pinar');\t\t\t\n\n\t\t\t\t/**\n\t\t\t\t * Create the emails csv file\n\t\t\t\t */\n\t\t\t\t$email_list = $wpdb->get_results(\"SELECT email FROM $table_name\");\n\t\t\t\tforeach ($email_list as $emails_item) {\n\t\t\t\t\t$new_email_list[] = $emails_item->email;\n\t\t\t\t}\n\t\t\t\t$fp = fopen(PINAR_THEMEROOT.'/newsletter_emails.csv', 'w');\n\t\t\t fputcsv($fp, $new_email_list);\n\t\t\t\tfclose($fp);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$result['message'] = esc_html__( \"Email was not added!\", 'pinar');\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$result['message'] = esc_html__( \"Please add a valid email format\", 'pinar');\n\t}\n\techo json_encode($result);\n\tdie();\n}", "function ravis_notifier_add_email()\n\t{\n\t\tglobal $wpdb;\n\t\t$user_email = $_POST['email'];\n\t\t$result = array();\n\n\t\t// filter the variable\n\t\tif (filter_var($user_email, FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\t$table_name = $wpdb->prefix .'ravis_notifier';\n\t\t\t$check_query = $wpdb->get_results(\n\t\t\t\t\t\t\t\t$wpdb->prepare(\"\n\t\t\t\t\t\t\t\t\tSELECT id FROM $table_name\n\t\t\t\t\t\t\t\t\tWHERE email = %s\n\t\t\t\t\t\t\t\t\t\",\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t$user_email\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\n\t\t\tif($check_query)\n\t\t\t{\n\t\t\t\t$result['message'] = esc_html__( \"You have already subscribed.\", 'pinar');\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$wpdb->insert( \n\t\t\t\t\t$table_name, \n\t\t\t\t\tarray( \n\t\t\t\t\t\t'email' => $user_email,\n\t\t\t\t\t),\n\t\t\t\t\tarray('%s')\n\t\t\t\t);\n\t\t\t\tif($wpdb->insert_id)\n\t\t\t\t{\n\t\t\t\t\t$result['message'] = esc_html__( \"Thanks for your subscription.\", 'pinar');\t\t\t\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Create the emails csv file\n\t\t\t\t\t */\n\t\t\t\t\t$email_list = $wpdb->get_results(\"SELECT email FROM $table_name\");\n\t\t\t\t\tforeach ($email_list as $emails_item) {\n\t\t\t\t\t\t$new_email_list[] = $emails_item->email;\n\t\t\t\t\t}\n\t\t\t\t\t$fp = fopen(PINAR_THEMEROOT.'/notifier_emails.csv', 'w');\n\t\t\t\t fputcsv($fp, $new_email_list);\n\t\t\t\t\tfclose($fp);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$result['message'] = esc_html__( \"Email was not added!\", 'pinar');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result['message'] = esc_html__( \"Please add a valid email format\", 'pinar');\n\t\t}\n\t\techo json_encode($result);\n\t\tdie();\n\t}", "function tableNormalized($country,$fp)\n{\nheader(\"Content-type: text/csv\");\nheader(\"Content-Disposition: attachment; filename=newtable.csv\");\nheader(\"Pragma: no-cache\");\nheader(\"Expires: 0\");\n$str='';\n# get csv data \nwhile($csv_line = fgetcsv($fp,1024))\n{\n \n#data of column where country given\n$variable=$csv_line[1];\n\n#variable convert country and remaining data before use for country and after for remaining data\n$before = columnDivide($variable,$country);\n$after = substr($variable,strlen($before)); \n$str.=\"$csv_line[0],$before,$after,$csv_line[2],$csv_line[3],$csv_line[4]\\n\";\n\n//echo $csv_line[0];\n//echo \" \";\n//echo $before.\" *** \".$after;\n//echo \" \".$csv_line[2] .\" \".$csv_line[3].\" \".$csv_line[4];\n//echo \"</br></br>\";\n \n}#- end of if condition if email in CSV is present in database\n echo $str; \n}", "function send_csv_mail ($csvData, $body, $to = '[email protected]', $subject = 'CSV message', $from = 'thetidegroup.com') {\n $multipartSep = '-----'.md5(time()).'-----';\n\n // Arrays are much more readable\n $headers = array(\n \"From: $from\",\n \"Reply-To: $from\",\n \"Content-Type: multipart/mixed; boundary=\\\"$multipartSep\\\"\"\n );\n\n // Make the attachment\n $attachment = chunk_split(base64_encode(create_csv_string($csvData)));\n\n // Make the body of the message\n $body = \"--$multipartSep\\r\\n\"\n . \"Content-Type: text/plain; charset=ISO-8859-1; format=flowed\\r\\n\"\n . \"Content-Transfer-Encoding: 7bit\\r\\n\"\n . \"\\r\\n\"\n . \"$body\\r\\n\"\n . \"--$multipartSep\\r\\n\"\n . \"Content-Type: text/csv\\r\\n\"\n . \"Content-Transfer-Encoding: base64\\r\\n\"\n . \"Content-Disposition: attachment; filename=\\\"file.csv\\\"\\r\\n\"\n . \"\\r\\n\"\n . \"$attachment\\r\\n\"\n . \"--$multipartSep--\";\n\n // Send the email, return the result\n return @mail($to, $subject, $body, implode(\"\\r\\n\", $headers));\n\n }", "function _webform_table_data_email($data) {\r\n return check_plain(empty($data['value']['0']) ? '' : $data['value']['0']);\r\n}", "public function exportDataAsCSVFormat()\n\t{\n\t\t$emailResult=array();\n\t\t\n\t\t//$record=1;\n\t\t$qry=$this->getAllDetails();\n\t\t\n\t\t\n\t\t// THIS LINE WRITES THE TABLE HEADERS VALUES TO A MULTI-DIMENSIONAL ARRAY\t\n\t\t$emailResult[]=array(\"itemId\",\"title\",\"firstName\",\"lastName\",\"email\",\"countryCode\",\"subscribe\");\n\t\t\n\t\t\n\t\tforeach($qry as $rs)\n\t\t{\n\t\t\t\n\t\t\t$itemId=$rs->getId();\n\t\t\t$title=$rs->getTitle();\n\t\t\t$firstName=$rs->getFirstName();\n\t\t\t$lastName=$rs->getLastName();\n\t\t\t$email=$rs->getEmail();\n\t\t\t$countryCode=$rs->getCountryCode();\n\t\t\t$subscribe=$rs->getSubscribe();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif($subscribe==1){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$excelFileSubscribe='Subscribe';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\t$excelFileSubscribe='Unsubscribe';\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// THIS LINE WRITES THE ROW VALUES OBTAINED TO A MULTI-DIMENSIONAL ARRAY\t\n\t\t\t$emailResult[]=array($itemId,$title,$firstName,$lastName,$email,$countryCode,$excelFileSubscribe);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $emailResult;\n\t\n\t}", "public function csv()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header xml data\n header('Content-Type: application/csv');\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set varibales data\n $results = Utility::array2CSV($this->vars);\n // send\n echo $results;\n }\n }", "private function vaildateMailField($data)\n\t{\n\t\t$error = [];\n\t\t$error_flag = false;\n\n\t\tif ($this->commons->validateText($data['to'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['to'] = 'Email!';\n\t\t}\n\n\t\tif ($this->commons->validateText($data['subject'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['subject'] = 'Subject!';\n\t\t}\n\n\t\tif ($this->commons->validateText($data['message'])) {\n\t\t\t$error_flag = true;\n\t\t\t$error['message'] = 'Message!';\n\t\t}\n\n\t\tif ($error_flag) {\n\t\t\treturn $error;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function csv_export($extConf,$results,$q_data,$ff_data,$temp_file,$only_this_lang,$only_finished,$with_authcode,$feUserFields=array()){\r\n $this->extConf = $extConf;\r\n $this->results = $results;\r\n $this->q_data = $q_data;\r\n $this->ff_data = $ff_data;\r\n $this->temp_file = $temp_file;\r\n\t\t$this->only_this_lang = $only_this_lang;\r\n\t\t$this->only_finished = $only_finished;\r\n\t\t$this->with_authcode = $with_authcode;\r\n\t\t$this->feUserFields = $feUserFields;\r\n \r\n //t3lib_div::devLog('extConf', 'ke_questionnaire Export Mod', 0, $this->extConf);\r\n\t\t//t3lib_div::devLog('with_authcode', 'ke_questionnaire Export Mod', 0, array($this->with_authcode));\r\n }", "function places_email_listing_csv() {\n\n $query = db_select('meeting_places_emails', 'm');\n $query->fields('m', array('name', 'date'));\n\n $results = $query->execute()->fetchAll();\n\n $rows = array();\n $rows[] = array(\n 'name' => 'name',\n 'date' => 'date'\n );\n\n foreach ($results as $row) {\n $rows[] = array(\n 'name' => $row->name,\n 'date' => format_date($row->date, 'custom', 'Y-m-d'),\n );\n }\n\n array_to_CSV($rows);\n\n header(\"Content-type: application/octet-stream\");\n header(\"Content-Disposition: attachment; filename=meeting_place_email.xls\");\n header(\"Pragma: no-cache\");\n header(\"Expires: 0\");\n return;\n}", "public function writeCsv($data)\n {\n \t//create a file\n \t$file_path = WEBROOT_DIR.\"/files/postnotification/\";\n \t$filename = \"twitter_post_notification_\".date(\"Y.m.d\").\".csv\";\n \n \t//check if file exist\n \tif (file_exists($file_path.$filename)) {\n \t\t$fp = fopen($file_path.$filename, 'a'); //get the file object\n \t\tfputcsv($fp, $data); //write the file\n \t} else {\n \t\t$fp = fopen($file_path.$filename, 'a');\n \t\t$head_data = array(\"twitter_id\",\"content\");\n \t\tfputcsv($fp, $head_data);\n \t\tfputcsv($fp, $data);\n \t}\n \tfclose($fp); //close the file\n \treturn true;\n }", "function validateCSVLine($line, $line_number) {\n\t $errors = array();\n\n\t if(!is_array($line)) {\n\t\t array_push($errors,'Invalid line');\t\t\t \n\t }\n\n\t if($line[0] == null || $line[0] == '') {\n\t\t array_push($errors, \"Error in line $line_number: blank email\");\n\t } \n\t return $errors;\n }", "public function traveler_cancelation_mail_send($tourwise_id, $traveler_id_arr){\n $sq_tourwise = mysql_fetch_assoc(mysql_query(\"select * from tourwise_traveler_details where id='$tourwise_id'\"));\n $date = $sq_tourwise['form_date'];\n $yr = explode(\"-\", $date);\n $year =$yr[0];\n $sq_personal_info = mysql_fetch_assoc(mysql_query(\"select * from traveler_personal_info where tourwise_traveler_id='$tourwise_id'\"));\n $sq_tour = mysql_fetch_assoc(mysql_query(\"select * from tour_master where tour_id='$sq_tourwise[tour_id]'\"));\n $sq_tour_group = mysql_fetch_assoc(mysql_query(\"select * from tour_groups where group_id='$sq_tourwise[tour_group_id]'\"));\n\n $sq_traveler = mysql_fetch_assoc(mysql_query(\"select * from travelers_details where traveler_group_id='$sq_tourwise[traveler_group_id]'\"));\n\n $tour_group = date('d-m-Y', strtotime($sq_tour_group['from_date'])).' To '.date('d-m-Y', strtotime($sq_tour_group['to_date']));\n\n $content1 = '';\n\n for($i=0; $i<sizeof($traveler_id_arr); $i++){\n $sq_traveler_info = mysql_fetch_assoc(mysql_query(\"select * from travelers_details where traveler_id='$traveler_id_arr[$i]'\"));\n $content1 .= '\n <tr>\n <td style=\"text-align:left;border: 1px solid #888888;\">'.($i+1).'</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$sq_traveler_info['first_name'].' '.$sq_traveler_info['last_name'].'</td> \n </tr> \n '; \n }\n\n global $mail_em_style, $mail_font_family, $mail_strong_style, $mail_color;\n $content = '\n <tr>\n <table width=\"85%\" cellspacing=\"0\" cellpadding=\"5\" style=\"color: #888888;border: 1px solid #888888;margin: 0px auto;margin-top:20px; min-width: 100%;\" role=\"presentation\">\n <tr>\n <td style=\"text-align:left;border: 1px solid #888888;\">Tour Name</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$sq_tour[tour_name].'</td> \n <tr>\n <td style=\"text-align:left;border: 1px solid #888888;\">Tour Date</td> <td style=\"text-align:left;border: 1px solid #888888;\">'.$tour_group .'</td> \n </tr> \n </tr> \n </table>\n </tr>\n <tr>\n <table width=\"85%\" cellspacing=\"0\" cellpadding=\"5\" style=\"color: #888888;border: 1px solid #888888;margin: 0px auto;margin-top:20px; min-width: 100%;\" role=\"presentation\">\n <tr>\n <th style=\"border: 1px solid #888888;text-align: left;background: #ddd;color: #888888;\">Sr.No</th>\n <th style=\"border: 1px solid #888888;text-align: left;background: #ddd;color: #888888;\">Guest Name\n </th>\n </tr>\n \n '.$content1.'\n \n </table>\n</tr> \n ';\n $subject = 'Tour Cancellation Confirmation ('.get_group_booking_id($tourwise_id,$year).' ,'.$sq_tour['tour_name'].' )';\n global $model;\n $model->app_email_send('26',$sq_traveler['first_name'],$sq_personal_info['email_id'], $content, $subject);\n \n}", "function p_check_security($arr)\n{\n\t//Trim surrounding white space of inputs and lower cases all letters\n\t$arr = p_trim_space($arr); \n\t\n\t//Removes all illegal e-mail characters from 'to' and 'from' inputs (W3 Schools) - consolidate into for loop\n\tif($arr['to']!=NULL)\n\t{\n\t\t$arr['to'] = filter_var($arr['to'], FILTER_SANITIZE_EMAIL);\n\t\tif(!filter_var($arr['to'], FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\tadd_error(\"Invalid To address\");\n\t\t}\t\n\t}\n\t\n\tif($arr['from']!=NULL)\n\t{\n\t\t$arr['from'] = filter_var($arr['from'], FILTER_SANITIZE_EMAIL);\n\t\t\n\t\tif(!filter_var($arr['from'], FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\tadd_error(\"Invalid From address\");\n\t\t}\t\n\t} \n\t\n\t//Check for no newlines added in to, from, subject header fields\n\tforeach ($arr as $ind => &$lfield)\n\t{\n\t\tif ($ind == 'to' || $ind == 'from' || $ind == 'subject')\n\t\t{\n\t\t\tif(preg_match( \"/[\\r\\n]/\", $lfield ))\n\t\t\t{\n\t\t\t\tadd_error(\"Invalid header/s\");\n\t\t\t}\n\t\t}\n\t}\n\t unset($lfield);\n\t \n\t //Optional - Restricts allowed email domains to receive/send email\n\t //Must create a p_recipient.txt with list of allowable domains e.g. gmail, hotmail\n\t /*if($arr['to']!=NULL)\n\t {\n\t\t//Get list of allowable recipient domains\n\t\t$recipient_array = file('p_recipient.txt');\n\t\t\n\t\t//Trim surrounding whitespaces and lowercase letters\n\t\t$recipient_array = p_trim_space($recipient_array);\n\t\t\n\t\t//split to address using @ as delimiter - domain stored in split_to[1]\n\t\t$split_to = explode(\"@\",$arr['to']);\n\t\t\n\t\t//Variable to indicate whether domain was found \n\t\t$domain_found = 0;\n\t\t\n\t\t//Check if the To address domain is in the list of recipients\n\t\tforeach ($recipient_array as $line_num => $line) \n\t\t{\n\t\t\tif($split_to[1]==$line)\n\t\t\t{\n\t\t\t\t$domain_found = 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If to address domain not found in recipient list - print message\n\t\tif(!$domain_found)\n\t\t{\n\t\t\tdie(\"<br>To field domain is not allowed\");\n\t\t}\n\t\t\n\t }*/\n\t \n\t //Fix XSS + HTTP Header Injection for v1.93\n\t foreach ($arr as $ind => &$lfield)\n\t {\n //Removes html tags to prevent javascript injections/tricks in headers\n\t\tif ($ind == 'to' || $ind == 'from' || $ind=='subject')\n\t\t{\n\t\t\t$arr[$ind] = strip_tags($lfield);\n\t\t}\t\t\t\n }\n\t \n\t unset($lfield);\n\t\t\t\n\treturn $arr; \n}", "function GuardarEnCSV()\n {\n //fwrite($miArchivo, \"$usuario->nombre; $usuario->mail; \".date(\"d/m/Y\").\"\\n\");\n //fclose($miArchivo);\n //return $miArchivo;\n \n //$mensaje = null;\n //$retorno = false;\n //if ($this->_validarUsuario()) {//validar usuario\n \n $miArchivo= fopen(\"usuario.csv\", \"a\") or die(\"Imposible abrir el archivo\");//con a agrega datos y con w sobrescribe.\n //fwrite($miArchivo, \"$usuario->nombre, $usuario->mail, \".date(\"d/m/Y\").\"\\n\");\n //fclose($miArchivo);\n //return $miArchivo;\n if (fwrite($miArchivo, \"$this->nombre, $this->mail, \".date(\"d/m/Y\").\"\\n\")) {//fwrite($miarchivo, $mensaje) ---- validar escritura de archivo\n //$retorno = true;\n //echo \"fwrite\";\n return true;\n }else {\n //echo \"fwrite fallido\";\n return false;\n }\n fclose($miarchivo);\n //return $miarchivo;\n }", "function email_validation($toemail) \n\t{ \n\t\t$param_array = func_get_args();\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - PARAMETER LIST : ', $param_array);\n\t\t\t\n\t\tif($_SERVER['REMOTE_ADDR'] != \"127.0.0.1\")\n\t\t{\n\t\t\n\t\tglobal $HTTP_HOST; \n\t\t\n\t\t$result = array(); \n\t\t\n\t\t$result[0]=true; \n\t\t\n\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t/* this regular expression is not allowing some of the domain names like .name etc., so we check for one @ symbol and \n\t\tatleast 1 \".\" symbol in email id.\n\t\tif (!eregi(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$\", $toemail)) \n\t\t{ \t\t\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t\t//remove the name from the email\n\t\t\n\t\t$earr = explode(\"<\", $toemail);\n\t\t\n\t\tif(count($earr) == 2 && strlen(trim($earr[1])) > 0)\n\t\t\t$email = substr(trim($earr[1]),0,-1);\n\t\telse\n\t\t\t$email = trim($earr[0]);\n\t\t\n\t\t$eml_arr = explode(\"@\",$email);\n\t\t$result[0]=false; \n\t\t\n\t\t$result[1]=\"$toemail is not properly formatted\"; \n\t\tif(count($eml_arr) == 2 && strlen(trim($eml_arr[0])) > 0 && strlen(trim($eml_arr[1])) > 0)\n\t\t{\n\t\t\t$domain_arr = explode(\".\",$eml_arr[1]);\n\t\t\tif(count($domain_arr) > 1 && strlen(trim($domain_arr[0])) > 0 && strlen(trim($domain_arr[1])) > 0)\n\t\t\t{\n\t\t\t\t$result[0]=true; \n\t\t\t\t$result[1]=\"$toemail appears to be valid.\"; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif(1==2)\n\t\t{//need not check by communicating to email server...\n\t\t\n\t\tlist ( $username, $domain ) = split (\"@\",$toemail); \n\t\t\n\t\tif (getmxrr($domain, $MXHost)) \n\t\t{\t\t\n\t\t\t$connectaddress = $MXHost[0];\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$connectaddress = $domain;\n\t\t} \n\t\t//echo \"Connect address : \" . $connectaddress . \"<br>\";\n\t\t//echo \"Domain Name : \" . $domain . \"<br>\";\n\t\t$connect = fsockopen ( $connectaddress, 25 ); \n\t\t\n\t\tif ($connect) \n\t\t{\t\t\n\t\t\tif (ereg(\"^220\", $Out = fgets($connect, 1024))) \n\t\t\t{ \n\t\t\t\n\t\t\t fputs ($connect, \"HELO $HTTP_HOST\\r\\n\"); \n\t\t\t \n\t\t\t $out = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t $this->from_email = $GLOBALS['site_config']['admin_email'];\n\t\t\t \n\t\t\t $from = $this->from_email;\n\t\t\t \n\t\t\t fputs ($connect, \"MAIL FROM: <{$from}>\\r\\n\"); \n\t\t\t \n\t\t\t $from = fgets ( $connect, 1024 ); \n\t\t\t \n\t\t\t fputs ($connect, \"RCPT TO: <{$toemail}>\\r\\n\"); \n\t\t\t \n\t\t\t $to = fgets ($connect, 1024); \n\t\t\t \n\t\t\t fputs ($connect, \"QUIT\\r\\n\"); \n\t\t\t \n\t\t\t fclose($connect); \n\t\t\t \n\t\t\t if (!ereg (\"^250\", $from) || !ereg ( \"^250\", $to )) \n\t\t\t { \n\t\t\t \n\t\t\t\t $result[0]=false; \n\t\t\t\t \n\t\t\t\t $result[1]=\"Server rejected address\"; \n\t\t\t\t \n\t\t\t\t} \n\t\t\t} \n\t\t\t\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$result[0] = false; \n\t\t\t\t\n\t\t\t\t$result[1] = \"No response from server\"; \n\t\t\t\t\n\t\t\t } \n\t\t\t \n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$result[0]=false; \n\t\t\t\n\t\t\t$result[1]=\"Can not connect E-Mail server.\"; \n\t\t\t\n\t\t\t//return $result; \n\t\t} \n\t\t\n\t\t}\n\t\t\n\t\tif(!$result[0])\n\t\t{\n\n\t\t\t$ttext = \"\";\n\t\t\t$ttext .= \"<table border=0 cellpadding=3 cellspacing=1 align=center width=90%>\";\n\t\t\t$ttext .= \"<tr align=left><td><strong>Error Message</strong></td><td>\" . $result[1] . \" (\" . $toemail . \")\" . \"</td></tr>\";\n\t\t\t$ttext .= \"</table>\";\n\n\t\t\t$GLOBALS['logger_obj']->error('<br>METHOD email::email_validation() - Return Value : ', $ttext,'email');\n\n\t\t}\n\t}\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD email::email_validation() - Return Value : ', $result);\n\t\treturn $result; \n\t\t\n\t}", "public function csvDownAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * get form entry field list\r\n \t\t */\r\n \t\t$form_field_list = $this->db_model->getFormFieldList($form_id);\r\n \t\t//print_r($form_field_list);\r\n \t\t\r\n \t\tforeach ($form_field_list as $field_row){\r\n \t\t\t\r\n \t\t\tif (preg_match('/^privacy_/', $field_row['name'])) continue;\r\n \t\t\t\r\n \t\t\tif (preg_match('/^name_[0-9]/', $field_row['name'])){\r\n \t\t\t\t\r\n \t\t\t\t$expl = explode(';:;', $field_row['field_labels']);\r\n \t\t\t\t$csv_header[$field_row['name'].'_1'] \t\t= $expl[0].'-'.$expl[2];\r\n \t\t\t\t$csv_header[$field_row['name'].'_2'] \t\t= $expl[0].'-'.$expl[3];\r\n \t\t\t\t$csv_header[$field_row['name'].'_kana_1'] \t= $expl[1].'-'.$expl[4];\r\n \t\t\t\t$csv_header[$field_row['name'].'_kana_2'] \t= $expl[1].'-'.$expl[5];\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (preg_match('/^address_[0-9]/', $field_row['name'])){\r\n \t\t\t\t\r\n \t\t\t\t$expl = explode(';:;', $field_row['field_labels']);\r\n \t\t\t\t$csv_header[$field_row['name'].'_pcode'] \t\t= $expl[0];\r\n \t\t\t\t$csv_header[$field_row['name'].'_pref'] \t\t= $expl[1];\r\n \t\t\t\t$csv_header[$field_row['name'].'_address_a'] \t= $expl[2];\r\n \t\t\t\t$csv_header[$field_row['name'].'_address_b'] \t= $expl[3];\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (preg_match('/^birthday_[0-9]/', $field_row['name'])){\r\n \t\t\t\t\r\n \t\t\t\t$expl = explode(';:;', $field_row['field_labels']);\r\n \t\t\t\t$csv_header[$field_row['name'].'_year_type'] \t= '年式';\r\n \t\t\t\t$csv_header[$field_row['name'].'_year'] \t\t= $field_row['label'].'-'.$expl[0];\r\n \t\t\t\t$csv_header[$field_row['name'].'_month'] \t\t= $field_row['label'].'-'.$expl[1];\r\n \t\t\t\t$csv_header[$field_row['name'].'_day'] \t\t\t= $field_row['label'].'-'.$expl[2];\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (preg_match('/^ynradio_[0-9]/', $field_row['name'])){\r\n \t\t\t\t\r\n \t\t\t\t$yn_expl = explode('|yn|', $field_row['ynfields']);\r\n \t\t\t\t$yn_field_array = array();\r\n \t\t\t\t\r\n \t\t\t\tforeach ($yn_expl as $ym_row){\r\n \t\t\t\t\t\r\n \t\t\t\t\t$yn_row_expl = explode('_', $ym_row);\r\n \t\t\t\t\t\r\n \t\t\t\t\t$yn_field = $yn_row_expl[0].'_'.$yn_row_expl[1];\r\n \t\t\t\t\t\r\n \t\t\t\t\t$yn_field_expl = explode(':=:', $yn_row_expl[2]);\r\n \t\t\t\t\t\r\n \t\t\t\t\t$yn_field_list[$field_row['name'].'_'.$yn_field]['name'] = $field_row['name'].'_'.$yn_field;\r\n \t\t\t\t\t$yn_field_list[$field_row['name'].'_'.$yn_field][$yn_field_expl[0]] = $yn_field_expl[1];\r\n \t\t\t\t\t\r\n\r\n \t\t\t\t\tif (!in_array($yn_field, $yn_field_array)){\r\n \t\t\t\t\t\t$yn_field_array[$yn_row_expl[1]] = $yn_field;\r\n \t\t\t\t\t}else \r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t} // foreach ($yn_expl as $ym_row){\r\n \t\t\t\t\r\n \t\t\t\t/**\r\n\t\t\t \t * sort yes no field as input sequence\r\n\t\t\t \t */\r\n\t\t\t \tksort($yn_field_array);\r\n \t\t\t\t\r\n \t\t\t\t//print_r($yn_expl);\r\n \t\t\t\t//print_r($yn_field_list);\r\n \t\t\t\t//print_r($yn_field_array);\r\n \t\t\t\t\r\n \t\t\t\tif (is_array($yn_field_array)){\r\n \t\t\t\t\t$csv_header[$field_row['name']] = $field_row['label'];\r\n \t\t\t\t\tforeach ($yn_field_array as $yn_field){\r\n \t\t\t\t\t\t$csv_header[$field_row['name'].'_'.$yn_field] = $field_row['label'].'-'.$yn_field_list[$yn_field]['label'];\r\n \t\t\t\t\t}\r\n \t\t\t\t} // if (is_array($yn_field_array)){\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$csv_header[$field_row['name']] = $field_row['label']; \r\n \t\t}\r\n \t\t\r\n \t\t//print_r($csv_header);\r\n \t\t\r\n \t\t/**\r\n \t\t * get mail data list\r\n \t\t */\r\n \t\t$mail_data_list = $this->db_model->getFormMailData($form_id);\r\n \t\t//print_r($mail_data_list[0]);\r\n \t\t//$mail_data_list_t[]=$mail_data_list[0];\r\n \t\t//$mail_data_list_t[]=$mail_data_list[1];\r\n \t\t\r\n \t\t$form_data_list = array();\r\n \t\t\r\n \t\tif (is_array($mail_data_list) && !empty($mail_data_list)){\r\n\t \t\tforeach ($mail_data_list as $mail_data){\r\n\t \t\t\t$tmp_data = array();\r\n\t \t\t\t\t\r\n\t \t\t\tforeach ($csv_header as $header_key=>$header_value){\r\n\t \t\t\t\t\r\n\t \t\t\t\tforeach ($mail_data as $data_key => $data_value){\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\tif (preg_match('/^privacy_/', $data_key)) continue;\r\n\t \t\t\t\t\t\r\n\t\t \t\t\t\t\r\n\t \t\t\t\t\t/**\r\n\t \t\t\t\t\t * for name set\r\n\t \t\t\t\t\t */\r\n\t \t\t\t\t\tif (preg_match('/^name_[0-9]/', $data_key)){\r\n\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t$exp_name_1 = explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t$exp_name_2 = explode(':=:', $expl[1]);\r\n\t\t\t \t\t\t\t$exp_kana_1 = explode(':=:', $expl[2]);\r\n\t\t\t \t\t\t\t$exp_kana_2 = explode(':=:', $expl[3]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_name_1[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_name_1[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_name_2[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_name_2[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_kana_1[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_kana_1[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_kana_2[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_kana_2[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^name_[0-9]/', $header_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for address set\r\n\t\t\t \t\t\t */\r\n\t\t \t\t\t\tif (preg_match('/^address_[0-9]/', $data_key)){\r\n\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$exp_pcode_1\t= explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t$exp_pcode_2\t= explode(':=:', $expl[1]);\r\n\t\t\t \t\t\t\t$exp_pref\t\t= explode(':=:', $expl[2]);\r\n\t\t\t \t\t\t\t$exp_address_a\t= explode(':=:', $expl[3]);\r\n\t\t\t \t\t\t\t$exp_address_b\t= explode(':=:', $expl[4]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == str_replace('_1', '', $exp_pcode_1[0]))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_pcode_1[1].'-'.$exp_pcode_2[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_pref[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_pref[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_address_a[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_address_a[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_address_b[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_address_b[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^address_[0-9]/', $header_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for birthday set\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^birthday_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$exp_year_type\t= explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t$exp_year\t\t= explode(':=:', $expl[1]);\r\n\t\t\t \t\t\t\t$exp_month\t\t= explode(':=:', $expl[2]);\r\n\t\t\t \t\t\t\t$exp_day\t\t= explode(':=:', $expl[3]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_year_type[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $this->data_class->getYearTypeName($exp_year_type[1]);\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_year[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_year[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_month[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_month[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == $exp_day[0])\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_day[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^birthday_[0-9]/', $header_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for mail\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^mail_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t$exp_mail\t= explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == str_replace('_mail', '', $exp_mail[0]))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_mail[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^mail_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for tel number\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^tel_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$exp_tel_1\t= explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t$exp_tel_2\t= explode(':=:', $expl[1]);\r\n\t\t\t \t\t\t\t$exp_tel_3\t= explode(':=:', $expl[2]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == str_replace('_1', '', $exp_tel_1[0]))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_tel_1[1].'-'.$exp_tel_2[1].'-'.$exp_tel_3[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^tel_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for password\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^password_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t$exp_password\t= explode(':=:', $expl[0]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($header_key == str_replace('_pass', '', $exp_password[0]))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $exp_password[1];\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^password_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for yes no fields\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^ynradio_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode('|fd|', $data_value);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tforeach ($expl as $yn_row){\r\n\t\t\t \t\t\t\t\t$yn_row_expl = explode(':=:', $yn_row);\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\t\tif ($header_key == $yn_row_expl[0]){\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t/**\r\n\t\t\t \t\t\t\t\t\t * for yes no label\r\n\t\t\t \t\t\t\t\t\t */\r\n\t\t\t \t\t\t\t\t\tif ($match[0] == $header_key){\r\n\t\t\t \t\t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t\t$value = $this->getYesNoLabel($form_field_list, $data_key, $yn_row_expl[1]);\r\n\t\t\t\t\t\t \t\t\t\t$tmp_data[$header_key] = $value;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tcontinue;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t\t\t} // if ($match[0] == $header_key){\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t/**\r\n\t\t\t \t\t\t\t\t\t * for yes no field's select and radio option \r\n\t\t\t \t\t\t\t\t\t */\r\n\t\t\t \t\t\t\t\t\tif (preg_match('/^ynradio_[0-9]_select_[0-9]/', $yn_row_expl[0], $match) || preg_match('/^ynradio_[0-9]_radio_[0-9]/', $yn_row_expl[0], $match)){\r\n\t\t\t \t\t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\t$expl = explode(':other:', $yn_row_expl[1]);\r\n\t\t\t\t\t\t \t\t\t\t$value = $this->getYesNoOptionValue($yn_field_list, $yn_row_expl[0], $expl[0]);\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tif (!empty($expl[1]))\r\n\t\t\t\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $value.',その他:'.$expl[1];\r\n\t\t\t\t\t\t \t\t\t\telse\r\n\t\t\t\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $value;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tcontinue;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t} // if (preg_match('/^ynradio_[0-9]_select_[0-9]/', $yn_row_expl[0], $match) || preg_match('/^ynradio_[0-9]_radio_[0-9]/', $yn_row_expl[0], $match)){\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t\t\t\t \t\t\t/**\r\n\t\t\t\t\t\t \t\t\t * for yes no field's checkbox option\r\n\t\t\t\t\t\t \t\t\t */\r\n\t\t\t\t\t\t \t\t\tif (preg_match('/^ynradio_[0-9]_checkbox_[0-9]/', $yn_row_expl[0], $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\t$expl = explode(':other:', $yn_row_expl[1]);\r\n\t\t\t\t\t\t \t\t\t\t$option_expl = explode('::', $expl[0]);\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\t$value = array();\r\n\t\t\t\t\t\t \t\t\t\tforeach ($option_expl as $row)\r\n\t\t\t\t\t\t \t\t\t\t\t$value[] = $this->getYesNoOptionValue($yn_field_list, $yn_row_expl[0], $row);\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tif (!empty($expl[1]))\r\n\t\t\t\t\t\t \t\t\t\t\t$tmp_data[$header_key] = join(',', $value).',その他:'.$expl[1];\r\n\t\t\t\t\t\t \t\t\t\telse\r\n\t\t\t\t\t\t \t\t\t\t\t$tmp_data[$header_key] = join(',', $value);\r\n\t\t\t\t\t\t \t\t\t\t\t\r\n\t\t\t\t\t\t \t\t\t\tcontinue;\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t\t \t\t\t} // if (preg_match('/^checkbox_[0-9]/', $data_key)){\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t \t\t\t\t\t\t$tmp_data[$header_key] = $yn_row_expl[1];\r\n\t\t\t \t\t\t\t\t}\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t}\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t} // if (preg_match('/^ynradio_[0-9]/', $header_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for select and radion fields\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^select_[0-9]/', $data_key, $match) || preg_match('/^radio_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode(':other:', $data_value);\r\n\t\t\t \t\t\t\t$value = $this->getOptionValue($form_field_list, $data_key, $expl[0]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($data_key == $header_key ){\r\n\t\t\t \t\t\t\t\tif (!empty($expl[1]))\r\n\t\t\t \t\t\t\t\t\t$tmp_data[$header_key] = $value.',その他:'.$expl[1];\r\n\t\t\t \t\t\t\t\telse\r\n\t\t\t \t\t\t\t\t\t$tmp_data[$header_key] = $value;\r\n\t\t\t \t\t\t\t}\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^select_[0-9]/', $data_key, $match) || preg_match('/^radio_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for checkbox field\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^checkbox_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode(':other:', $data_value);\r\n\t\t\t \t\t\t\t$option_expl = explode('::', $expl[0]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$value = array();\r\n\t\t\t \t\t\t\tforeach ($option_expl as $row)\r\n\t\t\t \t\t\t\t\t$value[] = $this->getOptionValue($form_field_list, $data_key, $row);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($data_key == $header_key ){\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\t\tif (!empty($expl[1]))\r\n\t\t\t \t\t\t\t\t\t$tmp_data[$header_key] = join(',', $value).',その他:'.$expl[1];\r\n\t\t\t \t\t\t\t\telse\r\n\t\t\t \t\t\t\t\t\t$tmp_data[$header_key] = join(',', $value);\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\t}\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^checkbox_[0-9]/', $data_key)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for survey options\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^svid_[0-9]_fid_[0-9]_sid_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$survey_expl = explode('_', $data_key);\r\n\t\t\t \t\t\t\t$survey_id = $survey_expl[1];\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$expl = explode(':other:', $data_value);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\t$value = $this->getSurveyOptionValue($survey_id, $data_key, $expl[0]);\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif (!empty($expl[1]))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $value.',その他:'.$expl[1];\r\n\t\t\t \t\t\t\telse\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = $value;\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^svid_[0-9]_fid_[0-9]_sid_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for image field\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^image_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif (!empty($data_value))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = _HTTP.$GLOBALS['gl_wpcms_Info']['wpcms_path'].'/wpform/file/imageDisplay/image_name/'.$data_value;\r\n\t\t\t \t\t\t\telse \r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = \"\";\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^image_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t/**\r\n\t\t\t \t\t\t * for pdf field\r\n\t\t\t \t\t\t */\r\n\t\t\t \t\t\tif (preg_match('/^pdf_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif ($match[0] != $header_key) continue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t\tif (!empty($data_value))\r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = _HTTP.$GLOBALS['gl_wpcms_Info']['wpcms_path'].'/wpform/file/pdfDisplay/pdf_name/'.$data_value;\r\n\t\t\t \t\t\t\telse \r\n\t\t\t \t\t\t\t\t$tmp_data[$header_key] = \"\";\r\n\t\t\t \t\t\t\t\t\r\n\t\t\t \t\t\t\tcontinue;\r\n\t\t\t \t\t\t\t\r\n\t\t\t \t\t\t} // if (preg_match('/^pdf_[0-9]/', $data_key, $match)){\r\n\t\t\t \t\t\t\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t\t\t\t \t\t\t\r\n\t\t\t \t\t\t\r\n\t \t\t\t\t\tif ($data_key == $header_key ){\r\n\t \t\t\t\t\t\t$tmp_data[$header_key] = $data_value;\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t\t\r\n\t \t\t\t\t} // foreach ($mail_data as $data_key => $data_value){\r\n\t \t\t\t\t\r\n\t \t\t\t} // foreach ($csv_header as $header_key=>$header_value){\r\n\t \t\t\t\r\n\t \t\t\t//$form_data_list[] = $tmp_data;\r\n\t \t\t\t$form_data_list[] = implode(',', $tmp_data);\r\n\t \t\t\t\r\n\t \t\t} // foreach ($mail_data_list as $mail_data){\r\n \t\t\r\n \t\t} // if (is_array($mail_data_list) && !empty($mail_data_list)){\r\n \t\t\r\n \t\t\r\n \t\t//print_r($form_data_list);\r\n \t\t//exit;\r\n \t\t\r\n \t\t/**\r\n \t\t * make csv header text\r\n \t\t */\r\n \t\t$csv_header_txt = mb_convert_encoding(implode(',', $csv_header), \"Shift_JIS\");\r\n \t\t\r\n \t\t/**\r\n \t\t * make csv data\r\n \t\t */\r\n \t\t$csv_data_txt = mb_convert_encoding(implode(\"\\n\", $form_data_list), \"Shift_JIS\");\r\n \t\t\r\n \t\t/**\r\n\t\t * make csv downloadable\r\n\t\t */\r\n\t\theader(\"Cache-Control: public\");\r\n\t\theader(\"Pragma: public\");\r\n\t\t\r\n\t\t$csv_name = \"form_name\"; \r\n\t\t\r\n\t\theader(sprintf(\"Content-disposition: attachment; filename=%s.csv\",$csv_name));\r\n\t\theader(sprintf(\"Content-type: application/octet-stream; name=%s.csv\",$csv_name));\r\n\r\n\t\t/**\r\n\t\t * make csv text\r\n\t\t */\r\n\t\t$csv_txt = $csv_header_txt.\"\\n\".$csv_data_txt;\r\n\t\t\r\n\t\techo $csv_txt;\r\n\t\texit;\r\n \t\t\r\n \t}", "function HAA_saveErrorReport($form_params)\n{\n // Parsed form data.\n $parsed_form_data = HAA_parseFormData($form_params);\n\n if (is_array($parsed_form_data) && $parsed_form_data != false) {\n // Generate Complaint ID.\n $complaint_id = HAA_generateComplaintId();\n if (! $complaint_id) {\n return false;\n }\n\n // Add newly generated unique Complaint ID to $parsed_form_data.\n $parsed_form_data[':complaint_id'] = $complaint_id;\n\n // Insert complaint record.\n $result = HAA_insertComplaintRecord($parsed_form_data);\n\n // If fails to insert record.\n if (! $result) {\n HAA_gotError(\n 'Failed to save the Complaint record.'\n );\n return false;\n }\n\n // Send an email.\n $mail_id = $parsed_form_data[':email'];\n $name = $parsed_form_data[':full_name'];\n $to = array($mail_id => $name);\n $from = array(smtpFromEmail => smtpFromName);\n $subject = 'Hostel-J Complaint Registration';\n $message = 'Dear ' . $name . \",\\n\\n\"\n . \"\\tYour Complaint has been successfully received.\\n\"\n . \"\\tYour Complaint ID is : \" . $parsed_form_data[':complaint_id'] . \"\\n\\n\\n\"\n . \"Regards,\\n\"\n . smtpFromName . \", Hostel-J\\n\"\n . 'Thapar University';\n $mail = HAA_sendMail($subject, $to, $from, $message);\n $mail_notify = ($mail == false) ? ('')\n : ('<p>A confirmation email has also been sent to : <span class=\"blue\"> '\n . $parsed_form_data[':email']\n . '. </span></p>');\n\n // Send an email to help mailing list.\n $to_id = \"[email protected]\";\n $to_name = \"Support Hostel-J\";\n $mail_id = $parsed_form_data[':email'];\n $name = $parsed_form_data[':full_name'];\n $to = array($to_id => $to_name);\n $from = array($mail_id => $name);\n $subject = 'Hostel-J Complaint';\n $message = $parsed_form_data[':complaint_description'];\n $mail = HAA_sendMail($subject, $to, $from, $message);\n\n // Create a success message.\n $success_msg = '<div class=\"report_complaint gray_grad box success\">'\n . '<table>'\n . '<caption><h1>CONGRATULATIONS !</h1></caption>'\n . '</td>'\n . '</tr>'\n . '<tr>'\n . '<td colspan=\"2\">'\n . 'Successfully received the complaint!'\n . '</td>'\n . '</tr>'\n . '<tr>'\n . '<td>'\n . 'This is your Complaint ID : '\n . '</td>'\n . '<td><span class=\"blue\">'\n . $parsed_form_data[':complaint_id'] . '</span><br>'\n . '</td>'\n . '<tr>'\n . '<td colspan=\"2\">'\n . '<strong><center>Thank you.</center></strong><br>'\n . '</td>'\n . '</tr>'\n . '<tr>'\n . '<td colspan=\"2\">'\n . $mail_notify\n . '</td>'\n . '</tr>'\n . '</table>'\n . '</div>';\n $GLOBALS['message'] = $success_msg;\n\n return true;\n } else {\n return false;\n }\n}", "function addUser($v) \r\n{\r\n\tglobal $wpdb;\r\n\r\n //Validate $v\r\n $errors = array();\r\n if(!is_array($v))\r\n {\r\n return array(\"Error processing data, please try again.\");\r\n }\r\n\r\n\t$keys = \"account_id, firstname, lastname, membernumber, email, password\";\r\n\t$vals = \"%d, %s, %s, %s, %s, %s\";\r\n\r\n $sql = $wpdb->prepare( \"INSERT INTO \".CSI_ACCOUNTS_TABLE.\" ($keys) values ($vals);\", \r\n time(), //Use this value as the account id. \r\n $v[\"firstname\"], \r\n $v[\"lastname\"], \r\n $v[\"membernumber\"], \r\n $v[\"username\"], \r\n $v[\"password\"] ); \r\n\r\n //Add the account to the database\r\n $result = $wpdb->query( $sql );\r\n\r\n\t//Send an email with a CSV file (http://stackoverflow.com/questions/5816421/send-csv-file-attached-to-the-email)\r\n\t/*\r\n\t$cr = \"\\n\"; \r\n\t$csvdata = \"\";\r\n $csvdata .= \"First Name\" . ',' . \"Last Name\" . \",\" . \"Member Number\". \",\" . \"E-mail\". \",\" . \"Password\" . $cr;\r\n $csvdata .= $v[\"firstname\"] . ',' . $v[\"lastname\"] . ',' . $v[\"membernumber\"] . ',' . $v[\"username\"] . ',' . $v[\"password\"] . $cr;\r\n\r\n\t$mailer = new PHPMailer();\r\n\r\n\t$mailer->AddAddress( get_option(HS_LOGIN_MEMBERSHIP_EMAIL_NOTIFY ) );\r\n\t//$mailer->AddAddress( \"[email protected]\" );\r\n\t$mailer->From = \"healthsport.com\";\r\n\t$mailer->FromName = \"HealthSPORT Membership Plugin\";\r\n\t$mailer->Subject = \"HealthSPORT Membership Request\";\r\n\t$mailer->Body = \"The attached file contains the information for the account request.\\n\\nThe Data:\\n\\n\".$csvdata;\r\n\r\n\t$mailer->AddStringAttachment( $csvdata, \"new_account.csv\" );\r\n\r\n\tif( !$mailer->Send() )\r\n\t{\r\n\t\t$errors[] = \"Error Sending Notification Email: \". $mailer->ErrorInfo;\r\n\t}\r\n\t*/\r\n\r\n\t//Update Google SpreadSheet\r\n\t$u = \"[email protected]\";\r\n\t$p = \"!!__GOOG_jgd71\";\r\n\r\n\t$ss = new Google_Spreadsheet( $u, $p );\r\n\t$ss->useSpreadsheet( \"Form Test\" );\r\n\r\n\t//$row = array\r\n\t//\t(\r\n\t//\t\t\"First Name\" => $v[\"firstname\"],\r\n\t//\t\t\"Last Name\" => $v[\"lastname\"],\r\n\t//\t\t\"Member Number\" => $v[\"membernumber\"], \r\n\t//\t\t\"Email\" => $v[\"username\"], \r\n\t//\t\t\"Password\" => $v[\"password\"]\r\n\t//\t);\r\n\r\n\t//if( !$ss->addRow($row) )\r\n\t//{\r\n\t//\t$errors[] = \"Error, unable to store spreadsheet data.\";\r\n\t//}\r\n\r\n return $errors;\r\n}", "public function exportToCSVContacts() {\n\t\t$contactDB = new contactDB();\n\t\t$emailsArray = $contactDB->getEmails($this->request->getVariable('id'),0,100000,1,0,$contactDB->contactColumns,PDO::FETCH_ASSOC);\n\t\t$contactGroupsDB = new contactgroupsDB();\n\t\t$contactGroup = $contactGroupsDB->fetchRow(\"id={$this->request->getVariable('id')}\");\n\t\t\n\t\tarray_unshift($emailsArray, $contactDB->contactColumns);\n\n\t\tcsv::getCsvFile(generate::cleanFileName($contactGroup->name.'_'.generate::sqlDatetime()), $emailsArray);\n\t}", "function composeTextFile(){\r\n\tresetErrorMessages();\r\n\tglobal $dataBody, $emailAddress;\r\n\tglobal $writeFileOpenError, $writeFileWritingError;\r\n\r\n\t//now write to text file\r\n\tglobal $thisURL, $filename;\r\n\t$filename\t \t= substr($thisURL, strpos($thisURL, \"/\"));\r\n\t$filename\t.= \"../datasources/savedResults/\";\r\n\tif(isset($_REQUEST[\"filenameBox\"])){ //use name of uploaded file\r\n\t\t$filename\t \t.= check_input($_REQUEST[\"filenameBox\"]);\r\n\t} else { // used to be no choice of file name, now we can specify: this is the fallback\r\n\t\t\t//use beginning of email address (username) plus random number\r\n\t\t$filename\t \t.= substr($emailAddress, 0, strpos($emailAddress, \"@\" ));\r\n\t\t$filename\t \t.= rand();\r\n\t}\r\n\t$filename\t \t.= \".csv\";\r\n\t//strrchr = Find last occurrence of a character in a string\r\n\t$displayFilename = strrchr( $filename, \"/\");\r\n\t$displayFilename = str_replace( \"/\", \"\", $displayFilename);\r\n\r\n\t//echo \"<span class='highlightNumbers'>&nbsp;filename='\" . $filename . \"'; displayFilename='\" . $displayFilename . \"';&nbsp;</span></h2>\";\r\n\r\n\t$writeFileOpenError = str_replace(\"REPLACE_DUMMY_STRING\", $filename, $writeFileOpenError);\r\n\r\n\t$writeFileWritingError = \"<h3 class='alert'>Couldn't write '\" . substr($dataBody, 0, 50) . \"'... to \";\r\n\t$writeFileWritingError .= $displayFilename . \"!</h3>\";\r\n\r\n\t$fileHandle = fopen( $filename, \"wb\" ) or die(\"<h3 class='alert'>\" . $writeFileOpenError . \"</h3>\");\r\n\t$numBytes \t= fwrite( $fileHandle, $dataBody ) or die( \"<h3 class='alert'>\" . $writeFileWritingError . \"</h3>\" );\r\n\tfclose( $fileHandle );\r\n\r\n\t$writeFileSuccessMsg = generateSuccessMessage($displayFilename, $filename);\r\n\t$numKB\t\t\t\t\t\t\t = $numBytes / 1000;\r\n\t$writeFileSuccessMsg = str_replace(\"REPLACE_DUMMY_STRING\", $numKB, $writeFileSuccessMsg);\r\n\techo $writeFileSuccessMsg;\r\n\r\n\treturn $filename;\r\n}", "public function convert_to_email()\n {\n return $this->convert_to_csv();\n }", "private function prepareCsvChecklist()\n\t{\n\t\t$csv = $this->checklist->asCsvArray();\n\n\t\t$csv_file = fopen('php://output', 'w');\n\n\t\tob_start();\n\n\t\tforeach ($csv as $row) {\n\t\t\tfputcsv($csv_file, $row);\n\t\t}\n\n\t\tfclose($csv_file);\n\n\t\treturn ob_get_clean();\n\t}", "function sendemailNotifications($mode) {\n\n $inFileName = \"../minis/emailNot.txt\";\n \n if(!file_exists($inFileName)) {\n \n echo \"<br>&nbsp;&nbsp;&nbsp;no email notification, no file \\\" emailNot.txt \\\"\";\n return; \n }\n \n $inFileName = \"../minis/emailNot.txt\";\n $inFileHandle = fopen($inFileName, 'r') or die(\"can't open file\");\n \n if($inFileHandle == 0) {\n \n echo \"No email notification file emailNot.txt\";\n return;\n }\n\n while(true) {\n \n $lineOne = fgetcsv($inFileHandle, 500, \",\");\n $lineTwo = fgets($inFileHandle, 500);\n \n if(feof($inFileHandle))\n break;\n \n $result = sendMail($lineOne[0], \"[email protected]\", $lineOne[2], $lineTwo);\n \n echo substr($result, 0, 35).\".\";\n \n // echo \"to: \".$lineOne[0].\" subject: \".$lineOne[2].\"<br>\";\n // echo \"message: \".$lineTwo.\"<br><br>\";\n \n }\n unlink($inFileName);\n return;\n}", "function processData($data) {\n\n // include states with list of population\n include 'state-popu.php';\n\n // assign $data in $row var\n $row = $data;\n\n // check each data if set and not null and assign to their variables\n $first = isset($row[0]) ? $row[0] : '';\n $last = isset($row[1]) ? $row[1] : '';\n $email = isset($row[2]) ? $row[2] : '';\n $state = isset($row[3]) ? $row[3] : '';\n\n // get the email domain base on the requirements\n $edomain = '';\n if($email) {\n $edomain = substr(strrchr($email, \"@\"), 1);\n }\n\n // changed the email for export base on the requirements\n // the given data only has a state and Jacksonville belongs to Florida, I just assumed that if state = Florida I will change the export data base on the requirement\n $exportedEmail = $email;\n if($state === 'Florida') {\n $exportedEmail = '[email protected]';\n }\n\n // add class to rows that will be excluded base on state population base on requirements\n $check_pop = '';\n if($state_popu_list[$state] > 10000000) {\n $check_pop = 'js-excluded';\n }\n\n // putting data as arrays for conversion\n $datas = array(\n $first,\n $last,\n $email,\n $state,\n $edomain,\n $exportedEmail,\n $check_pop\n );\n\n return $datas;\n}", "public function export(){\n\t $list_id = $this->uri->segment(3);\n\t $list_name = $this->distributiondata->getinfobyid('title',$list_id); \n\t \t$query = $this->distributionemails->getbyattribute('list_id',$list_id);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\t$header[] = \"Email\";\n\t\t\t\t$header[] = \"Owner\";\n\t\t\t\t$header[] = \"Domains\";\n\t\t\t\t$this->exportxls->addHeader($header);\n\t\t\t\t\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t\n\t\t\t\t\t\t$data_row = array();\n\t\t\t\t\t\t$data_row[] = $row->email;\n\t\t\t\t\t\t$data_row[] = $row->owner;\n\t\t\t\t\t\t$data_row[] = $row->domains;\n\t\t\t\t\t\t$this->exportxls->addRow($data_row);\n\t\t\t\t }\n\t\t\t}\n\t\t\n\t\t$list_name = str_replace(' ','',strtolower($list_name));\n\t\t$this->exportxls->sendFile($list_name.'.xls');\n\t}", "function email($database = \"\"){\n\t\n\t\t$to = '[email protected]';\n\t\t$subject = 'Reports';\n\t\t$semi_rand = md5(time()); \n\t\t$mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\";\n\t\t$headers ='MIME-Version: 1.0'.\"\\r\\n\";\n\t\t$headers .= 'Content-Type: multipart/alternative; boundary='.$mime_boundary. \"\\r\\n\";\n\t\t$headers .='From: \"Webmistress\" <[email protected]>'. \"\\r\\n\";\t\n\t\t\n\t\t$htmlEmail = $this ->build_email_html($database);\n\t\t$txtEmail = $this ->build_email_txt($database);\n\t\t\n\t\t//$this ->cleanVisitorTable($database);\n\t\t\n\t\t$message = \"This is a multi-part message in MIME format.\\r\\n\\r\\n\" .\n\t\t'--'.$mime_boundary.\"\\r\\n\".\n\t\t'Content-Type: text/plain; charset=\"utf-8\"'.\"\\r\\n\".\n\t\t'Content-Transfer-Encoding:7-bit'.\"\\r\\n\\r\\n\".$txtEmail.\"\\r\\n\".\n\t\t\"--{$mime_boundary}\\r\\n\" .\n\t\t\"Content-Type:text/html; charset=\\\"utf-8\\\"\\r\\n\" .\n\t\t\"Content-Transfer-Encoding: 7bit\\r\\n\\r\\n\" .\n\t\t$htmlEmail.\"\\r\\n\";\n\t\t\n\t\tif (mail($to,$subject,$message, $headers)){\n\t\t\t\n\t\t\t$output = 'Email was sent.';\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$output = \"Email wasn't sent.\";\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$filename = 'visitorsEmail.txt';\n\t\t\n\t\ttry {\n\t\t\t$file = fopen('/var/www/websites/redesign2013/logs/'.$filename,'c');\n\t\n\t\t\tif ($file){\n\t\t\t\tfwrite($file, $message);\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tthrow new Exception(\"Couldn't open file.\");\n\t\t\t\t\n\t\t\t}\n\t\n\t\t}catch(Exception $error){\n\t\t\t\n\t\t\techo 'Error: '.$error ->getMessage(),\"\\n\";\n\t\t\tprint_r($error->getTrace());\n\t\t\techo 'Exception Code:'.$error->getCode().\"\\n\";\n\t\t\techo 'Line :'.$error->getLine().' - File:'.$error->getFile().\"\\n\";\n\t\t}\n\t\t\n\t\techo $message;\n\t\t\n\t\treturn $output ;\n\t\t\n\t\t\n\t}", "public function generateCsv()\n\t{\n\t\t$doc = new CsvDocument(array(\"Member Name\",\"Email Address\",\"Alternate Email\"));\n\t\tforeach($this->emailList as $record)\n\t\t{\n\t\t\t$doc->addRow(array(\n\t\t\t\t$record->name,\n\t\t\t\t$record->emailAddress, \n\t\t\t\t$record->alternateEmail\n\t\t\t));\n\t\t}\n\n\t\t$filename = \"svenskaklubben_maillist_\" . date(\"d-m-Y_G-i\");\n\t\theader(\"Content-type: application/csv\");\n\t\theader(\"Content-Disposition: attachment; filename={$filename}.csv\");\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: 0\");\n\n\t\techo $doc->getDocument();\n\t\texit; //premature exit so the templates aren't appended to the document\n\t}", "public function SendCronMail(){\n\n $mail = new PHPMailer(true);\n $fromEmail = Config::get('constants.supportEmailProduction');\n $attach = $this->AdminOrder->courier(true);\n if($attach){\n $handle = fopen (public_path('../data.csv'), \"w+\");\n fclose($handle);\n file_get_contents(public_path('../data.csv'));\n file_put_contents(public_path('../data.csv'),$attach);\n file_put_contents('../couriers/courier-mail-'.date('d-m-Y-h-i-s').'.csv', $attach, FILE_APPEND);\n sleep(20);\n try{\n $mail->isSMTP();\n $mail->CharSet = 'utf-8'; #set it utf-8\n $mail->SMTPAuth = false; #set it true\n /*$mail->SMTPSecure = 'tls';\n $mail->Host = 'smtp.gmail.com'; #gmail has host smtp.gmail.com\n $mail->Port = '587'; #gmail has port 587 . without double quotes\n $mail->Username = '[email protected]'; #your username. actually your email\n $mail->Password = 'Whiz@2016'; # your password. your mail password*/\n $mail->setFrom($fromEmail, 'Support - TSS Clubhire');\n $mail->Subject = 'TSS Clubhire - Courier Order Details '.date('d/m/Y',strtotime('-1 day'));\n $mail->MsgHTML('Dear sir/mam <br /><p>Please find attached The Sweet Spot order details for '.date('d/m/Y',strtotime('-1 day')).'</p>');\n $mail->addAttachment(public_path('../data.csv'));\n $mail->addAddress('[email protected]' ,'Info');\n $mail->addAddress('[email protected]' ,'Luca');\n /*$mail->addAddress('[email protected]' ,'Info');\n $mail->addAddress('[email protected]' ,'Luca');*/\n $mail->addBCC('[email protected]','Prashant');\n $mail->addBCC('[email protected]' ,'Whiz');\n $mail->addBCC('[email protected]','Tss-Clubhire');\n $mail->addBCC('[email protected]','Lukecerra');\n $mail->send();\n }catch(Exception $e){\n dd($e);\n }\n }\n }", "public function csv() {\n //get user id.\n if(!isset($id)){\n $user_id = $this->Session->read('Auth.User.id');\n }\n //Check if user has access\n $conditions = array(\n 'uid'=>$user_id);\n //Test and run\n if ($this->SocialPosts->hasAny($conditions)){\n //Get all records and send them for .csv file\n //Build Query.\n $get = array(\n 'conditions' => array('uid'=>$user_id),\n 'fields'=>array('message','dateposted') \n );\n //Data\n $data = $this->SocialPosts->find('all',$get);\n \n //prepare data\n foreach ($data as $key => $value){\n $rows[] = $value['SocialPosts']['message'];\n $rows[] = $value['SocialPosts']['dateposted'];\n $csv[] = $rows;\n $rows = array();\n }\n //Column names initiate\n //$columns = (array) NULL;\n $columns = array('Message','Date Posted');\n //Run csv download\n CsvDownloadRequest::build($csv, $columns, 'Social_Posts');\n }else{\n $this->Session->setFlash(__('The request could not be processed. Please, try again.'),'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n }", "function mail_un_routine($conn, $email, $un){\n check_email(\"students\",$conn, $email);\n check_email(\"teachers\", $conn, $email);\n check_username(\"students\", $conn, $un);\n check_username(\"teachers\", $conn, $un);\n }", "function export_report()\n {\n // load csv generator library\n $this->load->library('csvgenerator');\n \n // get current session data \n $session_data = $this->session->userdata('logged_in');\n\n // get filter criteria from post input\n $data = array(\n 'risk_register' => $this->input->post('risk_register'),\n 'user_id' => $this->input->post('general_user'),\n 'project_id' => $session_data['report_project_id']\n );\n\n if ($session_data['role_id'] == 8)\n {\n // get assigned risk register and its ID\n $register_row = $this->project_model->getAssignedRiskRegisterName($data['user_id']);\n $assigned_register_id = $register_row->subproject_id;\n $this->csvgenerator->fetch_data( $user_id, $main_category, $risk_level, $risk_register, $assigned_register_id );\n }\n else\n {\n if($this->csvgenerator->fetch_response_data($data))\n {\n redirect('dashboard/report_response/generate'); \n }\n else\n {\n // error\n $this->session->set_flashdata('negative_msg','Sorry. No report or data for the selected data filter!');\n redirect('dashboard/reports/response_project');\n }\n } \n }", "function envoyer_inscription_mail($values)\n{\n\t$mot = $GLOBALS['mot'];\n\t$phrase = $GLOBALS['phrase'];\n\t$val = FALSE;\n\t\n\t$contenu = array(\t$mot['Cabinet'] => $values['Cabinet'],\n\t\t\t\t\t\t$mot['Nom'] => $values['Nom'],\n\t\t\t\t\t\t$mot['Prenom'] => $values['Prenom'],\n\t\t\t\t\t\t$mot['Adresse'] => $values['Adresse'],\n\t\t\t\t\t\t$mot['CP'] => $values['CP'],\n\t\t\t\t\t\t$mot['Ville'] => $values['Ville'],\n\t\t\t\t\t\t$mot['Tel'] => $values['Tel'],\n\t\t\t\t\t\t$mot['Email'] => $values['Email'],\n\t\t\t\t\t\t$mot['Commentaire'] => $values['Commentaire'] );\n\t$contenu_message = corps_email($contenu);\n\t\n\t// Si le message a bien été envoyé, on affiche un message de validation\n\t// et on enregistre le message dans la base de données\n\tif (envoi_email(EMAIL_ADMIN, NOM_SITE, EMAIL, $values['Email'], $phrase['UneNouvelleInscription'], $contenu_message) == TRUE)\n\t{\n\t\tif (ajouter_inscription_db($values) == TRUE)\n\t\t{\n\t\t\t$val = TRUE;\n\t\t}\n\t}\n\treturn $val;\n}", "function membersemail_form_capture()\n{\n global $post,$wpdb;\n if(array_key_exists('membersemail_submit_form', $_POST))\n {\n $to = \"[email protected]\";\n $subject = \"Data Inputs - me\";\n $body = '';\n\n $body .= 'Name: '. $_POST['full_name'] . '<br />';\n $body .= 'Email: '. $_POST['email_address'] . '<br />';\n\n wp_mail($to,$subject, $body);\n\n remove_filter('wp_mail_content_type','set_html_content_type');\n\n /* add the submission to the database using the table we created */\n $insertData = $wpdb->get_results(\" INSERT INTO \".$wpdb->prefix.\"form_submit (data) VALUES ('\".$body.\"')\");\n\n\n }\n\n}", "function doCSV($fileName) \n{\n $csvFile = file($fileName);\n $data = [];\n foreach ($csvFile as $line) {\n $data[] = str_getcsv($line);\n\n $pieces = explode(\";\", $data[0][3]);\n foreach ($pieces as $piece) {\n $url = encryptCSVLine($data[0][0], $data[0][1], $data[0][2], $piece);\n // get email from $data[0][4] and send it to the user\n print $url;\n print \"\\n\";\n }\n }\n}", "function process_mail(){\n\t\t$result = true;\n\t\t\n\t\tif(count($this->to) < 1){\n\t\t\treturn 'No email address.';\n\t\t}\n\t\t$this->set_eol();\n\t\t$this->get_message_type();\n\t\t$this->set_boundary();\n\t\t$headers = $this->set_headers();\n\t\t$body = $this->set_body();\n\t\t\n\t\tif($body == ''){\n\t\t\treturn 'Empty email body.';\n\t\t}\n\t\t$result = $this->send_mail($headers, $body);\n\t\treturn $result;\n\t}", "function mailer($emailto, $data, $function){\n\n\t$emailfrom = $GLOBALS['email_templates'][$function]['emailfrom'];\n\t$emailto = $emailto;\n\n\tif(filter_var($emailto, FILTER_VALIDATE_EMAIL)){\n\t\t// retrieve parameters\n\t\t$subject = $GLOBALS['email_templates'][$function]['subject'];\n\t\t$message = $GLOBALS['email_templates'][$function]['message'];\n\t\tforeach($data as $key => $value){\n\t\t\t$subject = str_replace('%'.$key.'%', $value, $subject);\n\t\t\t$message = str_replace('%'.$key.'%', $value, $message);\n\t\t}\n\t\t$message = '<html><body>'.$message.'</body></html>';\n\t\t$response = sendEmail($subject, $message, $emailto, $emailfrom, 0);\n\n\t\tif($response == true){\n\t\t\t$response = $GLOBALS['email_templates'][$function]['success'];\n\t\t} else {\n\t\t\t$response = $GLOBALS['email_templates'][$function]['fail'];\n\t\t}\n\t} else {\n\t\t$response = $GLOBALS['email_templates'][$function]['fail'];\n\t}\n}", "function bulkmail() {\n\nprint <<<EOF\n<form method=\"post\" NAME=\"mainform\" enctype=\"multipart/form-data\">\n<center>\n<TABLE height=100><TBODY><TR><TD></TD></TR></TBODY></TABLE>\n<TABLE bgcolor=\"#4B9BE0\" cellSpacing=1 cellPadding=1 width=\"70%\" border=0>\n<TBODY>\n <tr bgcolor=\"#4B9BE0\"> \n<TD background=\"../images/headerbg.gif\" colSpan=2>\n<center><FONT color=#ffffff><B>G&#7917;i Mail cho th&#224;nh vi&#234;n</B></center></font></TD></TR>\n</TBODY></TABLE>\n\n<TABLE bgcolor=\"#6bAAef\" cellSpacing=1 cellPadding=2 width=\"70%\" border=0>\n<TBODY>\n\n<tr bgcolor=#F5F5F5>\n <td width=\"80\" ><font size=\"2\"><b>&nbsp;&nbsp;Ti&#234;u &#273;&#7873;:</b></font></td>\n <td> \n <input onkeyup=initTyper(this); name=\"tieude\" type=\"text\" id=\"news_tieude\" size=\"75\" ></td>\n</tr>\n\n\n<tr bgcolor=#F5F5F5>\n <td><font size=\"2\"><b>&nbsp;&nbsp;N&#7897;i dung:</b></font></td>\n\t<td> \n<textarea onkeyup=initTyper(this); name=\"noidung\" rows=\"17\" class=\"adminTextbox\" cols=\"75\"></textarea> \n\t</td>\n</tr>\n\n</TBODY></TABLE>\n<TABLE><TBODY><TR><TD></TD></TR></TBODY></TABLE>\n<TABLE align=\"center\" bgcolor=\"#4B9BE0\" cellSpacing=1 cellPadding=2 width=\"70%\" border=0>\n<TBODY>\n<tr bgcolor=#F5F5F5>\n <td><font size=\"2\"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></font></td><TD>\n<input class=butstyle style=\"FONT-WEIGHT: bold; CURSOR: hand; COLOR: #ffffff; BACKGROUND-COLOR: #4B9BE0\" name=\"submit\" type=\"submit\" id=\"submit\" value=\"Send Mail\"><br></td>\n </tr>\n\n</form>\n</TBODY></TABLE>\nEOF;\n\n}", "function Email_Proforma($Src,$SrcId,$to,$mescat,$subject,$helper='',$helperdata=0,$logfile='',&$attachments=0,$embeded=0,$from='') {\n global $PLANYEAR,$YEARDATA,$FESTSYS;\n if (strlen($mescat) < 30) {\n $Prof = Get_Email_Proforma($mescat);\n $Mess = ($Prof? $Prof['Body'] : \"Unknown message $mescat \");\n } else {\n $Mess = $mescat;\n }\n Parse_Proforma($Mess,$helper,$helperdata,0,$attachments,$embeded);\n \n NewSendEmail($Src,$SrcId,$to,$subject,$Mess,$attachments,$embeded,$from);\n \n if ($logfile) {\n $logf = fopen(\"LogFiles/$logfile.txt\",\"a\");\n fwrite($logf,\"\\n\\nEmail to : \" . Pretty_Print_To($to) . \"Subject:$subject\\n\");\n if ($from) fwrite($logf,\"From: \" . Pretty_Print_To($from));\n fwrite($logf,\"\\n\\n$Mess\");\n\n if ($attachments) {\n if (is_array($attachments)) {\n foreach ($attachments as $i=>$att) fwrite($logf,\" With attachment: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With attachment $attachments\\n\\n\"); \n }\n }\n if ($embeded) {\n if (is_array($embeded)) {\n foreach ($embeded as $i=>$att) fwrite($logf,\" With embeded: \" . $att[0] . \" as \" . $att[1] . \"\\n\\n\");\n } else {\n fwrite($logf,\" With embeded $embeded\\n\\n\"); \n }\n }\n\n fclose($logf);\n }\n return $Mess;\n}", "function myExceptionHandling($_exception, $_logfile)\n{\n if ($_SERVER['SERVER_NAME'] != \"localhost\")\n {\n //sumiere boodschap\n $_msg=\"Er heeft zich een fout voorgedaan, probeer opnieuw.<br>Als de fout blijft voorkomen neem dan contact op met de web-master.<br>Alvast onze verontschuldigingen\"; \n }\n else\n {\n //complete error message\n $_msg = \"<hr>\n <strong>Exception</strong><br><br>\n Foutmelding: \".$_exception->getMessage().\"<br><br>\n Bestand: \".$_exception->getFile().\"<br>\n Regel: \".$_exception->getLine().\"<br><hr>\";\n }\n \n// exception log\n $_error_log[1] = strftime(\"%d-%m-%Y %H:%M:%S\");\n $_error_log[2] = $_exception->getMessage();\n $_error_log[3] = $_exception->getFile();\n $_error_log[4] = $_exception->getLine();\n \n $_pointer = fopen(\"$_logfile\",\"ab\");\n fputcsv($_pointer, $_error_log);\n fclose($_pointer);\n \n// user-message \n return $_msg;\n \n}", "function daily_mailman_check() {\n\t$f3=$this->f3;\n\t$mailinglist =\tnew Mailinglist($this->db);\n\t$members =\tnew Member($this->db);\n\t$uselog=$f3->get('uselog');\n\t$email_logger = new MyLog('email.log');\n\t$email_logger->write('in daily_mailman_check ',$uselog);\t\n\t/* Get all mailing lists */\n\t$count=$mailinglist->count();\n\t$mailinglist->load();\n\t$i=0;\n\twhile ( !$mailinglist->dry() ) { // gets dry when we passed the last record\n\t// get the mailing list and then the details \n\t$thediff=$this->compare_missingmembers($mailinglist);\n\n//\t$email_logger->write('in daily_mailman_check thelist = '.var_export($mailinglist,true),$uselog);\n\t// Now get the membership contents appropriate to the particular list \t\n\t//\t$email_logger->write('in daily_mailman_check unique selection = '.$mailinglist->memberquery,$uselog);\n\n\t// return an array of 2 arrays, 1st is the email list in alpha order, 2nd is the names corresponding TO THEM\n\t// only interested in the 1st, the email list really \n//\t$email_logger->write('in daily_mailman_check thememberslist = '.var_export($thememberslist,true),$uselog);\n\t//$email_logger->write('in daily_mailman_check missing from mailing list '.$mailinglist->memberselection .' vs '.$mailinglist->memberquery . ' = '.var_export($thediff,true),$uselog);\n\n\n\t$email_logger->write('in daily_mailman_check missing from mailing list '.$mailinglist->memberselection .' vs '.$mailinglist->memberquery . ' = '.var_export($thediff,true),$uselog);\n\t$i++;\n\t$mailinglist->next();\n\t}\n\t\n}", "function getCSVSimple2(){\r\n\t\tglobal $LANG;\r\n\r\n\t\t$csvdata = '';\r\n\t\t$csvheader = '';\r\n\t\t$delimeter = $this->extConf['CSV_qualifier'];\r\n\t\t$parter = $delimeter.$this->extConf['CSV_parter'].$delimeter;\r\n\t\t\r\n\t\t$csvheader = $this->q_data['header'].\"\\n\\n\";\r\n\t\t\r\n\t\t$fill_array = $this->createFillArray();\r\n\t\t//t3lib_div::devLog('getCSVSimple2 fill_array', 'ke_questionnaire Export Mod', 0, $fill_array);\r\n\t\t\r\n\t\tif (is_array($fill_array)){\r\n\t\t\t$headline = array();\r\n\t\t\tforeach ($fill_array as $question_id => $values){\r\n\t\t\t\tif ($values['title'] != ''){\r\n\t\t\t\t\tswitch ($values['type']){\r\n\t\t\t\t\t\tcase 'authcode':\r\n\t\t\t\t\t\tcase 'fe_user': \r\n\t\t\t\t\t\tcase 'start_tstamp':\r\n\t\t\t\t\t\tcase 'finished_tstamp':\r\n\t\t\t\t\t\t\t\t$headline[] = $values['title'];\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'closed':\r\n\t\t\t\t\t\t\tforeach ($values['answers'] as $a_id => $a_values){\r\n\t\t\t\t\t\t\t\t$answer = t3lib_BEfunc::getRecord('tx_kequestionnaire_answers',$a_id);\r\n\t\t\t\t\t\t\t\t$headline[] = $values['title'].'_'.$answer['title'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t/*case 'dd_pictures':\r\n\t\t\t\t\t\t\tforeach ($values['answers'] as $a_id => $a_values){\r\n\t\t\t\t\t\t\t\t$answer = t3lib_BEfunc::getRecord('tx_kequestionnaire_answers',$a_id);\r\n\t\t\t\t\t\t\t\t$headline[] = $values['title'].'_'.$answer['title'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;*/\r\n\t\t\t\t\t\tcase 'matrix':\r\n\t\t\t\t\t\t\t//t3lib_div::devLog('getCSVSimple matrix', 'ke_questionnaire Export Mod', 0, $values);\r\n\t\t\t\t\t\t\tif (is_array($values['subquestions'])){\r\n\t\t\t\t\t\t\t\tforeach ($values['subquestions'] as $sub_id => $sub_values){\r\n\t\t\t\t\t\t\t\t\t$subl = t3lib_BEfunc::getRecord('tx_kequestionnaire_subquestions',$sub_id);\r\n\t\t\t\t\t\t\t\t\tforeach ($sub_values['columns'] as $col_id => $col_values){\r\n\t\t\t\t\t\t\t\t\t\t$col = t3lib_BEfunc::getRecord('tx_kequestionnaire_columns',$col_id);\r\n\t\t\t\t\t\t\t\t\t\t$headline[] = $values['title'].'_'.$subl['title'].'_'.$col['title'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'semantic':\r\n\t\t\t\t\t\t\tforeach ($values['subquestions'] as $sub_id => $sub_values){\r\n\t\t\t\t\t\t\t\t$subl = t3lib_BEfunc::getRecord('tx_kequestionnaire_sublines',$sub_id);\r\n\t\t\t\t\t\t\t\tforeach ($sub_values['columns'] as $col_id => $col_values){\r\n\t\t\t\t\t\t\t\t\t$col = t3lib_BEfunc::getRecord('tx_kequestionnaire_columns',$col_id);\r\n\t\t\t\t\t\t\t\t\t$headline[] = $values['title'].'_'.$subl['title'].'_'.$col['title'];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'demographic':\r\n\t\t\t\t\t\t\t//t3lib_div::devLog('getCSVSimple2 demo', 'ke_questionnaire Export Mod', 0, $values);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t// Hook to make other types available for export\r\n\t\t\t\t\t\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_questionnaire']['CSVExportType2Headline'])){\r\n\t\t\t\t\t\t\t\tforeach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_questionnaire']['CSVExportType2Headline'] as $_classRef){\r\n\t\t\t\t\t\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\r\n\t\t\t\t\t\t\t\t\t$headline = $_procObj->CSVExportType2Headline($headline,$values);\r\n //t3lib_div::devLog('headline', 'ke_questionnaire Export Mod', 0, $headline);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n $headline[] = $values['title']; \r\n }\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$csvheader .= $delimeter.implode($parter,$headline).$delimeter.\"\\n\";\r\n\t\tif (is_array($this->results)){\r\n\t\t\t$file_path = PATH_site.'typo3temp/'.$this->temp_file;\r\n\t\t\t$store_file = fopen($file_path,'r');\r\n\t\t\t//t3lib_div::devLog('simple 2 results', 'ke_questionnaire Export Mod', 0, $this->results);\r\n\t\t\tforeach ($this->results as $r_id => $r_values){\r\n\t\t\t\t$read_line = fgets($store_file);\r\n\t\t\t\t$csvdata .= $read_line;\r\n\t\t\t\t//t3lib_div::devLog('simple 2 '.$r_id, 'ke_questionnaire Export Mod', 0, array($read_line,$r_values));\r\n\t\t\t}\r\n\t\t\tfclose($store_file);\r\n\t\t}\r\n\t\r\n\t\treturn $csvheader.$csvdata;\r\n\t}", "public function uploadCommissionReport($commission_report){\n $file = $commission_report['tmp_name']; \n $handle = fopen($file,\"r\"); \n \n // unset the first line like this \n fgets($handle);\n\n // created loop here\n while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) {\n \n date_default_timezone_set('America/New_York');\n $purchase_date = date('Y-m-d', strtotime($data[4])); \n $date_activated = date('Y-m-d', strtotime($data[7])); \n \n if($data[0]!=\"\"){ \n $query = \"INSERT INTO \".RDAMS_COMMISIONS.\" (dealer_id,\n dealer_name,\n sim_no,\n market,\n purchase_date,\n sold_price,\n plan,\n date_activated,\n pin_no,\n item_description,\n item_name,\n category_name,\n commision,\n commision_type) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t\t\t\n $stmt = $this->db->prepare($query);\n\n $stmt->bindParam(1, $data[0]); \n $stmt->bindParam(2, $data[1]);\n $stmt->bindParam(3, $data[2]);\n $stmt->bindParam(4, $data[3]);\n $stmt->bindParam(5, $purchase_date); \n $stmt->bindParam(6, $data[5]);\n $stmt->bindParam(7, $data[6]);\n $stmt->bindParam(8, $date_activated);\n $stmt->bindParam(9, $data[8]);\n $stmt->bindParam(10, $data[9]);\n $stmt->bindParam(11, $data[10]);\n $stmt->bindParam(12, $data[11]);\n $stmt->bindParam(13, $data[12]);\n $stmt->bindParam(14, $data[13]);\n\n $stmt->execute();\n } \n }\n fclose($handle);\n return $success=1;\n }", "function import_subscriptions($delim=',', $encl=false, $sample='', $def_format='TEXT', $header_row=true) {\n\tglobal $db;\n\t$email_elem=false; $format_elem=false;\t$error = '';\n\n\t$sample_arr = explode(' ',trim($sample)); $elems = count($sample_arr);\n $email_elem = array_search('email',$sample_arr);\n $format_elem = array_search('format',$sample_arr);\n\n\tif($email_elem===false) { $error = 'Upload failed: No email element specified.'; }\n $import_file = $_FILES['subscriber_import_file']['tmp_name'];\n $import_error = $_FILES['subscriber_import_file']['error'];\n\t\n\t\n\tif(!empty($import_error)) {\n\t switch($import_error) {\n\t\t\tcase 1:\n\t\t\tcase 2: $error = 'Upload failed: The uploaded file exceeds the upload_max_filesize<br/>'; break;\n\t\t\tcase 3: $error = 'Upload failed: The uploaded file was only partially uploaded.<br/>'; break;\n\t\t\tcase 4: $error = 'Upload failed: No file was uploaded.<br/>'; break;\n\t\t\tcase 6: $error = 'Upload failed: Missing a temporary folder.<br/>'; break;\n\t\t\tdefault: $error = 'Upload failed: Unknown error uploading file.<br />'; break;\n\t\t}\n\t} elseif(empty($import_file)) { $error = 'Upload failed: File not found/uploaded.<br />'; return false;}\n\n if(empty($error)) {\n\t\tswitch($delim) {\n\t\t\tcase '\\n' : $delim=\"\\n\"; break;\n\t\t\tcase '\\t' : $delim=\"\\t\"; break;\n\t\t\tcase '\\a' : $delim=\"\\a\"; break;\n\t\t\tcase ' ' : case '' : $delim=\"\\t\"; break;\n\t\t}\n\t\t\n\t\t$row = 1; $imported=0;\n\t\t$handle = fopen($import_file, \"r\");\n\t\tzen_set_time_limit(600);\n\t\tfor($row=1;(($data = fgetcsv($handle, 10000, $delim)) !== FALSE);$row++) {\n\t\t\tif((count($data)==1) && (strlen($data[0])<3)) { /* empty row */ }\n\t\t\telseif($header_row && $row==1) { }\n\t\t\telse {\n\t\t\t\t$ea = (empty($data[$email_elem]) ? '' : $data[$email_elem]);\n\t\t\t\t$ef = (!empty($data[$format_elem]) && in_array(strtoupper($data[$format_elem]),array('HTML','TEXT'))) ? strtoupper($data[$format_elem]) : $def_format;\n\t\t\t\tif(!empty($ea)) {\n\t\t\t\t\t$db->Execute(\"REPLACE INTO \" . TABLE_SUBSCRIBERS . \n\t\t\t\t\t\t\t\t\t\t\t \" ( email_address, email_format, confirmed, subscribed_date ) VALUES ( '{$ea}', '{$ef}', '1', NOW() )\");\n\t\t\t\t\t$imported++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($handle);\n\t}\n\treturn array($imported, $error);\n}", "function mme_display_form() {\n\tif( isset($_POST['send']) ) {\n\t\t$emailstring = $_POST['emails'];\n\t\t$emails = explode( ',', $emailstring );\n\t\t//print_r($emails);\n\t\tforeach($emails as $email){\n\t\t\t$iserror = mme_checkemail( $email );\n\t\t}\n\t\t\tif($iserror) {\n\t\t\tmme_addemail( $emailstring );\n\t\t\tmme_success_notice();\n\t\t}\n\t}\n\t?>\n\t<form method=\"POST\" name=\"mailform\" action=\"#\">\n\t\t<style>\n\t\t\tdiv{\n\t\t\t\tmargin-left:15px;\n\t\t\t\tmargin-top: 10px;\n\t\t\t}\n\t\t\t\n\t\t\tdiv#metavalue{\n \t\t\twidth : 50%;\n \n\t\t\t}\n\t\t</style>\n\t\t<div>Enter the Email address</div>\n\t\t<div><input type = \"text\" id =\"metavalue\" name=\"emails\" /></div>\n\t\t<div class = \"buttons\">\n\t\t\t<input type=\"submit\" value=\"Save\" name=\"send\" class=\"button button-primary button-large\"/>\n\t\t\t<input type=\"reset\" value=\"Cancel\" name=\"cancel\"/>\n\t\t</div>\n\n\t</form>\n\t<?php\n}", "function elegantSendEmail() {\n $to = $_POST['datastring']['newEmailForm'][0][0];\n $title = $_POST['datastring']['newEmailForm'][0][1];\n $messagetext = nl2br(rawurldecode($_POST['datastring']['newEmailForm'][0][2])); \n $properties = $_POST['datastring']['properties'];\n\n //Send the email and get a report back\n $sent = elegeantSend($to,$messagetext,$properties);\n \n //Save the email as a post and get a report back\n $saved = elegantSave($title,$to,$messagetext,$properties);\n\n //echo 'Email Status:'.$sent.'<br>Save Status:'.$saved;\n \n //Terminate and provide a response. \n wp_die(); \n}", "function print_report_csv($header, $data, $title='Report', $delim='comma'){\n global $DB, $CFG;\n\n require_once($CFG->libdir . '/csvlib.class.php');\n\n $csvexporter = new csv_export_writer($delim);\n\n $tt = getdate(time());\n\n $strftimedatetime = get_string(\"strftimedatetime\");\n\n $newfilename = preg_replace(\"/[^A-Za-z0-9_]/\",\"\", $title);\n\n $csvexporter->set_filename('TT_'.$newfilename, '.csv');\n $title = array($title,'Generated: '.userdate(time(), $strftimedatetime));\n\n $csvexporter->add_data($title);\n $csvexporter->add_data($header);\n\n if (sizeof($data) == 0) {\n return true;\n }\n\n foreach ($data as $row) {\n $csvexporter->add_data($row);\n }\n\n $csvexporter->download_file();\n\n return true;\n}", "function send_emails() {\n $settings = new Settings();\n $mail_companies = $settings->get_mailto_companies();\n $failed_list_mails = array();\n $mail_reader = new EmailReader(dirname(__FILE__) . '/mails', $this->user_information);\n foreach ($this->cookie_list as $item) {\n if (!$item->has_email()) {\n \t$failed_list_mails[] = $item;\n }\n else {\n $template = $mail_reader->get_companies_mail($item, $mail_companies);\n if (!$this->mail_to($item, $template, $mail_companies)) {\n $failed_list_mails[] = $item;\n }\n\t }\n }\n $this->update_amounts_used($this->cookie_list);\n\n\n $attachments = array();\n\n $failed_list_letters = array();\n foreach ($this->cookie_list as $item) {\n if (!$item->has_address()) {\n $failed_list_letters[] = $item;\n }\n else {\n $letter_generator = new LetterGenerator($this->user_information);\n $pdf = $letter_generator->generate_letter_string($item);\n if ($pdf) {\n \t$folder_writer = new FolderHandler();\n \t$file = $folder_writer->store_file($pdf, \"pdf\");\n \tif ($file) {\n \t\t$attachments[] = $file;\n \t}\n \telse {\n \t\t$failed_list_letters[] = $item;\n \t}\n }\n else {\n $failed_list_letters[] = $item;\n }\n }\n }\n\n\n\n return $this->send_confirmation_mail($attachments, $failed_list_mails, array_diff($this->cookie_list,\n $failed_list_mails), $failed_list_letters, array_diff($this->cookie_list, $failed_list_letters),\n $mail_companies);\n }", "public function sendReportCheckin()\n { // $sended = $this->TBLTSendMail\n // ->exists([\n // 'Date' => date(\"Y-m-d\"),\n // 'Result' => 'success'\n // ]);\n\n // if($sended) { exit; }\n\n $alert = $this->TBLMItem->find()\n ->where([\n 'Code' => 'alert_time',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail1 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_1',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail2 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_2',\n 'Value IS NOT NULL'\n ])\n ->first();\n \n $allow = false;\n if (isset($alert['Value']) && (isset($mail1['Value']) || isset($mail2['Value']))) {\n if ($alert['Value'] == date(\"H:i\")) {\n $allow = true;\n } \n }\n\n // debug\n // $allow = true;\n\n if ($allow) {\n // set_time_limit(0);\n // ini_set(\"memory_limit\", \"-1\");\n // $builder = $this->viewBuilder();\n // // configure as needed\n // $builder->setLayout(false);\n // $builder->setTemplate('/Element/Pdf/ExportResultCheckin');\n // $builder->setHelpers(['Html']);\n // create a view instance\n\n\n $data[\"checked_in\"] = $this->TBLTTimeCard->find()\n ->contain(['TBLMStaff'])\n ->where([\n 'Date' => date(\"Y-m-d\"),\n // 'TimeIn <=' => $alert\n ])\n ->order(['TimeIn' => 'ASC'])\n ->toArray();\n\n $data[\"not_come\"] = $this->TBLMStaff->find()\n ->where([\n \"StaffID NOT IN (SELECT StaffID FROM tblTTimeCard WHERE Date ='\" . date(\"Y-m-d\") . \"')\",\n \"Position LIKE '%Leader%'\",\n \"FlagDelete = 0\"\n ])\n ->order(['StaffID' => 'ASC'])\n ->toArray();\n\n // echo '<pre>';\n // var_dump($data);\n // echo '</pre>';\n // exit;\n\n\n\n // $view = $builder->build(compact('data'));\n // $content = $view->render();\n\n // $dompdf = new Dompdf(array('enable_font_subsetting' => true));\n // $dompdf->loadHtml(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), \"UTF-8\");\n // $dompdf->set_option('defaultFont', 'Times-Roman');\n\n // // (Optional) Setup the paper size and orientation\n // $dompdf->setPaper('A4');\n\n // // Render the HTML as PDF\n // $dompdf->render();\n\n // /* save file */\n // $path = WWW_ROOT . \"files/PdfResultCheckin\";\n // if (!file_exists($path)) {\n // mkdir($path);\n // }\n\n // $fileNameExport = \"ASM SYSTEM \" . date(\"Ymd\") . \" (\" . date(\"D\") . \") \" . date(\"Hi\") . \".pdf\";\n // $output = $path . \"/\" . $fileNameExport;\n\n // $file = $dompdf->output();\n // file_put_contents($output, $file);\n\n // debug\n // exit;\n\n $result_sended = self::__sendFileToMail($data, $mail1['Value'], $mail2['Value']);\n // mails receipt\n $mails_receipt = \"\";\n if ($mail1['Value']) {\n $mails_receipt .= $mail1['Value'];\n }\n\n if ($mail2['Value']) {\n $mails_receipt .= \", \" . $mail2['Value'];\n }\n // result\n $result = \"\";\n if(isset($result_sended['success']) && $result_sended['success'] == 1){\n $result = \"success\";\n } else {\n $result = \"fail\";\n }\n\n // ==> SAVE RESULT TO DB\n $sended = TableRegistry::getTableLocator()->get('TBLTSendMail')->newEntity();\n $sended->Date = date(\"Y-m-d\");\n $sended->Time = date(\"H:i\");\n $sended->ToEmail = $mails_receipt;\n $sended->FileSend = '';\n $sended->Result = $result;\n TableRegistry::getTableLocator()->get('TBLTSendMail')->save($sended);\n\n // ==> WRITE LOG\n $content = \n \"Date: \".date(\"Y-m-d\") . \"\\n\" .\n \"Time: \".date(\"H:i\") . \"\\n\" . \n \"To emails: \" . $mails_receipt .\"\\n\".\n \"Filename attachment: \".'' . \"\\n\" .\n \"Result: \".$result . \"\\n \\n\";\n Log::info($content, ['scope' => ['SENDMAIL']]);\n }\n exit;\n }", "function SendResults($results,$to,$a_values)\n{\n global $SPECIAL_VALUES;\n\n\t$b_got_filter = (isset($SPECIAL_VALUES[\"filter\"]) && !empty($SPECIAL_VALUES[\"filter\"]));\n\t\t//\n\t\t// special case: if there is only one non-special value and no\n\t\t// filter, then format it as an email\n\t\t//\n\tif (count($a_values) == 1 && !$b_got_filter)\n\t{\n\t\t\t//\n\t\t\t// create a new results value\n\t\t\t//\n\t\t$results = \"\";\n\t\tforeach ($a_values as $s_value)\n\t\t{\n\t\t\t\t//\n\t\t\t\t// replace carriage return/linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// replace lone linefeeds with <br>\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\n\",'<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// remove lone carriage returns\n\t\t\t\t//\n\t\t\t$s_value = str_replace(\"\\r\",\"\",$s_value);\n\t\t\t\t//\n\t\t\t\t// replace all control chars with <br>\n\t\t\t\t//\n\t\t\t$s_value = preg_replace('/[[:cntrl:]]+/','<br>',$s_value);\n\t\t\t\t//\n\t\t\t\t// strip HTML\n\t\t\t\t//\n\t\t\t$s_value = StripHTML($s_value,BODY_LF);\n\t\t\t$results .= $s_value;\n\t\t}\n\t}\n\telse\n\t{\n\t\t\t//\n\t\t\t// write some standard mail headers - if we're using capcode, these\n\t\t\t// headers are not used, but they are nice to have as clear text anyway\n\t\t\t//\n\t\t$res_hdr = \"To: $to\".BODY_LF;\n\t\t$res_hdr .= \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\".BODY_LF;\n\t\t$res_hdr .= BODY_LF;\n\t\t$res_hdr .= \"--START--\".BODY_LF;\t\t// signals the beginning of the text to encode\n\n\t\t\t//\n\t\t\t// put the realname and the email address at the top of the results\n\t\t\t//\n\t\t$results = \"realname: \".$SPECIAL_VALUES[\"realname\"].BODY_LF.$results;\n\t\t$results = \"email: \".$SPECIAL_VALUES[\"email\"].BODY_LF.$results;\n\n\t\t\t//\n\t\t\t// prepend the header to the results\n\t\t\t//\n\t\t$results = $res_hdr.$results;\n\n\t\t\t//\n\t\t\t// if there is a filter required, filter the data first\n\t\t\t//\n\t\tif ($b_got_filter)\n\t\t\t$results = Filter($SPECIAL_VALUES[\"filter\"],$results);\n\t}\n\t\t//\n\t\t// append the environment variables report\n\t\t//\n\tif (isset($SPECIAL_VALUES[\"env_report\"]))\n\t{\n\t\t$results .= BODY_LF.\"==================================\".BODY_LF;\n\t\t$results .= BODY_LF.GetEnvVars(explode(\",\",$SPECIAL_VALUES[\"env_report\"]),BODY_LF);\n\t}\n\t\t//\n\t\t// create the From address as the mail header\n\t\t//\n\t$headers = \"From: \".$SPECIAL_VALUES[\"email\"].\" (\".$SPECIAL_VALUES[\"realname\"].\")\";\n\t\t//\n\t\t// send the mail - assumes the to addresses have already been checked\n\t\t//\n return (SendCheckedMail($to,$SPECIAL_VALUES[\"subject\"],$results,$headers));\n}", "public function getExport(){\n\n $Model = new \\EmailNewsletter\\model\\Email;\n\n $result = $Model\n ->select('email')\n ->order('created_on DESC')\n ->data();\n\n $csv = '';\n\n while($row = $result->fetch()){\n $csv .= \"{$row['email']}\\n\";\n }//while\n\n $path = ENACT_STORAGE . 'email-newsletter-dump.csv';\n\n file_put_contents(ENACT_STORAGE . 'email-newsletter-dump.csv', $csv);\n\n if(!is_file($path)){\n $back = enact_cpSlug('email-newsletter/');\n $this->html(\"<h1>Sorry, the email newsletter export doesn't exist</h1><a href='{$back}'>Go back</a>\");\n }//if\n\n $this->download($path);\n\n }", "function validate_visit_data($visit_data ) {\n\textract($visit_data);\n\t$err = array();\n\n\t// name: min 2 chars length\n\tif (empty($name )) {\n\t\t$err[] = 'Name is required.';\n\t}\telse if (mb_strlen($name ) < 1 ) {\n\t\t$err[] = 'Name must be at least 1 character long.';\n\t}\n\t\n\t// start_date: valid date. either integer timestamp (unix time in \n\t// milliseconds) or parseable date string.\n\tif (!isset($start_date )) {\n\t\t$err[] = 'Start date is required.';\n\t} else if (!is_numeric($start_date )) {\n\t\t$start_date = strtotime($start_date);\n\t\tif ($start_date === false ) {\n\t\t\t$err[] = \"Start date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$start_date /= 1000;\n\t}\n\n\t// end_date: valid date. either integer timestamp (unix time in\n\t// milliseconds) or parseable date string.\n\tif (!isset($end_date )) {\n\t\t$err[] = 'End date is required';\n\t} else if (!is_numeric($end_date )) {\n\t\t$end_date = strtotime($end_date);\n\t\tif ($end_date === false ) {\n\t\t\t$err[] = \"End date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$end_date /= 1000;\n\t}\n\n\t// sanity check: start date is BEFORE end date!\n\tif ($start_date && $end_date && ($end_date < $start_date)) {\n\t\t$err[] = 'End date must be >= start date';\n\t}\n\n\t// receivers: comma-separated list of axis usernames\n\tif (empty($receivers )) {\n\t\t$err[] = 'Receivers is required.';\n\t} else {\n\t\t$db = db_connect();\n\n\t\t$rs = $receivers;\n\t\tif (!is_array($receivers )) {\n\t\t\t$rs = explode(',', $receivers);\n\t\t}\n\n\t\t$receivers = array();\n\t\tforeach ($rs as $r ) {\n\t\t\t$r = trim($r);\n\n\t\t\t$sql = sprintf(\"SELECT * FROM info \".\n\t\t\t\t\"WHERE uname='%s' LIMIT 1\",\n\t\t\t\t$db->real_escape_string($r ));\n\n\t\t\tif ($result = $db->query($sql )) {\n\t\t\t\t$rec = $result->fetch_assoc();\n\t\t\t\tif (!$rec ) {\n\t\t\t\t\t$err[] = \"Receiver username \".\n\t\t\t\t\t\t\"not found: $r\";\n\t\t\t\t} else {\n\t\t\t\t\t$receivers[] = $rec;\n\t\t\t\t}\n\t\t\t\t$result->free();\n\t\t\t} else {\n\t\t\t\t$err[] = \"Internal error\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif (empty($picture )) {\n\t\t$err[] = 'Picture is required.';\n\t}\n\t\n\tif ($err ) {\n\t\tthrow new Http_error(400, implode(\"\\n\", $err ));\n\t}\n\n\treturn array(\n\t\t'name' => $name,\n\t\t// company is not required\n\t\t'company' => @$_POST['company'],\n\t\t'parking' => $parking,\n\t\t'start_date' => $start_date,\n\t\t'end_date' => $end_date,\n\t\t'receivers' => $receivers,\n\t\t'picture' => $picture,\n\t);\n}", "public function check(){\n\t\t\t//Inform the user that the file is being checked for validity\n\t\t\techo \"-->Checking for file validity.<br/>\";\n\t\t\t$allowed_extensions = array('csv','CSV');\t//Array containing valid csv extensions\t\n\t\t\t$csv_filename\t= $this->csv_file['name'];\t//Variable containing the name of the file\n\t\t\t$csv_size \t= $this->csv_file['size'];\t//Variable containing the size of the file\n\t\t\t$csv_extension \t= explode(\".\",$csv_filename);\t//Variable containing the extension of the file\n\t\t\t$max_file_size = 20; //MB\t\t\t//Variable containing the maximum allowed file size\n\t\t\t//Check if the file was posted, if it's less than 20MB, and if it has an allowed CSV extension\n\t\t\tif(empty($this->csv_file) || $csv_size > (20 * MB) || !in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t//If the combined check fails\t\n\t\t\t\t$errors = \"\";\t//We create an error variable\n\t\t\t\tif(empty($this->csv_file)){\n\t\t\t\t\t//We check that a file was indeed selected for upload, and if not we append an error message\n\t\t\t\t\t//to the errors variable detailing the problem\n\t\t\t\t\t$errors .= \"Please make sure you select a CSV file for upload before attempting to upload.<br/>\";\n\t\t\t\t}\n\t\t\t\tif($csv_size > (20 * MB)){\n\t\t\t\t\t//We then check that the file is within the 20MB upload limit, and it it is not we append \n\t\t\t\t\t//a message detailing the problem to the error variable.\n\t\t\t\t\t$errors .= \"The maximum allowed filesize is \" . $max_file_size . \"MB, please select a smaller file.</br>\";\n\t\t\t\t}\n\t\t\t\tif(!in_array($csv_extension[1], $allowed_extensions)){\n\t\t\t\t\t//We then check that the file's extension is contained in the allowed extensions array\n\t\t\t\t\t//And if it is not, we advice the user that the extension is invalid and display the \n\t\t\t\t\t//allowed extensions for reference.\n\t\t\t\t\t$errors .= \"The file you are trying to upload has the extension '.\" . $csv_extension[1] . \"'.\";\n\t\t\t\t\t$errors .= \"The allowed extensions are:<br/>\";\n\t\t\t\t\tforeach($allowed_extensions as $ext){\n\t\t\t\t\t\t$errors .= \"<font color='orange'>.\" . $ext . \"</font><br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Then we display the combined error messages.\n\t\t\t\techo $errors;\n\t\t\t\t//And return false to indicate the file is invalid\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//If the file passes all the checks, we inform the user that the file is a valid one\n\t\t\t\techo \"-->File is valid.<br/>\";\n\t\t\t\t//And return true to indicate the file is a valid one\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}", "public function _ruleExportCustomerCommence($data)\n\t{\n\t\tif (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Export_Customers)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$keystore = Interspire_KeyStore::instance();\n\n\t\t// find a unique export id to use\n\t\tdo {\n\t\t\t$id = md5(uniqid('',true));\n\t\t} while ($keystore->exists('email:rule_export:id:' . $id));\n\t\t$keystore->set('email:rule_export:id:' . $id, $id);\n\n\t\t$prefix = 'email:rule_export:' . $id;\n\n\t\tif (!isset($data['exportSearch'])) {\n\t\t\t$data['exportSearch'] = array();\n\t\t}\n\n\t\t$keystore->set($prefix . ':started', time());\n\t\t$keystore->set($prefix . ':abort', 0);\n\t\t$keystore->set($prefix . ':skip', 0);\n\t\t$keystore->set($prefix . ':type', $data['exportType']);\n\t\t$keystore->set($prefix . ':rule', $data['exportRule']);\n\t\t$keystore->set($prefix . ':search', ISC_JSON::encode($data['exportSearch']));\n\t\t$keystore->set($prefix . ':success_count', 0);\n\t\t$keystore->set($prefix . ':error_count', 0);\n\t\t$keystore->set($prefix . ':doubleoptin', $data['exportDoubleOptin']);\n\t\t$keystore->set($prefix . ':updateexisting', $data['exportUpdateExisting']);\n\n\t\t// so we can send an email later, or diagnose troublesome users\n\t\t$user = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUser();\n\t\t$keystore->set($prefix . ':owner:id', $user['pk_userid']);\n\t\t$keystore->set($prefix . ':owner:username', $user['username']);\n\t\t$keystore->set($prefix . ':owner:email', $user['useremail']);\n\n\t\t$jobData = array(\n\t\t\t'id' => $id,\n\t\t);\n\n\t\t$json = array(\n\t\t\t'success' => (bool)Interspire_TaskManager::createTask('emailintegration', 'Job_EmailIntegration_RuleExport', $jobData),\n\t\t\t'id' => $id,\n\t\t);\n\n\t\tif (isset($data['return']) && $data['return']) {\n\t\t\treturn $json;\n\t\t}\n\n\t\t// @codeCoverageIgnoreStart\n\t\tISC_JSON::output($json);\n\t\t// @codeCoverageIgnoreEnd\n\t}", "function makeRecList($rawRecList,$messageType) {\r\n\tglobal $set, $rxEmailX, $rxPhone;\r\n\r\n\t$recArray = array();\r\n\t$rawRecArray = explode(';',$rawRecList);\r\n\tforeach ($rawRecArray as $recipient) { //create full recipient list\r\n\t\t$recipient = trim($recipient);\r\n\t\tif (preg_match('~^\\[(.+)\\]$~',$recipient,$matches)) { //file list name\r\n\t\t\t$listName = $matches[1].(strpos($matches[1],'.') ? '' : '.txt');\r\n\t\t\tif (file_exists(\"./reciplists/{$listName}\")) { //recipients list\r\n\t\t\t\t$fileRecArray = file(\"./reciplists/{$listName}\", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); // recipients from file\r\n\t\t\t\tforeach ($fileRecArray as $recipient) { //add recipients from file\r\n\t\t\t\t\t$recArray[] = trim($recipient);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$recArray[] = $recipient;\r\n\t\t}\r\n\t}\r\n\tarray_walk($recArray,function(&$v,$k) use($rxPhone) {if (preg_match($rxPhone,rtrim($v,'$'))) $v = str_replace(array(' ','-','/','(',')'),'',$v);}); //strip phone numbers\r\n\r\n\t//now $recArray contains email addresses, phone numbers and user names\r\n\r\n\t$destArr = array();\r\n//echo \"TEST - recArray: \".implode(' - ',$recArray).\"<br>\"; //TEST\r\n\tswitch ($messageType) {\r\n\tcase 'eml': //make eml recipient list\r\n\t\tforeach ($recArray as $recipient) {\r\n\t\t\tif (strpos($recipient,'@',1)) { //email address\r\n\t\t\t\t$destArr[] = rtrim($recipient,'$');\r\n\t\t\t} elseif (ctype_digit(trim($recipient,'+$'))) { //mob. number\r\n\t\t\t\tif (substr($recipient,-1) != '$') { //find matching mail address\r\n\t\t\t\t\t$stH = stPrep(\"SELECT `email` FROM `users` WHERE `phone` LIKE ? limit 1\");\r\n\t\t\t\t\tstExec($stH,array('%'.ltrim($recipient,'+0')));\r\n\t\t\t\t\t$row = $stH->fetch(PDO::FETCH_NUM);\r\n\t\t\t\t\tif ($row != false) {\r\n\t\t\t\t\t\t$destArr[] = $row[0];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlogMessage('luxcal',2,\"Send email. Phone number: {$recipient} - No matching email address found in the database.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} elseif (preg_match(\"~^[\\w\\-.\\s\\u00C0-\\u017F]{2,}$~u\",$recipient)) { //username\r\n\t\t\t\t$stH = stPrep(\"SELECT `email` FROM `users` WHERE `name` = ?\");\r\n\t\t\t\tstExec($stH,array($recipient));\r\n\t\t\t\t$row = $stH->fetch(PDO::FETCH_NUM);\r\n\t\t\t\tif ($row != false) {\r\n\t\t\t\t\t$destArr[] = $row[0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlogMessage('luxcal',2,\"Send email. User: {$recipient} - No matching email address found in the database.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n//echo \"TEST - destArr: \".implode(' - ',$destArr); //TEST\r\n\t\tbreak;\r\n\tcase 'sms': //make sms recipient list\r\n\t\tforeach ($recArray as $recipient) {\r\n\t\t\tif (strpos($recipient,'@',1)) { //email address\r\n\t\t\t\tif (substr($recipient,-1) != '$') { //find matching phone number\r\n\t\t\t\t\t$stH = stPrep(\"SELECT `phone` FROM `users` WHERE `email` = ? limit 1\");\r\n\t\t\t\t\tstExec($stH,array($recipient));\r\n\t\t\t\t\t$row = $stH->fetch(PDO::FETCH_NUM);\r\n\t\t\t\t\tif ($row != false and !empty($row[0])) { //phone number found\r\n\t\t\t\t\t\t$destArr[] = $row[0];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlogMessage('luxcal',2,\"Send SMS. Email address: {$recipient} - No matching phone number found in the database.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} elseif (ctype_digit(trim($recipient,'+$'))) { //mob. number\r\n\t\t\t\t$destArr[] = rtrim($recipient,'$');\r\n\t\t\t} elseif (preg_match(\"~^[\\w\\-.\\s\\u00C0-\\u017F]{2,}$~u\",$recipient)) { //username\r\n\t\t\t\t$stH = stPrep(\"SELECT `phone` FROM `users` WHERE `name` = ?\");\r\n\t\t\t\tstExec($stH,array($recipient));\r\n\t\t\t\t$row = $stH->fetch(PDO::FETCH_NUM);\r\n\t\t\t\tif ($row != false and !empty($row[0])) { //phone number found\r\n\t\t\t\t\t$destArr[] = $row[0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlogMessage('luxcal',2,\"Send SMS. User: {$recipient} - No matching phone number found in the database.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_walk($destArr,function(&$recipient,$k) use($set) { //pre-process mobile numbers\r\n\t\t\t\tif ($set['smsCountry'] and !preg_match('~^(\\+|00)~',$recipient)) $recipient = '+'.$set['smsCountry'].ltrim($recipient,'0'); //add country code\r\n\t\t\t\tif (!$set['cCodePrefix']) $recipient = preg_replace('~^(\\+|00)~','',$recipient); //remove prefix + or 00\r\n\t\t\t\t$recipient = str_replace('#',$recipient,$set['smsCarrier']);\r\n\t\t\t});\r\n//echo \"TEST - destArr: \".implode(' - ',$destArr); //TEST\r\n\t\tbreak;\r\n\tcase 'wap': //make WhatsApp recipient list\r\n\t\treturn false; //for future use\r\n\t\tbreak;\r\n\tdefault:\r\n\t\treturn false; //no valid message type\r\n\t}\r\n\treturn array_unique($destArr);\r\n}", "public function filterValidEmailsProvider() {}", "public function exportSubscribers(){\n\n\t\t// Get all records\n\t\t$list = model('NewsletterSubscriberModel')->adminGetForExport();\n\n\t\t// Generate CSV data\n\t\t$counter = 1;\n\t\t$csv = 'Nr;Naam;Email;Ingeschreven;Blacklisted';\n\t\tforeach($list as &$row){\n\t\t\t$csv .= \"\\n\" . implode(';', array(\n\t\t\t\t$counter++,\n\t\t\t\tstr_replace(';', ' ', $row['name']),\n\t\t\t\tstr_replace(';', ' ', $row['email']),\n\t\t\t\tdate('d/m/Y', strtotime($row['created'])),\n\t\t\t\t$row['blacklisted']\n\t\t\t));\n\t\t}\n\t\tunset($row);\n\n\t\t// Output data\n\t\theader('Pragma: public');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Cache-Control: private', false);\n\t\theader('Content-Type: text/csv');\n\t\theader('Content-Disposition: attachment; filename=\"inschrijvingen.csv\"');\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Content-Length: '.strlen($csv));\n\t\texit($csv);\n\t}", "public function mailtest()\n {\n echo getAreaId(4147);\n return false;\n echo decrypt('q+fX19fNg7zez84=');\n echo \"</br/>\" . decrypt('q+fX19fNg7zez86U');\n return false;\n $tmrw = date('Y-m-d', strtotime(' +1 day'));\n $startdate = date('Y-m-d', strtotime(' -2 day'));\n $enddate = date('Y-m-d', strtotime(' +2 day'));\n $data = array();\n $query = $this->db->query(\"SELECT\n LIC.end_date as expiry ,\n AD.name as contectperson ,\n ORG.Id as orgid,\n ORG.Name as orgname ,\n ORG.PhoneNumber as orgno,\n ORG.Email as orgemail,\n ORG.Country as orgcountry,\n (select count(id) from EmployeeMaster as EMP where EMP.OrganizationId=ORG.Id) as orgemp ,\n AD.username as uname,\n AD.password as pass\n FROM admin_login AD , Organization ORG , licence_ubiattendance LIC WHERE LIC.OrganizationId=ORG.Id AND AD.OrganizationId=ORG.Id AND LIC.end_date BETWEEN '$startdate' AND '$enddate' ORDER BY LIC.end_date \");\n foreach ($query->result() as $row) {\n $data1 = array();\n $data1['expiry'] = $row->expiry;\n $data1['contectperson'] = $row->contectperson;\n $data1['orgid'] = $row->orgid;\n $data1['orgname'] = $row->orgname;\n $data1['orgno'] = $row->orgno;\n $data1['orgemail'] = $row->orgemail;\n $data1['orgcountry'] = $row->orgcountry;\n $data1['orgemp'] = $row->orgemp;\n $data1['uname'] = $row->uname;\n $data1['pass'] = decrypt($row->pass);\n $data[] = $data1;\n }\n //print_r($data); return;\n $list = '';\n for ($i = 0; $i < count($data); $i++) {\n $list .= '<tr><td>' . ($i + 1) . '.</td><td>' . date('d-m-Y', strtotime($data[$i]['expiry'])) . '</td><td>' . (($data[$i]['orgid']) * ($data[$i]['orgid']) + 99) . '</td><td>' . $data[$i]['orgname'] . '</td><td>' . $data[$i]['contectperson'] . '</td><td>' . $data[$i]['orgno'] . '</td><td>' . $data[$i]['orgemail'] . '</td><td>' . $data[$i]['orgemp'] . '</td><td>' . getCountryById1($data[$i]['orgcountry']) . '</td><tr/>';\n \n if ($data[$i]['expiry'] == $tmrw) {\n $to = $data[$i]['orgemail'];\n $subject = $data[$i]['contectperson'] . \", your Premium Plan expires tomorrow!\";\n $message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n\n <title>ubiAttendance</title>\n <style type=\"text/css\">\n body {\n margin-left: 0px;\n margin-top: 0px;\n margin-right: 0px;\n margin-bottom: 0px;\n -webkit-text-size-adjust:none; -ms-text-size-adjust:none;\n background: white;\n } \n\n table{border-collapse: collapse;} \n .icon-row{\n border-bottom: 2px solid #00aad4;\n\n }\n\n .icons{\n padding: 50px;\n }\n .icons img{\n width:100px;\n height: auto;\n }\n\n </style></head>\n\n <body>\n <table width=\"650\" align=\"center\" style=\"background-color: white;\">\n <tr>\n <td><img src=\"https://ubiattendance.ubihrm.com/mailers/banner.png\"></td>\n </tr>\n <tr>\n <td align=\"left\">\n <p style=\"font-family: Arial;font-size: 18px;padding: 10px;\">\n Hello ' . $data[$i]['contectperson'] . ',<br><br>\n\n We hope you are enjoying the free trial of ubiAttendance!<br><br> \n\n The Trial period will be over in just less than 24 hours. By now, you are more than likely feeling one of these two ways:<br><br> \n\n \n\n HAPPY! - Subscribe to the ubiAttendance Software - <a target=\"_blank\" href=\"https://ubiattendance.ubihrm.com/\">Login to My Plan</a><br><br>\n\n NEED MORE TIME? - <a style=\"color: black;\" href=\"mailto:[email protected]?subject=Extend%20My%20Free%20Trial\">Extend your trial further by writing back to us</a><br><br>\n\n \n\n Looking forward to make <b>ubiAttendance</b> work for you!<br><br>\n\n Regards,<br>\n\n Team ubiAttendance \n \n </p>\n \n </td>\n </tr>\n <tr>\n <td align=\"center\">\n <p style=\"text-align: center;font-size: 16px;font-family: Arial\">You can <a style=\"color: black;\" href=\"mailto:[email protected]?subject=Unsubscribe&body=Hello%0A%0APlease%20unsubscribe%20me%20from%20the%20mailing%20list%0A%0AThanks\">unsubscribe</a> from this email or change your email \n <br>notifications</p>\n </td>\n </tr>\n </table>\n <table width=\"650\" align=\"center\"> \n <tr>\n <td>\n <p style=\"text-align: center; font-size: 12px; font-family:Arial\">\n This email was sent by <a style=\"\" href=\"mailto:[email protected]\">[email protected]</a> to ' . $data[$i]['orgemail'] . '\n Not interested? <a style=\"color: black;\" href=\"mailto:[email protected]?subject=Unsubscribe&body=Hello%0A%0APlease%20unsubscribe%20me%20from%20the%20mailing%20list%0A%0AThanks\">Unsubscribe</a><br>\n <p style=\"color: grey;text-align: center;font-size: 12px;\">Ubitech Solutions Private Limited | S-553, Greater Kailash Part II, New Delhi, 110048</p>\n\n </p>\n </td>\n </tr>\n </table>\n\n </body>\n </html>';\n \n // Always set content-type when sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n // More headers\n $headers .= 'From: <[email protected]>' . \"\\r\\n\";\n //$headers .= 'Cc: [email protected]' . \"\\r\\n\";\n // sendEmail_new($to,$subject,$message,$headers);\n //-- sendEmail_new('[email protected]', \"Mail Via SMTP\", $message, $headers);\n echo 'Mail done';\n // sendEmail_new('[email protected]',$subject,$message,$headers);\n break;\n } //if ends here\n } // loop ends here\n \n \n return false;\n /*\n $to = \"[email protected]\";\n $subject = \"Expiry mailer\";\n $message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n \n <title>ubiAttendance</title>\n <style type=\"text/css\">\n body {\n margin-left: 0px;\n margin-top: 0px;\n margin-right: 0px;\n margin-bottom: 0px;\n -webkit-text-size-adjust:none; -ms-text-size-adjust:none;\n background: white;\n } \n \n table{border-collapse: collapse;} \n .icon-row{\n border-bottom: 2px solid #00aad4;\n \n }\n \n .icons{\n padding: 50px;\n }\n .icons img{\n width:100px;\n height: auto;\n }\n \n </style></head>\n \n <body>\n <table width=\"650\" align=\"center\" style=\"border: 3px solid #e3e6e7;\">\n <tr>\n <td><img src=\"https://ubiattendance.ubihrm.com/mailers/banner.png\"></td>\n </tr>\n <tr>\n <td align=\"left\">\n <p style=\"font-family: Arial;font-size: 20px;padding: 10px;\">\n Hello [Customer Name]*,<br><br>\n \n We hope you are enjoying the free trial of ubiAttendance!<br><br> \n \n The Trial period will be over in just less than 24 hours. By now, you are more than likely feeling one of these two ways:<br><br> \n \n \n \n HAPPY! Subscribe to the ubiAttendance Software - <a target=\"_blank\" href=\"https://ubiattendance.ubihrm.com/\">Login to My Plan</a><br><br>\n \n ID - [registered email id]*<br><br>\n \n Password - [password]*<br><br>\n \n \n \n NEED MORE TIME? <a style=\"color: black;\" href=\"mailto:[email protected]?subject=Extend%20My%20Free%20Trial\">Extend your trial further by writing back to me</a><br><br>\n \n \n \n Looking forward to make <b>ubiAttendance</b> work for you!<br><br>\n \n Regards,<br><br>\n \n Team ubiAttendance \n \n </p>\n \n </td>\n </tr>\n </table>\n \n </body>\n </html>';\n \n // Always set content-type when sending HTML email\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\n // More headers\n $headers .= 'From: <[email protected]>' . \"\\r\\n\";\n //$headers .= 'Cc: [email protected]' . \"\\r\\n\";\n sendEmail_new($to,$subject,$message,$headers);*/\n }", "public function writeTwitterCsv($data)\n {\n \t//create a file\n \t$file_path = WEBROOT_DIR.\"/files/assignmentReminder/\";\n \t$filename = \"twitter_reminder_notification_\".date(\"Y.m.d\").\".csv\";\n \n \t//check if file exist\n \tif (file_exists($file_path.$filename)) {\n \t\t$fp = fopen($file_path.$filename, 'a'); //get the file object\n \t\tfputcsv($fp, $data); //write the file\n \t} else {\n \t\t$fp = fopen($file_path.$filename, 'a');\n \t\t$head_data = array(\"id\", \"twitter_id\", \"content\");\n \t\tfputcsv($fp, $head_data);\n \t\tfputcsv($fp, $data);\n \t}\n \tfclose($fp); //close the file\n \treturn true;\n }", "function validadres($MailAdres){\r\n$prereturn = true;\r\n// then we check the length. if is is less then 5 chars long. the adres has to be invalid\r\nif (strlen($MailAdres) < 5){$prereturn = false;}\r\n\r\n// we split the email ares in 2 parts, we 'break' the adres at the @ sign\r\n$partsNumber = split(\"@\",$MailAdres);\r\n// if there aren't 2 parts after the adres was split the adres is incorrect\r\nif (count($partsNumber) <> 2) {$prereturn = false;}\r\nelse{\r\n// else we save the 2 parts in $user and $domain\r\nlist($user,$domain) = split(\"@\",$MailAdres);\r\n// and we check if the user entered a part before the @.\r\nif (strlen($user) < 1) {$prereturn = false;}\r\n}\r\n\r\n// after the validation $prereturn has either true or false.\r\n// - false if one validation turned out bad\r\n// - true if the adres is validid\r\n// now we return this value back to the place it was requered.\r\nreturn $prereturn;\r\n}", "public function emailtemplete($email)\n\t{\t\n\t\t$templetedata = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta name=\"viewport\" content=\"width=device-width\" />\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<title>Verify your account</title>\n<style>/* -------------------------------------\n GLOBAL\n A very basic CSS reset\n------------------------------------- */\n* {\n margin: 0;\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n box-sizing: border-box;\n font-size: 14px;\n}\n\nimg {\n max-width: 100%;\n}\n\nbody {\n -webkit-font-smoothing: antialiased;\n -webkit-text-size-adjust: none;\n width: 100% !important;\n height: 100%;\n line-height: 1.6em;\n /* 1.6em * 14px = 22.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */\n /*line-height: 22px;*/\n}\n\ntable td {\n vertical-align: top;\n}\n\nbody {\n background-color: #f6f6f6;\n}\n\n.body-wrap {\n background-color: #f6f6f6;\n width: 100%;\n}\n\n.container {\n display: block !important;\n max-width: 600px !important;\n margin: 0 auto !important;\n /* makes it centered */\n clear: both !important;\n}\n\n.content {\n max-width: 600px;\n margin: 0 auto;\n display: block;\n padding: 20px;\n}\n\n/* -------------------------------------\n HEADER, FOOTER, MAIN\n------------------------------------- */\n.main {\n background-color: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 3px;\n}\n\n.content-wrap {\n padding: 20px;\n}\n\n.content-block {\n padding: 0 0 20px;\n}\n\n.header {\n width: 100%;\n margin-bottom: 20px;\n}\n\n.footer {\n width: 100%;\n clear: both;\n color: #999;\n padding: 20px;\n}\n.footer p, .footer a, .footer td {\n color: #999;\n font-size: 12px;\n}\n\n/* -------------------------------------\n TYPOGRAPHY\n------------------------------------- */\nh1, h2, h3 {\n font-family: \"Helvetica Neue\", Helvetica, Arial, \"Lucida Grande\", sans-serif;\n color: #000;\n margin: 40px 0 0;\n line-height: 1.2em;\n font-weight: 400;\n}\n\nh1 {\n font-size: 32px;\n font-weight: 500;\n /* 1.2em * 32px = 38.4px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */\n /*line-height: 38px;*/\n}\n\nh2 {\n font-size: 24px;\n /* 1.2em * 24px = 28.8px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */\n /*line-height: 29px;*/\n}\n\nh3 {\n font-size: 18px;\n /* 1.2em * 18px = 21.6px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */\n /*line-height: 22px;*/\n}\n\nh4 {\n font-size: 14px;\n font-weight: 600;\n}\n\np, ul, ol {\n margin-bottom: 10px;\n font-weight: normal;\n}\np li, ul li, ol li {\n margin-left: 5px;\n list-style-position: inside;\n}\n\n/* -------------------------------------\n LINKS & BUTTONS\n------------------------------------- */\na {\n color: #348eda;\n text-decoration: underline;\n}\n\n.btn-primary {\n text-decoration: none;\n color: #FFF;\n background-color: #348eda;\n border: solid #348eda;\n border-width: 10px 20px;\n line-height: 2em;\n /* 2em * 14px = 28px, use px to get airier line-height also in Thunderbird, and Yahoo!, Outlook.com, AOL webmail clients */\n /*line-height: 28px;*/\n font-weight: bold;\n text-align: center;\n cursor: pointer;\n display: inline-block;\n border-radius: 5px;\n text-transform: capitalize;\n}\n\n/* -------------------------------------\n OTHER STYLES THAT MIGHT BE USEFUL\n------------------------------------- */\n.last {\n margin-bottom: 0;\n}\n\n.first {\n margin-top: 0;\n}\n\n.aligncenter {\n text-align: center;\n}\n\n.alignright {\n text-align: right;\n}\n\n.alignleft {\n text-align: left;\n}\n\n.clear {\n clear: both;\n}\n\n/* -------------------------------------\n ALERTS\n Change the class depending on warning email, good email or bad email\n------------------------------------- */\n.alert {\n font-size: 16px;\n color: #fff;\n font-weight: 500;\n padding: 20px;\n text-align: center;\n border-radius: 3px 3px 0 0;\n}\n.alert a {\n color: #fff;\n text-decoration: none;\n font-weight: 500;\n font-size: 16px;\n}\n.alert.alert-warning {\n background-color: #FF9F00;\n}\n.alert.alert-bad {\n background-color: #D0021B;\n}\n.alert.alert-good {\n background-color: #68B90F;\n}\n\n/* -------------------------------------\n INVOICE\n Styles for the billing table\n------------------------------------- */\n.invoice {\n margin: 40px auto;\n text-align: left;\n width: 80%;\n}\n.invoice td {\n padding: 5px 0;\n}\n.invoice .invoice-items {\n width: 100%;\n}\n.invoice .invoice-items td {\n border-top: #eee 1px solid;\n}\n.invoice .invoice-items .total td {\n border-top: 2px solid #333;\n border-bottom: 2px solid #333;\n font-weight: 700;\n}\n\n/* -------------------------------------\n RESPONSIVE AND MOBILE FRIENDLY STYLES\n------------------------------------- */\n@media only screen and (max-width: 640px) {\n body {\n padding: 0 !important;\n }\n\n h1, h2, h3, h4 {\n font-weight: 800 !important;\n margin: 20px 0 5px !important;\n }\n\n h1 {\n font-size: 22px !important;\n }\n\n h2 {\n font-size: 18px !important;\n }\n\n h3 {\n font-size: 16px !important;\n }\n\n .container {\n padding: 0 !important;\n width: 100% !important;\n }\n\n .content {\n padding: 0 !important;\n }\n\n .content-wrap {\n padding: 10px !important;\n }\n\n .invoice {\n width: 100% !important;\n }\n}\n\n/*# sourceMappingURL=styles.css.map */\n</style>\n</head>\n\n<body itemscope itemtype=\"http://schema.org/EmailMessage\">\n\n<table class=\"body-wrap\">\n\t<tr>\n\t\t<td></td>\n\t\t<td class=\"container\" width=\"600\">\n\t\t\t<div class=\"content\">\n\t\t\t\t<table class=\"main\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"alert alert-warning\">\n\t\t\t\t\t\t\tVerify your account\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"content-wrap\">\n\t\t\t\t\t\t\t<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"content-block\">\n\t\t\t\t\t\t\t\t\t\tDear customer Pleas <strong>Click</strong> Below link .\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"content-block\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"'.base_url().'varify/'.urlencode(base64_encode($email)).'\" class=\"btn-primary\">verify</a>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"content-block\">\n\t\t\t\t\t\t\t\t\t\tThanks for choosing 11needs.com.\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<div class=\"footer\">\n\t\t\t\t\t<table width=\"100%\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class=\"aligncenter content-block\"></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div></div>\n\t\t</td>\n\t\t<td></td>\n\t</tr>\n</table>\n\n</body>\n</html>';\n\t\treturn $templetedata;\n\t}", "function check_content(){\r\n if(!(strlen($_POST['first_name']) > 0 && strlen($_POST['last_name']) > 0 && strlen($_POST['email']) > 0 && strlen($_POST['headline']) > 0 && strlen($_POST['summary']) > 0)){\r\n\treturn 'All fields are required';\r\n }\r\n for($i = 1; $i<10 ; $i++ ){\r\n\tif(isset($_POST['year'.$i])){\r\n\t error_log('$_POST[year'.$i.']: '.$_POST['year'.$i]);\r\n\t if(strlen($_POST['year'.$i]) == 0){\r\n\t\treturn 'All fields are required';\r\n\t }\r\n\t if(!is_numeric($_POST['year'.$i])){\r\n\t\treturn 'Year must be a number';\r\n\t }\r\n\t}\r\n\tif(isset($_POST['desc'.$i]) && strlen($_POST['desc'.$i]) == 0){\r\n\t error_log('$_POST[desc'.$i.']: '.$_POST['desc'.$i]);\r\n\t return 'All fields are required';\r\n\t}\r\n\tif(isset($_POST['edu_year'.$i])){\r\n\t error_log('$_POST[edu_year'.$i.']: '.$_POST['edu_year'.$i]);\r\n\t if(strlen($_POST['edu_year'.$i]) == 0){\r\n\t\treturn 'All fields are required';\r\n\t }\r\n\t if(!is_numeric($_POST['edu_year'.$i])){\r\n\t\treturn 'Year must be a number';\r\n\t }\r\n\t}\r\n\tif(isset($_POST['edu_school'.$i]) && strlen($_POST['edu_school'.$i]) == 0){\r\n\t error_log('$_POST[edu_school'.$i.']: '.$_POST['edu_school'.$i]);\r\n\t return 'All fields are required';\r\n\t}\r\n }\r\n if(strpos($_POST['email'], '@') === false){\r\n\treturn 'Email address must contain @';\r\n }\r\n return true;\r\n}", "function saveAndSend(){\n\t$to = $_POST['email'];\n\t$title = get_the_title($_POST['emailID']).' Copy';\n\t$messagetext = get_the_content($_POST['emailID']);\n\t$id = $_POST['emailID'];\n\n $noofprop = explode(',',get_post_meta($_POST['emailID'],'property_data', true));\n $properties = array();\n foreach ($noofprop as $item) {\n \t\n \t$notes = get_post_meta($id, 'propnotes_'.$item, true);\n \t$price = get_post_meta($id, 'propprice_'.$item, true);\n\n \t$array1 = array($item,$notes,$price);\n \t$properties[] = $array1;\n\n }\n\n //Send the email and get a report back\n\telegeantSend($to,$messagetext,$properties);\n \n\t//Save the email as a post and get a report back\n\telegantSave($title,$to,$messagetext,$properties); \n\n\t//redirect to the list emails screen. \n\twp_redirect(get_admin_url().'/admin.php?page=existing-elegant-emails');\n\texit;\n\n}", "function customer_export_excel(){\r\n\t\t//POST varibale here\r\n\t\t\t\t$cust_id=trim(@$_POST[\"cust_id\"]);\r\n\t\t$cust_no=trim(@$_POST[\"cust_no\"]);\r\n\t\t$cust_no=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no);\r\n\t\t$cust_no=str_replace(\"'\", '\"',$cust_no);\r\n\t\t$cust_no_awal=trim(@$_POST[\"cust_no_awal\"]);\r\n\t\t$cust_no_awal=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_awal);\r\n\t\t$cust_no_awal=str_replace(\"'\", '\"',$cust_no_awal);\r\n\t\t$cust_no_akhir=trim(@$_POST[\"cust_no_akhir\"]);\r\n\t\t$cust_no_akhir=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_no_akhir);\r\n\t\t$cust_no_akhir=str_replace(\"'\", '\"',$cust_no_akhir);\r\n\t\t$cust_nama=trim(@$_POST[\"cust_nama\"]);\r\n\t\t$cust_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_nama);\r\n\t\t$cust_nama=str_replace(\"'\", '\"',$cust_nama);\r\n\t\t$cust_panggilan=trim(@$_POST[\"cust_panggilan\"]);\r\n\t\t$cust_panggilan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_panggilan);\r\n\t\t$cust_panggilan=str_replace(\"'\", '\"',$cust_panggilan);\r\n\t\t$cust_foreigner=trim(@$_POST[\"cust_foreigner\"]);\r\n\t\t$cust_foreigner=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_foreigner);\r\n\t\t$cust_foreigner=str_replace(\"'\", '\"',$cust_foreigner);\r\n\t\t$cust_kelamin=trim(@$_POST[\"cust_kelamin\"]);\r\n\t\t$cust_kelamin=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kelamin);\r\n\t\t$cust_kelamin=str_replace(\"'\", '\"',$cust_kelamin);\r\n\t\t$cust_alamat=trim(@$_POST[\"cust_alamat\"]);\r\n\t\t$cust_alamat=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat);\r\n\t\t$cust_alamat=str_replace(\"'\", '\"',$cust_alamat);\r\n\t\t$cust_alamat2=trim(@$_POST[\"cust_alamat2\"]);\r\n\t\t$cust_alamat2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_alamat2);\r\n\t\t$cust_alamat2=str_replace(\"'\", '\"',$cust_alamat2);\r\n\t\t$cust_kota=trim(@$_POST[\"cust_kota\"]);\r\n\t\t$cust_kota=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kota);\r\n\t\t$cust_kota=str_replace(\"'\", '\"',$cust_kota);\r\n\t\t$cust_kodepos=trim(@$_POST[\"cust_kodepos\"]);\r\n\t\t$cust_kodepos=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_kodepos);\r\n\t\t$cust_kodepos=str_replace(\"'\", '\"',$cust_kodepos);\r\n\t\t$cust_propinsi=trim(@$_POST[\"cust_propinsi\"]);\r\n\t\t$cust_propinsi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_propinsi);\r\n\t\t$cust_propinsi=str_replace(\"'\", '\"',$cust_propinsi);\r\n\t\t$cust_negara=trim(@$_POST[\"cust_negara\"]);\r\n\t\t$cust_negara=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_negara);\r\n\t\t$cust_negara=str_replace(\"'\", '\"',$cust_negara);\r\n\t\t$cust_telprumah=trim(@$_POST[\"cust_telprumah\"]);\r\n\t\t$cust_telprumah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah);\r\n\t\t$cust_telprumah=str_replace(\"'\", '\"',$cust_telprumah);\r\n\t\t$cust_telprumah2=trim(@$_POST[\"cust_telprumah2\"]);\r\n\t\t$cust_telprumah2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telprumah2);\r\n\t\t$cust_telprumah2=str_replace(\"'\", '\"',$cust_telprumah2);\r\n\t\t$cust_telpkantor=trim(@$_POST[\"cust_telpkantor\"]);\r\n\t\t$cust_telpkantor=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_telpkantor);\r\n\t\t$cust_telpkantor=str_replace(\"'\", '\"',$cust_telpkantor);\r\n\t\t$cust_hp=trim(@$_POST[\"cust_hp\"]);\r\n\t\t$cust_hp=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp);\r\n\t\t$cust_hp=str_replace(\"'\", '\"',$cust_hp);\r\n\t\t$cust_hp2=trim(@$_POST[\"cust_hp2\"]);\r\n\t\t$cust_hp2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp2);\r\n\t\t$cust_hp2=str_replace(\"'\", '\"',$cust_hp2);\r\n\t\t$cust_hp3=trim(@$_POST[\"cust_hp3\"]);\r\n\t\t$cust_hp3=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_hp3);\r\n\t\t$cust_hp3=str_replace(\"'\", '\"',$cust_hp3);\r\n\t\t$cust_email=trim(@$_POST[\"cust_email\"]);\r\n\t\t$cust_email=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_email);\r\n\t\t$cust_email=str_replace(\"'\", '\"',$cust_email);\r\n\t\t$cust_agama=trim(@$_POST[\"cust_agama\"]);\r\n\t\t$cust_agama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_agama);\r\n\t\t$cust_agama=str_replace(\"'\", '\"',$cust_agama);\r\n\t\t$cust_pendidikan=trim(@$_POST[\"cust_pendidikan\"]);\r\n\t\t$cust_pendidikan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_pendidikan);\r\n\t\t$cust_pendidikan=str_replace(\"'\", '\"',$cust_pendidikan);\r\n\t\t$cust_profesi=trim(@$_POST[\"cust_profesi\"]);\r\n\t\t$cust_profesi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_profesi);\r\n\t\t$cust_profesi=str_replace(\"'\", '\"',$cust_profesi);\r\n\t\t$cust_tgllahir=trim(@$_POST[\"cust_tgllahir\"]);\r\n\t\t$cust_tgllahirend =(isset($_POST['cust_tgllahirend']) ? @$_POST['cust_tgllahirend'] : @$_GET['cust_tgllahirend']);\r\n\t\t$cust_tgllahirend=trim(@$_POST[\"cust_tgllahirend\"]);\r\n\t\t$cust_umur=trim(@$_POST[\"cust_umur\"]);\r\n\t\t\r\n\t\t$cust_hobi_baca=trim(@$_POST[\"cust_hobi_baca\"]);\r\n\t\t$cust_hobi_olah=trim(@$_POST[\"cust_hobi_olah\"]);\r\n\t\t$cust_hobi_masak=trim(@$_POST[\"cust_hobi_masak\"]);\r\n\t\t$cust_hobi_travel=trim(@$_POST[\"cust_hobi_travel\"]);\r\n\t\t$cust_hobi_foto=trim(@$_POST[\"cust_hobi_foto\"]);\r\n\t\t$cust_hobi_lukis=trim(@$_POST[\"cust_hobi_lukis\"]);\r\n\t\t$cust_hobi_nari=trim(@$_POST[\"cust_hobi_nari\"]);\r\n\t\t$cust_hobi_lain=trim(@$_POST[\"cust_hobi_lain\"]);\r\n\t\t$cust_referensi=trim(@$_POST[\"cust_referensi\"]);\r\n\t\t$cust_referensi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensi);\r\n\t\t$cust_referensi=str_replace(\"'\", '\"',$cust_referensi);\r\n\t\t$cust_referensilain=trim(@$_POST[\"cust_referensilain\"]);\r\n\t\t$cust_referensilain=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_referensilain);\r\n\t\t$cust_referensilain=str_replace(\"'\", '\"',$cust_referensilain);\r\n\t\t$cust_keterangan=trim(@$_POST[\"cust_keterangan\"]);\r\n\t\t$cust_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_keterangan);\r\n\t\t$cust_keterangan=str_replace(\"'\", '\"',$cust_keterangan);\r\n\t\t$cust_member=trim(@$_POST[\"cust_member\"]);\r\n\t\t$cust_member=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member);\r\n\t\t$cust_member=str_replace(\"'\", '\"',$cust_member);\r\n\t\t$cust_member2=trim(@$_POST[\"cust_member2\"]);\r\n\t\t$cust_member2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_member2);\r\n\t\t$cust_member2=str_replace(\"'\", '\"',$cust_member2);\r\n\t\t$cust_statusnikah=trim(@$_POST[\"cust_statusnikah\"]);\r\n\t\t$cust_statusnikah=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_statusnikah);\r\n\t\t$cust_statusnikah=str_replace(\"'\", '\"',$cust_statusnikah);\r\n\t\t$cust_priority=trim(@$_POST[\"cust_priority\"]);\r\n\t\t$cust_priority=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_priority);\r\n\t\t$cust_priority=str_replace(\"'\", '\"',$cust_priority);\r\n\t\t$cust_jmlanak=trim(@$_POST[\"cust_jmlanak\"]);\r\n\t\t$cust_unit=trim(@$_POST[\"cust_unit\"]);\r\n\t\t$cust_unit=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_unit);\r\n\t\t$cust_unit=str_replace(\"'\", '\"',$cust_unit);\r\n\t\t$cust_aktif=trim(@$_POST[\"cust_aktif\"]);\r\n\t\t$cust_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_aktif);\r\n\t\t$cust_aktif=str_replace(\"'\", '\"',$cust_aktif);\r\n\t\t$sortby=trim(@$_POST[\"sortby\"]);\r\n\t\t$sortby=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$sortby);\r\n\t\t$sortby=str_replace(\"'\", '\"',$sortby);\r\n\t\t$cust_fretfulness=trim(@$_POST[\"cust_fretfulness\"]);\r\n\t\t$cust_fretfulness=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_fretfulness);\r\n\t\t$cust_fretfulness=str_replace(\"'\", '\"',$cust_fretfulness);\r\n\t\t$cust_creator=trim(@$_POST[\"cust_creator\"]);\r\n\t\t$cust_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_creator);\r\n\t\t$cust_creator=str_replace(\"'\", '\"',$cust_creator);\r\n\t\t$cust_date_create=trim(@$_POST[\"cust_date_create\"]);\r\n\t\t$cust_update=trim(@$_POST[\"cust_update\"]);\r\n\t\t$cust_update=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_update);\r\n\t\t$cust_update=str_replace(\"'\", '\"',$cust_update);\r\n\t\t$cust_date_update=trim(@$_POST[\"cust_date_update\"]);\r\n\t\t$cust_revised=trim(@$_POST[\"cust_revised\"]);\r\n\t\t$cust_umurstart=trim(@$_POST[\"cust_umurstart\"]);\r\n\t\t$cust_umurstart=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurstart);\r\n\t\t$cust_umurstart=str_replace(\"'\", '\"',$cust_umurstart);\r\n\t\t$cust_umurend=trim(@$_POST[\"cust_umurend\"]);\r\n\t\t$cust_umurend=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_umurend);\r\n\t\t$cust_umurend=str_replace(\"'\", '\"',$cust_umurend);\r\n\t\t$cust_transaksi_start=trim(@$_POST[\"cust_transaksi_start\"]);\r\n\t\t$cust_transaksi_end=trim(@$_POST[\"cust_transaksi_end\"]);\r\n\t\t$cust_tidak_transaksi_start=trim(@$_POST[\"cust_tidak_transaksi_start\"]);\r\n\t\t$cust_tidak_transaksi_end=trim(@$_POST[\"cust_tidak_transaksi_end\"]);\r\n\t\t$cust_terdaftar=trim(@$_POST[\"cust_terdaftar\"]);\r\n\t\t$cust_tgldaftarend =(isset($_POST['cust_tgldaftarend']) ? @$_POST['cust_tgldaftarend'] : @$_GET['cust_tgldaftarend']);\r\n\t\t$cust_tgldaftarend=trim(@$_POST[\"cust_tgldaftarend\"]);\r\n\t\t$member_terdaftarstart=trim(@$_POST[\"member_terdaftarstart\"]);\r\n\t\t$member_terdaftarend=trim(@$_POST[\"member_terdaftarend\"]);\r\n\t\t$cust_tglawaltrans=trim(@$_POST[\"cust_tglawaltrans\"]);\r\n\t\t$cust_tglawaltransend=trim(@$_POST[\"cust_tglawaltrans_end\"]);\r\n\t\t$cust_tgl=trim(@$_POST[\"cust_tgl\"]);\r\n\t\t$cust_tgl=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tgl);\r\n\t\t$cust_tgl=str_replace(\"'\", '\"',$cust_tgl);\r\n\t\t$cust_bulan=trim(@$_POST[\"cust_bulan\"]);\r\n\t\t$cust_bulan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulan);\r\n\t\t$cust_bulan=str_replace(\"'\", '\"',$cust_bulan);\r\n\t\t$cust_tglEnd=trim(@$_POST[\"cust_tglEnd\"]);\r\n\t\t$cust_tglEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_tglEnd);\r\n\t\t$cust_tglEnd=str_replace(\"'\", '\"',$cust_tglEnd);\r\n\t\t$cust_bulanEnd=trim(@$_POST[\"cust_bulanEnd\"]);\r\n\t\t$cust_bulanEnd=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bulanEnd);\r\n\t\t$cust_bulanEnd=str_replace(\"'\", '\"',$cust_bulanEnd);\r\n\t\t$cust_bb=trim(@$_POST[\"cust_bb\"]);\r\n\t\t$cust_bb=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$cust_bb);\r\n\t\t$cust_bb=str_replace(\"'\", '\"',$cust_bb);\r\n\r\n\t\t$option=$_POST['currentlisting'];\r\n\t\t$filter=$_POST[\"query\"];\r\n\t\t\r\n\t\t$query = $this->m_customer->customer_export_excel($cust_id,$cust_no,$cust_no_awal ,$cust_no_akhir,$cust_nama, $cust_panggilan, $cust_foreigner,$cust_kelamin,$cust_alamat,$cust_kota,$cust_kodepos,$cust_propinsi,$cust_negara,$cust_telprumah,$cust_telprumah2,$cust_telpkantor,$cust_hp,$cust_hp2,$cust_hp3,$cust_email,$cust_agama,$cust_pendidikan,$cust_profesi,$cust_tgllahir,$cust_tgllahirend,$cust_referensi,$cust_referensilain,$cust_keterangan,$cust_member, $cust_member2, $cust_terdaftar,$cust_tgldaftarend, $member_terdaftarstart, $member_terdaftarend, $cust_tglawaltrans,$cust_tglawaltransend,$cust_statusnikah,$cust_priority,$cust_jmlanak,$cust_unit,$cust_aktif, $sortby, $cust_fretfulness,$cust_creator,$cust_date_create,$cust_update,$cust_date_update,$cust_revised, $cust_transaksi_start, $cust_transaksi_end, $cust_tidak_transaksi_start, $cust_tidak_transaksi_end, $cust_hobi_baca, $cust_hobi_olah, $cust_hobi_masak, $cust_hobi_travel, $cust_hobi_foto, $cust_hobi_lukis, $cust_hobi_nari, $cust_hobi_lain, $cust_umurstart, $cust_umurend, $cust_umur,$cust_tgl, $cust_bulan, $cust_tglEnd, $cust_bulanEnd,$cust_bb,$option,$filter);\r\n\t\t\r\n\t\tto_excel($query,\"customer\"); \r\n\t\techo '1';\r\n\t\t\t\r\n\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = '[email protected]';\r\n // Test address\r\n //$to = '[email protected]';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "function input_check_mailinj($value, $sendto)\n{\n # mail adress(ess) for reports...\n $report_to = $sendto;\n\n # array holding strings to check...\n $suspicious_str = array\n (\n\t \"content-type:\"\n\t ,\"charset=\"\n\t ,\"mime-version:\"\n\t ,\"multipart/mixed\"\n\t ,\"bcc:\"\n );\n\n // remove added slashes from $value...\n $value = stripslashes($value);\n\n //SETUP REPLY EMAIL ADDRESS\n $fifth = '-f ' . $report_to;\n\n //SETUP THE FROM ADDRESS\n $headers = \"From: <\" . $report_to . \">\\n\";\n $headers .= \"MIME-Version: 1.0\\n\";\n $headers .= \"Content-type: text/plain; charset=iso-8859-1\\r\\n\";\n $email_body = '<table width=\"100%\" border=\"0\"\n cellspacing=\"0\" cellpadding=\"0\"\nstyle=\"font-family:Vivaldi;font-size:12px;text-align:left\">'.\"\\n\";\n\n\n foreach($suspicious_str as $suspect)\n {\n\t # checks if $value contains $suspect...\n\t if(eregi($suspect, strtolower($value)))\n\t {\n\t\t // replace this with your own get_ip function...\n\t\t $ip = (empty($_SERVER['REMOTE_ADDR'])) ? 'empty'\n\t\t\t : $_SERVER['REMOTE_ADDR'];\n\t\t $rf = (empty($_SERVER['HTTP_REFERER'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_REFERER'];\n\t\t $ua = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'empty'\n\t\t\t : $_SERVER['HTTP_USER_AGENT'];\n\t\t $ru = (empty($_SERVER['REQUEST_URI'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_URI'];\n\t\t $rm = (empty($_SERVER['REQUEST_METHOD'])) ? 'empty'\n\t\t\t : $_SERVER['REQUEST_METHOD'];\n\n\t\t # if so, file a report...\n\t\t if(isset($report_to) && !empty($report_to))\n\t\t {\n\t\t\t @mail\n\t\t\t (\n\t\t\t\t\t $report_to\n\t\t\t\t ,\"[ABUSE] mailinjection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip\n\t\t\t\t ,\"Stopped possible mail-injection @ \" .\n\t\t\t\t $_SERVER['HTTP_HOST'] . \" by \" . $ip .\n\t\t\t\t \" (\" . date('d/m/Y H:i:s') . \")\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** IP/HOST\\r\\n\" . $ip . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** USER AGENT\\r\\n\" . $ua . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REFERER\\r\\n\" . $rf . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST URI\\r\\n\" . $ru . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** REQUEST METHOD\\r\\n\" . $rm . \"\\r\\n\\r\\n\" .\n\t\t\t\t\t \"*** SUSPECT\\r\\n--\\r\\n\" . $value . \"\\r\\n--\"\n\t\t\t\t\t , $headers, $fifth\n\t\t\t );\n\t\t }\n\n\t\t # ... and kill the script.\n\t\t die\n\t\t (\n\t\t\t '<p>Script processing cancelled: string\n\t\t\t (`<em>'.$value.'</em>`) contains text portions that\n\t\t\t are potentially harmful to this server. <em>Your input\n\t\t\t has not been sent!</em> Please try\n\t\t\t rephrasing your input.</p>'\n\t\t );\n\t }\n }\n}", "function store_rules($file_name, $entry){\n echo json_encode($entry);\n // OVERVIEW:\n // $entry = [id.add, path+name.add, table_name, table_type, table_colour, descriptor , path1, val1..... path11, val11]\n // path/file_name.csv \n global $path_to;\n $path_to_file = \"/view/\".$entry[1].\"_\".$entry[0].\".csv\";\n $path_to_rules = $path_to.\"/stored_rules/rules.csv\";\n $check_for = $path_to_file;\n // CHECK IF FILE NAME EXIST\n $dun_log = 0;\n if (($check_me = fopen($path_to_rules, \"r\")) !== FALSE) {\n while (($data = fgetcsv($check_me, 1000, \",\")) !== FALSE) {\n if ($data[1] == $check_for){\n $dun_log = 1;\n break;\n }else{\n\n }\n }\n fclose($check_me);\n }else{echo \"failed to send\";}\n if($dun_log != 1){\n //if not present log\n array_unshift($entry, $path_to_file);\n // READ &\n $start_from = 1;\n $rows = file($file_name);\n $last_row = array_pop($rows);\n $data = str_getcsv($last_row);\n if ($data != null){\n if ($start_from <= $data){\n // Get last num\n $start_from = $data[0] + 1;\n }\n }\n \n // include ID \n array_unshift($entry, $start_from);\n\n // Append from last num\n $file = fopen($file_name, \"a\");\n\n if (flock($file, LOCK_EX)){\n fputcsv($file, $entry);\n $file = NULL;\n flock($file, LOCK_UN);\n }\n fclose($file);\n }else{\n echo \"file already present\";\n }\n}", "public function actionCollectorReport() {\n /*Get result using model method*/\n $result = [\n ['a', 'b', 'c',],\n [1, 2, 3,],\n ];\n\n $fileName = 'debtorList' . date('Y-m-d');\n $this->createCSV($result, $fileName);\n\n //$subscribers = Subscriber::getSubscribers('collector');\n //$this->actionSendReport($fileName, $subscribers);\n\n }", "public function handle()\n {\n //$current_date=date('Y-m-d');\n\t\t$current_date='2019-11-28';\n \t\t\t\n\t\t$email_subject='Test Cron';\n\tMail::send('email.Hello',[\n\n\t\t\t\t\t\t ], function($message) use ($email_subject){\n\t\t\t\t\t\t\t $message->to('[email protected]','Magik Lights');\n\t\t\t\t\t\t\t $message->cc('[email protected]','Magik Lights');\n\t\t\t\t\t\t\t $message->from('[email protected]','Magik Lights');\n\t\t\t\t\t\t\t $message->subject($email_subject);\n\t\t\t\t\t\t\t $message->attach($csvattach);\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t });\n\n\n \t\t\t\n\t\t $selSumcount = Contact::leftJoin('states', 'states.id', '=', 'contacts.state_id')\n\t\t\t\t\t->leftJoin('gifts', 'gifts.id', '=', 'contacts.gift_id')\n\t\t\t\t\t->leftJoin('codes', 'codes.code', '=', 'contacts.code')\n\t\t\t\t\t->select('contacts.*', 'states.name as state_name','gifts.gift_name',\t'codes.campaign_id','codes.campaign_name')\n\t\t\t\t\t->whereDate('contacts.created_at', '=', $current_date)->count();\n\n\n\t\tif($selSumcount)\n\t\t{\n\t\t\t $selSumm1 = Contact::leftJoin('states', 'states.id', '=', 'contacts.state_id')\n\t\t\t\t\t->leftJoin('gifts', 'gifts.id', '=', 'contacts.gift_id')\n\t\t\t\t\t->leftJoin('codes', 'codes.code', '=', 'contacts.code')\n\t\t\t\t\t->select('contacts.*', 'states.name as state_name','gifts.gift_name',\t'codes.campaign_id','codes.campaign_name')\n\t\t\t\t\t->whereDate('contacts.created_at', '=', $current_date)->get();\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\n\t\t\n\t \n\t\t\t$handle = fopen('php://output', 'w');\n\t\t\t\n\t\t\t//fputcsv($handle, array('ID','NAME'));\n\t\t\t$csv = \"Campaign Id,Campaign Name, Gift Name,Outlet Name,Distributer Name,State,City,Person \t\tName,Mobile,Email,Created At \\n\";//Column headers\n\t\t\tforeach ($selSumm1 as $selSumm1) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tprint_r($selSumm1);\n\t\t\t\t if($selSumm1->state_id!=$selSumm1->state_id)\n\t\t\t\t {\n\t\t\t\t\t \n\t\t\t\t $filename = 'Report-'.strtolower($selSumm1->state_name).'-'.$current_date . '.csv';\n\t\t\t\n\n\t\t\t\t\n\t\t\t\t$csv.= $selSumm1->campaign_id.','.$selSumm1->campaign_name.','.$selSumm1->gift_name.\n\t\t\t\t\t\t','.$selSumm1->outlet_name.','.$selSumm1->distributor_name.','.$selSumm1->state_name.\n\t\t\t\t\t\t','.$selSumm1->city.','.$selSumm1->name.','.$selSumm1->mobile.\n\t\t\t\t\t\t','.$selSumm1->email.','.$selSumm1->created_at.\"\\n\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$csv_handler = fopen (public_path().'/daySummary/'.$filename,'w');\n\t\t\t\t\t\tfwrite ($csv_handler,$csv);\n\t\t\t\t\t\tfclose ($csv_handler);\n\t\t\t\t\t\t\t\n\t\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\t}\n\n\t\techo 'done';\n \n\t\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n }", "function csv_report($a)\n{\n\t$pioneer = null;\n\tforeach($a as $r)\n\t{\n\t\tif($pioneer !== $r['pioneer']) echo \"\\n\\nLast name,First name,Group,Pioneer,Month,Placements,Videos,Hours,Credits,RVs,Studies,6 Month Avg (no Credit),6 Month Avg (With Credit)\\n\";\n\t\techo implode(',',$r) . \"\\n\";\n\t\t$pioneer = $r['pioneer'];\n\t}\n//\tprint_r($a);\n}", "public function testValidateAndCollectData()\n {\n $obj = new CSVFileReader();\n $obj->setHeader(['name', 'address', 'stars', 'contact', 'phone', 'uri']);\n $validateAndCollectData = self::getMethod($obj, 'validateAndCollectData');\n $validateAndCollectData->invokeArgs($obj, array($this->data[0]));\n $res = $obj->getFileData();\n $this->assertCount(0, $res);\n \n $validateAndCollectData->invokeArgs($obj, array($this->data[1]));\n $res = $obj->getFileData();\n $this->assertCount(0, $res);\n\n $validateAndCollectData->invokeArgs($obj, array($this->data[4]));\n $res = $obj->getFileData();\n $this->assertCount(1, $res);\n }", "public function sendMail($subject, $bodyHtml, $csvReportContents = null, $csvReportName = null) {\r\n $mail = new Zend_Mail();\r\n $mail->setType(Zend_Mime::MULTIPART_RELATED);\r\n $mail->setBodyHtml($bodyHtml);\r\n $mail->setFrom('datafeed@' . $this->domain, 'Lycenok Datafeed');\r\n $mailRecipient = ($this->isProduction() ? 'sales' : 'eugene') . '@' . $this->domain;\r\n $mail->addTo($mailRecipient, 'Eugene');\r\n $mail->setSubject($subject);\r\n if (!empty($csvReportName)) { \r\n $dir = Mage::getBaseDir();\r\n $file = $mail->createAttachment($csvReportContents);\r\n $file ->type = 'text/csv';\r\n $file ->disposition = Zend_Mime::DISPOSITION_INLINE;\r\n $file ->encoding = Zend_Mime::ENCODING_BASE64;\r\n $file ->filename = $csvReportName;\r\n } \r\n try {\r\n //Confimation E-Mail Send\r\n $mail->send();\r\n Mage::log('mail sent to: ' . $mailRecipient);\r\n }\r\n catch(Exception $error) {\r\n Mage::getSingleton('core/session')->addError($error->getMessage());\r\n return false;\r\n } \r\n}", "function generateMeetingAttendanceReport($args) {\r\n\t\tparent::validate();\r\n\t\t$this->setupTemplate();\r\n\t\t$ercMembers = Request::getUserVar('ercMembers');\r\n\t\t\r\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\r\n\t\tif ($fromDate != null) $fromDate = date('Y-m-d H:i:s', $fromDate);\r\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\r\n\t\tif ($toDate != null) $toDate = date('Y-m-d H:i:s', $toDate);\r\n\t\t$meetingDao = DAORegistry::getDAO('MeetingDAO');\r\n\t\t$userDao = DAORegistry::getDAO('UserDAO');\r\n\t\t\r\n\t\theader('content-type: text/comma-separated-values');\r\n\t\theader('content-disposition: attachment; filename=meetingAttendanceReport-' . date('Ymd') . '.csv');\r\n\t\t\r\n\t\t$columns = array(\r\n\t\t'lastname' => Locale::translate('user.lastName'),\r\n\t\t'firstname' => Locale::translate('user.firstName'),\r\n\t\t'middlename' => Locale::translate('user.middleName'),\r\n\t\t'meeting_date' => Locale::translate('editor.reports.meetingDate'),\r\n\t\t'present' => Locale::translate('editor.reports.isPresent'),\r\n\t\t'reason_for_absence' => Locale::translate('editor.reports.reason')\r\n\t\t);\r\n\t\t$yesNoArray = array('present');\r\n\t\t$yesnoMessages = array( 0 => Locale::translate('common.no'), 1 => Locale::translate('common.yes'));\r\n\t\t$fp = fopen('php://output', 'wt');\r\n\t\tString::fputcsv($fp, array_values($columns));\r\n\t\t\r\n\t\tforeach ($ercMembers as $member) {\r\n\t\t\t$user = $userDao->getUser($member);\r\n\t\t\tlist($meetingsIterator) = $meetingDao->getMeetingReportByReviewerId($member, $fromDate, $toDate);\r\n\t\t\r\n\t\t\t$meetings = array();\r\n\t\t\twhile ($row =& $meetingsIterator->next()) {\r\n\t\t\t\tforeach ($columns as $index => $junk) {\r\n\t\t\t\t\tif (in_array($index, $yesNoArray)) {\r\n\t\t\t\t\t\t$columns[$index] = $yesnoMessages[$row[$index]];\r\n\t\t\t\t\t} elseif ($index == \"lastname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getLastName();\r\n\t\t\t\t\t} elseif ($index == \"firstname\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getFirstName();\r\n\t\t\t\t\t} elseif ($index == \"middlename\") {\r\n\t\t\t\t\t\t$columns[$index] = $user->getMiddleName();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$columns[$index] = $row[$index];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tString::fputcsv($fp, $columns);\r\n\t\t\t\tunset($row);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($fp);\r\n\t}", "function hb_record_vorpit_mail_errors($line_no,$file_name,$template_id,$receiver_id,$receiver_type,$subject,$message,$sender_id,$sender_type,$related_job_id,$table_affected,$operation_performed,$id_affected)\r\n\t{\r\n\t\tglobal $global_user_id,$global_paypal_to_email_address,$global_user_type;\r\n\t\t$ip_address = $_SERVER['REMOTE_ADDR'];\r\n\t\t$error_on = date('Y-m-d H:i');\r\n\t\t$hb_record_query = \"INSERT INTO\r\n\t\t\t\t\t\t\t\t`tbl_messages_errors`\r\n\t\t\t\t\t\t SET\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t`sender_id`\t\t\t\t=\t'$sender_id'\r\n\t\t\t\t\t\t\t,\t`receiver_id`\t\t\t=\t'$receiver_id'\r\n\t\t\t\t\t\t\t,\t`sender_user_name`\t\t=\taes_encrypt('$sender_user_name','$GBV_ED_KEY')\r\n\t\t\t\t\t\t\t,\t`receiver_user_name`\t=\taes_encrypt('$receiver_user_name','$GBV_ED_KEY')\r\n\t\t\t\t\t\t\t,\t`subject`\t\t\t\t=\t'\".addslashes($subject).\"'\r\n\t\t\t\t\t\t\t,\t`message`\t\t\t\t=\t'\".addslashes($message).\"'\r\n\t\t\t\t\t\t\t,\t`reply_id`\t\t\t\t=\t'$reply_id'\r\n\t\t\t\t\t\t\t,\t`sender_type`\t\t\t=\t'$sender_type'\r\n\t\t\t\t\t\t\t,\t`receiver_type`\t\t\t=\t'$receiver_type'\r\n\t\t\t\t\t\t\t,\t`table_affected`\t\t=\t'$table_affected'\r\n\t\t\t\t\t\t\t,\t`operation_performed`\t=\t'$operation_performed'\r\n\t\t\t\t\t\t\t,\t`id_affected`\t\t\t=\t'$id_affected'\r\n\t\t\t\t\t\t\t,\t`related_job_id`\t\t=\t'$related_job_id'\r\n\t\t\t\t\t\t\t,\t`ccd_to` \t\t\t\t=\t'$ccd_to'\r\n\t\t\t\t\t\t\t,\t`file_name` \t\t\t= \t'$file_name'\r\n\t\t\t\t\t\t\t,\t`ip_address` \t\t\t= \t'$ip_address'\r\n\t\t\t\t\t\t\t,\t`error_on` \t\t\t\t= \t'$error_on'\r\n\t\t\t\t\t\t\t,\t`user_id` \t\t\t\t= \t'$global_user_id'\r\n\t\t\t\t\t\t\t,\t`user_type` \t\t\t= \t'$global_user_type'\r\n\t\t\t\t\t\t\t,\t`line_no` \t\t\t\t= \t'$line_no'\r\n\t\t\t\t\t\t\t,\t`script_filename`\t\t= \t'$hp_file_name'\r\n\t\t\t\t\t\t\t,\t`template_id` \t\t\t= \t'$template_id'\";\t\t\t\t\t\t\t\t \r\n\t\thb_mysql_query($hb_record_query) or die(hb_mysql_error());\r\n\t\t//die(stripslashes($sql_error));\r\n\t}", "function send_mails() {\n\t //$myactivebatch = $this->load_saved_batch();//load direct from file\n\t $myactivebatch = GetParam('batchrestore');//load in html form field and save as param\n\t //echo '>',$myactivebatch;\n\t \n\t $batch = GetReq('batchid');\n\t $bid = GetParam('bid')?GetParam('bid'):0; \n\t \t \n\t $include_subs = GetParam('includesubs');\n\t $include_all = GetParam('includeall');\t \n\t $subscribers = $include_subs?$include_subs:$include_all;//one or another\n\t\n\t $from = GetParam('from');\n\t $to = GetParam('to');\t \n\t $subject = GetParam('subject');\n\t \n\t if ($this->template) {\n\t if ($this->dirdepth) {\n\t\t for($i=0;$i<$this->dirdepth;$i++)\n\t\t\t $backdir .= \"../\";\n\t\t }\n\t\t else\n\t\t $backdir = \"../\";\n\t\t //repalce viewable data to send data (absolute dir)\t \n\t\t //echo $backdir;\n\t\t if ($this->mailbody)//get session text with headers\n\t\t $body = $this->mailbody;\n\t\t else //get text area\n\t $body = str_replace($backdir,$this->url.$this->infolder.'/',GetParam('mail_text')); \t \n\t }\t \n\t else\t{ //text area or session text with headers\n\t \n\t if (GetReq('editmode')) {\n\t\t $mytext = $this->mailbody?$this->mailbody:GetParam('mail_text');\n\t\t $body = $this->unload_spath($mytext);\n\t\t }\n\t\t else\n\t $body = $this->mailbody?$this->mailbody:GetParam('mail_text'); \n\t }\t \t \n\t \t \n\t\t \n\t if ($subscribers) {// || ($batch)) {//if sybs checked or batch in process..\n\t \n\t //save the current mail campaign state\n\t $this->save_current_batch($batch);\t\n\t \t \t \n\t //$subs = $this->subs_mail;\n\t\t \n\t\t //workinh batch tosend\n\t\t $subs = $this->getmails($include_all,$this->batch,$bid);\n\t\t \n\t if (($batch>=0) && ($batch>=$myactivebatch)) {\n\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body.'+'.$subs)) {\n if ($res = $this->sendit($from,$to,$subject,$body,$subs,$this->ishtml)) {\n\t $this->mailmsg = $res . \" mail(s) send!\";\n\t }\t \n\t else \n\t $this->mailmsg = \"Send failed\";\n\t\t }\n\t\t else \t\n\t\t $this->mailmsg = \"Send bypassed\"; \n\t }\t \n\t else {//one receipent\n\t //if ($res = GetGlobal('controller')->calldpc_method('rcshmail.sendit use '.$from.'+'.$to.'+'.$subject.'+'.$body))\n\t\t if ($res = $this->sendit($from,$to,$subject,$body,null,$this->ishtml)) \n\t\t $this->mailmsg = $res . \" mail(s) send!\";\n\t\t else\n\t\t $this->mailmsg = \"Send failed\";\t\n\t }\t \n\t\t \n\t //auto refresh\n\t $refresh = GetParam('refresh')?GetParam('refresh'):$this->auto_refresh;\n\t if (($refresh>0) && ($res==$this->batch)) {\n $this->refresh_bulk_js(seturl('t=cpsubsend&batchid='.($bid+1).'&batch='.$this->batch.'&refresh='.$refresh),$refresh);\t\t\t \n\t $this->mailmsg .= \"Wait for next batch \" . $this->timeout;\t\t \n\t }\t \n\t \n\t //test\n\t //return $this->batch;\n //return (400);\t \t //??????????????????????????????????????????????????\n\t //echo '---------------------',$res,'---------------------------<br>';\n\t \n\t if ($res<$this->batch) //means end of campaign\n\t $this->reset_batch_state();\n\t \n\t return ($res);//how many mails tried to send (batch...)\t \n\t}", "public function validEmailInvalidDataProvider() {}", "public function emailtest(){\n\t\t$sub = array(\n\t \t'email' => '[email protected]',\n\t \t'order_no' => '14615660058503',\n\t \t'sequence' => 8,\n\t \t'rent_price' => 808.00,\n\t \t'rent_start' => '2016-04-26',\n\t \t'rent_end' => '2016-04-26',\n\t \t'balance' =>12,\n\t \t'username' => 'zhihui',\n\t \t'date' => '2016-04',\n\t \t'url' => 'http://www.kuaizu365.cn/home/account/bill.html'\n\t\t);\n\t\t$email = new \\Common\\Service\\EmailService();\n\t\t$flag = $email ->billWarning($sub);\n\t\tvar_dump($flag);\n\n\t}", "private function joinValidate($data)\n\t{\n\t\t/*\n\t\t [iam] => org\n\t\t[name] => Peter\n\t\t[email] => [email protected]\n\t\t[pw] => 12345\n\t\t[avatar] => 5427fb55f3a5d.jpg\n\t\t[phone] => 02261889971\n\t\t[lat] => 48.0649838\n\t\t[lon] => 7.885475300000053\n\t\t[str] => Bauerngasse\n\t\t[nr] => 6\n\t\t[plz] => 79211\n\t\t[country] => DE\n\t\t*/\n\t\t\n\t\t$check = true;\n\t\t\n\t\t$data['type'] = 0;\n\t\t\n\t\tif($data['iam'] == 'org')\n\t\t{\n\t\t\t$data['type'] = 1;\n\t\t}\n\t\t\n\t\tif($data['avatar'] != '')\n\t\t{\n\t\t\t$data['avatar'] = $this->resizeAvatar($data['avatar']);\n\t\t}\n\t\t\n\t\t$data['name'] = strip_tags($data['name']);\n\t\t$data['name'] = trim($data['name']);\n\t\t\n\t\t$data['surname'] = strip_tags($data['surname']);\n\t\t$data['surname'] = trim($data['surname']);\n\t\t\n\t\tif($data['name'] == '')\n\t\t{\n\t\t\treturn s('error_name');\n\t\t}\n\t\t\n\t\tif(!validEmail($data['email']))\n\t\t{\n\t\t\treturn s('error_email');\n\t\t}\n\t\t\n\t\tif($this->model->emailExists($data['email']))\n\t\t{\n\t\t\treturn s('email_exists');\n\t\t}\n\t\t\n\t\tif(strlen($data['pw']) < 5 && strlen($data['pw']) > 30)\n\t\t{\n\t\t\treturn s('error_password');\n\t\t}\n\t\t\n\t\t$data['gender'] = (int)$data['gender'];\n\t\t\n\t\tif($data['gender'] > 2 || $data['gender'] < 0)\n\t\t{\n\t\t\t$data['gender'] = 0;\n\t\t}\n\t\t\n\t\t$data['phone'] = $this->format_phone_number($data['phone']);\n\t\t$data['lat'] = floatval($data['lat']);\n\t\t$data['lon'] = floatval($data['lon']);\n\t\t$data['str'] = strip_tags($data['str']);\n\t\t$data['plz'] = preg_replace('[^0-9]', '', $data['plz']).'';\n\t\t$data['city'] = strip_tags($data['city']);\n\t\t$data['city'] = trim($data['city']);\n\t\t$data['country'] = strip_tags($data['country']);\n\t\t$data['country'] = strtolower($data['country']);\n\t\t$data['country'] = trim($data['country']);\n\t\t\n\t\treturn $data;\n\t\t\n\t}", "public function scopeAddMailToList()\n {\n\n $data = array();\n $data ['gname'] = Input::get( 'gname' );\n $data ['email'] = Input::get( 'email' );\n $data ['empty'] = $data ['gname'] === \"\" || $data ['email'] === \"\";\n if ( $data ['empty'] || self::mailExists( $data ['gname'], $data ['email'] ) ) {\n $data ['added'] = false;\n } else {\n self::add( $data ['gname'], $data ['email'] );\n $data ['added'] = true;\n }\n\n return $data;\n }", "private function process_emails(&$doing){\n\n if (isset($_GET['hotel_confirmation_once'])){\n // ----------------------- Ask for the welcome mail attachment\n print x(\"span class='only_online'\",\n\t x(\"form action='\".b_url::same('?resetcache_once=1').\"' method='post' enctype='multipart/form-data' name='upload_mail_attachment'\",\n\t\tx('table',\n\t\t x('tr',\n\t\t x('td','Please select PDF file').\n\t\t x('td',\"<input name='_virt_att' type='file' />\").\n\t\t \"<input name='v_id' value='\".$_GET['hotel_confirmation_once'].\"' type='hidden' />\".\n\t\t \"<input name='lease_id' value='\".$_GET['lease_once'].\"' type='hidden' />\").\n\t\t x('tr',\n\t\t x('td colspan=2',x('center',\"<input type='submit' value='submit'/>\"))))));\n }elseif (isset($_FILES['_virt_att'])){\n // ----------------------- Save the welcome mail attachment\n VM_mailer()->save_attachment($_REQUEST['v_id'],$_REQUEST['lease_id'],$_FILES['_virt_att'],'hotel_confirmation');\n }elseif (isset($_GET['mail2all_deny_once'])){\n // ----------------------- Send deny E-mails to all refused attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->m_applicant_deny($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->m_applicant_deny($rec['v_id'],$no_preview=True);\n\t}\n }\n }\n if(isset($_GET['mail2all_welcome_once'])){\n // ----------------------- Send welcome E-mails to all accepted attenders of the event\n $q = $this->query();\n while($rec = myPear_db()->next_record($q)){\n\tif(VM_mailer()->welcome_applicant($rec['v_id'],'status',$rec['v_status']) === False){\n\t VM_mailer()->welcome_applicant($rec['v_id'],@$rec['lease_id'],$no_preview=True);\n\t}\n }\n }elseif (isset($_GET['mail_once'])){\n //\n // ----------------------- Preview e-mails \n //\n $doing = 'send_accept_deny';\n switch($_GET['mail_once']){ \n case 'vm_mail_yes':\n\tVM_mailer()->welcome_applicant($_GET['v_id'],$_GET['lease_id']);\n\tbreak;\n\t\n case 'vm_mail_no':\n\tVM_mailer()->m_applicant_deny($_GET['v_id']);\n\tbreak;\n\t\n case 'vm_mail_info':\n\tVM_mailer()->m_applicant_info_mail($_GET['v_id']);\n\tbreak;\n\n case 'vm_mail_pwd':\n\tVM_mailer()->remind_organizer($_GET['v_id'],VM::$e,'pwd',False);\n\tbreak;\n }\n }elseif(isset($_GET['sendmail_once'])){\n //\n // ----------------------- Sending the e-mail after preview\n //\n switch($sendmail_once=$_GET['sendmail_once']){\n case 'send':\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'\",$this);\n\tbreak;\n default:\n\tb_debug::_debug(\"sendmail_once='$sendmail_once'... What to do???\",$this);\n }\n }\n }", "function sti_send_email_report($format, $report_key, $email, $subject, $message, $file_name, $data)\n\t{\n\t\t// You should change these parameters according to the requirements.\n\t\t$_options = array(\n\t\t\t// Email address of the sender\n\t\t\t\"from\" => \"[email protected]\",\n\t\t\t// Name and surname of the sender\n\t\t\t\"name\" => \"John Smith\",\n\t\t\t// Email address of the recipient\n\t\t\t\"to\" => $email,\n\t\t\t// Email Subject\n\t\t\t\"subject\" => $subject,\n\t\t\t// Text of the Email\n\t\t\t\"message\" => $message,\n\t\t\t// Show a message when Email is successfully sent\n\t\t\t\"successfully\" => true,\n\t\t\t// The text of the error message if unable to send Email \n\t\t\t\"error\" => \"An error occurred while sending Email.\",\n\t\t\t\n\t\t\t\n\t\t\t// Set to true if authentication is required\n\t\t\t\"auth\" => false,\n\t\t\t// Address of the SMTP server\n\t\t\t\"host\" => \"smtp.gmail.com\",\n\t\t\t// Port of the SMTP server\n\t\t\t\"port\" => 465,\n\t\t\t// The secure connection prefix - ssl or tls\n\t\t\t\"secure\" => \"ssl\",\n\t\t\t// Login (Username or Email)\n\t\t\t\"login\" => \"login\",\n\t\t\t// Password\n\t\t\t\"password\" => \"password\"\n\t\t);\n\t\t\n\t\t\n\t\t$guid = substr(md5(uniqid().mt_rand()), 0, 12);\n\t\tif (!file_exists('tmp')) mkdir('tmp');\n\t\tfile_put_contents('tmp/'.$guid.'.'.$file_name, $data);\n\t\t\n\t\t$error = $_options['error'];\n\t\t$error_description = '';\n\t\t\n\t\t$mail = new PHPMailer(true);\n\t\tif ($_options['auth']) $mail->IsSMTP();\n\t\ttry {\n\t\t\t$mail->CharSet = 'UTF-8';\n\t\t\t$mail->IsHTML(false);\n\t\t\t$mail->From = $_options['from'];\n\t\t\t$mail->FromName = $_options['name'];\n\t\t\t$mail->AddAddress($_options['to']);\n\t\t\t$mail->Subject = htmlspecialchars($_options['subject']);\n\t\t\t$mail->Body = $_options['message'];\n\t\t\t$mail->AddAttachment('tmp/'.$guid.'.'.$file_name, $file_name);\n\t\t\t\n\t\t\tif ($_options['auth']) {\n\t\t\t\t$mail->Host = $_options['host'];\n\t\t\t\t$mail->Port = $_options['port'];\n\t\t\t\t$mail->SMTPAuth = $_options['auth'];\n\t\t\t\t$mail->SMTPSecure = $_options['secure'];\n\t\t\t\t$mail->Username = $_options['login'];\n\t\t\t\t$mail->Password = $_options['password'];\n\t\t\t}\n\t\t\t\n\t\t\t$mail->Send();\n\t\t\t$error = $_options['successfully'] ? '0' : '-1';\n\t\t}\n\t\tcatch (phpmailerException $e) {\n\t\t\t$error_description = strip_tags($e->errorMessage());\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$error_description = strip_tags($e->getMessage());\n\t\t}\n\t\t\n\t\tunlink('tmp/'.$guid.'.'.$file_name);\n\t\t\n\t\tif ($error == \"0\" || $error == \"-1\") return $error;\n\t\treturn \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><SendEmail><ErrorCode>$error</ErrorCode><ErrorDescription>$error_description</ErrorDescription></SendEmail>\";\n\t}", "public function indexImport()\n\t{\n\t\t$this->commons->isAdmin();\n\t\t$filename = $_FILES[\"file\"][\"tmp_name\"];\n\t\t$data = '';\n\t\t$row = 0;\n\t\t$expire = date('Y-m-d', strtotime('+1 years'));\n\t\tif ($_FILES[\"file\"][\"size\"] > 0) {\n\t\t\t$file = fopen($filename, \"r\");\n\t\t\twhile (($getData = fgetcsv($file, 10000, \",\")) !== FALSE) {\n\t\t\t\tif ($row == 0 && $getData[0] !== 'Salutation' && $getData[1] !== 'First Name' && $getData[2] !== 'Last Name' && $getData[3] !== 'Company' && $getData[4] !== 'Email Address' && $getData[5] !== 'Phone Number' && $getData[6] !== 'Website' && $getData[7] !== 'Address Line 1' && $getData[8] !== 'Address Line 2' && $getData[9] !== 'City' && $getData[10] !== 'State' && $getData[11] !== 'Country' && $getData[12] !== 'Postal Code') {\n\t\t\t\t\techo 0;\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\tif ($row > 0) {\n\t\t\t\t\t$temp = array('address1' => $getData[7], 'address2' => $getData[8], 'city' => $getData[9], 'state' => $getData[10], 'country' => $getData[11], 'pin' => $getData[12], 'phone1' => '', 'fax' => '');\n\t\t\t\t\t$data .= \"('\" . $getData[0] . \"','\" . $getData[1] . \"','\" . $getData[2] . \"','\" . $getData[3] . \"','\" . $getData[4] . \"','\" . $getData[5] . \"','\" . $getData[6] . \"','\" . json_encode($temp) . \"','\" . $getData[11] . \"','\" . $expire . \"'),\";\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t\t$data = rtrim($data, ',');\n\t\t$result = $this->contactModel->importContact($data);\n\t\tif ($result) {\n\t\t\techo 1;\n\t\t} else {\n\t\t\techo 0;\n\t\t}\n\t}", "function isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isFileNumberValid = isFileNumberValid($fileNumber);\n if (!$isFileNumberValid) {\n $result['message'] = \"Please Enter a Valid File No\";\n return $result;\n }\n if (!$name) {\n $result['message'] = \"Please Enter Patient Name\";\n return $result;\n }\n $phoneNoIsValid = isPhoneNoValid($phoneNo);\n if (!$phoneNoIsValid) {\n $result['message'] = \"Please Enter Valid Phone No\";\n return $result;\n }\n $isDateOfBirthValid = isDateOfBirthValid($dateOfBirth);\n if (!$isDateOfBirthValid) {\n $result['message'] = \"Please Enter a Valid Date of Birth\";\n return $result;\n }\n $result['result'] = true;\n return $result;\n}", "function sendMailForDomainPublishUnPublish()\n\t\t{\n\t\t\tglobal $CFG;\n \t $sel_id \t = $_POST['checkedvaluesarr'];\n\t\t\t$tablename \t\t = $_POST['tablename'];\n\t\t\t$filedname \t\t = $_POST['fieldname'];\n\t\t\t$changestatusval = $_POST['changestatusval'];\n\t\t\t$upid \t\t\t = $_POST['whereField'];\n\t\t\t$from_name = $CFG['site']['adminname'];\n\t\t\t$from_email = $CFG['site']['adminemail'];\n\t\t\t\n\t\t\tif( isset($sel_id) && is_array($sel_id) ) {\n\t\t foreach($sel_id as $x => $value){\n\t\t \t$sel_del = \"UPDATE \".$tablename.\" SET \".$filedname.\" = '\".$this->filterInput($changestatusval).\"' WHERE \".$upid.\" = '\".$this->filterInput($value).\"'\";\n\t \t$res_del = mysql_query($sel_del) or die($this->mysql_error($sel_del));\n\t \tif($res_del)\n\t \t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t \t$mail_content = $this->readfilecontent($CFG['site']['emailtpl_path'].\"/emailToAllDomainUser.tpl\");\n\t\t\t\t\t $mail_content = str_replace('{SITE_TITLE}',$CFG['site']['sitename'],$mail_content);\n\t\t\t\t\t $mail_content = str_replace('{SITE_LOGO}',$CFG['site']['logoname'],$mail_content);\n\t\t\t\t\t \n\t\t\t\t\t if($changestatusval == 'publish')\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\t$to_email= $this->selectEmailFromSighupTable($value);\n\t\t\t\t\t \t\t$mailsubject = $CFG['site']['sitename'].\" Your New Domain Published\";\n\t\t\t\t\t\t\t\t\t$name= $this->selectNameFromSighupTable($value);\n\t\t\t\t \t\t$domain_name= $this->selectDomainFromSighupTable($value);\n\t\t\t\t \t\t$mail_content = str_replace('{CONTENT}','Your '.$domain_name.' Domain Published By Us.Lets Enjoy With Your New Domain.',$mail_content);\n\t\t\t\t \t\t$mail_content = str_replace('{NAME}',$name,$mail_content);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t else if($changestatusval == 'unpublish')\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \t $to_email= $this->selectEmailFromSighupTable($value);\n\t\t\t\t\t\t \t $mailsubject = $CFG['site']['sitename'].\" Your New Domain Un Published\";\n\t\t\t\t\t\t\t\t\t $name= $this->selectNameFromSighupTable($value);\n\t\t\t\t \t\t\t $domain_name= $this->selectDomainFromSighupTable($value);\n\t\t\t\t \t\t\t $mail_content = str_replace('{CONTENT}','Your '.$domain_name.' Domain Un Published By Us.Sorry For Delaying.Soon We Will Contact You.',$mail_content);\n\t\t\t\t \t\t\t $mail_content = str_replace('{NAME}',$name,$mail_content);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t else if($changestatusval == 'pointed')\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\t $to_email= $this->selectPointEmailFromSighupTable($value);\n\t\t\t\t\t \t\t $mailsubject = $CFG['site']['sitename'].\" Your Domain Pointed\";\n\t\t\t\t\t \t\t $name= $this->selectPointNameFromSighupTable($value);\n\t\t\t\t \t\t\t $domain_name= $this->selectPointDomainFromSighupTable($value);\n\t\t\t\t\t\t\t\t\t $mail_content = str_replace('{CONTENT}','Your '.$domain_name.' Domain Pointed .Lets Enjoy With Your New Point Domain.',$mail_content);\n\t\t\t\t\t\t\t\t\t $mail_content = str_replace('{NAME}',$name,$mail_content);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t \t else\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\t $to_email= $this->selectPointEmailFromSighupTable($value);\n\t\t\t\t\t \t\t $mailsubject = $CFG['site']['sitename'].\" Your Domain Un Pointed\";\n\t\t\t\t\t \t\t $name= $this->selectPointNameFromSighupTable($value);\n\t\t\t\t \t\t\t $domain_name= $this->selectPointDomainFromSighupTable($value);\n\t\t\t\t\t\t\t\t\t $mail_content = str_replace('{CONTENT}','Your '.$domain_name.' Domain Un Pointed By Us.Sorry For Delaying.Soon We Will Contact You.',$mail_content);\n\t\t\t\t\t\t\t\t\t $mail_content = str_replace('{NAME}',$name,$mail_content);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t \n\t\t\t\t\t $mail_content = str_replace('{ADMINNAME}',$CFG['site']['adminname'],$mail_content);\n\t\t\t\t\t\t\t//echo $mail_content;die();\n\t\t\t\t\t\t\t$ok=$this->sendMail($from_name,$from_email,$to_email,$mailsubject,$mail_content);\n\t\t\t\t\t\t}\n\t\t \n\t\t \t}\n\t\t echo 'success';exit;\n\t\t }\t\t\n\t\t\t\n\t\t}", "public function exportReport($data,$timeZone = \"\") {\n // $timezone = '';\n $timezone = getClientSpecificTimeZone();\n // if($timeZone!= \"\")\n // $timezone = $timeZone;\n \n $results = collect($data)->map(function ($x) use($timezone) {\n \n $x->DateOfSubmission = Carbon::parse($x->DateOfSubmission)->setTimezone($timezone)->format(getDateFormat().\" \".getTimeFormat());\n if($x->DateOfTPV != \"\")\n $x->DateOfTPV = Carbon::parse($x->DateOfTPV)->setTimezone($timezone)->format(getDateFormat().\" \".getTimeFormat());\n return (array)$x;\n })->toArray();\n \n Log::info($results);\n $filename = \"CRITICAL-ALERT-REPORT-\" . date('y-m-d');\n\n $csvExported = Excel::create($filename, function ($excel) use ($results) {\n $excel->sheet('Report', function ($sheet) use ($results) {\n $column_name = 'A';\n foreach ($results as $key1 => $value12) {\n if ($key1 == 0) {\n\n foreach ($value12 as $cname => $cvalue) {\n\n $sheet->cell($column_name . '1', $cname, function ($cell, $cellvalue) {\n $cell->setValue($cellvalue);\n });\n $sheet->row($sheet->getHighestRow(), function ($row) {\n $row->setFontWeight('bold');\n });\n $column_name++;\n }\n } else {\n continue;\n }\n }\n\n if (!empty($results)) {\n $g = 0;\n foreach ($results as $key => $value) {\n\n $columnname = 'A';\n if ($key == 0) {\n $i = $key + 2;\n }\n\n foreach ($value as $cnam => $cval) {\n $sheet->setCellValue($columnname . $i, $value[$cnam]);\n $columnname++;\n }\n $i++;\n\n }\n }\n\n });\n })->string('csv');\n\n\n // Store Exported CSV to storage\n $awsFolderPath = config()->get('constants.aws_folder');\n $filePath = config()->get('constants.CRITICAL_PDF_UPLOAD_PATH');\n $fileName = 'critical_csv_' . time() . '.csv';\n\n $path = $this->storageService->uploadFileToStorage($csvExported, $awsFolderPath, $filePath, $fileName);\n\n $fileDetails = [];\n if ($path !== false) {\n $fileDetails[] = $path;\n }\n // Retrieve leads with critical logs and generates its pdf and store it to storage\n foreach ($data as $lead) {\n \n $pdfUploaded = $this->criticalLogsPdf($lead->LeadNumber,$timezone);\n if ($pdfUploaded !== false) {\n $fileDetails[] = $pdfUploaded;\n } else {\n continue;\n }\n }\n\n // Create Zip file and integrate all zips & csv into it\n $tmpFile = $this->downloadCriticalLogsZip($fileDetails);\n return $tmpFile;\n }", "public function validEmailValidDataProvider() {}", "public function export($filename, $data, $options = array(),$headers_text=array()) {\n\t\t$options = array_merge($this->defaults, $options);\n\t\t\n\t\t// open the file\n\t\tif ($file = @fopen($filename, 'w')) {\n\t\t\t// Iterate through and format data\n\t\t\t$firstRecord = true;\n\t\t\tforeach ($data as $record) {\n\t\t\t\t$row = array();\n\t\t\t\tforeach ($record as $model => $fields) {\n\t\t\t\t\t// TODO add parsing for HABTM\n\t\t\t\t\tif($model==\"BusinessOwner\"){ $fields = array_reverse($fields);}\n\t\t\t\t\tforeach ($fields as $field => $value) {\n\t\t\t\t\t\tif (!is_array($value)) {\n\t\t\t\t\t\t\tif (strpos(strtolower($field),'date') !== false) {\n\t\t\t\t\t\t\t\t$value = date('m-d-Y',strtotime($value));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (strtolower($field) == \"is_active\") {\n\t\t\t\t\t\t\t\t$value = ($value==1) ? \"Active\" : \"Inactive\";\n\t\t\t\t\t\t\t\t$field = \"Status\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (strtolower($field) == \"is_registered\") {\n\t\t\t\t\t\t\t\t$value = ($value==1) ? \"Registered\" : \"Guest\";\n\t\t\t\t\t\t\t\t$field = \"Type\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ($firstRecord) {\n\t\t\t\t\t\t\t\t//$headers[] = $this->_encode($model . '.' . $field);\n\t\t\t\t\t\t\t\t$field = ucwords(str_replace('_', ' ', $field));\n\t\t\t\t\t\t\t\t$headers[] = $this->_encode($field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$row[] = $this->_encode($value);\n\t\t\t\t\t\t} // TODO due to HABTM potentially being huge, creating an else might not be plausible\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$rows[] = $row;\n\t\t\t\t$firstRecord = false;\n\t\t\t}\n\n\t\t\tif ($options['headers']) {\n\t\t\t\t// write the 1st row as headings\n\t\t\t\tif($headers_text){\n\t\t\t\t\tfputcsv($file, $headers_text, $options['delimiter'], $options['enclosure']);\n\t\t\t\t}else{\n\t\t\t\t\tfputcsv($file, $headers, $options['delimiter'], $options['enclosure']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// Row counter\n\t\t\t$r = 0;\n\t\t\tforeach ($rows as $row) {\n\t\t\t\tfputcsv($file, $row, $options['delimiter'], $options['enclosure']);\n\t\t\t\t$r++;\n\t\t\t}\n\n\t\t\t// close the file\n\t\t\tfclose($file);\n\t\t\t$ok = @chmod($filename, 0777);\t\t\t\n\t\t\treturn $r;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function dataToMail(){\n\t\t\t\t\n\n\t\t\t\t\n\n\n\n $sql = \"SELECT MAX(m.id), m.id, t.ID, t.reference, t.user_id, u.name, u.username, u.email, m.subject, m.body, MAX(m.posted) posted, t.ticket_status_id, st.title estatus, t.ticket_dept_id, dep.title, t.opened, \t\tt.closed, t.lastupdate FROM cquko_fss_ticket_status st, cquko_fss_ticket_dept dep, cquko_users u, cquko_fss_ticket_ticket t, cquko_fss_ticket_messages m WHERE u.id = t.user_id AND t.ticket_status_id = st.id AND t.ticket_dept_id = dep.id AND m.ticket_ticket_id = t.id AND m.subject <>'Audit Message' AND st.title <> 'Closed' AND st.title = 'Open' GROUP BY t.id ORDER BY opened DESC, reference asc\";\n\n\t\t\t\t\n\n return $this->db->query($sql);\n\n \n\n //return $this->db->fetchAll(PDO::FETCH_ASSOC) ;\n\n }", "function mail_allothers($db_object,$common,$post_var,$user_id,$error_msg)\n\t{\n\t\twhile(list($kk,$vv)=@each($post_var))\n\t\t{\n\n\t\t$$kk=$vv;\n\t\n\t\t}\n\t\t\n\t$config=$common->prefix_table(\"config\");\n\t$appraisal_table=$common->prefix_table(\"multirater_appraisal\");\n \t$otherraters_table = $common->prefix_table(\"other_raters\");\n\t$user_table=$common->prefix_table(\"user_table\");\n\t$ratergroup_table = $common->prefix_table(\"rater_group\");\n\t$position_table = $common->prefix_table(\"position\");\n \t\n//groups to be sent mail...\n\t\n\t$mysql = \"select rater_group_name from $ratergroup_table\";\n\t$group_arr = $db_object->get_single_column($mysql);\n\n\t\n\t\tfor($i=0;$i<count($group_arr);$i++)\n\t\t{\n\t\t\t$group_var = $group_arr[$i];\n\t\t\n\t\t\t$name=$group_var;\t\n\n\t\t\t$$name=1;\n\t\t}\n\n// emails in OTHERS category will be sent in the multirater_appraisal.php\n\n\t\tfor($x=0;$x<count($user_id_all);$x++)\n\t\t{\n\t\t\t\n\t\t$appraisal_userid = $user_id_all[$x];\n\t \n//OCT 11 MAILS SHOULD BE SENT FROM HERE TO BOSS , BOSS' BOSS , SELF ONLY\n\n//boss id\n\t\t\n\t\t$boss_no = $common->immediate_boss($db_object,$appraisal_userid);\n\t\t\n\n//boss' boss id \n\t\t \n\t\t\n\t\t$boss_boss_no = $common->immediate_boss($db_object,$boss_no);\n\n\t//check with the group names...\n\t\t$current_user_id = \"\";\n\t\t\n\t\t$current_user_id[] = $appraisal_userid; //converting the current userid to array \n\n\t\t\tif($grp_boss == 1)\n\t\t\t{\n\t\t\t\tif($boss_no != 0)\n\t\t\t\t{\n\t\t\t\t$array_users4 = $boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\n\t\t\n\t\t\t}\n\t\t \n\t \t\tif($grp_topboss == 1)\n\t\t\t{\n\t\t\t\tif($boss_boss_no !=0)\n\t\t\t\t{\n\t\t\t\t$array_users7 = $boss_boss_no;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\n\t\t$array_users = @array_merge($array_users4,$array_users7,$current_user_id);\t\n\t\n//all the persons who are supposed to recieve email is obtained...\n\t\n\t\t$array_users = @array_unique($array_users);\n\n\n//codings to send mail...\n\t\t\n\t\t$mysql=\"select masubject,mamessage from $config\";\n\t\n\t\t$rslt_arr=$db_object->get_a_line($mysql);\n\n\t\t\n\n\t\t$masubject=$rslt_arr[\"masubject\"];\n\t\t$mamessage=$rslt_arr[\"mamessage\"];\n\n//sender email details...\n\t\t$mysql = \"select username,email from $user_table where user_id = '$appraisal_userid'\";\n\n\t\t$sender_arr = $db_object->get_a_line($mysql);\n\t\t$user = $sender_arr[\"username\"];\n\t\t$from = $sender_arr[\"email\"];\n\n\t\t\n\t\t$user_idstring=implode(\",\",$array_users);\n\n\t\t$mysql = \"select email,username,user_id from $user_table \n\t\twhere user_id in ($user_idstring)\";\n\t\t\t\t\t\t\n\n\t\t$email_arr1 = $db_object->get_rsltset($mysql);\n\n\t\t$email_arr=array();\n\n\t\tfor($l=0;$l<count($email_arr1);$l++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$id=$email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"user_id\"] = $email_arr1[$l][\"user_id\"];\n\t\t\t\t$email_arr[$id][\"email\"]=$email_arr1[$l][\"email\"];\n\t\t\t\t$email_arr[$id][\"username\"]=$email_arr1[$l][\"username\"];\n\t\t\t\t\n\t\t\t}\n\n\n\n\n\t\twhile (list($kk,$vv) = @each($array_users))\n\t\t\t{\n\t\t\t$useridToMail = $array_users[$kk];\n\t\t\t\n\t\t\t\n\t\t\t\tif($useridToMail != 0)\n\t\t\t\t{\n\n\t\t\t\n\t\t\t\t$email = $email_arr[$useridToMail][\"email\"];\n\n\t\t\t\t$username = $email_arr[$useridToMail][\"username\"];\t\n\t\t\t\t$rater_user_id = $email_arr[$useridToMail][\"user_id\"];\n\n\t\t\t\t$to = $email;\n\t\t\t\t\n\t\t\t\t$values[\"username\"]\t=$username;\n\t\t\t\t$values[\"user\"] \t= $user;\n\t\t\t\t$values[\"login_username\"] = $username;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$values[\"url\"]=$common->http_path.\"/index.php\";\n\n\t\t\t\t$message=$common->direct_replace($db_object,$mamessage,$values);\n\n\t\t\t\t//echo \"to $to<br> sub $masubject<br> mess $message<br> from $from<br><br>\";\n\n\t\t\t\t$sent=$common->send_mail($to,$masubject,$message,$from);\n \n//store the data of the persons to whom the mail has been sent\n\t\t\n\t\t\t\t$rater_id = $rater_user_id;\n\t\t\t\t$user_to_be_rated = $appraisal_userid;\n\t\t\t\t$rater_email = $email;\n\t\t\n//insert the data regarding the raters into the table...\n\t\t\t\t\n//if the user is the rater, it means that he belong to the self category...\t\t\t\n\t\t\t\t\n\t\t\t\tif($user_to_be_rated == $rater_id)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_self';\n\t\t\t\t}\n\t\t\t\telseif($rater_id == $boss_boss_no)\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_topboss';\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t$group_belongingto = 'grp_boss';\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$mysql = \"insert into $otherraters_table set rater_userid = '$rater_id' , rater_email = '$rater_email' ,cur_userid = '$user_to_be_rated' , group_belonging = '$group_belongingto' ,date_rating_requested=now()\";\n\t\t\t\t\n\t\t\t\t$db_object->insert($mysql);\n\t\t\n\t\t\t\t//user_to_be_rated = \"\"; //from\n\t\t\t\t//rater_id = \"\"; //to\n\t\t\n\t\t\t\t}\n\t\t\n\n\t\t\t}\n\t\t\n\t\n\t\t\n\t}\n\t\tif($sent)\n\t\t{\n\t\t\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_sent\"];\n\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo $error_msg[\"cMultiraterAppraisalMail_fail\"];\n\t\t}\n\t\t\n\t\n}", "function wp_user_personal_data_exporter($email_address)\n {\n }", "public function sendBatchEmail($peeps, $unsubtype, $SUBJECT, $TEXT, $context, \r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\"), $REPLYTO = null, $ATTACHMENT = null) \r\n {\r\n // $FROM = array('[email protected]' => \"Conejo Valley UU Fellowship\");\r\n $FROM = array('[email protected]' => '[email protected]');\r\n $efunctions = new Cvuuf_emailfunctions();\r\n $peoplemap = new Application_Model_PeopleMapper();\r\n $unsmap = new Application_Model_UnsubMapper();\r\n\r\n $results = array();\r\n $orwhere = array(\r\n array('`all`', ' = ', 1),\r\n array($unsubtype, ' = ', 1),\r\n );\r\n $unsubs = $unsmap->fetchOrWhere($orwhere);\r\n $unsubids = array();\r\n foreach ($unsubs as $unsub)\r\n {\r\n $person = $peoplemap->find($unsub->id);\r\n if ($person['email'] <> '')\r\n $unsubids[$person['email']] = 1;\r\n }\r\n\r\n $emailCount = count($peeps); \r\n $results[] = \"$emailCount copies to be sent.\";\r\n \t\t$count = 0;\r\n \t\t$fullcount = 0;\r\n\r\n $totalsent = 0;\r\n $invalid = array();\r\n $unsub = array();\r\n if ($emailCount >= 30) {\r\n return array('results' => $results.\" (rejected to avoid spam blacklists, 30-email max. Contact [email protected] to work out how to send this)\", 'log' => 'rejected to avoid spam blacklists', 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }\r\n unset($TO_array);\r\n \t\tforeach ($peeps as $peep) \r\n {\r\n \t $emailAddress = $peep->email;\r\n \t if (!$efunctions->isValidEmail($emailAddress))\r\n { \r\n $invalid[] = $emailAddress;\r\n }\r\n elseif (isset($unsubids[$emailAddress]))\r\n {\r\n $unsub[] = $emailAddress;\r\n } \r\n else \r\n {\r\n $fullcount++;\r\n $TO_array[$count++] = $emailAddress;\r\n \t\t\tif (($count%20) == 0) \r\n {\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n unset($TO_array);\r\n $count = 0;\r\n sleep(1);\r\n \t\t }\r\n // Check section limit and delay if reached\r\n if (($fullcount % 10) == 0)\r\n {\r\n $results[] = \"Progress count $fullcount sent\"; \r\n sleep(5);\r\n }\r\n \t}\r\n } \r\n // send last email segment\r\n $numsent = $efunctions->sendEmail($SUBJECT, $TO_array, $TEXT, $context, $FROM, $REPLYTO, $ATTACHMENT);\r\n $totalsent += $numsent;\r\n $results[] = sprintf(\"Ending fraction count %d copies\\n\", $numsent);\r\n $log = $efunctions->log_email($context, $emailCount, $totalsent, count($invalid), count($unsub));\r\n $results[] = \"Last Segment sent\";\r\n\r\n return array('results' => $results, 'log' => $log, 'totalsent' => $totalsent, \r\n 'invalid' => $invalid, 'unsub' => $unsub);\r\n }", "function get_report()\r\n{\r\n$fname = 'myCSV.csv';\r\n$fp = fopen($fname,'w');\r\n$column_name = '\"ID\",\"package_name\",\"package_add1\",\"package_add2\",\"package_state\",\"package_email\",\"package_city\",\"package_mobile\",\"package_gender\",\"package_dob\",\"package_nl_id\",\"package_image\"'.\"\\n\\r\";\r\nfwrite($fp,$column_name);\t\r\n\t\r\n$SQL=\"SELECT * FROM package,city WHERE package_city = city_id\";\r\n$rs=mysql_query($SQL);\r\nwhile($data=mysql_fetch_assoc($rs))\r\n{\r\n\t$csvdata=implode(\",\",$data).\"\\n\\r\";\r\n\tfwrite($fp,$csvdata);\t\t\r\n}\r\nfclose($fp);\r\nheader('Content-type: application/csv');\r\nheader(\"Content-Disposition: inline; filename=\".$fname);\r\nreadfile($fname);\r\n}", "private function exportCSV($finalRespArr, $personId, $orgId, $questionTypeCode, $questionNumber, $source)\n {\n if (($questionTypeCode == 'SA' || $questionTypeCode == 'LA' || $questionTypeCode == 'ISQ-SA' || $questionTypeCode == 'ISQ-LA') && $source != 'drilldown') {\n $csvHeader = [\n 'RESPONSE'\n ];\n } else {\n $csvHeader = [\n 'FIRST NAME',\n 'LAST NAME',\n 'RISK INDICATOR',\n 'CLASS LEVEL',\n 'RESPONSE',\n 'EXTERNAL ID',\n 'PRIMARY EMAIL'\n ];\n }\n $fh = @fopen(\"data://report_downloads/{$orgId}-{$personId}-{$questionTypeCode}-{$questionNumber}-snapshot-report.csv\", 'w');\n fputcsv($fh, $csvHeader);\n if (!empty($finalRespArr)) {\n\n if (($questionTypeCode == 'SA' || $questionTypeCode == 'LA' || $questionTypeCode == 'ISQ-SA' || $questionTypeCode == 'ISQ-LA') && $source != 'drilldown') {\n foreach ($finalRespArr as $array) {\n $rows[] = [\n 'response' => $array->getResponse()\n ];\n }\n } else {\n foreach ($finalRespArr as $array) {\n /*\n * Include student external id and primary email\n */\n $primaryEmail = \"\";\n $personDetails = $this->personRepository->find($array->getStudentId());\n if (!$personDetails) {\n throw new ValidationException([\n PersonConstant::ERROR_PERSON_NOT_FOUND\n ], PersonConstant::ERROR_PERSON_NOT_FOUND, PersonConstant::ERROR_PERSON_NOT_FOUND_KEY);\n } else {\n $personDetail = $this->personRepository->getPersonDetails($personDetails);\n if (count($personDetail) > 0) {\n $contacts = $personDetail[0]['contacts'][0];\n if (!empty($contacts)) {\n $primaryEmail = $contacts['primaryEmail'];\n }\n }\n }\n\n $rows[] = [\n 'first_name' => @iconv(\"UTF-8\", \"ISO-8859-2\", $array->getStudentFirstName()),\n 'last_name' => @iconv(\"UTF-8\", \"ISO-8859-2\", $array->getStudentLastName()),\n 'risk_indicator' => $array->getStudentRiskStatus(),\n 'class_level' => $array->getStudentClasslevel(),\n 'response' => $array->getResponse(),\n 'external_ID' => $personDetails->getExternalId() ? $personDetails->getExternalId() : null,\n 'primary_email' => $primaryEmail\n ];\n }\n }\n }\n if (isset($rows) && count($rows) > 0) {\n foreach ($rows as $fields) {\n fputcsv($fh, $fields);\n }\n }\n fclose($fh);\n }", "function _osg_singout_notifier_prep_message($info,$data) {\n global $base_url;\n $message = array();\n $separator = md5(time());\n // carriage return type (we use a PHP end of line constant)\n $eol = PHP_EOL;\n\n //$params['to'] = $record['email'];\n $recipient = $info['first_name'].' '.$info['last_name'].' <[email protected]'.'>';\n $sender = variable_get('site_mail', '[email protected]');\n $message['subject'] = 'These Performances are available for registration.';\n $fudge = count($data) > 2?'s':'';\n $fudge = \"Please visit <a href=\\\"$base_url\\\">\".variable_get('site_name','[Some Cool Site]').\"</a>\"\n .\" and indicate your attendance plan for the following event$fudge:\";\n $data[0] = $fudge;\n $body = implode(\"<br>\",$data);\n\n\n\n $message['body'] = $body;\n\n debug($message,'$message');\n //drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)\n drupal_mail('osg_singout_notifier'\n , 'registration_needed'\n , $recipient\n , language_default()\n , $message\n , $sender\n );\n\n}", "public function ConsumerFeedbackEmailtoCustomer($product_name, $bar_code, $customer_name, $consumer_name, $customer_feedback_email, $consumer_feedback_rating, $consumer_feedback_description, $consumer_mobile, $consumer_email, $feedback_datetime) \n\t\t{//echo '***'.$email;exit;\n \n $subject = 'ISPL : Product Feedback -> ' . $product_name;\n $body = \"Hello <b>\" . $customer_name . \"</b>,\n\t\t\t\t\t\t\t\t <br><br>\n\t\t\t\t\t\t\t\t The following consumer feedback has been received. The detail of feedback as received is as under:\n\t\t\t\t\t\t\t\t <br>\n\t\t\t\t\t\t\t\t<br>Consumer Name : <b> \" . $consumer_name . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Mobile Number : <b> \" . $consumer_mobile . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Email address : <b> \" . $consumer_email . \"</b>.\n \t\t\t\t\t\t\t\t<br>Date & Time of Feedback: : <b> \" . $feedback_datetime . \"</b>.\n \t\t\t\t\t\t\t\t<br>Product Name : <b> \" . $product_name . \"</b>. \t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<br>Product Code : <b>\" . $bar_code . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Feedback Type: <b>\" . $consumer_feedback_rating . \"</b>.\n\t\t\t\t\t\t\t\t<br>Consumer Feedback Description : <b>\" . $consumer_feedback_description . \"</b>.\n\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\tPlease address to the same and update the status to your consumer.\n \t\t\t\t\t\t\t\t<br><br><b>ISPL Team</b>\";\n $mail_conf = array(\n 'subject' => $subject,\n 'to_email' => $customer_feedback_email,\n 'cc' => '[email protected]',\n 'from_email' => 'admin@'.$_SERVER['SERVER_NAME'],\n 'from_name' => 'ISPL',\n 'body_part' => $body\n );\n if ($this->dmailer->mail_notify($mail_conf)) {\n return true;\n } return false; //echo redirect('accounts/create');\n }", "function dmailer_prepare($row)\t{\n\t\tglobal $LANG;\n\n\t\t$sys_dmail_uid = $row['uid'];\n\t\tif ($row['flowedFormat']) {\n\t\t\t$this->flowedFormat = 1;\n\t\t}\n\t\tif ($row['charset']) {\n\t\t\t$this->charset = $row['charset'];\n\t\t}\n\t\tswitch ($row['encoding']) {\n\t\t\tcase 'base64':\n\t\t\t\t$this->useBase64();\n\t\t\t\tbreak;\n\t\t\tcase '8bit':\n\t\t\t\t$this->use8Bit();\n\t\t\t\tbreak;\n\t\t\tcase 'printed-quotable':\n\t\t\tdefault:\n\t\t\t\t$this->useQuotedPrintable();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->theParts = unserialize($row['mailContent']);\n\t\t$this->messageid = $this->theParts['messageid'];\n\n\t\t$this->subject = $row['subject'];\n\t\t$this->subject = $LANG->csConvObj->conv($this->subject, $LANG->charSet, $this->charset);\n\t\t$this->subject = t3lib_div::encodeHeader($this->subject, ($this->alt_base64 ? 'base64' : 'quoted_printable'), $this->charset);\n\n\t\t$this->from_email = $row['from_email'];\n\t\t$this->from_name = ($row['from_name'] ? $LANG->csConvObj->conv($row['from_name'], $LANG->charSet, $this->charset) : '');\n\t\t$this->from_name = t3lib_div::encodeHeader($this->from_name, ($this->alt_base64 ? 'base64' : 'quoted_printable'), $this->charset);\n\t\t\n\t\t$this->replyto_email = ($row['replyto_email'] ? $row['replyto_email'] : '');\n\t\t$this->replyto_name = ($row['replyto_name'] ? $LANG->csConvObj->conv($row['replyto_name'], $LANG->charSet, $this->charset) : '');\n\t\t$this->replyto_name = t3lib_div::encodeHeader($this->replyto_name, ($this->alt_base64 ? 'base64' : 'quoted_printable'), $this->charset);\n\t\t\n\t\t$this->organisation = ($row['organisation'] ? $LANG->csConvObj->conv($row['organisation'], $LANG->charSet, $this->charset) : '');\n\t\t$this->organisation = t3lib_div::encodeHeader($this->organisation, ($this->alt_base64 ? 'base64' : 'quoted_printable'), $this->charset);\n\t\t\n\t\t$this->priority = tx_directmail_static::intInRangeWrapper($row['priority'], 1, 5);\n\t\t$this->mailer = 'TYPO3 Direct Mail module';\n\t\t$this->authCode_fieldList = ($row['authcode_fieldList'] ? $row['authcode_fieldList'] : 'uid');\n\n\t\t$this->dmailer['sectionBoundary'] = '<!--DMAILER_SECTION_BOUNDARY';\n\t\t$this->dmailer['html_content'] = base64_decode($this->theParts['html']['content']);\n\t\t$this->dmailer['plain_content'] = base64_decode($this->theParts['plain']['content']);\n\t\t$this->dmailer['messageID'] = $this->messageid;\n\t\t$this->dmailer['sys_dmail_uid'] = $sys_dmail_uid;\n\t\t$this->dmailer['sys_dmail_rec'] = $row;\n\n\t\t$this->dmailer['boundaryParts_html'] = explode($this->dmailer['sectionBoundary'], '_END-->'.$this->dmailer['html_content']);\n\t\tforeach ($this->dmailer['boundaryParts_html'] as $bKey => $bContent) {\n\t\t\t$this->dmailer['boundaryParts_html'][$bKey] = explode('-->', $bContent, 2);\n\n\t\t\t\t// Remove useless HTML comments\n\t\t\tif (substr($this->dmailer['boundaryParts_html'][$bKey][0],1) == 'END') {\n\t\t\t\t$this->dmailer['boundaryParts_html'][$bKey][1] = $this->removeHTMLComments($this->dmailer['boundaryParts_html'][$bKey][1]);\n\t\t\t}\n\n\t\t\t\t// Now, analyzing which media files are used in this part of the mail:\n\t\t\t$mediaParts = explode('cid:part', $this->dmailer['boundaryParts_html'][$bKey][1]);\n\t\t\treset($mediaParts);\n\t\t\tnext($mediaParts);\n\t\t\twhile(list(,$part) = each($mediaParts)) {\n\t\t\t\t$this->dmailer['boundaryParts_html'][$bKey]['mediaList'] .= ',' . strtok($part, '.');\n\t\t\t}\n\t\t}\n\t\t$this->dmailer['boundaryParts_plain'] = explode($this->dmailer['sectionBoundary'], '_END-->'.$this->dmailer['plain_content']);\n\t\tforeach ($this->dmailer['boundaryParts_plain'] as $bKey => $bContent) {\n\t\t\t$this->dmailer['boundaryParts_plain'][$bKey] = explode('-->', $bContent, 2);\n\t\t}\n\n\t\t$this->flag_html = ($this->theParts['html']['content'] ? 1 : 0);\n\t\t$this->flag_plain = ($this->theParts['plain']['content'] ? 1 : 0);\n\t\t$this->includeMedia = $row['includeMedia'];\n\t}", "function mailreport()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlerObject = atkErrorHandlerBase::get('mail', array('mailto'=>atkconfig('mailreport')));\n\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n}" ]
[ "0.65734947", "0.64186656", "0.64186656", "0.638806", "0.6291466", "0.6214176", "0.61309475", "0.60481906", "0.6023297", "0.59110874", "0.5873534", "0.5873211", "0.58305365", "0.57869405", "0.5731531", "0.5700321", "0.5699381", "0.56718177", "0.5670822", "0.564732", "0.5645884", "0.5632916", "0.56259227", "0.56228155", "0.55759776", "0.556359", "0.55466884", "0.5535902", "0.5509797", "0.5506294", "0.55030906", "0.5498323", "0.5494296", "0.5493943", "0.5490755", "0.5482195", "0.54711676", "0.5466017", "0.54653543", "0.54458", "0.54426134", "0.5440805", "0.54308474", "0.54274166", "0.5425241", "0.5424695", "0.54215443", "0.5412045", "0.5401922", "0.5398603", "0.53934073", "0.537133", "0.53670174", "0.5361873", "0.53575474", "0.5342698", "0.53324246", "0.5319803", "0.5311984", "0.53061634", "0.5304053", "0.5298673", "0.5295193", "0.52939516", "0.52865285", "0.5284196", "0.52799445", "0.52752876", "0.52676725", "0.5266055", "0.5256287", "0.5254596", "0.5254295", "0.5248557", "0.52428395", "0.5230491", "0.52285266", "0.52212334", "0.52165145", "0.5213755", "0.52080345", "0.5205479", "0.52005845", "0.51991993", "0.51988435", "0.51980627", "0.5196154", "0.5186925", "0.5185747", "0.5183397", "0.51783234", "0.51768064", "0.5175987", "0.516329", "0.51603675", "0.51603174", "0.51519895", "0.51516026", "0.5149944", "0.51446396", "0.5143321" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $response = $next($request); $operands = $response->original['data']['operands']; if($request->segment(1) != 'divide'){ sort($operands, SORT_NUMERIC); } $key = $response->original['data']['operation'].'_'.implode(array_flatten($operands),''); $data = ['operands'=>$response->original['data']['operands'], 'result'=> $response->original['data']['result'] ]; Cache::set($key, $data, $this->setTime); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public function handleRequest(Request $request, Response $response);", "public abstract function processRequest();", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function DispatchRequest ();", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.83001333", "0.81485367", "0.81485367", "0.81485367", "0.8128516", "0.79942316", "0.7927549", "0.791423", "0.79006535", "0.7633586", "0.7510298", "0.74876535", "0.74091655", "0.7377972", "0.7368652", "0.7294605", "0.7238382", "0.72307026", "0.7212001", "0.718095", "0.717224", "0.71465683", "0.71273196", "0.71229774", "0.7122698", "0.7116914", "0.7062758", "0.6983692", "0.6967316", "0.6940985", "0.6913539", "0.6898834", "0.68877935", "0.6877659", "0.680785", "0.6797346", "0.67790395", "0.6763232", "0.67560714", "0.6753546", "0.6719948", "0.6685106", "0.6650047", "0.6639689", "0.66348207", "0.6628421", "0.6618235", "0.6610563", "0.6610016", "0.65444595", "0.6538756", "0.6514681", "0.6467964", "0.64375377", "0.6418638", "0.6336543", "0.6336101", "0.63350236", "0.63316256", "0.63228595", "0.6319524", "0.6318904", "0.63125557", "0.6311948", "0.6297688", "0.62801427", "0.62796235", "0.6251629", "0.62429273", "0.623243", "0.62246484", "0.6205245", "0.6198499", "0.61915994", "0.61775106", "0.6170583", "0.6152125", "0.61287546", "0.61263406", "0.6116409", "0.61135703", "0.6113341", "0.6102533", "0.6089161", "0.60881805", "0.6085798", "0.60739726", "0.60537106", "0.6029873", "0.60261786", "0.60217005", "0.6013551", "0.6011408", "0.60106146", "0.5999416", "0.5999074", "0.59919995", "0.59858745", "0.596715", "0.59615225", "0.5954595" ]
0.0
-1
Asks the database what games are currently running.
public static function current_games( $db = 0 ) { if( !$db ) { $db = REGISTRY::get( "db" ); } $sth = $db->prepare( " SELECT id FROM games WHERE start_date < CURRENT_TIMESTAMP() AND end_date > CURRENT_TIMESTAMP() " ); $sth->execute(); if( $sth->rowCount() > 0 ) { return $sth->fetchAll( PDO::FETCH_COLUMN, 0 ); } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAvailableGames() {\n\t$sql = \"select id, name, admin_id from games where has_started = 0\";\n\n\treturn parcoursRs(SQLSelect($sql));\n}", "public function processGames()\n\t{\n\t\tif ($this->site->lookupgames !== '0') {\n\t\t\t$console = new Console($this->echooutput);\n\t\t\t$console->processConsoleReleases();\n\t\t}\n\t}", "public function listGame()\n {\n return $this->db->get('game', 8, 9)->result();\n }", "public function getCurrentGame() {\n\t\t// $stmt = $this->dbh->prepare($sql);\n\t\t// $this->dbo->execute($stmt,array());\t\n\n\t\t// if ($stmt->rowCount() >= 1)\n\t\t// {\t\n\t\t// \t$result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t// \treturn $result[0];\n\t\t// } else {\n\t\t// \treturn false;\n\t\t// }\t\n\t }", "public function runGame()\n {\n $currentGame = $this->find('all')->where([\n 'complete' => false\n ])->contain(['Users'])->first();\n\n //get all the plays counts\n $gamesUsersTable = TableRegistry::get('GamesUsers');\n $currentGameCheckedCount = $gamesUsersTable->find();\n $currentGameCheckedCount = $currentGameCheckedCount->select([\n 'count' => $currentGameCheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->first()->count;\n\n $currentGameUncheckedCount = $gamesUsersTable->find();\n $currentGameUncheckedCount = $currentGameUncheckedCount->select([\n 'count' => $currentGameUncheckedCount->func()->count('*')\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->first()->count;\n\n $totalPlays = $currentGameCheckedCount + $currentGameUncheckedCount;\n\n //If not enough players, extend the end time and bail;\n if ($totalPlays < 2) {\n $currentGame->end_time = Time::now()->addHour(1);\n $this->save($currentGame);\n return false;\n }\n\n //update current game fields\n $currentGame->total_checked = $currentGameCheckedCount;\n $currentGame->total_plays = $totalPlays;\n $currentGame->ratio = round((float)$currentGameCheckedCount / (float)$totalPlays, 2);\n\n //save game as 'complete'\n $currentGame->complete = true;\n $this->save($currentGame);\n\n //get all the users that played this round\n $usersTable = TableRegistry::get('Users');\n $usersWhoCheckedThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => true\n ])->toArray();\n $currentGameCheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoCheckedThisGameIdArray) ? $usersWhoCheckedThisGameIdArray : [0])\n ]);\n\n $usersWhoDidntCheckThisGameIdArray = $gamesUsersTable->find('list', [\n 'valueField' => 'user_id'\n ])->where([\n 'game_id' => $currentGame->id,\n 'checked_box' => false\n ])->toArray();\n $currentGameUncheckedUsers = $usersTable->find('all')->where([\n 'id IN' => (!empty($usersWhoDidntCheckThisGameIdArray) ? $usersWhoDidntCheckThisGameIdArray : [0])\n ]);\n\n\n //update users scores\n foreach ($currentGameCheckedUsers as $user) {\n if ($currentGame->ratio > 0.5) {\n if ($user->score != 0) {\n $user->score = (int)$user->score - 10;\n }\n } else {\n $user->score = (int)$user->score + 10;\n }\n $usersTable->save($user);\n }\n\n //create next incomplete game & save\n $this->createNewGame();\n\n //send notification emails to everybody that gained/lost points\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => true,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameCheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n\n //send email to everybody who played but didn't check\n $email = new Email('default');\n\n $email->setTemplate('end_game', 'default')\n ->setEmailFormat('html')\n ->setFrom(\"[email protected]\", \"Cruelty Game\")\n ->setSubject('Cruelty Game Results')\n ->setViewVars([\n 'ratio' => $currentGame->ratio,\n 'checked' => false,\n 'gameDomain' => Configure::read('GameDomain')\n ]);\n\n foreach ($currentGameUncheckedUsers as $user) {\n if ($user->receive_emails && $user->enabled) {\n $email->addBcc($user->email);\n }\n }\n\n //don't bother emailing if there's nobody to email.\n if (empty($email->getTo()) && empty($email->getCc()) && empty($email->getBcc())) {\n return true;\n }\n try {\n $email->send();\n } catch (\\Cake\\Network\\Exception\\SocketException $e) {\n Log::write(\"error\", \"Couldn't send game result email!\");\n }\n }", "function getWaitingGames()\n\t{\n\t\t$uid = $_SESSION[\"uid\"];\n\t\t\n\t\t$query = \"SELECT DISTINCT g.gid, g.year, g.season, g.players\n\t\t\t\t\tFROM games g, in_game i\n\t\t\t\t\tWHERE g.running=false and g.gid=i.gid and not i.uid='$uid';\";\n\t\t\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t\n\t\t$games = array();\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($games, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "function getAllGames() {\n $conn = dbcon();\n\n $query = $conn->prepare(\"SELECT * FROM games\");\n $query->execute();\n\n return $query->fetchAll();\n }", "public function runningApp(){\n\t\t\t$nilaiAkhir = self::pembulatan(self::$schoolPG, 5, 100, self::$inputanUser);\n\n\t\t\t// tampilkan hasil nilai akhir siswa\n\t\t\tprint(\"Final Score: <br/>\");\n\t\t\tforeach(self::$inputanUser as $key => $nilai){\n\t\t\t\tif(isset($nilaiAkhir[$key])){\n\t\t\t\t\tprintf(\"%d. Siswa ke-%d: %d --> %d<br/>\", ($key + 1), ($key + 1), $nilai, $nilaiAkhir[$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function run()\n {\n //game 1\n\n //economy:\n //dilapidated 3\n //impoverished 3\n //mediocre 7\n //upscale 7\n //rich 3\n //opulent 1\n\n //1.\n DB::table('hoods')->insert([\n 'hood_name' => 'Streeterville',\n 'hood_type' => 'impoverished',\n 'game' => '1'\n ]);\n //2.\n DB::table('hoods')->insert([\n 'hood_name' => 'Little Village',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //3.\n DB::table('hoods')->insert([\n 'hood_name' => 'Cicero',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //4.\n DB::table('hoods')->insert([\n 'hood_name' => 'Berwyn',\n 'hood_type' => 'dilapidated',\n 'game' => '1'\n ]);\n //5.\n DB::table('hoods')->insert([\n 'hood_name' => 'Loop',\n 'hood_type' => 'opulent',\n 'game' => '1'\n ]);\n //6.\n DB::table('hoods')->insert([\n 'hood_name' => 'Chinatown',\n 'hood_type' => 'impoverished',\n 'game' => '1'\n ]);\n //7.\n DB::table('hoods')->insert([\n 'hood_name' => 'Humboldt Park',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //8.\n DB::table('hoods')->insert([\n 'hood_name' => 'Lincoln Park',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //9.\n DB::table('hoods')->insert([\n 'hood_name' => 'Garfield Park',\n 'hood_type' => 'rich',\n 'game' => '1'\n ]);\n //10.\n DB::table('hoods')->insert([\n 'hood_name' => 'Bronzeville',\n 'hood_type' => 'dilapidated',\n 'game' => '1'\n ]);\n //11.\n DB::table('hoods')->insert([\n 'hood_name' => 'Brookfield',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //12.\n DB::table('hoods')->insert([\n 'hood_name' => 'Broadview',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //13.\n DB::table('hoods')->insert([\n 'hood_name' => 'Stickney',\n 'hood_type' => 'dilapidated',\n 'game' => '1'\n ]);\n //14.\n DB::table('hoods')->insert([\n 'hood_name' => 'Englewood',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //15.\n DB::table('hoods')->insert([\n 'hood_name' => 'Elmwood',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //16\n DB::table('hoods')->insert([\n 'hood_name' => 'Belmont',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //17.\n DB::table('hoods')->insert([\n 'hood_name' => 'Dunning',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //18.\n DB::table('hoods')->insert([\n 'hood_name' => 'Berkeley',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //19.\n DB::table('hoods')->insert([\n 'hood_name' => 'Lake View',\n 'hood_type' => 'rich',\n 'game' => '1'\n ]);\n //20.\n DB::table('hoods')->insert([\n 'hood_name' => 'Bucktown',\n 'hood_type' => 'mediocre',\n 'game' => '1'\n ]);\n //21.\n DB::table('hoods')->insert([\n 'hood_name' => 'Elmhurst',\n 'hood_type' => 'rich',\n 'game' => '1'\n ]);\n //22.\n DB::table('hoods')->insert([\n 'hood_name' => 'Cragin',\n 'hood_type' => 'impoverished',\n 'game' => '1'\n ]);\n //23.\n DB::table('hoods')->insert([\n 'hood_name' => 'Avondale',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n //24.\n DB::table('hoods')->insert([\n 'hood_name' => 'Maywood',\n 'hood_type' => 'upscale',\n 'game' => '1'\n ]);\n }", "protected function initDB() {\r\n\r\n $qry = $this->getMain()->getDatabase()->get(\"*\", [\"table\" => \"Games\", \"name\" => $this->getName()]);\r\n\r\n if($qry instanceof \\SQLite3Result) {\r\n\r\n if($qry->num_rows == 0) { // Game not initiated in the db.\r\n\r\n $id = $this->getMain()->getDatabase()->get(\"*\", [\"table\" => \"Games\"]);\r\n\r\n $v3 = $this->getLevel()->getSafeSpawn();\r\n\r\n $v3Ser = $v3->x . \",\" . $v3->y . \",\" . $v3->z; // V32String\r\n\r\n $this->getMain()->getDatabase()->insert(\"Games\", [$this->getName(), $v3Ser, $v3Ser, $this->getMain()->getMaxPlayers(), $this->getMain()->getWaitTime(), $this->getMain()->getSeekTime(), $this->getMain()->getSeekersPercentage(), $id->num_rows+1]); // Inserting the db with new queries\r\n\r\n }\r\n\r\n } else {\r\n\r\n throw new \\Exception(\"Could not contact database.\");\r\n\r\n }\r\n\r\n }", "private function selectCurrentDatabase()\n {\n $input = $this->cli->input('Please enter DB name >>');\n $dbName = $input->prompt();\n $this->currentDB = $this->mongoClient->selectDatabase($dbName)->getDatabaseName();\n $this->cli->info('Selected ' . $dbName . ' database');\n }", "public function getGames(){\n\t\t$sql = new SqlManager();\n\t\t$sql->setQuery(\"SELECT game_id FROM game WHERE game_status != 'finished'\");\n\t\t$sql->execute();\n\t\t\n\t\t$games = array();\n\t\twhile($row = $sql->fetch()){\n\t\t\t$games[] = new Game($row['game_id']);\n\t\t}\n\t\t\n\t\treturn $games;\n\t}", "public static function poll( ) {\n\t\t\t\t\n\t\tforeach(Config::get('nagios:status') as $chrURL){\n\t\t\t\n\t\t\t$objStatus = new NagiosStatus($chrURL);\n\n\t\t}\n\t\t\n\t\tdisplay(\"Total of \" . DB::count() . \" database queries executed\");\n\t\t\t\n\t\treturn true;\n\t\t\t\n\t}", "function CheckDisponiblityGame($IdJoinGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT MaxPlayersGame, (SELECT COUNT(fkGamePlace) FROM fishermenland.place WHERE fkGamePlace = '$IdJoinGame') as UsedPlaces FROM fishermenland.game WHERE idGame = '$IdJoinGame'\");\n $reqArray = $req->fetch();\n\n return $reqArray;\n}", "public function get_games()\n {\n return $this->games;\n }", "public function index() {\n\n\t\t$arr = [\n\t\t\t'fields' => ['id', 'description', 'user_id', 'complete'],\n\t\t\t'recursive' => 0\n\t\t];\n\t\t$this->set('games', $this->Killer->find('all', $arr));\n\n\t}", "public function showdbs()\n {\n $this->_validate(array());\n $this->_QUERYCOUNT++;\n\n return $this->_query->showdatabases();\n }", "private function fetchGames() {\n $this->games = array();\n $this->playtimes = array();\n\n $url = $this->getBaseUrl() . '/games?xml=1';\n $gamesData = new SimpleXMLElement(file_get_contents($url));\n\n foreach($gamesData->games->game as $gameData) {\n $game = SteamGame::create($gameData);\n $this->games[$game->getAppId()] = $game;\n $recent = (float) $gameData->hoursLast2Weeks;\n $total = (float) $gameData->hoursOnRecord;\n $playtimes = array((int) ($recent * 60), (int) ($total * 60));\n $this->playtimes[$game->getAppId()] = $playtimes;\n }\n }", "public function runExists() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runboard \"\r\n . \"WHERE fromStore='$this->fromStore' \"\r\n . \"AND toStore='$this->toStore' \"\r\n . \"AND category='$this->category' \"\r\n . \"AND item='$this->item' \"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }", "public function run()\n {\n DB::table('games')->insert([\n [\n 'name'=>'League of Legends',\n 'isSinglePlayer'=>false,\n 'maxPlayers'=>5,\n 'MaxTeams'=>14\n ],\n [\n 'name'=>'Counter Strike Global Offensive',\n 'isSinglePlayer'=>false,\n 'maxPlayers'=>5,\n 'MaxTeams'=>14\n ],\n [\n 'name'=>'Hearthstone',\n 'isSinglePlayer'=>true,\n 'maxPlayers'=>1,\n 'MaxTeams'=>30\n ]\n ]);\n }", "public function runGame( )\n {\n\n $MODELS = include(ROOT.'/conf/rooms.php');\n $gameConfig = $MODELS[1];\n\n }", "public function run()\n {\n\t DB::table('games')->insert([\n\t\t ['name'=>'Memory','popularity'=>'18','time_min'=>'15','time_max'=>'30','approved'=>'1',],\n ['name'=>'Vier op een rij','popularity'=>'14','time_min'=>'5','time_max'=>'20','approved'=>'1',],\n ['name'=>'Monopoly','popularity'=>'12','time_min'=>'60','time_max'=>'120','approved'=>'1',],\n ['name'=>'Dammen','popularity'=>'4','time_min'=>'15','time_max'=>'30','approved'=>'1',],\n\t\t ['name'=>'Schaken','popularity'=>'2','time_min'=>'15','time_max'=>'30','approved'=>'1',],\n\t ]);\n }", "function retrieveGameInfo($name) {\n \t# Open and validate the Database connection.\n \t$conn = connect();\n\n if ($conn != null) {\n \t$sql = \"SELECT * FROM Games WHERE Name = '$name'\";\n\t\t\t$result = $conn->query($sql);\n\n\t\t\tif ($result->num_rows == 0) {\n\t\t\t\t# There are no games that match the searchTerm in the database.\n\t\t\t\t$conn->close();\n\t\t\t\treturn errors(460);\n\t\t\t}\n\n\t\t\t# Get game information\n\t\t\twhile ($row = $result -> fetch_assoc()) {\n $ans = array(\"status\" => \"COMPLETE\", \"state\" => $row[\"State\"], \"imageSource\" => $row[\"ImageSource\"],\n \"PlayStation\" => $row[\"PlayStation\"], \"PlayStation2\" => $row[\"PlayStation2\"],\n \"PlayStation3\" => $row[\"PlayStation3\"], \"PlayStation4\" => $row[\"PlayStation4\"],\n \"PSP\" => $row[\"PSP\"], \"GameboyAdvance\" => $row[\"GameboyAdvance\"],\n \"NintendoDS\" => $row[\"NintendoDS\"], \"Nintendo3DS\" => $row[\"Nintendo3DS\"],\n \"NintendoSwitch\" => $row[\"NintendoSwitch\"], \"XboxOne\" => $row[\"XboxOne\"],\n \"Blizzard\" => $row[\"Blizzard\"], \"GOG\" => $row[\"GOG\"], \"Epic\" => $row[\"Epic\"],\n \"Origin\" => $row[\"Origin\"], \"Steam\" => $row[\"Steam\"], \"Twitch\" => $row[\"Twitch\"],\n \"UPlay\" => $row[\"UPlay\"], \"Microsoft\" => $row[\"Microsoft\"]);\n\t\t\t}\n\n\t\t\t$conn->close();\n\t\t\treturn $ans;\n }\n else {\n \t# Connection to Database was not successful.\n \t$conn->close();\n \treturn errors(400);\n }\n\t}", "public function getGames()\n {\n return $this->games;\n }", "public function run()\n {\n //\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Mighty Pucks',\n 'time' => '4:30'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Ruthless',\n 'time' => '20:00'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Ruthless',\n 'time' => '20:55'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Ruthless',\n 'time' => '23:41'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Mighty Pucks',\n 'time' => '34:18'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Mighty Pucks',\n 'time' => '40:38'\n ]);\n\n DB::table('goals')->insert([\n 'game_id' => '1',\n 'team' => 'Ruthless',\n 'time' => '47:47'\n ]);\n }", "public function findAllGames()\n {\n return $this->entityManager->getRepository('Model\\Entity\\Game')->findAll();\n }", "public function run()\n {\n //Game::factory(100)->create();\n\n\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '1',\n 'date' => '2020-06-01',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '2',\n 'date' => '2020-06-02',\n 'time' => '16:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '3',\n 'date' => '2020-06-05',\n 'time' => '12:15',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '2',\n 'boardgame_id' => '1',\n 'date' => '2020-06-08',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '5',\n 'date' => '2020-06-10',\n 'time' => '16:00',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '6',\n 'boardgame_id' => '3',\n 'date' => '2020-06-21',\n 'time' => '17:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '3',\n 'boardgame_id' => '3',\n 'date' => '2020-06-01',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '5',\n 'boardgame_id' => '5',\n 'date' => '2020-06-05',\n 'time' => '17:05',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '7',\n 'boardgame_id' => '7',\n 'date' => '2020-06-07',\n 'time' => '17:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '6',\n 'boardgame_id' => '6',\n 'date' => '2020-06-12',\n 'time' => '18:50',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '1',\n 'boardgame_id' => '10',\n 'date' => '2020-07-01',\n 'time' => '11:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '10',\n 'boardgame_id' => '2',\n 'date' => '2020-08-01',\n 'time' => '14:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '9',\n 'boardgame_id' => '8',\n 'date' => '2020-06-08',\n 'time' => '20:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '7',\n 'boardgame_id' => '6',\n 'date' => '2020-02-05',\n 'time' => '08:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '5',\n 'date' => '2020-06-09',\n 'time' => '09:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '3',\n 'boardgame_id' => '1',\n 'date' => '2020-06-04',\n 'time' => '16:10',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '8',\n 'boardgame_id' => '9',\n 'date' => '2020-06-09',\n 'time' => '10:39',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '4',\n 'boardgame_id' => '4',\n 'date' => '2019-06-01',\n 'time' => '12:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n DB::table('games')->insert([\n 'master' => '5',\n 'boardgame_id' => '5',\n 'date' => '2020-06-27',\n 'time' => '20:30',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n DB::table('games')->insert([\n 'master' => '2',\n 'boardgame_id' => '8',\n 'date' => '2020-12-01',\n 'time' => '17:35',\n \"created_at\" => date('Y-m-d H:i:s'),\n \"updated_at\" => date('Y-m-d H:i:s'),\n ]);\n\n\n\n\n $this->command->info('Games añadidas correctamente');\n }", "public function showAllDatabase(){\n $stmt = $this->pdo->query('SHOW DATABASES');\n\n //Fetch the columns from the returned PDOStatement\n $databases = $stmt->fetchAll(PDO::FETCH_COLUMN);\n //var_dump($databases);\n //Loop through the database list and print it out.\n foreach($databases as $database){\n //$database will contain the database name\n //in a string format\n echo $database, '<br>';\n }\n return 1;\n }", "public function run()\n {\n // [\"CREATED\" => 0, \"ABORTED\" => 1, \"PLAYING\" => 2, \"WONTEAM1\" => 3, \"WONTEAM2\" => 4];\n\n $g = new Game();\n\n\n $g->player1 = 1;\n $g->player2 = 2;\n $g->player3 = 3;\n $g->player4 = 4;\n\n $g->scorelimit = 1000;\n $gameState = rand(0, 4);\n $g->gamestate = $gameState;\n\n switch ($gameState) {\n case 0:\n $g->scoreteam1 = 0;\n $g->scoreteam2 = 0;\n break;\n case 3:\n $g->scoreteam1 = 1000;\n $g->scoreteam2 = rand(100, 999);\n break;\n case 4:\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = 1000;\n break;\n \n default: #case ABORTED et PLAYING\n $g->scoreteam1 = rand(100, 999);\n $g->scoreteam2 = rand(100, 999);\n break;\n }\n $g->save();\n }", "function getActiveGamesList () {\n\tglobal $bdd;\n\t$req = $bdd->prepare('\n\t\tSELECT *\n\t\tFROM parties\n\t\tORDER BY id_partie;\n\t');\n\t$req->execute();\n\t$list = array();\n\twhile ($row = $req->fetch()) {\n\t\t$list[] = array(\n\t\t\t'id_partie' => $row['id_partie'],\n\t\t\t'nom' => $row['nom'],\n\t\t\t'createur' => getLoginForPlayer($row['createur']),\n\t\t\t'date_debut' => $row['date_debut'],\n\t\t\t'date_fin' => $row['date_fin'],\n\t\t\t'partie_privee' => ($row['password'] === sha1('') || $row['password'] === NULL) ? 'NO' : 'YES',\n\t\t\t'players' => getListeJoueursPartie($row['id_partie'])\n\t\t);\n\t}\n\treturn $list;\n}", "abstract public function getSelectedDatabase();", "public function get() {\n $stmt = DB::prepare(\"UPDATE game\n SET accepted_time = NOW(),\n game_id = LAST_INSERT_ID(game_id)\n WHERE outcome = 'pending' AND\n accepted_time < TIMESTAMPADD(MINUTE, -15, NOW())\n LIMIT 1\");\n $stmt->execute();\n\n // Get Game ID\n $id = DB::lastInsertId();\n\n // If we don't have an ID, bail\n if ($id == 0) {\n throw new Exception('No Games Pending', 400);\n }\n\n // Otherwise, load the details\n $stmt = DB::prepare('SELECT game_id, bot1_id, bot2_id FROM game WHERE game_id = ?');\n $stmt->execute(array($id));\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function run()\n {\n $teams = factory(App\\Team::class,30)->make();\n foreach ($teams AS $key=>$team){\n \t$team->save();\n \tif($key > 3){\n \t\t$ownerID = $teams[$key-2]->id;\n \t\t$guestID = $teams[$key-1]->id;\n \t\t$matchDate = $this->randomMatchDate();\n \t\t\n \t\tif($this->currentDate > $matchDate){\n\t\t\t DB::table('playlist')->insert([\n\t\t\t\t 'game_date'=>$matchDate,\n\t\t\t\t 'owner_id'=>$ownerID,\n\t\t\t\t 'guest_id'=>$guestID,\n\t\t\t\t 'owner_score'=>rand(0,15),\n\t\t\t\t 'guest_score'=>rand(0,15),\n\t\t\t\t 'status'=>$this->oldMatchStatuses[rand(0,count($this->oldMatchStatuses)-1)],\n\t\t\t\t 'created_at'=>Carbon::now(),\n\t\t\t\t 'updated_at'=>Carbon::now(),\n\t\t\t ]);\n\t\t }else{\n\t\t\t DB::table('playlist')->insert([\n\t\t\t\t 'game_date'=>$matchDate,\n\t\t\t\t 'owner_id'=>$ownerID,\n\t\t\t\t 'guest_id'=>$guestID,\n\t\t\t\t 'owner_score'=> null,\n\t\t\t\t 'guest_score'=> null,\n\t\t\t\t 'status'=>$this->newMatchStatuses[rand(0,count($this->newMatchStatuses)-1)],\n\t\t\t\t 'created_at'=>Carbon::now(),\n\t\t\t\t 'updated_at'=>Carbon::now(),\n\t\t\t ]);\n\t\t }\n\t }\n }\n }", "function show_available_bookings(){\n global $db;\n $sql = \"SELECT * FROM booking_info;\";\n $result = $db->query($sql);\n return $result;\n}", "function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}", "public function run()\n {\n DB::table('horses')->insert([\n 'name' => 'Kronas',\n 'runs' => '10',\n 'wins' => '8',\n 'about' => 'slow'\n ]);\n\n DB::table('horses')->insert([\n 'name' => 'Priusas',\n 'runs' => '10',\n 'wins' => '8',\n 'about' => 'weak'\n ]);\n DB::table('horses')->insert([\n 'name' => 'Hermis',\n 'runs' => '10',\n 'wins' => '8',\n 'about' => 'fast'\n ]);\n }", "function getRandomGames() {\n return DBcommand(\"SELECT * FROM games WHERE suggestion = 0 ORDER BY RAND() LIMIT 5\", [])['output'];\n}", "function GetListGames()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idGame, LakeFishesGame, LakeReproductionGame, PondReproductionGame, EatFishesGame, FirstPlayerGame, TourGame, SeasonTourGame, MaxPlayersGame, MaxReleaseGame, DescriptionType, (SELECT COUNT(idPlace) FROM fishermenland.place WHERE fkGamePlace = idGame) AS OccupedPlaces\n FROM fishermenland.game\n INNER JOIN fishermenland.type ON game.fkTypeGame = type.idType GROUP BY idGame\");\n\n return $req;\n}", "function getWaitListedApplications()\r\n {\r\n $db = db_connect();\r\n $sql = \"SELECT account.* FROM account, application WHERE account.accountID = application.accountID AND \r\n account.role = :role: AND application.applicationStatus = :applicationStatus: ORDER BY \r\n account.accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0,\r\n 'applicationStatus' => 'W'\r\n ]);\r\n\r\n return $results;\r\n }", "public function getAllProgrammes() {\n try {\n $programes = $this->em->getRepository(Entity\\Programme::class)->findAll();\n $this->em->flush();\n } catch (\\Doctrine\\ORM\\OptimisticLockException $e) {\n $this->em->rollback();\n }\n return $programes === null ? 0 : $programes;\n }", "function choosedb() {\n $web = \"enwiki.web.db.svc.eqiad.wmflabs\";\n $analytics = \"enwiki.analytics.db.svc.eqiad.wmflabs\";\n\n $ts_pw = posix_getpwuid(posix_getuid());\n $ts_mycnf = parse_ini_file($ts_pw['dir'] . \"/replica.my.cnf\");\n\n $webtest = mysqli_connect( $web, $ts_mycnf['user'], $ts_mycnf['password'], 'heartbeat_p' );\n $analyticstest = mysqli_connect( $analytics, $ts_mycnf['user'], $ts_mycnf['password'], 'heartbeat_p' );\n\n $lagq = \"select lag from heartbeat where shard = 's1';\";\n\n $lag_wr = mysqli_query( $webtest, $lagq );\n $lag_ar = mysqli_query( $analyticstest, $lagq );\n\n $lag_webrow = mysqli_fetch_assoc( $lag_wr );\n $lag_anarow = mysqli_fetch_assoc( $lag_ar );\n\n $weblag = $lag_webrow['lag'];\n $analag = $lag_anarow['lag'];\n\n if( $weblag < 600 ) {\n $dbhost = $web;\n } elseif ( $weblag <= $analag ) {\n $dbhost = $web;\n } elseif( $analag <= $weblag ) {\n $dbhost = $analytics;\n } else {\n $dbhost = $web;\n }\n mysqli_close( $webtest );\n mysqli_close( $analyticstest );\n return( $dbhost );\n}", "public function checkCurrentSlot() {\n $result = array();\n foreach($this->workflowSlotUser as $user) {\n $processUser = WorkflowProcessUserTable::instance()->getProcessUserByWorkflowSlotUserId($user->getId())->toArray();\n $this->decission[] = $this->checkProcessState($processUser);\n }\n }", "public function getGames() {\n if(empty($this->games)) {\n $this->fetchGames();\n }\n\n return $this->games;\n }", "public function games()\n {\n \t$start_date = $this->attributes['start_date'];\n \t$end_date = $this->attributes['end_date'];\n\n \t$games = Game::whereBetween('game_date',[$start_date, $end_date])->get();\n\n return $games;\n }", "public function run()\n {\n \tDB::table('games')->insert([\n [\n 'start_time' => Carbon::now(),\n 'pX' => 1,\n 'pO' => 2,\n 'size' => 3,\n 'status' => 2\n ],[\n 'start_time' => Carbon::now(),\n 'pX' => 1,\n 'pO' => 2,\n 'size' => 3,\n 'status' => 2\n ]\n ]);\n }", "public function index()\n {\n $active_games = Game::where('status', '!=', 'finished')->get();\n $finished_games = Game::where('status', 'finished')->get();\n return view('games.index', [\n 'active_games' => $active_games,\n 'finished_games' => $finished_games\n ]);\n }", "public function actionDb()\n {\n preg_match('/host\\=([^;]+);dbname=(.*)$/', \\Yii::$app->db->dsn, $m);\n return static::runProgram('mysql', '-u'.\\Yii::$app->db->username . ' -p'.\\Yii::$app->db->password . ' -h'.$m[1] .' ' . $m[2]);\n }", "public function onRun(): void\n {\n foreach (Server::getInstance()->getOnlinePlayers() as $player){\n $session = SessionManager::getSession($player->getXuid());\n if ($session !== null && $session->getTogglesModule()->scoreboards()){\n ScoreboardHandler::sendAppropriateScoreboard($session);\n }\n }\n }", "function unity_query_lobby() {\r\n $lilo_mongo = new LiloMongo();\r\n $lilo_mongo->selectDB('Game');\r\n $lilo_mongo->selectCollection('LobbySetting');\r\n $data = $lilo_mongo->findOne();\r\n return $data['ip'] . \":\" . $data['port'];\r\n}", "function afficherstages(){\n\t\t$sql=\"SElECT * From stage\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function queries_run(){\n\t\tglobal $database_sql_queries;\n\t\treturn($database_sql_queries);\n\t}", "function names_db() {\n\t\t$tmp = mysql_num_rows($this -> dbc);\n\t\treturn ($tmp);\n\t}", "public function startNewGame() {\n\t \t//Set all queued used to playing\n\t \t//Build new map scaled on number of playing users\n\t \t//place users on map\n\t \t//start game\n\t \t//send out alert that game has started\n\t }", "public function run()\n {\n DB::table('programmes')->delete();\n Programme::create([\n 'name' => 'Bachelor of Computer Science (Cyber Security) (Hons.)',\n 'status' => 1\n ]);\n Programme::create([\n 'name' => 'Bachelor of Computer Science (Software Engineering) (Hons.)',\n 'status' => 1\n ]);\n Programme::create([\n 'name' => 'Bachelor of Computer Science (Systems & Networking) (Hons.)',\n 'status' => 1\n ]);\n Programme::create([\n 'name' => 'Bachelor of Information Technology (Graphics & Multimedia) (Hons.)',\n 'status' => 1\n ]);\n Programme::create([\n 'name' => 'Bachelor of Information Technology (Information System) (Hons.)',\n 'status' => 1\n ]);\n Programme::create([\n 'name' => 'Bachelor of Information Technology (Visual Media) (Hons.)',\n 'status' => 1\n ]);\n }", "function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }", "function getAcceptedApplications()\r\n {\r\n $db = db_connect();\r\n $sql = \"SELECT account.* FROM account, application WHERE account.accountID = application.accountID AND \r\n account.role = :role: AND application.applicationStatus = :applicationStatus: ORDER BY \r\n account.accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0,\r\n 'applicationStatus' => 'A'\r\n ]);\r\n\r\n return $results;\r\n }", "public static function DatabaseCheck() {\n try {\n // Check if database is initialized!\n if(Database::$instance == null) {\n throw new Exception(\"Database not initialized! Construct Database::\\$instance!\", 70);\n }\n // Check if database is complete\n Database::$instance->query(\"SELECT * \n FROM information_schema.tables\n WHERE table_schema = 'itp-minigames'\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) != 19)\n throw new Exception(\"Database not complete!\n Please add all tables that are needed to database!\", 71);\n \n // Check if platforms are correctly set up\n Database::$instance->query(\"SELECT * FROM `platform` ORDER BY PlatformID ASC\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) != 3)\n throw new Exception(\"Platform table not correctly set up!\", 72);\n else {\n if($result[0]['PlatformID'] != 1 || $result[0]['Name'] != \"Windows\")\n throw new Exception(\"Platform table not correctly set up!\", 73);\n if($result[1]['PlatformID'] != 2 || $result[1]['Name'] != \"Linux\")\n throw new Exception(\"Platform table not correctly set up!\", 74);\n if($result[2]['PlatformID'] != 3 || $result[2]['Name'] != \"Mac OS\")\n throw new Exception(\"Platform table not correctly set up!\", 75);\n }\n \n // Check if default profile picture path is set\n Database::$instance->query(\"SELECT `PictureID`, `SourcePath`, `ThumbnailPath`\n FROM `picture` WHERE `SourcePath` = 'resources/profilePictures/default.png'\n AND `ThumbnailPath` = 'resources/profilePictures/defaultThumbnail.jpeg';\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) == 0)\n throw new Exception(\"No default profile picture database entry found! Inserting default path.\", 76);\n\n // Check for available admin user\n Database::$instance->query(\"SELECT * FROM `user` WHERE `Usertype` = 'admin'\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) == 0)\n throw new Exception(\"No administrator user found! Inserting default administrator.\", 77);\n\n Database::$instance->query(\"SELECT * FROM `forum` WHERE ForumID = 1\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) == 0) {\n throw new Exception(\"ForumID 1 is not in the Database!\", 78);\n }\n\n // Check if developer forum is number 1\n Database::$instance->query(\"SELECT * FROM `game` WHERE FK_ForumID = 1\");\n $result = Database::$instance->fetchAll();\n if(sizeof($result) == 1) {\n throw new Exception(\"ForumID 1 is reserved for the developer forum, please change the ForumID of the specific game to a new one!\", 79);\n }\n\n }\n catch(Exception $e) {\n switch($e->getCode()) {\n // Invalid platform\n case 72:\n case 73:\n case 74:\n case 75:\n // Autogenerate the platform table\n // Clear table platform\n Database::$instance->query(\"DELETE FROM `platform`\");\n // Reset auto increment value\n Database::$instance->query(\"ALTER TABLE `platform` AUTO_INCREMENT = 1\");\n // Insert correct platforms \n Database::$instance->query(\"INSERT INTO `platform` (`PlatformID`, `Name`)\n VALUES ('1', 'Windows'), ('2', 'Linux'), ('3', 'Mac OS')\");\n break;\n case 76:\n Database::$instance->query(\"INSERT INTO `picture`(`SourcePath`, `ThumbnailPath`) VALUES ('resources/profilePictures/default.png','resources/profilePictures/defaultThumbnail.jpeg')\");\n break;\n case 77:\n // Get id of default profile picture\n Database::$instance->query(\"SELECT `PictureID`\n FROM `picture` WHERE `SourcePath` = 'resources/profilePictures/default.png'\n AND `ThumbnailPath` = 'resources/profilePictures/defaultThumbnail.jpeg';\");\n $result = Database::$instance->fetchArray();\n $pictureId = $result['PictureID'];\n $password = password_hash(InitializationService::$defaultAdminPassword, PASSWORD_DEFAULT);\n $username = InitializationService::$defaultAdminUsername;\n Database::$instance->query(\"INSERT INTO `user` (`FirstName`, `LastName`, `Username`, `Email`, `Usertype`, `Password`, `FK_PictureID`) VALUES ('admin', 'admin', '$username', '[email protected]', 'admin', '$password', $pictureId)\");\n break;\n case 78:\n Database::$instance->query(\"INSERT INTO `forum` ( `ForumID` ) VALUES ( 1 )\");\n break;\n }\n throw $e;\n }\n // Return true if everything is correctly set up\n return true;\n }", "public static function run($forced = TRUE) {\n $queries = array();\n\n // Create table for Team.\n $fields = array();\n $fields[] = \"tid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"team_id VARCHAR(255) NOT NULL\";\n $fields[] = \"team_name VARCHAR(255) NOT NULL\";\n $fields[] = \"bot_user_id VARCHAR(255) NOT NULL\";\n $fields[] = \"bot_access_token VARCHAR(255) NOT NULL\";\n $queries[] = static::createTableStatement(Team::$db_table, Team::$primary_key, $fields);\n\n // Create table for Guild.\n $fields = array();\n $fields[] = \"gid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"slack_id VARCHAR(255) NOT NULL\";\n $fields[] = \"username VARCHAR(255) NOT NULL\";\n $fields[] = \"name VARCHAR(255) NOT NULL\";\n $fields[] = \"icon VARCHAR(255) NOT NULL\";\n $fields[] = \"team_id INT(11) NOT NULL\";\n $queries[] = static::createTableStatement(Guild::$db_table, Guild::$primary_key, $fields);\n\n // Create table for Season.\n $fields = array();\n $fields[] = \"sid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"created INT(11) NOT NULL\";\n $fields[] = \"active TINYINT(1) NOT NULL\";\n $fields[] = \"team_id INT(11) NOT NULL\";\n $queries[] = static::createTableStatement(Season::$db_table, Season::$primary_key, $fields);\n\n // Create table for ActionState.\n $fields = array();\n $fields[] = \"asid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"team_id VARCHAR(255) NOT NULL\";\n $fields[] = \"guild_id VARCHAR(255) NOT NULL\";\n $fields[] = \"slack_id VARCHAR(255) NOT NULL\";\n $fields[] = \"timestamp VARCHAR(255) NOT NULL\"; // Slack timestamps are different, so save as string.\n $fields[] = \"channel_id VARCHAR(255) NOT NULL\";\n $fields[] = \"original_message LONGTEXT NOT NULL\";\n $fields[] = \"action VARCHAR(255) NOT NULL\";\n $fields[] = \"step VARCHAR(255) NOT NULL\";\n $fields[] = \"extra LONGTEXT NOT NULL\";\n $queries[] = static::createTableStatement(ActionState::$db_table, ActionState::$primary_key, $fields);\n\n // Create table for Map.\n $fields = array();\n $fields[] = \"mapid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"season_id INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"created INT(10) UNSIGNED NOT NULL\";\n $queries[] = static::createTableStatement(Map::$db_table, Map::$primary_key, $fields);\n\n // Create table for Location.\n $fields = array();\n $fields[] = \"locid INT(11) UNSIGNED AUTO_INCREMENT\";\n $fields[] = \"map_id INT(11) UNSIGNED NOT NULL\";\n $fields[] = \"team_id INT(11) UNSIGNED NOT NULL\";\n $fields[] = \"guild_id INT(11) UNSIGNED NOT NULL\";\n $fields[] = \"name VARCHAR(255) NOT NULL\";\n $fields[] = \"row INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"col INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"type VARCHAR(255) NOT NULL\";\n $fields[] = \"created INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"revealed TINYINT(1) NOT NULL\";\n $fields[] = \"open TINYINT(1) NOT NULL\";\n $fields[] = \"star_min INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"star_max INT(10) UNSIGNED NOT NULL\";\n $fields[] = \"keywords VARCHAR(255) NOT NULL\";\n $fields[] = \"map_icon VARCHAR(255) NOT NULL\";\n $queries[] = static::createTableStatement(Location::$db_table, Location::$primary_key, $fields);\n\n return $queries;\n }", "public function query()\n {\n if($this->type ==1){\n return Upgrade::query()->where(['status'=>0,'year'=>currentYear(),'semester'=>currentSemester()]);\n }\n elseif ($this->type==2){\n return Upgrade::query()->where(['status'=>1,'year'=>currentYear(),'semester'=>currentSemester()]);\n }\n\n\n }", "function run_app(){\n\t\tglobal $con;\n\t\t$query = \"select * from user\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "protected function runDatabaseCheck() {\n\t\t$this->showProgressMessage('Going to run database check.');\n\n\t\t$dbOperations = t3lib_div::makeInstance('tx_mnogosearch_dboperations');\n\t\t/* @var $dbOperations tx_mnogosearch_dboperations */\n\t\t$dbOperations->setIndexer($this->indexer);\n\t\t$dbOperations->checkAndCreate();\n\t}", "private function action_databasePopulation()\n\t{\n\t\tglobal $txt, $databases, $modSettings, $db_type, $db_prefix, $incontext, $db_name, $boardurl;\n\n\t\t$incontext['sub_template'] = 'populate_database';\n\t\t$incontext['page_title'] = $txt['db_populate'];\n\t\t$incontext['continue'] = 1;\n\n\t\t// Already done?\n\t\tif (isset($_POST['pop_done']))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t// Reload settings.\n\t\trequire(TMP_BOARDDIR . '/Settings.php');\n\t\tdefinePaths();\n\n\t\t$db = load_database();\n\t\tdb_table_install();\n\n\t\t// Before running any of the queries, let's make sure another version isn't already installed.\n\t\t$db->skip_next_error();\n\t\t$result = $db->query('', '\n\t\t\tSELECT \n\t\t\t variable, value\n\t\t\tFROM {db_prefix}settings',\n\t\t\tarray()\n\t\t);\n\n\t\t$modSettings = array();\n\t\tif ($result->hasResults())\n\t\t{\n\t\t\twhile ($row = $result->fetch_assoc())\n\t\t\t{\n\t\t\t\t$modSettings[$row['variable']] = $row['value'];\n\t\t\t}\n\t\t\t$result->free_result();\n\n\t\t\t// Do they match? If so, this is just a refresh so charge on!\n\t\t\tif (!isset($modSettings['elkVersion']) || $modSettings['elkVersion'] != CURRENT_VERSION)\n\t\t\t{\n\t\t\t\t$incontext['error'] = $txt['error_versions_do_not_match'];\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$modSettings['disableQueryCheck'] = true;\n\t\t$modSettings['time_offset'] = empty($modSettings['time_offset']) ? 0 : $modSettings['time_offset'];\n\n\t\t// Since we are UTF8, select it. PostgreSQL requires passing it as a string...\n\t\t$db->skip_next_error();\n\t\t$db->query('', '\n\t\t\tSET NAMES {' . ($db_type == 'postgresql' ? 'string' : 'raw') . ':utf8}',\n\t\t\tarray(\n\t\t\t\t'utf8' => 'utf8',\n\t\t\t)\n\t\t);\n\n\t\t$replaces = array(\n\t\t\t'{$db_prefix}' => $db_prefix,\n\t\t\t'{BOARDDIR}' => TMP_BOARDDIR,\n\t\t\t'{$boardurl}' => $boardurl,\n\t\t\t'{$enableCompressedOutput}' => isset($_POST['compress']) ? '1' : '0',\n\t\t\t'{$databaseSession_enable}' => isset($_POST['dbsession']) ? '1' : '0',\n\t\t\t'{$current_version}' => CURRENT_VERSION,\n\t\t\t'{$current_time}' => time(),\n\t\t\t'{$sched_task_offset}' => 82800 + mt_rand(0, 86399),\n\t\t);\n\n\t\tforeach ($txt as $key => $value)\n\t\t{\n\t\t\tif (substr($key, 0, 8) == 'default_')\n\t\t\t{\n\t\t\t\t$replaces['{$' . $key . '}'] = $value;\n\t\t\t}\n\t\t}\n\t\t$replaces['{$default_reserved_names}'] = strtr($replaces['{$default_reserved_names}'], array('\\\\\\\\n' => '\\\\n'));\n\n\t\t// Execute the SQL.\n\t\t$exists = array();\n\t\t$incontext['failures'] = array();\n\t\t$incontext['sql_results'] = array(\n\t\t\t'tables' => 0,\n\t\t\t'inserts' => 0,\n\t\t\t'table_dups' => 0,\n\t\t\t'insert_dups' => 0,\n\t\t);\n\n\t\tif (!empty($databases[$db_type]['additional_file']))\n\t\t{\n\t\t\tparseSqlLines(__DIR__ . '/' . $databases[$db_type]['additional_file'], $replaces);\n\t\t}\n\n\t\t// Read in the SQL. Turn this on and that off... internationalize... etc.\n\t\tparseSqlLines(__DIR__ . '/install_' . DB_SCRIPT_VERSION . '.php', $replaces);\n\n\t\t// Make sure UTF will be used globally.\n\t\t$db->insert('replace',\n\t\t\t$db_prefix . 'settings',\n\t\t\tarray(\n\t\t\t\t'variable' => 'string-255', 'value' => 'string-65534',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'global_character_set', 'UTF-8',\n\t\t\t),\n\t\t\tarray('variable')\n\t\t);\n\n\t\t$agreement = new \\ElkArte\\Agreement('english');\n\t\t$success = $agreement->storeBackup();\n\t\t$db->insert('replace',\n\t\t\t$db_prefix . 'settings',\n\t\t\tarray(\n\t\t\t\t'variable' => 'string-255', 'value' => 'string-65534',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'agreementRevision', $success,\n\t\t\t),\n\t\t\tarray('variable')\n\t\t);\n\n\t\t// Maybe we can auto-detect better cookie settings?\n\t\tpreg_match('~^http[s]?://([^\\.]+?)([^/]*?)(/.*)?$~', $boardurl, $matches);\n\t\tif (!empty($matches))\n\t\t{\n\t\t\t// Default = both off.\n\t\t\t$localCookies = false;\n\t\t\t$globalCookies = false;\n\n\t\t\t// Okay... let's see. Using a subdomain other than www.? (not a perfect check.)\n\t\t\tif ($matches[2] != '' && (strpos(substr($matches[2], 1), '.') === false || in_array($matches[1], array('forum', 'board', 'community', 'forums', 'support', 'chat', 'help', 'talk', 'boards', 'www'))))\n\t\t\t{\n\t\t\t\t$globalCookies = true;\n\t\t\t}\n\n\t\t\t// If there's a / in the middle of the path, or it starts with ~... we want local.\n\t\t\tif (isset($matches[3]) && strlen($matches[3]) > 3 && (substr($matches[3], 0, 2) == '/~' || strpos(substr($matches[3], 1), '/') !== false))\n\t\t\t{\n\t\t\t\t$localCookies = true;\n\t\t\t}\n\n\t\t\tif ($globalCookies)\n\t\t\t{\n\t\t\t\t$rows[] = array('globalCookies', '1');\n\t\t\t}\n\n\t\t\tif ($localCookies)\n\t\t\t{\n\t\t\t\t$rows[] = array('localCookies', '1');\n\t\t\t}\n\n\t\t\tif (!empty($rows))\n\t\t\t{\n\t\t\t\t$db->insert('replace',\n\t\t\t\t\t$db_prefix . 'settings',\n\t\t\t\t\tarray('variable' => 'string-255', 'value' => 'string-65534'),\n\t\t\t\t\t$rows,\n\t\t\t\t\tarray('variable')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Setting a timezone is required.\n\t\tif (!isset($modSettings['default_timezone']))\n\t\t{\n\t\t\t$server_offset = mktime(0, 0, 0, 1, 1, 1970);\n\t\t\t$timezone_id = 'Etc/GMT' . ($server_offset > 0 ? '+' : '') . ($server_offset / 3600);\n\t\t\tif (date_default_timezone_set($timezone_id))\n\t\t\t{\n\t\t\t\t$db->insert('',\n\t\t\t\t\t$db_prefix . 'settings',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'variable' => 'string-255', 'value' => 'string-65534',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'default_timezone', $timezone_id,\n\t\t\t\t\t),\n\t\t\t\t\tarray('variable')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Let's optimize those new tables.\n\t\t$tables = $db->list_tables($db_name, $db_prefix . '%');\n\t\t$db_table = db_table($db);\n\t\tforeach ($tables as $table)\n\t\t{\n\t\t\tif ($db_table->optimize($table) == -1)\n\t\t\t{\n\t\t\t\t$incontext['failures'][-1] = $db->last_error();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Check for the ALTER privilege.\n\t\t$db->skip_next_error();\n\t\t$cannot_alter_table = $db->query('', \"\n\t\t\tALTER TABLE {$db_prefix}log_digest\n\t\t\tORDER BY id_topic\",\n\t\t\t\tarray(\n\t\t\t\t\t'security_override' => true\n\t\t\t\t)\n\t\t\t)->getResultObject() === false;\n\n\t\tif (!empty($databases[$db_type]['alter_support']) && $cannot_alter_table)\n\t\t{\n\t\t\t$incontext['error'] = $txt['error_db_alter_priv'];\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!empty($exists))\n\t\t{\n\t\t\t$incontext['page_title'] = $txt['user_refresh_install'];\n\t\t\t$incontext['was_refresh'] = true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function run()\n {\n Game::query()->delete();\n foreach(Player::all() as $player) {\n $numGames = rand(20,50);\n foreach(range(1,$numGames) as $num) {\n $game = Game::factory()->make(['game_number' => $num, 'player_id' => $player->id]);\n $player->games()->save($game);\n }\n }\n }", "public function isInGame() {\n return $this->onlineState == 'in-game';\n }", "function getAllApplications()\r\n {\r\n //Connect to the DB, build query\r\n $db = db_connect();\r\n $sql = \"SELECT * FROM account WHERE role = :role: ORDER BY accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0\r\n ]);\r\n return $results;\r\n }", "public function databases()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/databases');\n }", "public function run()\n {\n $name3 = str_random(10);\n $description3 = str_random(40);\n\n DB::table('tournaments')->insert([\n 'name' => str_random(10),\n 'description' => str_random(40),\n 'maxPlayers' => 5,\n 'startsAt' => time() + 600,\n 'timeBetweenQuestions' => 3000,\n 'timeToAnswer' => 2000,\n 'password' => '',\n ]); \t\n DB::table('tournaments')->insert([\n 'name' => str_random(10),\n 'description' => str_random(40),\n 'maxPlayers' => 10,\n 'startsAt' => time() + 840,\n 'timeBetweenQuestions' => 5000,\n 'timeToAnswer' => 10000,\n 'password' => '',\n ]); \n\n DB::table('tournaments')->insert([\n 'name' => $name3,\n 'description' => $description3,\n 'isAllocated' => true,\n 'maxPlayers' => 10,\n 'startsAt' => time() - 3600,\n 'timeBetweenQuestions' => 5000,\n 'timeToAnswer' => 10000,\n 'password' => '',\n ]); \n\n DB::table('donetournaments')->insert([\n 'tournament_id' => 3,\n 'name' => $name3,\n 'description' => $description3,\n 'winner' => 'Joonas_83',\n 'second' => 'yh1978',\n 'third' => 'goneGirlGG',\n 'created_at' => time(),\n 'standings' => '[{\n \"name\": \"Joonas_83\",\n \"points\": 507\n }, {\n \"name\": \"yh1978\",\n \"points\": 504\n }, {\n \"name\": \"goneGirlGG\",\n \"points\": 501\n }, {\n \"name\": \"Joonas_84\",\n \"points\": 484\n }]'\n ]); \n }", "function ShowInfoPlayers($idGame)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT idPlace, PondFishesPlace, FishedFishesPlace, ReleasedFishesPlace, OrderPlace, PseudoPlayer, RankingPlayer, DescriptionStatus FROM fishermenland.place\n INNER JOIN fishermenland.player ON place.fkPlayerPlace = player.idPlayer\n INNER JOIN fishermenland.status ON place.fkStatusPlace = status.idStatus WHERE fkGamePlace = '$idGame' ORDER BY OrderPlace ASC\");\n\n return $req;\n}", "public function startGameSession() {\n if(!isset($_SESSION['wrongGuesses'])) {\n $_SESSION['wrongGuesses'] = 0;\n }\n $_SESSION['activeGame'] = true;\n }", "public function run()\n {\n $question = HouseQuestion::create([\n 'title' => 'What will happen to the Night King?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Lives',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Dies',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will we see Ice Spiders?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Please, God, no.',\n 'house_question_id' => $question->id\n ]);\n\n\n $question = HouseQuestion::create([\n 'title' => 'Cleganebowl?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'The Mountain wins',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'The Hound wins',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Draw',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Won\\'t take place',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'How many times will we hear the phrase \"Winter has come.\"?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Never',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Fewer than 5 times',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'Between 5 and 10 times',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'More than 10 times',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Jon ride a dragon (excluding Daenerys)?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Tyrion ride a dragon?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will Arya ride a dragon?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Will King\\'s Landing still be standing when the season is over?',\n ]);\n HouseQuestionOption::create([\n 'label' => 'Yes',\n 'house_question_id' => $question->id\n ]);\n HouseQuestionOption::create([\n 'label' => 'No',\n 'house_question_id' => $question->id\n ]);\n\n $question = HouseQuestion::create([\n 'title' => 'Which character will be the first to die this season?',\n ]);\n foreach (\\App\\Character::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n\n }\n foreach (\\App\\HouseCharacter::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n }\n\n $question = HouseQuestion::create([\n 'title' => 'Which character will be the last to die this season?',\n ]);\n foreach (\\App\\Character::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n\n }\n foreach (\\App\\HouseCharacter::all() as $character) {\n HouseQuestionOption::create([\n 'label' => $character->name,\n 'house_question_id' => $question->id\n ]);\n }\n }", "function showGames()\n{\n $email = trim($_SESSION['login']);\n $dbEmail = R::getAll(\"SELECT * FROM users WHERE email = '$email'\");\n if (!empty($dbEmail)) {\n $user_id = $dbEmail[0]['id'];\n $games = R::getAll(\"SELECT * FROM games WHERE `user_id` = '$user_id'\");\n if (!empty($games)) {\n echo \"<table class='games'>\";\n echo \"<thead><tr>\n <td>#</td>\n <td>Cas hry</td>\n <td>Data hry</td>\n </tr></thead>\";\n $count = 1;\n foreach ($games as $game) {\n echo \"<tr>\n <td>\" . $count . \"</td>\";\n echo \"<td>\" . $game['time'] . \"</td>\";\n echo \"<td>\" . $game['data'] . \"</td>\";\n echo \"</tr>\";\n $count++;\n }\n echo \"</table>\";\n } else {\n echo \"No games yet!\";\n }\n }\n}", "public function game()\n {\n return $this->game;\n }", "abstract public function selectDatabase($name);", "function determineNextGame( $gameID, $teamID, $winnerOrLoser ) {\n\n/* ... get the details for the game just played */\n $gameDetails = $this->getGameDetails( $gameID );\n \n/* ... get the details for the next game using the proper flow */\n if ($winnerOrLoser == \"WINNER\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['WinnerNextGame'] );\n }\n else {\n if ($gameDetails['LoserNextGame'] != \"\") {\n $nextGameDetails = $this->findGameByTournamentID( $gameDetails['LoserNextGame'] );\n }\n else {\n return( -1 );\n }\n }\n \n/* ... if we have a game to update, then figure out what to change and do it */\n if (count( $nextGameDetails ) > 0) {\n $dbData = array();\n $division = substr( $gameDetails['TournamentID'], 0, 1 );\n \n/* ... if the Home Team hasn't been set, then put the winner in as the home team for now */ \n if ($nextGameDetails['HomeTeamID'] == NULL) {\n $dbData = array(\n \"GameID\" => $nextGameDetails['GameID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n\n/* ... determine who should be the home team from the 2 teams now known for the game */\n if ($this->_whoIsBetterSeed( $teamID, $nextGameDetails['HomeTeamID'], $division ) == $teamID) {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $nextGameDetails['HomeTeamID'],\n \"HomeTeamID\" => $teamID\n );\n }\n else {\n $dbData = array( \n \"GameID\" => $nextGameDetails['GameID'],\n \"VisitTeamID\" => $teamID\n );\n }\n }\n\n/* ... time to update the database */\n $this->saveGameResult( $nextGameDetails['GameID'], $dbData );\n\n }\n\n/* ... time to go */\n return( $dbData['GameID'] );\n }", "public function longRunning(): int {\n return self::$db->scalar(\"\n SELECT count(*)\n FROM information_schema.processlist\n WHERE COMMAND NOT IN ('Sleep')\n AND TIME > 1200;\n \");\n }", "public function queryAll()\n {\n $sql = <<<SQL\n SELECT s.*, p.title as program_name \n FROM ec_shows s, ec_programs p\n WHERE s.program_id = p.id\nSQL;\n $sqlQuery = new SqlQuery($sql);\n return $this->getList($sqlQuery);\n }", "public function getDatabaseInfo();", "function CheckRank()\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"SELECT AVG(ScoreHistory) AS AVGScoreHistory, fkPlayerHistory FROM fishermenland.history GROUP BY fkPlayerHistory ASC HAVING COUNT(fkPlayerHistory) >= (SELECT ValueInt FROM fishermenland.settings WHERE NameSettings = 'NeededGameToRank')\");\n\n return $req;\n}", "private function managePlayersPresence()\n {\n if($this->isNewRecord) {\n return;\n }\n\n if( $player = Player::findIdentity($this->join_player) ){\n $presence = 1;\n }elseif( $player = Player::findIdentity($this->reject_player) ){\n $presence = 0;\n } else {\n return;\n }\n\n $sql = \"INSERT INTO `game_has_player` (`game_id`, `player_id`, `presence`)\n VALUES ('{$this->id}', '{$player->id}', '{$presence}')\n ON DUPLICATE KEY UPDATE `presence` = '{$presence}'\";\n\n return Yii::$app->db->createCommand($sql)->execute();\n }", "function database_list(){\n\t\treturn($this->q2obj(\"show databases\"));\n\t}", "function StartGame($idGame, $FirstPlayer)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"UPDATE fishermenland.game SET TourGame = '1', FirstPlayerGame = '$FirstPlayer' WHERE idGame = '$idGame' AND TourGame IS NULL\");\n $req = $dbh->query(\"UPDATE fishermenland.place SET fkStatusPlace = '2' WHERE fkPlayerPlace = (SELECT idPlayer FROM fishermenland.player WHERE PseudoPlayer = '$FirstPlayer')\");\n}", "public function get_database_names() {\n return UPS_SUCCESS;\n }", "public function cheat(){\n\t\t$gameId = $this->input->get('gameId');\n\t\t$game = $this->setRedis_info($gameId);\n\t\techo \"<pre>\";\n\t\tprint_r($game['info']);\n\t\techo \"</pre>\";\n\t}", "public function run()\n {\n $name = ['doremon', 'bug', 'nobita', 'chaien', 'xeko'];\n if (!\\App\\Models\\Team::first()) {\n foreach (range(1, count($name) - 1) as $index) {\n DB::table('teams')->insert([\n 'name' => $name[$index]\n ]);\n }\n }\n\n }", "public function get_status()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$q = $this->_conn->prepare(\"select * from sandbox.dbo.daemon where dbtype = :dbtype order by object asc\");\n\t\t\t\n\t\t\t$dbtype = 'live';\n\t\t\t$q->bindParam(':dbtype', $dbtype);\n\n\t\t\t$q->execute();\n\t\t\t$rs = $q->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\treturn 'ERRORdd: ' . $e->getMessage();\n\t\t}\n\t\t\n\t\treturn $rs;\n\t}", "public function is_game_live()\n {\n return $this->status === 'live' ? true : false;\n }", "public function hasDatabase($name);", "public function FindByGame($gid)\n {\n $guessArr = $this->db->fetchAll('SELECT * FROM guess WHERE game_id = :game ORDER BY timestamp', array(\n 'game' => (int) $gid));\n return $this->returnGuesses($guessArr);\n }", "public function run()\n {\n $scheduleCount = (int)$this->command->ask('How many schedules would you like?', 50);\n $users = User::all();\n $gyms = Gym::all();\n $coaches = Coach::all();\n $training_programs = TrainingProgram::all();\n\n Schedule::factory($scheduleCount)->make()->each(function($schedule) use ($users, $gyms, $coaches, $training_programs) {\n $schedule->id_user = $users->random()->id;\n $schedule->id_gym = $gyms->random()->id;\n $schedule->id_coach = $coaches->random()->id;\n $schedule->id_training_program = $training_programs->random()->id;\n $schedule->save();\n });\n }", "protected function GetPrograms()\n {\n return $this->GetUser()->OptionsForEntitiesWithPrivilege(\"Program\", \\Ability::ADMIN, \"allow_teams = ?\", array(true));\n }", "public abstract function hasWaitingLobby(): bool;", "private function canUseDatabase()\n {\n return $this->deploymentConfig->get('db');\n }", "function get_open_risks()\n{\n // Open the database connection\n $db = db_open();\n\n // Query the database\n $stmt = $db->prepare(\"SELECT * FROM `risks` WHERE status != \\\"Closed\\\"\");\n $stmt->execute();\n\n // Store the list in the array\n $array = $stmt->fetchAll();\n\n // Close the database connection\n db_close($db);\n\n return count($array);\n}", "private function checkOpenDB(){\r\n if($this->connected){\r\n return true;\r\n }\r\n \r\n //No database opened yet\r\n return false;\r\n }", "public function run()\n {\n DB::table('pet_status')->insert([\n 'status' => \"available\",\n ]);\n\n DB::table('pet_status')->insert([\n 'status' => \"sitted\",\n ]);\n }", "function run()\n\t{\n\t\t$this->BG = new DataBase();\n\t\t$this->BG->connect();\n\t\t$process = new calendario($this->BG->con);\n\t\t$process ->sethecho(-1);\n\t\t$process=$process->read(true,1,array(\"hecho\"),1,array(\"fecha\",\"ASC\")); \n\t\t$fechaActual = fechaHoraActual();\n\t\t$sigue=true;\n\t\tfor($i=0;$i<count($process)&&$sigue;$i++)\n\t\t{\n\t\t\tif(FechaMayor($fechaActual,$process[$i]->getfecha())!=-1)\n\t\t\t{\n\t\t\t\tif($process[$i]->getaccion()==\"SORTE\")\n\t\t\t\t{\n\t\t\t\t\t$target = explode(\",\",$process[$i]->gettargetstring());\n\t\t\t\t\t$this->sorteo($target[0],$target[1]);\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"ACTBA\")\n\t\t\t\t{\n\t\t\t\t\t$this->activarBatalla($process[$i]->gettargetdate());\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"CONVO\")\n\t\t\t\t{\n\t\t\t\t\t$this->ConteoVotos();\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"CHTOR\")\n\t\t\t\t{\n\t\t\t\t\t$this->changeChampionship($process[$i]->gettargetint());\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"CHEVE\")\n\t\t\t\t{\n\t\t\t\t\t$this->changeEvento($process[$i]->gettargetstring());\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"CALPO\")\n\t\t\t\t{\n\t\t\t\t\t$target = explode(\",\",$process[$i]->gettargetstring());\n\t\t\t\t\t$this->calcularPonderacion($target[0],$target[1]);\n\t\t\t\t}\n\t\t\t\tif($process[$i]->getaccion()==\"INMAT\")\n\t\t\t\t{\n\t\t\t\t\t$this->ingresarMatch();\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\tif($process[$i]->getaccion()==\"PAREP\")\n\t\t\t\t{\n\t\t\t\t\t$target = explode(\",\",$process[$i]->gettargetstring());\n\t\t\t\t\t$this->pasarrepechaje($target[0],$target[1],$target[2],$target[3]);\n\t\t\t\t}\t\t\n\t\t\t\t$process[$i]->setHecho(1);\n\t\t\t\t$process[$i]->update(1,array(\"hecho\"),1,array(\"id\"));\n\t\t\t\t$lognew = new reg($this->BG->con,-10,$process[$i]->getaccion(),$fechaActual,1,\"system\",$process[$i]->gettargetstring().\" \".$process[$i]->gettargetdate().\" \".$process[$i]->gettargetint());\n\t\t\t\t$lognew->save(); \n\t\t\t}\n\t\t\telse\n\t\t\t\t$sigue=false;\n\t\t}\n\t\t$this->grafoenvivo();\n\t\t$this->BG->close();\n\t}", "public function getGamesList()\n {\n $games_list = array();\n try {\n $db = new Database();\n $db->connect();\n $query = $db->getConnection()->prepare(\"SELECT * FROM Games\");\n $query->execute();\n foreach ($query->fetchAll() as $data) {\n $item = new Games($data[0], $data[1], $data[2], $data[3], \"$\" . $data[4], $data[5]);\n array_push($games_list, $item);\n }\n } catch (PDOException $pdo_exception) {\n echo \"Error: \" . $pdo_exception->getMessage() . \"\\n\";\n }\n $db->disconnect();\n return $games_list;\n }", "public function check_queries() {\r\n\t\tQueryManager::check_queries();\r\n\t}", "public function run()\n {\n \t//Jessica Jones\n \tfor($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '13',\n\t\t\t 'serie_id' => '1',\n\t\t ]);\n\t }\n\n\t //Game of Thrones\n\t for($i = 1; $i <= 6; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '10',\n\t\t\t 'serie_id' => '2',\n\t\t ]);\n\t }\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '7',\n\t\t 'episode_number' => '7',\n\t\t 'serie_id' => '2',\n\t ]);\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '8',\n\t\t 'episode_number' => '6',\n\t\t 'serie_id' => '2',\n\t ]);\n\n\t //Westworld\n\t for($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '10',\n\t\t\t 'serie_id' => '3',\n\t\t ]);\n\t }\n\n\t //Brooklynn Nine-Nine\n\t DB::table('seasons')->insert([\n\t\t 'number' => '1',\n\t\t 'episode_number' => '22',\n\t\t 'serie_id' => '4',\n\t ]);\n\n\t for($i = 2; $i <= 3; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '23',\n\t\t\t 'serie_id' => '4',\n\t\t ]);\n\t }\n\n\t for($i = 4; $i <= 5; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '22',\n\t\t\t 'serie_id' => '4',\n\t\t ]);\n\t }\n\n\t //How i met your mother\n\t for($i = 1; $i <= 2; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '22',\n\t\t\t 'serie_id' => '5',\n\t\t ]);\n\t }\n\n\t DB::table('seasons')->insert([\n\t\t 'number' => '3',\n\t\t 'episode_number' => '20',\n\t\t 'serie_id' => '5',\n\t ]);\n\n\t for($i = 4; $i <= 9; $i++) {\n\t\t DB::table('seasons')->insert([\n\t\t\t 'number' => $i,\n\t\t\t 'episode_number' => '24',\n\t\t\t 'serie_id' => '5',\n\t\t ]);\n\t }\n\n }", "public function games()\n {\n return $this->belongsToMany('DashboardersHeaven\\Game')\n ->withPivot([\n 'earned_achievements',\n 'current_gamerscore',\n 'max_gamerscore',\n 'last_unlock'\n ])\n ->withTimestamps();\n }" ]
[ "0.63181704", "0.5849128", "0.56395024", "0.55175513", "0.550297", "0.5479659", "0.5446325", "0.53626204", "0.5309082", "0.5246008", "0.5228512", "0.5202838", "0.5187248", "0.51846135", "0.51785505", "0.5178185", "0.5170967", "0.5170245", "0.51696986", "0.51438165", "0.5139482", "0.51392126", "0.51344436", "0.5096586", "0.5069135", "0.50019366", "0.49918664", "0.4979509", "0.4963881", "0.4962833", "0.49545112", "0.49316475", "0.49176967", "0.49101585", "0.49017996", "0.48840588", "0.48832613", "0.48766214", "0.48584557", "0.4845588", "0.4844761", "0.48371294", "0.48341095", "0.48305383", "0.48300686", "0.48263437", "0.48232", "0.4816597", "0.4815018", "0.48142892", "0.48141193", "0.4793886", "0.47916844", "0.47915298", "0.47846228", "0.4762971", "0.47527578", "0.4743031", "0.47335553", "0.47294992", "0.47276103", "0.47256643", "0.4715202", "0.47100082", "0.47074932", "0.46987763", "0.46923792", "0.46918467", "0.46886727", "0.46853554", "0.4682312", "0.4681689", "0.46814272", "0.46719468", "0.46650538", "0.46633807", "0.46563196", "0.46531734", "0.4652205", "0.46485665", "0.46451637", "0.46395683", "0.4634614", "0.46309125", "0.46271807", "0.46220016", "0.46164805", "0.4601141", "0.45997155", "0.45985013", "0.45966464", "0.4594071", "0.4580902", "0.45789802", "0.45774382", "0.4577401", "0.457688", "0.45707124", "0.45656642", "0.45636687" ]
0.5993147
1
look up the details
function setSuccessMessage($appointmentData) { $stylistName = $appointmentData[0]['stylistName']; $serviceName = $appointmentData[0]['serviceName']; $appointmentDate = date('l F j',strtotime($appointmentData[0]['appointmentDate'])); $startTime = date('g:i a', strtotime($appointmentData[0]['startTime'])); $this->email = $appointmentData[0]['email']; $this->message = JText::sprintf('COM_SALONBOOK_EMAIL_BODY_SUCCESS', $serviceName, $stylistName, $appointmentDate, $startTime); $this->mailer->setBody($this->message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getDetails();", "public function getDetail();", "public function getInformation();", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "public function details_get()\n \t{\n \t\tlog_message('debug', 'Score/details_get');\n\n\t\t$result = $this->_score->get_details(\n\t\t\t$this->get('type'),\n\t\t\t$this->get('codes'),\n\t\t\textract_id($this->get('userId')),\n\t\t\t(!empty($this->get('storeId'))? extract_id($this->get('storeId')): '')\n\t\t);\n\n\t\tlog_message('debug', 'Score/details_get:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function getInfo();", "public function detail(){\r\n\t\t//only ajax is allowed\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('view');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//search data with pk for default\r\n\t\t$search_data = $this->input->post('ang_id');\r\n\t\t//if no search data exist, response error\r\n\t\tif($search_data === NULL)\r\n\t\t\tajax_response('error');\r\n\r\n\t\t//activate if search data is integer\r\n\t\t//$search_data = uintval($search_data);\r\n\r\n\t\t//get detail\r\n\t\t$detail = $this->m_anggota->get_by_column($search_data);\r\n\r\n\t\t//output return value\r\n\t\tif($detail !== NULL) ajax_response('ok', '', $detail);\r\n\t\telse ajax_response('error');\r\n\t}", "public function getRecordInformation() {}", "public function get_information() {\n $informationsources = ['name' => 'dbdetails', 'displayname' => get_string(\"dbdetails\", \"local_reportgen\")];\n\n return $informationsources;\n }", "function getDetails() {\n\t\treturn $this->data_array['details'];\n\t}", "public function getInfo() {}", "public function getInfo() {}", "public function getSpecifics() {}", "public function lookups()\n {\n }", "public function getLookupField() {}", "private function getAccInfo(){\n try {\n $stmt = $this->dbh->prepare(\"SELECT * FROM `Locations` WHERE P_Id = :id\");\n $stmt->bindParam(\":id\", $this->accId);\n $stmt->execute();\n } catch (Exception $e){\n error_log(\"Error: \" . $e->getMessage());\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->accName = $row[\"AccName\"];\n $this->accStrAdd = $row[\"AccStrAdd\"];\n $this->accAptNum = $row[\"AccAptNum\"];\n $this->accState = $row[\"AccState\"];\n $this->accZip = $row[\"AccZip\"];\n $this->currentUnits = $row[\"AccUnits\"];\n }", "abstract public function information();", "public function Individualgetdata();", "abstract public function getCorrespondingMetaData();", "public function getInfo($criteria)\n {\n }", "function get_detail() {\n return $this->detail;\n }", "public function getDetails() {\n return $this->_get( 'details', array() );\n }", "function getInfo();", "private function getTableDetail($name){\n\n\n foreach ($this->app[\"tables\"] as $item) {\n\n if($item[\"name\"] == $name){\n return $item;\n }\n\n }\n\n \n\n }", "protected function fetchDetails() {\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'tstamp, crdate, cruser_id, name',\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group')\n\t\t);\n\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t$this['name'] = $row['name'];\n\t\t$this['timeStamp'] = $row['timeStamp'];\n\t\t$this['createDate'] = $row['crdate'];\n\t\t$this['cruserUid'] = $row['cruser_id'];\n\t}", "abstract protected function extractProductDetail();", "abstract public function infoAll();", "function getInfo($id){\r\n\t\t$this->getQuestion($id);\r\n\t}", "public function readInfoById() {\t\t\n\t\t$fnName = \"getId\";\n\t\t$_id = -1;\n\t\t\n\t\t$_nombre = get_class( $this ) ;\n\t\t$result = null;\n\t\t$params = array();\n\t\t\n\t\tforeach(get_class_methods( $this ) as $id => $vl){\n\t\t\tif( strtolower( $vl ) == strtolower( $fnName ) ){\n\t\t\t\t$_id = $this->$fnName();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $_id > 0 ){\n\t\t\t$stmt = null;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM \" . strtolower( $_nombre ) . \" WHERE id = ?\";\n\t\t\tif ($stmt = self::$lnk->prepare($query)) {\n\t\t\t\t$stmt->bind_param(\"i\", $_id);\n\t\t\t $stmt->execute();\n\t\t\t \n\t\t\t\t$meta = $stmt->result_metadata(); \n\t\t\t while ($field = $meta->fetch_field()) {\n\t\t\t \t$params[] = &$row[ $field->name ]; \n\t\t\t } \n\t\t\t\n\t\t\t call_user_func_array(array($stmt, 'bind_result'), $params); \n\t\t\t \n\t\t\t while ($stmt->fetch()) {\n\t\t\t \t$o = new $_nombre();\n\t\t\t foreach($row as $key => $val) {\n\t\t\t $o->{ \"set\" . Singleton::toCap($key)}( $val );\n\t\t\t } \n\t\t\t $result = $o;\t\t\t \n\t\t\t }\n\t\t\t $stmt->close();\n\t\t\t}else{\n\t\t\t\t$this->mensaje_error = self::$lnk->error;\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "public function getInfo($name) {}", "function get_info($title) {\n \n $this->db->where('title_url', $title);\n $query = $this->db->get('tech_section');\n return $query->row_array();\n }", "protected function fetchDetails() {\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'be_users.uid AS uid, be_users.username AS username, be_users.tx_passwordmgr_cert AS cert, tx_passwordmgr_group_be_users_mm.rights AS rights',\n\t\t\t'be_users, tx_passwordmgr_group_be_users_mm',\n\t\t\t'tx_passwordmgr_group_be_users_mm.be_users_uid=be_users.uid' . // Join Constraint\n\t\t\t\t' AND be_users.uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['beUserUid'], 'be_users') .\n\t\t\t\t' AND tx_passwordmgr_group_be_users_mm.group_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['groupUid'], 'tx_passwordmgr_group_be_users_mm')\n\t\t);\n\t\tif ( $GLOBALS['TYPO3_DB']->sql_num_rows($res) == 1 ) {\n\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t\t$this['name'] = $row['username'];\n\t\t\t$this['certificate'] = $row['cert'];\n\t\t\t$this['publicKey'] = tx_passwordmgr_openssl::extractPublicKeyFromCertificate($this['certificate']);\n\t\t\t$this['rights'] = $row['rights'];\n\t\t} else {\n\t\t\tthrow new Exception ('Error getting group member details. user / group: ' . $this['beUserUid'] . ' ' . $this['groupUid']);\n\t\t}\n\t}", "function load_Info()\n {\n\n $this->Facility_Info($this->facilities[0]);\n }", "public function getdetail() \n\t{\n\t\ttry \n\t\t{\n\t\t\t// select mongoDB collection\n\t\t\t$app_collection = \t$this->mongo_db->db->func;\n\t\t\t// find data from collection\n\t\t\t$getdata \t\t= \t$app_collection->find(array(\n\t\t\t\t'_id' => new MongoId($this->_id)\n\t\t\t\t)\n\t\t\t);\n\t\t\twhile($getdata->hasNext()) \n\t\t\t{\n\t\t\t\t// Get data from collection\n\t\t\t\t$getdata2 \t\t\t\t= $getdata->getNext();\n\t\t\t\t// set data from collection to variable\n\t\t\t\t$this->function_name \t= $getdata2['function_name'];\n\t\t\t\t$this->function_token \t= $getdata2['function_token'];\n\t\t\t\t$this->application_name = $getdata2['application_name'];\n\t\t\t\t$this->application_id \t= $getdata2['application_id'];\n\t\t\t\t$this->function_primary = $getdata2['function_primary'];\n\t\t\t}\n\t\t\treturn true;\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function getAllDetails()\n\t{\n\t\t $qbLogin = $this->getDefaultEntityManager()->createQueryBuilder();\n\t\t $qbLogin->select('m')\n ->from('MailingList\\Entity\\PhoenixMailingList', 'm')\n\t\t\t ->where('m.status=:st')\n\t\t\t ->andwhere('m.subscribe=:s')\n\t\t\t ->setParameter('s',1)\n\t\t\t ->setParameter('st',1);\n\t\t $result = $qbLogin->getQuery()->getResult();\t\n\t\treturn $result;\n\t}", "protected function queryInfoById() {\n\t\tglobal $query, $lang, $wtcDB;\n\t\t\n\t\t$getWord = new Query($query['lang_words']['get'], Array(1 => $this->wordid));\n\t\n\t\t$this->info = parent::queryInfoById($getWord);\n\t}", "public function sanphamdetail()\n\t\t{\n\t\t\t$id = $_GET['chitiet_sanpham'];\n\t\t\t//goi ham model de xu li\n\t\t\t$ketqua = $this->sanpham_model->OneRecordData1($id);\n\t\t\treturn $ketqua;\n\t\t}", "public function studiengang_details() {\r\n\r\n //Sprachen rausfinden:\r\n $this->sprachen = StgProfil::getPossibleLanguages();\r\n //Abschlüsse suchen:\r\n $this->abschlusssuche = new SQLSearch(\"SELECT abschluss_id, name FROM abschluss WHERE name LIKE :input\", _(\"Abschluss eingeben\"));\r\n //zulassungsvoraussetzung:\r\n $this->moeglicheZulassungsvoraussetzungen_wise = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_wise\");\r\n $this->moeglicheZulassungsvoraussetzungen_sose = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_sose\");\r\n //Typen von Studiengängen:\r\n $this->moeglicheStgTypen = StgProfil::getMoeglicheTypen();\r\n\r\n $this->studiengaenge = PersonalRechte::meineStudiengaenge(null, true);\r\n $this->abschluesse = Abschluss::findAllUsed();\r\n $this->profile = StgProfil::getMeineProfile(null, Request::get(\"studiengang_id\"), Request::get(\"abschluss_id\"));\r\n\r\n //Neuen Eintrag in stg_profil erstellen\r\n if (Request::get(\"item_id\") === \"neu\" && !Request::get(\"studiengang_id\")) {\r\n //$this->profil = new StgProfil();\r\n $this->fachsuche = new SQLSearch(\"SELECT studiengang_id, name FROM studiengaenge WHERE name LIKE :input OR beschreibung LIKE :input \", _(\"Studiengang eingeben\"));\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n return;\r\n }\r\n\r\n $this->profil = new StgProfil(Request::get(\"studienprofil_id\") !== \"neu\" ? Request::get(\"studienprofil_id\") : null);\r\n if (!$this->profil->hasPermission()) {\r\n throw new AccessDeniedException(_(\"Sie dürfen diesen Studiengang nicht bearbeiten\"));\r\n }\r\n if (Request::get(\"delete_x\") && Request::get(\"item_id\") && Request::get(\"type\") === \"dokument\") {\r\n $this->profil->deleteDoku(Request::get(\"item_id\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung gelöscht\"));\r\n }\r\n if (Request::get(\"addDocument\")) {\r\n $this->profil->addDoku(Request::get(\"addDocument\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung hinzugefügt\"));\r\n }\r\n //Profil ändern, falls Informationen gesendet worden sind:\r\n if (Request::submitted(\"absenden\")) {\r\n if (Request::get(\"studiengang_id\")) {\r\n //Neuen Eintrag in stg_profil machen:\r\n $this->profil['fach_id'] = Request::get(\"studiengang_id\");\r\n $this->profil->store(); //Nachher wird noch einmal gestored, aber jetzt wollen wir IDs bekommen.\r\n }\r\n if (Request::submitted('informationen')) {\r\n $this->profil->setInformation(Request::getArray(\"informationen\"));\r\n }\r\n if (Request::submitted(\"abschluss_id\")) {\r\n $this->profil['abschluss_id'] = Request::get(\"abschluss_id\");\r\n }\r\n if (Request::submitted('settings')) {\r\n $settings = Request::getArray(\"settings\");\r\n foreach ($settings as $key => $value) {\r\n $this->profil[$key] = $value;\r\n }\r\n if (!$settings['sichtbar']) {\r\n $this->profil['sichtbar'] = 0;\r\n }\r\n }\r\n if (Request::submitted(\"zielvereinbarung\")) {\r\n $this->profil['zielvereinbarung'] = Request::get(\"zielvereinbarung\");\r\n }\r\n if (Request::submitted(\"einleitungstext\")) {\r\n $this->profil['einleitungstext'] = Request::get(\"einleitungstext\");\r\n }\r\n if (Request::submitted('typen')) {\r\n $this->profil->setTypen(Request::getArray(\"typen\"));\r\n }\r\n $this->profil->store();\r\n\r\n if (Request::submitted('textcombination')) {\r\n $textcombinations = (array) @$_REQUEST['textcombination'];\r\n Textbaustein::removeCombination($this->profil->getId());\r\n foreach ($textcombinations as $code => $ids) {\r\n Textbaustein::addCombination($this->profil->getId(), $code, $ids);\r\n }\r\n }\r\n\r\n $this->flash_now(\"success\", _(\"Änderungen wurden übernommen\"));\r\n if (Request::get(\"neues_dokument\")) {\r\n $dokument = new StgFile();\r\n if ($_GET['qqfile'] || isset($_FILES['qqfile'])) {\r\n ob_start();\r\n $dokument->upload();\r\n ob_clean();\r\n }\r\n $dokument['name'] = Request::get(\"neues_dokument_name\");\r\n $dokument['sichtbar'] = Request::get(\"neues_dokument_sichtbar\") ? '1' : '0';\r\n $dokument['jahr'] = Request::get(\"neues_dokument_jahr\");\r\n $dokument['doku_typ_id'] = Request::get(\"neues_dokument_doku_typ_id\");\r\n $dokument['quick_link'] = Request::get(\"neues_dokument_quick_link\");\r\n $dokument['user_id'] = $GLOBALS['user']->id;\r\n $dokument->store();\r\n $dokument->setTags(Request::get(\"neues_dokument_tags\"));\r\n $this->profil->addDoku($dokument->getId());\r\n if ($dokument->isPublic()) {\r\n $this->flash_now(\"success\", _(\"Neues Dokument angelegt und hinzugefügt\"));\r\n } else {\r\n $this->flash_now(\"success\", _(\"Neues internes Dokument angelegt und hinzugefügt. Es kann unter Akkreditierung gefunden werden.\"));\r\n }\r\n }\r\n if (Request::get(\"neuer_ansprechpartner\")) {\r\n $kontakt = new StgAnsprechpartner();\r\n $kontakt['range_typ'] = Request::get(\"range_typ\");\r\n $kontakt['range_id'] = Request::get(\"range_typ\") && Request::get(\"range_id\") ? Request::get(\"range_id\") : \"\";\r\n\r\n if (Request::get(\"ansprechpartner_typ_id\")) {\r\n $typen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n foreach ($typen as $typ) {\r\n if ($typ['ansprechpartner_typ_id'] === Request::get(\"ansprechpartner_typ_id\")) {\r\n $kontakt['ansprechpartner_typ_id'] = Request::get(\"ansprechpartner_typ_id\");\r\n }\r\n }\r\n }\r\n $kontakt['freitext_name'] = Request::get(\"freitext_name\");\r\n $kontakt['freitext_mail'] = Request::get(\"freitext_mail\");\r\n $kontakt['freitext_telefon'] = Request::get(\"freitext_telefon\");\r\n $kontakt['freitext_homepage'] = Request::get(\"freitext_homepage\");\r\n if ($kontakt->store()) {\r\n $this->profil->addAnsprechpartner($kontakt->getId());\r\n $this->flash_now(\"success\", _(\"Neuer Ansprechpartner angelegt und hinzugefügt\"));\r\n }\r\n }\r\n }\r\n\r\n //Informationen:\r\n $this->informationen = $this->profil->getInformation();\r\n\r\n //Verlaufspläne\r\n $this->verlaufsplaene = $this->profil->getVerlaufsplaene();\r\n\r\n //Dateien:\r\n $this->dateien = StgFile::getByStgProfil($this->profil->getId());\r\n $this->dokumentensuche = $this->getDokumentensuche();\r\n\r\n //Kontakte:\r\n $this->kontakte = StgAnsprechpartner::getByStgProfil($this->profil->getId());\r\n usort($this->kontakte, function ($a, $b) {\r\n return strcmp($a->getName('no_title_rev'), $b->getName('no_title_rev'));\r\n });\r\n $this->kontakt_neu = new StgAnsprechpartner();\r\n $this->ansprechpartnertypen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n\r\n\r\n //Aufbaustudiengänge:\r\n $this->mutterstudiengaenge = $this->profil->getAufbauendeStudiengaenge();\r\n $this->profilsuche = $this->getProfilSuche();\r\n\r\n\r\n // Textbausteine\r\n $this->textbausteine = array(\r\n 'de' => Textbaustein::loadAll('de'),\r\n 'en' => Textbaustein::loadAll('en'),\r\n );\r\n $this->textcombinations = Textbaustein::loadCombination($this->profil->getId());\r\n\r\n $this->ansprechpartnersuche = $this->getAnsprechpartnersuche();\r\n $this->datei_url = $this->link_for(\"zsb_dateien/download_file\");\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n //hiernach wird nichts weiter ausgegeben\r\n }", "public function getDetails()\r\n {\r\n return $this->details;\r\n }", "public function getDetails()\n {\n if (array_key_exists(\"details\", $this->_propDict)) {\n return $this->_propDict[\"details\"];\n } else {\n return null;\n }\n }", "public function detail() {\n global $guest_uname;\n\n $detail = array();\n $detail['billing_address'] = $this->getBillingAddress();\n $detail['shipping_address'] = $this->getShippingAddress();\n $detail['review_orders'] = array($this->getReviewOrder());\n if (tep_count_shipping_modules() < 1) {\n $detail['need_select_shipping_method'] = false;\n } elseif (!$this->freeShipping && !$detail['review_orders'][0]['selected_shipping_method_id']) {\n $detail['need_select_shipping_method'] = true;\n }\n $detail['price_infos'] = $this->getPriceInfos();\n $detail['payment_methods'] = $this->getPaymentMethods();\n $detail['is_virtual'] = $this->isVirtual;\n $detail['need_billing_address'] = defined('NEED_BILLING_ADDRESS') ? NEED_BILLING_ADDRESS : FALSE;\n $detail['need_shipping_address'] = !$this->isVirtual && !ServiceFactory::factory('Store')->checkAddressIntegrity($detail['shipping_address']);\n\n if (tep_session_is_registered('guest_uname')) {\n $detail['uname'] = $guest_uname;\n tep_session_unregister('guest_uname');\n }\n\n return $detail;\n }", "public function getDetail()\n {\n \t$request = \\Request::all();\n // add system log\n $this->systemLogs('view', 'information', $request);\n // End\n\n $information = false;\n $information_description = false;\n if(\\Request::has('information_id')) {\n $information = $this->information->getInformation($request['information_id']);\n\n if($information) {\n $information_description = $this->information->getInformationDescriptionByCode(['information_id'=>$request['information_id'], 'language_id'=>$request['language_id']]);\n }\n \n }\n\n if($information) {\n $this->data->information_id = $information->information_id;\n $this->data->icon = $information->icon;\n }else {\n $this->data->information_id = '';\n $this->data->icon = '';\n }\n\n if($information_description) {\n $this->data->title = $information_description->title;\n $this->data->description = $information_description->description;\n }else {\n $this->data->title = '';\n $this->data->description = '';\n }\n\n return view('information.detail', ['data'=>$this->data]);\n }", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function retrieveData(){\n\t\t$mParser = new RecipeParser;\n\t\t$mParser->retrieveInfoForObject($this);\n\t}", "public function getDetails()\n\t{\n\t\treturn $this->details;\n\t}", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "function getInfo () {\n\t\treturn array('id'=>'yahoo');\n\t}", "public function getInstanceDetail()\n {\n return $this->get(self::_INSTANCE_DETAIL);\n }", "public function getDetail() {\r\n\t\treturn($this->detail);\r\n\t}", "protected function collectInformation() {}", "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "public function billing_card_info_details() {\n\n $option = [\n 'projection' => [\n '_id' => 1,\n 'cardnumber' => 1,\n 'cvv' => 1,\n 'expiry_month' => 1,\n 'expiry_year' => 1,\n 'firstname' => 1,\n 'lastname' => 1,\n 'email'=>1,\n 'customer_id'=>1,\n 'address' => 1,\n 'city' => 1,\n 'state' => 1,\n 'country' => 1,\n 'postal_code' => 1,\n 'subscription_id'=>1,\n 'customer_id'=>1\n ]\n ];\n $result = $this->mongo_db->find(MDB_BILLING_REG_INFO, array('_id' => 1), $option);\n return (!empty($result)) ? $result : '';\n }", "public function\tgetReferidoInfo(){\r\t\t\r\t\t$model_ref = $this->getModel( 'referido' );\r\t\t$idref = JRequest::getInt( 'idref' );\r\t\t\r\t\t$model_ref->instance( $idref );\r\t\t$inf_ref = $model_ref->getReferidoInf();\r\t\t\r\t\tif( !empty($inf_ref) ){\r\t\t\t\r\t\t\t$model_ref\r\t\t}\r\t\t\r\t}", "function getSocietyDetails($soc_code){\n\t\t}", "public function findInfoByUid($uid){\n\t\t$sql = \"SELECT `id`, `name`, `cellphone`, `address` FROM `info` WHERE `uid` = ?\";\n\t\t$res = $this->connect()->prepare($sql);\n\t\t$res->bind_param(\"s\", $uid);\n\t\t$res->execute();\n\t\t$res->bind_result($id, $name, $cellphone, $address);\n\t\tif($res->fetch()) {\n\t\t\t$info = new \\stdClass();\n\t\t\t$info->id = $id;\n\t\t\t$info->name = $name;\n\t\t\t$info->cellphone = $cellphone;\n\t\t\t$info->$address = $address;\n\t\t\treturn $info;\n\t\t}\n\t\treturn NULL;\n\t}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "function getDetails($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n if ($sek_id == \"0\") {\r\n return false;\r\n }\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n left join \" . APP_TABLE_PREFIX . \"xsd_display_matchfields\r\n on xsdmf_sek_id=sek_id\r\n WHERE\r\n sek_id= \" . $db->quote($sek_id);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n $res['key_table_exists'] = Search_Key::checkIfKeyTableExists($res['sek_title_db'], $res['sek_relationship']);\r\n\r\n return $res;\r\n }", "public function getInformation(): array;", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetails() {\r\n\t\t\treturn $this->_details;\r\n\t\t}", "function achieve_get_details($id)\r\n{\r\n global $sql;\r\n\r\n $result = ($sql[\"dbc\"]->query(\"SELECT id, name, description, reward, points FROM achievement WHERE id='\".$id.\"' LIMIT 1\"));\r\n $details = $sql[\"dbc\"]->fetch_assoc($result);\r\n return $details;\r\n}", "public function getDetails($group_id);", "public function getDetails() {\n\t\treturn $this->details;\n\t}", "public function getLookupMode() {}", "function get_detail_data($table_name,$where,$return_data)\r\n{\r\n\t$ci = & get_instance();\r\n\t$ci->load->database();\r\n\t$result = $ci->db->get_where($table_name,$where)->row();\r\n\tif($result):\r\n\t\treturn $result->$return_data;\r\n\telse:\r\n\t\treturn false;\r\n\tendif;\r\n}", "public function getDetail( $key ) {\n $details = $this->getDetails();\n if( isset($details[$key]) ) {\n return $details[$key];\n }\n return null;\n }", "public function loadInfo()\n\t{\n\t\t$this->_info = $this->_adapter->describeTable($this->_identifier);\n\t}", "function getDetailsByTitle($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n inner join \" . APP_TABLE_PREFIX . \"xsd_display_matchfields\r\n on xsdmf_sek_id=sek_id\r\n WHERE\r\n sek_title=\" . $db->quote($sek_title);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "function info($what){\n if(isset($this->set[$what])) return $this->set[$what];\n return $this->key;\n }", "public function get_info() {\n\n\t\t$sql = \"SELECT COUNT(*) FROM `\" . $this->wpdb->commentmeta . \"` WHERE comment_id NOT IN (SELECT comment_id FROM `\" . $this->wpdb->comments . \"`);\";\n\t\t$commentmeta = $this->wpdb->get_var($sql);\n\t\t$this->found_trash_count += $commentmeta;\n\n\t\t$sql = \"SELECT COUNT(*) FROM `\".$this->wpdb->commentmeta.\"` WHERE meta_key LIKE '%akismet%';\";\n\t\t$akismetmeta = $this->wpdb->get_var($sql);\n\t\t$this->found_akismet_count += $akismetmeta;\n\n\t}", "public function returnDetailFindByPK($id);", "static function getLookupValueDescription($lookuptype, $lookuptypevalue) {\n\t\t$sql = \"SELECT lv.lookupvaluedescription FROM lookuptypevalue lv INNER JOIN lookuptype l ON (lv.lookuptypeid = l.id AND l.`name` = '\".$lookuptype.\"' AND lv.lookuptypevalue = '\".$lookuptypevalue.\"')\";\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t\n\t\treturn $conn->fetchOne($sql); \n\t}", "private function retrieveData(){\n\t\t\n\t\t$dbo=new DB();\n\t\t$db=$dbo->db;\n\t\t$stmt = $db->prepare(\t'SELECT `description`, '.\n\t\t\t\t\t\t\t\t\t\t'`duration` '.\n\t\t\t\t\t\t\t\t'FROM `status` '.\t\t\n\t\t\t\t\t\t\t\t'WHERE `status` = ? '.\n\t\t\t\t\t\t\t\t'LIMIT 1'\n\t\t\t\t\t\t\t\t);\n\t $stmt->bind_param(\"s\", $this->id);\n\t $stmt->bind_result($this->description,$this->duration);\n\t $stmt->execute();\n\t $stmt->fetch();\n \t\t$stmt->close();\n \t\t\n\t}", "abstract public function retrieve();", "public function get_details() {\n\t\t$member_id = $this->uri->segment(3);\n\t\t$member_details = $this->get_member_details($member_id);\n\t\t\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\t\t$data['user_mode'] = $this->session->userdata('mode');\n\t\t$data['member'] = (isset($member_details[0]))? $member_details[0]: NULL;\n\t\t\n\t\t$full_name = $member_details[0]->fname . ' ' . \n\t\t\t$member_details[0]->mname . ' ' . \n\t\t\t$member_details[0]->lname;\n\n\t\t$this->breadcrumbs->set(['Member Information: ' . $full_name => 'members/info/' . $member_id]);\n\t\t$this->render('information', $data);\n\t}", "function get_charity_details($name = NULL){\t\t\t\n\t\t$query = \" SELECT organization_id,charity_name,charity_overview\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers_details','dbtables');\n\t\t$query .= \" WHERE charity_name = ? \";\t\t\n\t\t$dataBindArr = array($name);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\t\n\t\tif(count($resArr) > 0){\n\t\t\treturn $resArr[0];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getdetails(){\n $data = $this->get();\n if(!empty($data)){\n $pizzalist = new pizzalist();\n $nonpizza = new ordernonpizzalist();\n $payment = new payment();\n $customer = new customer();\n\n $customer->__set('CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'OrderID', $this->__get('OrderID'));\n \n\n $data['pizza'] = $pizzalist->getorderspizza($this->__get('OrderID'));\n $data['nonpizza'] = $nonpizza->getordernonpizza($this->__get('OrderID'));\n $data['payment'] = $payment->getbyorderid();\n $data['Customer'] = $customer->get(); \n\n // $this->__set('Customer', $data[0]['CustomerID']);\n // $this->__set('TotalPrice', $data[0]['TotalPrice']);\n // $this->__set( 'Status', $data[0]['Status']);\n // $this->__set( 'OrderAddress', $data[0]['OrderAddress']);\n // $this->__set( 'OrderTime', $data[0]['OrderTime']);\n // $this->__set( 'OrderDeliverTime', $data[0]['OrderDeliverTime']);\n $this->__set( 'pizzalist', $data['pizza']);\n $this->__set( 'nonpizzalist', $data['nonpizza']);\n $this->__set( 'payment', $data['payment']);\n $this->__set( 'Customer', $data['Customer']);\n \n return $data;\n } else {\n\n return false;\n\n }\n }", "function getLookup($lkpName)\n{\n\tglobal $pclib;\n if ($pclib->app) $appflt = \"AND (APP='\".$pclib->app->name.\"' or APP is null)\";\n $sql = sprintf(\n\t \"select ifnull(id,guid), label from %s\n\t where cname='%s' %s order by position,label\",\n\t $this->LOOKUP_TAB, $lkpName, $appflt);\n\t\n\t$items = $this->selectPair($sql);\n\n/*\n\tif ($this->mls) {\n\t\t$langid = $lkpname;\n\t\t$mls_items = $this->mls->getpage('L_'.$langid);\n\t\tforeach((array)$mls_items as $iid => $label) $items[$iid] = $label;\n\n\t\tif ($this->mls->autoupdate)\n\t\t\t$this->mls->set_page_db($this->mls->defaultlang, 'L_'.$langid, $items);\n\t}\n*/\n\n\treturn $items;\n}", "public function getDetails()\n {\n\t $detail_field = $this->getValue('details');\n\t return wed_decodeJSON($detail_field,true);\n }", "public function verifyDetail() {\n $query=\"SELECT de.id_catalogo_producto\n FROM detalle_orden de\n INNER JOIN orden_compra oc\n ON oc.id_orden_compra = de.id_orden_compra\n WHERE de.id_catalogo_producto = ? AND oc.id_cliente = ? AND oc.id_estado_orden = 5\";\n $params = array($this->id_catalogo_producto, $_SESSION['id_cliente']);\n return Database::getRow($query, $params);\n }", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "function getBasicDetailsByTitle($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE \";\r\n if (is_numeric(strpos(APP_SQL_DBTYPE, \"pgsql\"))) { //pgsql is case sensitive\r\n $stmt .= \" sek_title ILIKE \" . $db->quote($sek_title);\r\n } else {\r\n $stmt .= \" sek_title=\" . $db->quote($sek_title);\r\n }\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "function getDetail($memberID, $query) {\r\n $completeQuery = \"SELECT $query FROM USER LEFT JOIN BUSINESS on USER.businessID=BUSINESS.businessID WHERE USER.UserID='$memberID'\";\r\n $sql = $this->db->prepare($completeQuery);\r\n if($sql->execute());\r\n return $sql->fetchall();\r\n return false;\r\n }", "private function Info() {\n\n\t\t$db=$GLOBALS['db'];\n\n\t\t$sql=\"SELECT *\n\t\t\t\t\tFROM \".$GLOBALS['database_prefix'].\"v_document_files\n\t\t\t\t\tWHERE document_id = '\".$this->document_id.\"'\n\t\t\t\t\t\";\n\t\t//echo $sql.\"<br>\";\n\t\t$result = $db->Query($sql);\n\n\t\tif ($db->NumRows($result) > 0) {\n\t\t\twhile($row=$db->FetchArray($result)) {\n\t\t\t\t/* HERE WE CALL THE FIELDS AND SET THEM INTO DYNAMIC VARIABLES */\n\t\t\t\t$arr_cols=$db->GetColumns($result);\n\t\t\t\tfor ($i=1;$i<count($arr_cols);$i++) {\n\t\t\t\t\t$col_name=$arr_cols[$i];\n\t\t\t\t\t$this->$col_name=$row[$col_name];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function employeeDetail(&$smartyEmployee,$searchBox) {\n\t\t$uid = intval($this->piVars['id']);\t//SQL-Injection!!!\n\t\t$pos_id = intval($this->piVars['pos_id']); //must come from piVars -> need to know which one of several possible positions is to be displayed....\n\n\t\t// test bk: get position from Database\n\t\t// a) employee is linked to position-record, could be > 1 !!!\n\t\t// b) employee is linked to organisation-record (leader of the pack)\n\t\t/*\n\t\t$pos_id = intval($this->piVars['pos_id']);\n\t\t$res_emppos = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'uid',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position'\n\t\t);\n\t\t*/\n\n\n\n\n\n\t\t// Standard query for employee details --> table tx_civserv_employee\n\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\n\t\t$res_common = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'tx_civserv_employee.uid,\n\t\t\t\t\t\t tx_civserv_employee.em_address,\n\t\t\t\t\t\t tx_civserv_employee.em_title,\n\t\t\t\t\t\t tx_civserv_employee.em_name,\n\t\t\t\t\t\t tx_civserv_employee.em_firstname,\n\t\t\t\t\t\t tx_civserv_employee.em_telephone,\n\t\t\t\t\t\t tx_civserv_employee.em_fax,\n\t\t\t\t\t\t tx_civserv_employee.em_email,\n\t\t\t\t\t\t tx_civserv_employee.em_image,\n\t\t\t\t\t\t tx_civserv_employee.em_datasec',\n\t\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t\t'1 '.\n\t\t\t\t\t\t$strEnableField.\n\t\t\t\t\t\t' AND uid='. intval($uid).'\n\t\t\t\t\t\tAND em_datasec=1',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\t\t//Check if data security option is enabled\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res_common) == 0) {\n\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_employee.datasec','Datasec enabled! Employee is not shown.');\n\t\t\treturn false;\n\t\t}\n\n\t\t//Query for employee office hours\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\t\t$res_emp_hours = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t'tx_civserv_employee_em_hours_mm',\n\t\t\t\t\t'tx_civserv_officehours',\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = ' . intval($uid),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\t\t// Create additional queries if position uid is set in piVars\n\t\tif ($pos_id != '' && intval($pos_id) > 0) {\n\n\t\t\t// Query for employee-position office hours\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_emp_pos_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_officehours,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_officehours_oep_employee_em_position_mm_mm',\n\t\t\t\t'1 '.\n\t\t\t\t$strEnableField.\n\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_local\n\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id),\n\t\t\t\t'',\n\t\t\t\t'oh_weekday',\n\t\t\t\t'');\n\n\n\t\t\t// Query for employee-organisation office hours\n\t\t\t// 1. will only return result if position occupied by employee has relation to organisation\n\t\t\t// 2. ignores direct employee-organisation-relations (leader of the pack....)\n\t\t\t$res_emp_org_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_organisation,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_officehours,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position_po_organisation_mm,\n\t\t\t\t\t tx_civserv_organisation_or_hours_mm',\n\t\t\t\t\t'1 '.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_position').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_organisation_or_hours_mm.uid_local\n\t\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_organisation_or_hours_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t\t AND em_datasec = 1\n\t\t\t\t\t AND tx_civserv_position.uid = ' . intval($pos_id),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\n\t\t\t//test bk: single out one building for the organisation / employee\n\t\t\t//todo!\n\n\n\t\t\t// not all employee-position-records have a relation to a room (building, floor)\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_position = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t\t\n\t\t\t$query_position = $GLOBALS['TYPO3_DB']->SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\n\t\t\t//special cases have been intercepted before, in fct employee_list\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_room = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_building.bl_name as building,\n\t\t\t\t\t tx_civserv_building.bl_name_to_show as building_to_show,\n\t\t\t\t\t tx_civserv_floor.fl_descr as floor,\n\t\t\t\t\t tx_civserv_room.ro_name as room',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_room,\n\t\t\t\t\t tx_civserv_floor,\n\t\t\t\t\t tx_civserv_building,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_building_bl_floor_mm',\n\t\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t\t AND em_datasec=1\n\t\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_room').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_floor').\n\t\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.ep_room = tx_civserv_room.uid\n\t\t\t\t\t AND tx_civserv_building.uid = tx_civserv_building_bl_floor_mm.uid_local\n\t\t\t\t\t AND tx_civserv_floor.uid = tx_civserv_building_bl_floor_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_room.rbf_building_bl_floor = tx_civserv_building_bl_floor_mm.uid',\n\t\t\t\t\t'',\n\t\t\t\t\t'',\n\t\t\t\t\t'');\n\n\t\t\t//Assign employee position data\n\t\t\t$employee_position = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_position);\n\t\t\tdebug($employee_position);\n\t\t\t$employee_position['or_link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'organisation', id => $employee_position['or_uid']),1,1));\n\t\t\tif($employee_position['building_to_show'] > ''){\n\t\t\t\t$employee_position['building'] = $employee_position['building_to_show'];\n\t\t\t}\n\t\t\t$employee_room = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_room);\n\t\t\tif(count($employee_room) > 0){\n\t\t\t\t$employee_position = array_merge($employee_position, (array)$employee_room);\n\t\t\t}\n\t\t\t$smartyEmployee->assign('position',$employee_position);\n\n\n\t\t\t// employee_position_hours:\n\t\t\t//Assign employee-position working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_pos_hours) ){\n\t\t\t\t$emp_pos_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_pos_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_pos_hours',$emp_pos_hours);\n\n\n\t\t\t//Assign employee-organisation working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_org_hours) ){\n\t\t\t\t$emp_org_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_org_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_org_hours',$emp_org_hours);\n\t\t} //End if additional queries\n\n\t\t$employee_rows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_common);\n\n\t\t// get Image code\n\t\t$imagepath = $this->conf['folder_organisations'] . $this->community['id'] . '/images/';\n\t\t$description = $employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'];\n\t\t$imageCode = $this->getImageCode($employee_rows['em_image'],$imagepath,$this->conf['employee-image.'],$description);\n\n\t\t//Assign employee data\n\t\t$smartyEmployee->assign('title',$employee_rows['em_title']);\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_female','Mrs.'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_male','Mr.'));\n\t\t}\n\t\t$smartyEmployee->assign('firstname',$employee_rows['em_firstname']);\n\t\t$smartyEmployee->assign('name',$employee_rows['em_name']);\n\t\t$smartyEmployee->assign('phone',$employee_rows['em_telephone']);\n\t\t$smartyEmployee->assign('fax',$employee_rows['em_fax']);\n\t\t$smartyEmployee->assign('image',$imageCode);\n\n\t\t//search employee\n\t\t$smartyEmployee->assign('employee_search', $this->community['employee_search']);\n\n\t\t// Assign email data\n\t\t// use typolink, because of the possibility to use encrypted email-adresses for spam-protection\n\t\tif ($employee_position['email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_position['emp_uid'],pos_id => $employee_position['pos_uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_position['email'],array(parameter => $employee_position['email'],ATagParams => 'class=\"email\"'));\n\t\t} elseif ($employee_rows['em_email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_rows['uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_rows['em_email'],array(parameter => $employee_rows['em_email'],ATagParams => 'class=\"email\"'));\n\t\t}\n\t\t$smartyEmployee->assign('email_form_url',$email_form_url);\n\t\t$smartyEmployee->assign('email_code',$email_code);\n\n\t\t//Assign employee working hours\n\t\t$row_counter = 0;\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_hours) ){\n\t\t\t$emp_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t$emp_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t$emp_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t$emp_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t$emp_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t}else{\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = '';\n\t\t\t}\n\t\t\t$row_counter++;\n\t\t}\n\t\t$smartyEmployee->assign('emp_hours',$emp_hours);\n\n\n\n\t\t//Assign template labels\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_female','Employee'));\n\t\t} else{ //1 for male or nothing\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_male','Employee'));\n\t\t}\n\t\t$smartyEmployee->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_organisation.phone','Phone'));\n\t\t$smartyEmployee->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_organisation.fax','Fax'));\n\t\t$smartyEmployee->assign('email_label',$this->pi_getLL('tx_civserv_pi1_organisation.email','E-Mail'));\n\t\t$smartyEmployee->assign('web_email_label',$this->pi_getLL('tx_civserv_pi1_organisation.web_email','E-Mail-Form'));\n\t\t$smartyEmployee->assign('working_hours_label',$this->pi_getLL('tx_civserv_pi1_employee.hours','Working hours'));\n\t\t$smartyEmployee->assign('office_hours_summary',str_replace('###EMPLOYEE###',$employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'],$this->pi_getLL('tx_civserv_pi1_employee.officehours','In the table are the office hours of ###EMPLOYEE### shown.')));\n\t\tif($this->conf['showOhLabels']){\n\t\t\t//default\n\t\t}else{\n\t\t\t$smartyEmployee->assign('supress_labels', 'invisible');\n\t\t}\n\t\t$smartyEmployee->assign('weekday',$this->pi_getLL('tx_civserv_pi1_weekday','Weekday'));\n\t\t$smartyEmployee->assign('morning',$this->pi_getLL('tx_civserv_pi1_organisation.morning','mornings'));\n\t\t$smartyEmployee->assign('afternoon',$this->pi_getLL('tx_civserv_pi1_organisation.afternoon','in the afternoon'));\n\n\t\t$smartyEmployee->assign('organisation_label',$this->pi_getLL('tx_civserv_pi1_employee.organisation','Organisation'));\n\t\t$smartyEmployee->assign('room_label',$this->pi_getLL('tx_civserv_pi1_employee.room','Room'));\n\t\t//the image_employee_label is not being used yet\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_female.image','Image of employee'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_male.image','Image of employee'));\n\t\t}\n\n\t\tif ($searchBox) {\n\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t$smartyTop15->assign('searchbox', $this->pi_list_searchBox('',true));\n\t\t}\n\t\t$GLOBALS['TSFE']->page['title']=$this->pi_getLL('tx_civserv_pi1_employee.employee_plural','Employees');\n\t\treturn true;\n\t}", "function getBasicDetails($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE\r\n sek_id= \" . $db->quote($sek_id);\r\n\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "public function get_details($id)\n {\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n\t\treturn $res=$q->result_array()[0];\t\n }" ]
[ "0.7443607", "0.69970787", "0.6909756", "0.64773667", "0.6369049", "0.6357228", "0.6215434", "0.61938334", "0.6173934", "0.6131351", "0.61127067", "0.61127067", "0.6099434", "0.6086556", "0.6030992", "0.60074526", "0.6003254", "0.5993721", "0.5988407", "0.59492934", "0.594116", "0.59391475", "0.59219", "0.5883901", "0.5872791", "0.58709383", "0.5861921", "0.58396745", "0.5823998", "0.577738", "0.5772935", "0.5753783", "0.5752836", "0.57507694", "0.5750519", "0.57426244", "0.5735363", "0.5717535", "0.5712347", "0.5708558", "0.57078725", "0.5701643", "0.5697168", "0.56724817", "0.5667796", "0.5649875", "0.5649875", "0.5649875", "0.5646728", "0.56431794", "0.5637106", "0.5633396", "0.5630018", "0.5628376", "0.5622374", "0.5613969", "0.5600589", "0.55961406", "0.55961406", "0.55961406", "0.55961406", "0.5593987", "0.5593972", "0.55939317", "0.55939317", "0.55929774", "0.55929774", "0.55929774", "0.55837363", "0.55837363", "0.55837363", "0.5582257", "0.5576971", "0.5573702", "0.55734074", "0.55725217", "0.55716705", "0.55690885", "0.55632806", "0.5561945", "0.5560489", "0.5555769", "0.5550912", "0.5550438", "0.55496484", "0.5548928", "0.5532393", "0.5530144", "0.55282056", "0.5524387", "0.5515454", "0.55137324", "0.5509801", "0.5507566", "0.55042076", "0.5501724", "0.55002564", "0.5494106", "0.54902744", "0.5489911", "0.5488402" ]
0.0
-1
look up the details
function setDetailsUpdatedMessage($appointmentData) { $stylistName = $appointmentData[0]['stylistName']; $serviceName = $appointmentData[0]['serviceName']; $appointmentDate = $appointmentData[0]['appointmentDate']; $startTime = $appointmentData[0]['startTime']; $this->email = $appointmentData[0]['email']; $this->message = JText::sprintf('COM_SALONBOOK_EMAIL_BODY_DETAILS_UPDATED', $serviceName, $stylistName, $appointmentDate, date('g:i a', $startTime)); $this->mailer->setBody($this->message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getDetails();", "public function getDetail();", "public function getInformation();", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "public function details_get()\n \t{\n \t\tlog_message('debug', 'Score/details_get');\n\n\t\t$result = $this->_score->get_details(\n\t\t\t$this->get('type'),\n\t\t\t$this->get('codes'),\n\t\t\textract_id($this->get('userId')),\n\t\t\t(!empty($this->get('storeId'))? extract_id($this->get('storeId')): '')\n\t\t);\n\n\t\tlog_message('debug', 'Score/details_get:: [1] result='.json_encode($result));\n\t\t$this->response($result);\n\t}", "public function getInfo();", "public function detail(){\r\n\t\t//only ajax is allowed\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('view');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//search data with pk for default\r\n\t\t$search_data = $this->input->post('ang_id');\r\n\t\t//if no search data exist, response error\r\n\t\tif($search_data === NULL)\r\n\t\t\tajax_response('error');\r\n\r\n\t\t//activate if search data is integer\r\n\t\t//$search_data = uintval($search_data);\r\n\r\n\t\t//get detail\r\n\t\t$detail = $this->m_anggota->get_by_column($search_data);\r\n\r\n\t\t//output return value\r\n\t\tif($detail !== NULL) ajax_response('ok', '', $detail);\r\n\t\telse ajax_response('error');\r\n\t}", "public function getRecordInformation() {}", "public function get_information() {\n $informationsources = ['name' => 'dbdetails', 'displayname' => get_string(\"dbdetails\", \"local_reportgen\")];\n\n return $informationsources;\n }", "function getDetails() {\n\t\treturn $this->data_array['details'];\n\t}", "public function getInfo() {}", "public function getInfo() {}", "public function getSpecifics() {}", "public function lookups()\n {\n }", "public function getLookupField() {}", "private function getAccInfo(){\n try {\n $stmt = $this->dbh->prepare(\"SELECT * FROM `Locations` WHERE P_Id = :id\");\n $stmt->bindParam(\":id\", $this->accId);\n $stmt->execute();\n } catch (Exception $e){\n error_log(\"Error: \" . $e->getMessage());\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->accName = $row[\"AccName\"];\n $this->accStrAdd = $row[\"AccStrAdd\"];\n $this->accAptNum = $row[\"AccAptNum\"];\n $this->accState = $row[\"AccState\"];\n $this->accZip = $row[\"AccZip\"];\n $this->currentUnits = $row[\"AccUnits\"];\n }", "abstract public function information();", "public function Individualgetdata();", "abstract public function getCorrespondingMetaData();", "public function getInfo($criteria)\n {\n }", "function get_detail() {\n return $this->detail;\n }", "public function getDetails() {\n return $this->_get( 'details', array() );\n }", "function getInfo();", "private function getTableDetail($name){\n\n\n foreach ($this->app[\"tables\"] as $item) {\n\n if($item[\"name\"] == $name){\n return $item;\n }\n\n }\n\n \n\n }", "protected function fetchDetails() {\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'tstamp, crdate, cruser_id, name',\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group')\n\t\t);\n\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t$this['name'] = $row['name'];\n\t\t$this['timeStamp'] = $row['timeStamp'];\n\t\t$this['createDate'] = $row['crdate'];\n\t\t$this['cruserUid'] = $row['cruser_id'];\n\t}", "abstract protected function extractProductDetail();", "abstract public function infoAll();", "function getInfo($id){\r\n\t\t$this->getQuestion($id);\r\n\t}", "public function readInfoById() {\t\t\n\t\t$fnName = \"getId\";\n\t\t$_id = -1;\n\t\t\n\t\t$_nombre = get_class( $this ) ;\n\t\t$result = null;\n\t\t$params = array();\n\t\t\n\t\tforeach(get_class_methods( $this ) as $id => $vl){\n\t\t\tif( strtolower( $vl ) == strtolower( $fnName ) ){\n\t\t\t\t$_id = $this->$fnName();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $_id > 0 ){\n\t\t\t$stmt = null;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM \" . strtolower( $_nombre ) . \" WHERE id = ?\";\n\t\t\tif ($stmt = self::$lnk->prepare($query)) {\n\t\t\t\t$stmt->bind_param(\"i\", $_id);\n\t\t\t $stmt->execute();\n\t\t\t \n\t\t\t\t$meta = $stmt->result_metadata(); \n\t\t\t while ($field = $meta->fetch_field()) {\n\t\t\t \t$params[] = &$row[ $field->name ]; \n\t\t\t } \n\t\t\t\n\t\t\t call_user_func_array(array($stmt, 'bind_result'), $params); \n\t\t\t \n\t\t\t while ($stmt->fetch()) {\n\t\t\t \t$o = new $_nombre();\n\t\t\t foreach($row as $key => $val) {\n\t\t\t $o->{ \"set\" . Singleton::toCap($key)}( $val );\n\t\t\t } \n\t\t\t $result = $o;\t\t\t \n\t\t\t }\n\t\t\t $stmt->close();\n\t\t\t}else{\n\t\t\t\t$this->mensaje_error = self::$lnk->error;\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "public function getInfo($name) {}", "function get_info($title) {\n \n $this->db->where('title_url', $title);\n $query = $this->db->get('tech_section');\n return $query->row_array();\n }", "protected function fetchDetails() {\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'be_users.uid AS uid, be_users.username AS username, be_users.tx_passwordmgr_cert AS cert, tx_passwordmgr_group_be_users_mm.rights AS rights',\n\t\t\t'be_users, tx_passwordmgr_group_be_users_mm',\n\t\t\t'tx_passwordmgr_group_be_users_mm.be_users_uid=be_users.uid' . // Join Constraint\n\t\t\t\t' AND be_users.uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['beUserUid'], 'be_users') .\n\t\t\t\t' AND tx_passwordmgr_group_be_users_mm.group_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['groupUid'], 'tx_passwordmgr_group_be_users_mm')\n\t\t);\n\t\tif ( $GLOBALS['TYPO3_DB']->sql_num_rows($res) == 1 ) {\n\t\t\t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n\t\t\t$this['name'] = $row['username'];\n\t\t\t$this['certificate'] = $row['cert'];\n\t\t\t$this['publicKey'] = tx_passwordmgr_openssl::extractPublicKeyFromCertificate($this['certificate']);\n\t\t\t$this['rights'] = $row['rights'];\n\t\t} else {\n\t\t\tthrow new Exception ('Error getting group member details. user / group: ' . $this['beUserUid'] . ' ' . $this['groupUid']);\n\t\t}\n\t}", "function load_Info()\n {\n\n $this->Facility_Info($this->facilities[0]);\n }", "public function getdetail() \n\t{\n\t\ttry \n\t\t{\n\t\t\t// select mongoDB collection\n\t\t\t$app_collection = \t$this->mongo_db->db->func;\n\t\t\t// find data from collection\n\t\t\t$getdata \t\t= \t$app_collection->find(array(\n\t\t\t\t'_id' => new MongoId($this->_id)\n\t\t\t\t)\n\t\t\t);\n\t\t\twhile($getdata->hasNext()) \n\t\t\t{\n\t\t\t\t// Get data from collection\n\t\t\t\t$getdata2 \t\t\t\t= $getdata->getNext();\n\t\t\t\t// set data from collection to variable\n\t\t\t\t$this->function_name \t= $getdata2['function_name'];\n\t\t\t\t$this->function_token \t= $getdata2['function_token'];\n\t\t\t\t$this->application_name = $getdata2['application_name'];\n\t\t\t\t$this->application_id \t= $getdata2['application_id'];\n\t\t\t\t$this->function_primary = $getdata2['function_primary'];\n\t\t\t}\n\t\t\treturn true;\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function getAllDetails()\n\t{\n\t\t $qbLogin = $this->getDefaultEntityManager()->createQueryBuilder();\n\t\t $qbLogin->select('m')\n ->from('MailingList\\Entity\\PhoenixMailingList', 'm')\n\t\t\t ->where('m.status=:st')\n\t\t\t ->andwhere('m.subscribe=:s')\n\t\t\t ->setParameter('s',1)\n\t\t\t ->setParameter('st',1);\n\t\t $result = $qbLogin->getQuery()->getResult();\t\n\t\treturn $result;\n\t}", "protected function queryInfoById() {\n\t\tglobal $query, $lang, $wtcDB;\n\t\t\n\t\t$getWord = new Query($query['lang_words']['get'], Array(1 => $this->wordid));\n\t\n\t\t$this->info = parent::queryInfoById($getWord);\n\t}", "public function sanphamdetail()\n\t\t{\n\t\t\t$id = $_GET['chitiet_sanpham'];\n\t\t\t//goi ham model de xu li\n\t\t\t$ketqua = $this->sanpham_model->OneRecordData1($id);\n\t\t\treturn $ketqua;\n\t\t}", "public function studiengang_details() {\r\n\r\n //Sprachen rausfinden:\r\n $this->sprachen = StgProfil::getPossibleLanguages();\r\n //Abschlüsse suchen:\r\n $this->abschlusssuche = new SQLSearch(\"SELECT abschluss_id, name FROM abschluss WHERE name LIKE :input\", _(\"Abschluss eingeben\"));\r\n //zulassungsvoraussetzung:\r\n $this->moeglicheZulassungsvoraussetzungen_wise = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_wise\");\r\n $this->moeglicheZulassungsvoraussetzungen_sose = DBHelper::getEnumOptions(\"stg_profil\", \"zulassungsvoraussetzung_sose\");\r\n //Typen von Studiengängen:\r\n $this->moeglicheStgTypen = StgProfil::getMoeglicheTypen();\r\n\r\n $this->studiengaenge = PersonalRechte::meineStudiengaenge(null, true);\r\n $this->abschluesse = Abschluss::findAllUsed();\r\n $this->profile = StgProfil::getMeineProfile(null, Request::get(\"studiengang_id\"), Request::get(\"abschluss_id\"));\r\n\r\n //Neuen Eintrag in stg_profil erstellen\r\n if (Request::get(\"item_id\") === \"neu\" && !Request::get(\"studiengang_id\")) {\r\n //$this->profil = new StgProfil();\r\n $this->fachsuche = new SQLSearch(\"SELECT studiengang_id, name FROM studiengaenge WHERE name LIKE :input OR beschreibung LIKE :input \", _(\"Studiengang eingeben\"));\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n return;\r\n }\r\n\r\n $this->profil = new StgProfil(Request::get(\"studienprofil_id\") !== \"neu\" ? Request::get(\"studienprofil_id\") : null);\r\n if (!$this->profil->hasPermission()) {\r\n throw new AccessDeniedException(_(\"Sie dürfen diesen Studiengang nicht bearbeiten\"));\r\n }\r\n if (Request::get(\"delete_x\") && Request::get(\"item_id\") && Request::get(\"type\") === \"dokument\") {\r\n $this->profil->deleteDoku(Request::get(\"item_id\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung gelöscht\"));\r\n }\r\n if (Request::get(\"addDocument\")) {\r\n $this->profil->addDoku(Request::get(\"addDocument\"));\r\n $this->flash_now(\"success\", _(\"Dokumentenzuordnung hinzugefügt\"));\r\n }\r\n //Profil ändern, falls Informationen gesendet worden sind:\r\n if (Request::submitted(\"absenden\")) {\r\n if (Request::get(\"studiengang_id\")) {\r\n //Neuen Eintrag in stg_profil machen:\r\n $this->profil['fach_id'] = Request::get(\"studiengang_id\");\r\n $this->profil->store(); //Nachher wird noch einmal gestored, aber jetzt wollen wir IDs bekommen.\r\n }\r\n if (Request::submitted('informationen')) {\r\n $this->profil->setInformation(Request::getArray(\"informationen\"));\r\n }\r\n if (Request::submitted(\"abschluss_id\")) {\r\n $this->profil['abschluss_id'] = Request::get(\"abschluss_id\");\r\n }\r\n if (Request::submitted('settings')) {\r\n $settings = Request::getArray(\"settings\");\r\n foreach ($settings as $key => $value) {\r\n $this->profil[$key] = $value;\r\n }\r\n if (!$settings['sichtbar']) {\r\n $this->profil['sichtbar'] = 0;\r\n }\r\n }\r\n if (Request::submitted(\"zielvereinbarung\")) {\r\n $this->profil['zielvereinbarung'] = Request::get(\"zielvereinbarung\");\r\n }\r\n if (Request::submitted(\"einleitungstext\")) {\r\n $this->profil['einleitungstext'] = Request::get(\"einleitungstext\");\r\n }\r\n if (Request::submitted('typen')) {\r\n $this->profil->setTypen(Request::getArray(\"typen\"));\r\n }\r\n $this->profil->store();\r\n\r\n if (Request::submitted('textcombination')) {\r\n $textcombinations = (array) @$_REQUEST['textcombination'];\r\n Textbaustein::removeCombination($this->profil->getId());\r\n foreach ($textcombinations as $code => $ids) {\r\n Textbaustein::addCombination($this->profil->getId(), $code, $ids);\r\n }\r\n }\r\n\r\n $this->flash_now(\"success\", _(\"Änderungen wurden übernommen\"));\r\n if (Request::get(\"neues_dokument\")) {\r\n $dokument = new StgFile();\r\n if ($_GET['qqfile'] || isset($_FILES['qqfile'])) {\r\n ob_start();\r\n $dokument->upload();\r\n ob_clean();\r\n }\r\n $dokument['name'] = Request::get(\"neues_dokument_name\");\r\n $dokument['sichtbar'] = Request::get(\"neues_dokument_sichtbar\") ? '1' : '0';\r\n $dokument['jahr'] = Request::get(\"neues_dokument_jahr\");\r\n $dokument['doku_typ_id'] = Request::get(\"neues_dokument_doku_typ_id\");\r\n $dokument['quick_link'] = Request::get(\"neues_dokument_quick_link\");\r\n $dokument['user_id'] = $GLOBALS['user']->id;\r\n $dokument->store();\r\n $dokument->setTags(Request::get(\"neues_dokument_tags\"));\r\n $this->profil->addDoku($dokument->getId());\r\n if ($dokument->isPublic()) {\r\n $this->flash_now(\"success\", _(\"Neues Dokument angelegt und hinzugefügt\"));\r\n } else {\r\n $this->flash_now(\"success\", _(\"Neues internes Dokument angelegt und hinzugefügt. Es kann unter Akkreditierung gefunden werden.\"));\r\n }\r\n }\r\n if (Request::get(\"neuer_ansprechpartner\")) {\r\n $kontakt = new StgAnsprechpartner();\r\n $kontakt['range_typ'] = Request::get(\"range_typ\");\r\n $kontakt['range_id'] = Request::get(\"range_typ\") && Request::get(\"range_id\") ? Request::get(\"range_id\") : \"\";\r\n\r\n if (Request::get(\"ansprechpartner_typ_id\")) {\r\n $typen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n foreach ($typen as $typ) {\r\n if ($typ['ansprechpartner_typ_id'] === Request::get(\"ansprechpartner_typ_id\")) {\r\n $kontakt['ansprechpartner_typ_id'] = Request::get(\"ansprechpartner_typ_id\");\r\n }\r\n }\r\n }\r\n $kontakt['freitext_name'] = Request::get(\"freitext_name\");\r\n $kontakt['freitext_mail'] = Request::get(\"freitext_mail\");\r\n $kontakt['freitext_telefon'] = Request::get(\"freitext_telefon\");\r\n $kontakt['freitext_homepage'] = Request::get(\"freitext_homepage\");\r\n if ($kontakt->store()) {\r\n $this->profil->addAnsprechpartner($kontakt->getId());\r\n $this->flash_now(\"success\", _(\"Neuer Ansprechpartner angelegt und hinzugefügt\"));\r\n }\r\n }\r\n }\r\n\r\n //Informationen:\r\n $this->informationen = $this->profil->getInformation();\r\n\r\n //Verlaufspläne\r\n $this->verlaufsplaene = $this->profil->getVerlaufsplaene();\r\n\r\n //Dateien:\r\n $this->dateien = StgFile::getByStgProfil($this->profil->getId());\r\n $this->dokumentensuche = $this->getDokumentensuche();\r\n\r\n //Kontakte:\r\n $this->kontakte = StgAnsprechpartner::getByStgProfil($this->profil->getId());\r\n usort($this->kontakte, function ($a, $b) {\r\n return strcmp($a->getName('no_title_rev'), $b->getName('no_title_rev'));\r\n });\r\n $this->kontakt_neu = new StgAnsprechpartner();\r\n $this->ansprechpartnertypen = StgAnsprechpartner::getAnsprechpartnerTypen();\r\n\r\n\r\n //Aufbaustudiengänge:\r\n $this->mutterstudiengaenge = $this->profil->getAufbauendeStudiengaenge();\r\n $this->profilsuche = $this->getProfilSuche();\r\n\r\n\r\n // Textbausteine\r\n $this->textbausteine = array(\r\n 'de' => Textbaustein::loadAll('de'),\r\n 'en' => Textbaustein::loadAll('en'),\r\n );\r\n $this->textcombinations = Textbaustein::loadCombination($this->profil->getId());\r\n\r\n $this->ansprechpartnersuche = $this->getAnsprechpartnersuche();\r\n $this->datei_url = $this->link_for(\"zsb_dateien/download_file\");\r\n $this->render_template('zsb_studiengang/details_studiengang', $this->layout);\r\n //hiernach wird nichts weiter ausgegeben\r\n }", "public function getDetails()\r\n {\r\n return $this->details;\r\n }", "public function getDetails()\n {\n if (array_key_exists(\"details\", $this->_propDict)) {\n return $this->_propDict[\"details\"];\n } else {\n return null;\n }\n }", "public function detail() {\n global $guest_uname;\n\n $detail = array();\n $detail['billing_address'] = $this->getBillingAddress();\n $detail['shipping_address'] = $this->getShippingAddress();\n $detail['review_orders'] = array($this->getReviewOrder());\n if (tep_count_shipping_modules() < 1) {\n $detail['need_select_shipping_method'] = false;\n } elseif (!$this->freeShipping && !$detail['review_orders'][0]['selected_shipping_method_id']) {\n $detail['need_select_shipping_method'] = true;\n }\n $detail['price_infos'] = $this->getPriceInfos();\n $detail['payment_methods'] = $this->getPaymentMethods();\n $detail['is_virtual'] = $this->isVirtual;\n $detail['need_billing_address'] = defined('NEED_BILLING_ADDRESS') ? NEED_BILLING_ADDRESS : FALSE;\n $detail['need_shipping_address'] = !$this->isVirtual && !ServiceFactory::factory('Store')->checkAddressIntegrity($detail['shipping_address']);\n\n if (tep_session_is_registered('guest_uname')) {\n $detail['uname'] = $guest_uname;\n tep_session_unregister('guest_uname');\n }\n\n return $detail;\n }", "public function getDetail()\n {\n \t$request = \\Request::all();\n // add system log\n $this->systemLogs('view', 'information', $request);\n // End\n\n $information = false;\n $information_description = false;\n if(\\Request::has('information_id')) {\n $information = $this->information->getInformation($request['information_id']);\n\n if($information) {\n $information_description = $this->information->getInformationDescriptionByCode(['information_id'=>$request['information_id'], 'language_id'=>$request['language_id']]);\n }\n \n }\n\n if($information) {\n $this->data->information_id = $information->information_id;\n $this->data->icon = $information->icon;\n }else {\n $this->data->information_id = '';\n $this->data->icon = '';\n }\n\n if($information_description) {\n $this->data->title = $information_description->title;\n $this->data->description = $information_description->description;\n }else {\n $this->data->title = '';\n $this->data->description = '';\n }\n\n return view('information.detail', ['data'=>$this->data]);\n }", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function retrieveData(){\n\t\t$mParser = new RecipeParser;\n\t\t$mParser->retrieveInfoForObject($this);\n\t}", "public function getDetails()\n\t{\n\t\treturn $this->details;\n\t}", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "public function getDetails()\n {\n return $this->details;\n }", "function getInfo () {\n\t\treturn array('id'=>'yahoo');\n\t}", "public function getInstanceDetail()\n {\n return $this->get(self::_INSTANCE_DETAIL);\n }", "public function getDetail() {\r\n\t\treturn($this->detail);\r\n\t}", "protected function collectInformation() {}", "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "public function billing_card_info_details() {\n\n $option = [\n 'projection' => [\n '_id' => 1,\n 'cardnumber' => 1,\n 'cvv' => 1,\n 'expiry_month' => 1,\n 'expiry_year' => 1,\n 'firstname' => 1,\n 'lastname' => 1,\n 'email'=>1,\n 'customer_id'=>1,\n 'address' => 1,\n 'city' => 1,\n 'state' => 1,\n 'country' => 1,\n 'postal_code' => 1,\n 'subscription_id'=>1,\n 'customer_id'=>1\n ]\n ];\n $result = $this->mongo_db->find(MDB_BILLING_REG_INFO, array('_id' => 1), $option);\n return (!empty($result)) ? $result : '';\n }", "public function\tgetReferidoInfo(){\r\t\t\r\t\t$model_ref = $this->getModel( 'referido' );\r\t\t$idref = JRequest::getInt( 'idref' );\r\t\t\r\t\t$model_ref->instance( $idref );\r\t\t$inf_ref = $model_ref->getReferidoInf();\r\t\t\r\t\tif( !empty($inf_ref) ){\r\t\t\t\r\t\t\t$model_ref\r\t\t}\r\t\t\r\t}", "function getSocietyDetails($soc_code){\n\t\t}", "public function findInfoByUid($uid){\n\t\t$sql = \"SELECT `id`, `name`, `cellphone`, `address` FROM `info` WHERE `uid` = ?\";\n\t\t$res = $this->connect()->prepare($sql);\n\t\t$res->bind_param(\"s\", $uid);\n\t\t$res->execute();\n\t\t$res->bind_result($id, $name, $cellphone, $address);\n\t\tif($res->fetch()) {\n\t\t\t$info = new \\stdClass();\n\t\t\t$info->id = $id;\n\t\t\t$info->name = $name;\n\t\t\t$info->cellphone = $cellphone;\n\t\t\t$info->$address = $address;\n\t\t\treturn $info;\n\t\t}\n\t\treturn NULL;\n\t}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "function getDetails($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n if ($sek_id == \"0\") {\r\n return false;\r\n }\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n left join \" . APP_TABLE_PREFIX . \"xsd_display_matchfields\r\n on xsdmf_sek_id=sek_id\r\n WHERE\r\n sek_id= \" . $db->quote($sek_id);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n $res['key_table_exists'] = Search_Key::checkIfKeyTableExists($res['sek_title_db'], $res['sek_relationship']);\r\n\r\n return $res;\r\n }", "public function getInformation(): array;", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getAdditionalInformation() {}", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetail()\n {\n return $this->detail;\n }", "public function getDetails() {\r\n\t\t\treturn $this->_details;\r\n\t\t}", "function achieve_get_details($id)\r\n{\r\n global $sql;\r\n\r\n $result = ($sql[\"dbc\"]->query(\"SELECT id, name, description, reward, points FROM achievement WHERE id='\".$id.\"' LIMIT 1\"));\r\n $details = $sql[\"dbc\"]->fetch_assoc($result);\r\n return $details;\r\n}", "public function getDetails($group_id);", "public function getDetails() {\n\t\treturn $this->details;\n\t}", "public function getLookupMode() {}", "function get_detail_data($table_name,$where,$return_data)\r\n{\r\n\t$ci = & get_instance();\r\n\t$ci->load->database();\r\n\t$result = $ci->db->get_where($table_name,$where)->row();\r\n\tif($result):\r\n\t\treturn $result->$return_data;\r\n\telse:\r\n\t\treturn false;\r\n\tendif;\r\n}", "public function getDetail( $key ) {\n $details = $this->getDetails();\n if( isset($details[$key]) ) {\n return $details[$key];\n }\n return null;\n }", "public function loadInfo()\n\t{\n\t\t$this->_info = $this->_adapter->describeTable($this->_identifier);\n\t}", "function getDetailsByTitle($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n inner join \" . APP_TABLE_PREFIX . \"xsd_display_matchfields\r\n on xsdmf_sek_id=sek_id\r\n WHERE\r\n sek_title=\" . $db->quote($sek_title);\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "public function getEmployeeInfo() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n\n $GLOBALS[\"employee\"] = $employeeModel->getOneByEmployeeID($_SESSION[\"workerID\"]);\n }", "function info($what){\n if(isset($this->set[$what])) return $this->set[$what];\n return $this->key;\n }", "public function get_info() {\n\n\t\t$sql = \"SELECT COUNT(*) FROM `\" . $this->wpdb->commentmeta . \"` WHERE comment_id NOT IN (SELECT comment_id FROM `\" . $this->wpdb->comments . \"`);\";\n\t\t$commentmeta = $this->wpdb->get_var($sql);\n\t\t$this->found_trash_count += $commentmeta;\n\n\t\t$sql = \"SELECT COUNT(*) FROM `\".$this->wpdb->commentmeta.\"` WHERE meta_key LIKE '%akismet%';\";\n\t\t$akismetmeta = $this->wpdb->get_var($sql);\n\t\t$this->found_akismet_count += $akismetmeta;\n\n\t}", "public function returnDetailFindByPK($id);", "static function getLookupValueDescription($lookuptype, $lookuptypevalue) {\n\t\t$sql = \"SELECT lv.lookupvaluedescription FROM lookuptypevalue lv INNER JOIN lookuptype l ON (lv.lookuptypeid = l.id AND l.`name` = '\".$lookuptype.\"' AND lv.lookuptypevalue = '\".$lookuptypevalue.\"')\";\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t\n\t\treturn $conn->fetchOne($sql); \n\t}", "private function retrieveData(){\n\t\t\n\t\t$dbo=new DB();\n\t\t$db=$dbo->db;\n\t\t$stmt = $db->prepare(\t'SELECT `description`, '.\n\t\t\t\t\t\t\t\t\t\t'`duration` '.\n\t\t\t\t\t\t\t\t'FROM `status` '.\t\t\n\t\t\t\t\t\t\t\t'WHERE `status` = ? '.\n\t\t\t\t\t\t\t\t'LIMIT 1'\n\t\t\t\t\t\t\t\t);\n\t $stmt->bind_param(\"s\", $this->id);\n\t $stmt->bind_result($this->description,$this->duration);\n\t $stmt->execute();\n\t $stmt->fetch();\n \t\t$stmt->close();\n \t\t\n\t}", "abstract public function retrieve();", "public function get_details() {\n\t\t$member_id = $this->uri->segment(3);\n\t\t$member_details = $this->get_member_details($member_id);\n\t\t\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\t\t$data['user_mode'] = $this->session->userdata('mode');\n\t\t$data['member'] = (isset($member_details[0]))? $member_details[0]: NULL;\n\t\t\n\t\t$full_name = $member_details[0]->fname . ' ' . \n\t\t\t$member_details[0]->mname . ' ' . \n\t\t\t$member_details[0]->lname;\n\n\t\t$this->breadcrumbs->set(['Member Information: ' . $full_name => 'members/info/' . $member_id]);\n\t\t$this->render('information', $data);\n\t}", "function get_charity_details($name = NULL){\t\t\t\n\t\t$query = \" SELECT organization_id,charity_name,charity_overview\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers_details','dbtables');\n\t\t$query .= \" WHERE charity_name = ? \";\t\t\n\t\t$dataBindArr = array($name);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\t\n\t\tif(count($resArr) > 0){\n\t\t\treturn $resArr[0];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getdetails(){\n $data = $this->get();\n if(!empty($data)){\n $pizzalist = new pizzalist();\n $nonpizza = new ordernonpizzalist();\n $payment = new payment();\n $customer = new customer();\n\n $customer->__set('CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'CustomerID', $this->__get('CustomerID'));\n $payment->__set( 'OrderID', $this->__get('OrderID'));\n \n\n $data['pizza'] = $pizzalist->getorderspizza($this->__get('OrderID'));\n $data['nonpizza'] = $nonpizza->getordernonpizza($this->__get('OrderID'));\n $data['payment'] = $payment->getbyorderid();\n $data['Customer'] = $customer->get(); \n\n // $this->__set('Customer', $data[0]['CustomerID']);\n // $this->__set('TotalPrice', $data[0]['TotalPrice']);\n // $this->__set( 'Status', $data[0]['Status']);\n // $this->__set( 'OrderAddress', $data[0]['OrderAddress']);\n // $this->__set( 'OrderTime', $data[0]['OrderTime']);\n // $this->__set( 'OrderDeliverTime', $data[0]['OrderDeliverTime']);\n $this->__set( 'pizzalist', $data['pizza']);\n $this->__set( 'nonpizzalist', $data['nonpizza']);\n $this->__set( 'payment', $data['payment']);\n $this->__set( 'Customer', $data['Customer']);\n \n return $data;\n } else {\n\n return false;\n\n }\n }", "function getLookup($lkpName)\n{\n\tglobal $pclib;\n if ($pclib->app) $appflt = \"AND (APP='\".$pclib->app->name.\"' or APP is null)\";\n $sql = sprintf(\n\t \"select ifnull(id,guid), label from %s\n\t where cname='%s' %s order by position,label\",\n\t $this->LOOKUP_TAB, $lkpName, $appflt);\n\t\n\t$items = $this->selectPair($sql);\n\n/*\n\tif ($this->mls) {\n\t\t$langid = $lkpname;\n\t\t$mls_items = $this->mls->getpage('L_'.$langid);\n\t\tforeach((array)$mls_items as $iid => $label) $items[$iid] = $label;\n\n\t\tif ($this->mls->autoupdate)\n\t\t\t$this->mls->set_page_db($this->mls->defaultlang, 'L_'.$langid, $items);\n\t}\n*/\n\n\treturn $items;\n}", "public function getDetails()\n {\n\t $detail_field = $this->getValue('details');\n\t return wed_decodeJSON($detail_field,true);\n }", "public function verifyDetail() {\n $query=\"SELECT de.id_catalogo_producto\n FROM detalle_orden de\n INNER JOIN orden_compra oc\n ON oc.id_orden_compra = de.id_orden_compra\n WHERE de.id_catalogo_producto = ? AND oc.id_cliente = ? AND oc.id_estado_orden = 5\";\n $params = array($this->id_catalogo_producto, $_SESSION['id_cliente']);\n return Database::getRow($query, $params);\n }", "function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}", "public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "function getBasicDetailsByTitle($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE \";\r\n if (is_numeric(strpos(APP_SQL_DBTYPE, \"pgsql\"))) { //pgsql is case sensitive\r\n $stmt .= \" sek_title ILIKE \" . $db->quote($sek_title);\r\n } else {\r\n $stmt .= \" sek_title=\" . $db->quote($sek_title);\r\n }\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "function getDetail($memberID, $query) {\r\n $completeQuery = \"SELECT $query FROM USER LEFT JOIN BUSINESS on USER.businessID=BUSINESS.businessID WHERE USER.UserID='$memberID'\";\r\n $sql = $this->db->prepare($completeQuery);\r\n if($sql->execute());\r\n return $sql->fetchall();\r\n return false;\r\n }", "private function Info() {\n\n\t\t$db=$GLOBALS['db'];\n\n\t\t$sql=\"SELECT *\n\t\t\t\t\tFROM \".$GLOBALS['database_prefix'].\"v_document_files\n\t\t\t\t\tWHERE document_id = '\".$this->document_id.\"'\n\t\t\t\t\t\";\n\t\t//echo $sql.\"<br>\";\n\t\t$result = $db->Query($sql);\n\n\t\tif ($db->NumRows($result) > 0) {\n\t\t\twhile($row=$db->FetchArray($result)) {\n\t\t\t\t/* HERE WE CALL THE FIELDS AND SET THEM INTO DYNAMIC VARIABLES */\n\t\t\t\t$arr_cols=$db->GetColumns($result);\n\t\t\t\tfor ($i=1;$i<count($arr_cols);$i++) {\n\t\t\t\t\t$col_name=$arr_cols[$i];\n\t\t\t\t\t$this->$col_name=$row[$col_name];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function employeeDetail(&$smartyEmployee,$searchBox) {\n\t\t$uid = intval($this->piVars['id']);\t//SQL-Injection!!!\n\t\t$pos_id = intval($this->piVars['pos_id']); //must come from piVars -> need to know which one of several possible positions is to be displayed....\n\n\t\t// test bk: get position from Database\n\t\t// a) employee is linked to position-record, could be > 1 !!!\n\t\t// b) employee is linked to organisation-record (leader of the pack)\n\t\t/*\n\t\t$pos_id = intval($this->piVars['pos_id']);\n\t\t$res_emppos = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'uid',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position'\n\t\t);\n\t\t*/\n\n\n\n\n\n\t\t// Standard query for employee details --> table tx_civserv_employee\n\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\n\t\t$res_common = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t\t'tx_civserv_employee.uid,\n\t\t\t\t\t\t tx_civserv_employee.em_address,\n\t\t\t\t\t\t tx_civserv_employee.em_title,\n\t\t\t\t\t\t tx_civserv_employee.em_name,\n\t\t\t\t\t\t tx_civserv_employee.em_firstname,\n\t\t\t\t\t\t tx_civserv_employee.em_telephone,\n\t\t\t\t\t\t tx_civserv_employee.em_fax,\n\t\t\t\t\t\t tx_civserv_employee.em_email,\n\t\t\t\t\t\t tx_civserv_employee.em_image,\n\t\t\t\t\t\t tx_civserv_employee.em_datasec',\n\t\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t\t'1 '.\n\t\t\t\t\t\t$strEnableField.\n\t\t\t\t\t\t' AND uid='. intval($uid).'\n\t\t\t\t\t\tAND em_datasec=1',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'');\n\n\t\t//Check if data security option is enabled\n\t\tif ($GLOBALS['TYPO3_DB']->sql_num_rows($res_common) == 0) {\n\t\t\t$GLOBALS['error_message'] = $this->pi_getLL('tx_civserv_pi1_employee.datasec','Datasec enabled! Employee is not shown.');\n\t\t\treturn false;\n\t\t}\n\n\t\t//Query for employee office hours\n\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t}\n\t\t$res_emp_hours = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee',\n\t\t\t\t\t'tx_civserv_employee_em_hours_mm',\n\t\t\t\t\t'tx_civserv_officehours',\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = ' . intval($uid),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\t\t// Create additional queries if position uid is set in piVars\n\t\tif ($pos_id != '' && intval($pos_id) > 0) {\n\n\t\t\t// Query for employee-position office hours\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_emp_pos_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_officehours,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_officehours_oep_employee_em_position_mm_mm',\n\t\t\t\t'1 '.\n\t\t\t\t$strEnableField.\n\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_local\n\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_officehours_oep_employee_em_position_mm_mm.uid_foreign\n\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id),\n\t\t\t\t'',\n\t\t\t\t'oh_weekday',\n\t\t\t\t'');\n\n\n\t\t\t// Query for employee-organisation office hours\n\t\t\t// 1. will only return result if position occupied by employee has relation to organisation\n\t\t\t// 2. ignores direct employee-organisation-relations (leader of the pack....)\n\t\t\t$res_emp_org_hours = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_officehours.oh_start_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_end_morning,\n\t\t\t\t\t tx_civserv_officehours.oh_start_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_end_afternoon,\n\t\t\t\t\t tx_civserv_officehours.oh_manual_checkbox,\n\t\t\t\t\t tx_civserv_officehours.oh_freestyle,\n\t\t\t\t\t tx_civserv_officehours.oh_weekday',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_organisation,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_officehours,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_position_po_organisation_mm,\n\t\t\t\t\t tx_civserv_organisation_or_hours_mm',\n\t\t\t\t\t'1 '.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_position').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_officehours').\n\t\t\t\t\t' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_employee_em_position_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_organisation_or_hours_mm.uid_local\n\t\t\t\t\t AND tx_civserv_officehours.uid = tx_civserv_organisation_or_hours_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_employee.uid = ' . intval($uid) . '\n\t\t\t\t\t AND em_datasec = 1\n\t\t\t\t\t AND tx_civserv_position.uid = ' . intval($pos_id),\n\t\t\t\t\t'',\n\t\t\t\t\t'oh_weekday',\n\t\t\t\t\t'');\n\n\n\t\t\t//test bk: single out one building for the organisation / employee\n\t\t\t//todo!\n\n\n\t\t\t// not all employee-position-records have a relation to a room (building, floor)\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_position = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t\t\n\t\t\t$query_position = $GLOBALS['TYPO3_DB']->SELECTquery(\n\t\t\t\t'tx_civserv_position.uid as pos_uid,\n\t\t\t\t tx_civserv_organisation.uid as or_uid,\n\t\t\t\t tx_civserv_employee.uid as emp_uid,\n\t\t\t\t tx_civserv_position.po_name as position,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_telephone as phone,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_fax as fax,\n\t\t\t\t tx_civserv_employee_em_position_mm.ep_email as email,\n\t\t\t\t tx_civserv_organisation.or_name as organisation',\n\t\t\t\t'tx_civserv_employee,\n\t\t\t\t tx_civserv_position,\n\t\t\t\t tx_civserv_organisation,\n\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t tx_civserv_position_po_organisation_mm',\n\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t AND em_datasec=1\n\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t$this->cObj->enableFields('tx_civserv_organisation').\n\t\t\t\t$strEnableField.\n\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t AND tx_civserv_position.uid = tx_civserv_position_po_organisation_mm.uid_local\n\t\t\t\t AND tx_civserv_organisation.uid = tx_civserv_position_po_organisation_mm.uid_foreign',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\n\t\t\t//special cases have been intercepted before, in fct employee_list\n\t\t\tif (!$this->conf['show_hidden_employees']){\n\t\t\t\t$strEnableField = $this->cObj->enableFields('tx_civserv_employee');\n\t\t\t\t$strEnableField .= $this->cObj->enableFields('tx_civserv_position');\n\t\t\t}\n\t\t\t$res_room = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t\t\t'tx_civserv_building.bl_name as building,\n\t\t\t\t\t tx_civserv_building.bl_name_to_show as building_to_show,\n\t\t\t\t\t tx_civserv_floor.fl_descr as floor,\n\t\t\t\t\t tx_civserv_room.ro_name as room',\n\t\t\t\t\t'tx_civserv_employee,\n\t\t\t\t\t tx_civserv_position,\n\t\t\t\t\t tx_civserv_room,\n\t\t\t\t\t tx_civserv_floor,\n\t\t\t\t\t tx_civserv_building,\n\t\t\t\t\t tx_civserv_employee_em_position_mm,\n\t\t\t\t\t tx_civserv_building_bl_floor_mm',\n\t\t\t\t\t'tx_civserv_employee.uid='. intval($uid).'\n\t\t\t\t\t AND em_datasec=1\n\t\t\t\t\t AND tx_civserv_position.uid = '. intval($pos_id).\n\t\t\t\t\t$strEnableField.\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_room').\n\t\t\t\t\t$this->cObj->enableFields('tx_civserv_floor').\n\t\t\t\t\t ' AND tx_civserv_employee.uid = tx_civserv_employee_em_position_mm.uid_local\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.uid_foreign = tx_civserv_position.uid\n\t\t\t\t\t AND tx_civserv_employee_em_position_mm.ep_room = tx_civserv_room.uid\n\t\t\t\t\t AND tx_civserv_building.uid = tx_civserv_building_bl_floor_mm.uid_local\n\t\t\t\t\t AND tx_civserv_floor.uid = tx_civserv_building_bl_floor_mm.uid_foreign\n\t\t\t\t\t AND tx_civserv_room.rbf_building_bl_floor = tx_civserv_building_bl_floor_mm.uid',\n\t\t\t\t\t'',\n\t\t\t\t\t'',\n\t\t\t\t\t'');\n\n\t\t\t//Assign employee position data\n\t\t\t$employee_position = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_position);\n\t\t\tdebug($employee_position);\n\t\t\t$employee_position['or_link'] = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'organisation', id => $employee_position['or_uid']),1,1));\n\t\t\tif($employee_position['building_to_show'] > ''){\n\t\t\t\t$employee_position['building'] = $employee_position['building_to_show'];\n\t\t\t}\n\t\t\t$employee_room = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_room);\n\t\t\tif(count($employee_room) > 0){\n\t\t\t\t$employee_position = array_merge($employee_position, (array)$employee_room);\n\t\t\t}\n\t\t\t$smartyEmployee->assign('position',$employee_position);\n\n\n\t\t\t// employee_position_hours:\n\t\t\t//Assign employee-position working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_pos_hours) ){\n\t\t\t\t$emp_pos_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_pos_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_pos_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_pos_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_pos_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_pos_hours',$emp_pos_hours);\n\n\n\t\t\t//Assign employee-organisation working hours\n\t\t\t$row_counter = 0;\n\t\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_org_hours) ){\n\t\t\t\t$emp_org_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t\t$emp_org_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t\t$emp_org_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t\t$emp_org_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t\t}else{\n\t\t\t\t\t$emp_org_hours[$row_counter]['freestyle'] = '';\n\t\t\t\t}\n\t\t\t\t$row_counter++;\n\t\t\t}\n\t\t\t$smartyEmployee->assign('emp_org_hours',$emp_org_hours);\n\t\t} //End if additional queries\n\n\t\t$employee_rows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_common);\n\n\t\t// get Image code\n\t\t$imagepath = $this->conf['folder_organisations'] . $this->community['id'] . '/images/';\n\t\t$description = $employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'];\n\t\t$imageCode = $this->getImageCode($employee_rows['em_image'],$imagepath,$this->conf['employee-image.'],$description);\n\n\t\t//Assign employee data\n\t\t$smartyEmployee->assign('title',$employee_rows['em_title']);\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_female','Mrs.'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('address',$this->pi_getLL('tx_civserv_pi1_organisation.address_male','Mr.'));\n\t\t}\n\t\t$smartyEmployee->assign('firstname',$employee_rows['em_firstname']);\n\t\t$smartyEmployee->assign('name',$employee_rows['em_name']);\n\t\t$smartyEmployee->assign('phone',$employee_rows['em_telephone']);\n\t\t$smartyEmployee->assign('fax',$employee_rows['em_fax']);\n\t\t$smartyEmployee->assign('image',$imageCode);\n\n\t\t//search employee\n\t\t$smartyEmployee->assign('employee_search', $this->community['employee_search']);\n\n\t\t// Assign email data\n\t\t// use typolink, because of the possibility to use encrypted email-adresses for spam-protection\n\t\tif ($employee_position['email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_position['emp_uid'],pos_id => $employee_position['pos_uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_position['email'],array(parameter => $employee_position['email'],ATagParams => 'class=\"email\"'));\n\t\t} elseif ($employee_rows['em_email'] != '') {\n\t\t\t$email_form_url = htmlspecialchars($this->pi_linkTP_keepPIvars_url(array(mode => 'set_email_form',id => $employee_rows['uid']),1,1));\n\t\t\t$email_code = $this->cObj->typoLink($employee_rows['em_email'],array(parameter => $employee_rows['em_email'],ATagParams => 'class=\"email\"'));\n\t\t}\n\t\t$smartyEmployee->assign('email_form_url',$email_form_url);\n\t\t$smartyEmployee->assign('email_code',$email_code);\n\n\t\t//Assign employee working hours\n\t\t$row_counter = 0;\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_emp_hours) ){\n\t\t\t$emp_hours[$row_counter]['weekday'] = $this->pi_getLL('tx_civserv_pi1_weekday_'.$row['oh_weekday']);\n\t\t\t$emp_hours[$row_counter]['start_morning'] = $row['oh_start_morning'];\n\t\t\t$emp_hours[$row_counter]['end_morning'] = $row['oh_end_morning'];\n\t\t\t$emp_hours[$row_counter]['start_afternoon'] = $row['oh_start_afternoon'];\n\t\t\t$emp_hours[$row_counter]['end_afternoon'] = $row['oh_end_afternoon'];\n#\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\tif($row['oh_manual_checkbox'] == 1){\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = $row['oh_freestyle'];\n\t\t\t}else{\n\t\t\t\t$emp_hours[$row_counter]['freestyle'] = '';\n\t\t\t}\n\t\t\t$row_counter++;\n\t\t}\n\t\t$smartyEmployee->assign('emp_hours',$emp_hours);\n\n\n\n\t\t//Assign template labels\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_female','Employee'));\n\t\t} else{ //1 for male or nothing\n\t\t\t$smartyEmployee->assign('employee_label',$this->pi_getLL('tx_civserv_pi1_employee.employee_male','Employee'));\n\t\t}\n\t\t$smartyEmployee->assign('phone_label',$this->pi_getLL('tx_civserv_pi1_organisation.phone','Phone'));\n\t\t$smartyEmployee->assign('fax_label',$this->pi_getLL('tx_civserv_pi1_organisation.fax','Fax'));\n\t\t$smartyEmployee->assign('email_label',$this->pi_getLL('tx_civserv_pi1_organisation.email','E-Mail'));\n\t\t$smartyEmployee->assign('web_email_label',$this->pi_getLL('tx_civserv_pi1_organisation.web_email','E-Mail-Form'));\n\t\t$smartyEmployee->assign('working_hours_label',$this->pi_getLL('tx_civserv_pi1_employee.hours','Working hours'));\n\t\t$smartyEmployee->assign('office_hours_summary',str_replace('###EMPLOYEE###',$employee_rows['em_firstname'] . ' ' . $employee_rows['em_name'],$this->pi_getLL('tx_civserv_pi1_employee.officehours','In the table are the office hours of ###EMPLOYEE### shown.')));\n\t\tif($this->conf['showOhLabels']){\n\t\t\t//default\n\t\t}else{\n\t\t\t$smartyEmployee->assign('supress_labels', 'invisible');\n\t\t}\n\t\t$smartyEmployee->assign('weekday',$this->pi_getLL('tx_civserv_pi1_weekday','Weekday'));\n\t\t$smartyEmployee->assign('morning',$this->pi_getLL('tx_civserv_pi1_organisation.morning','mornings'));\n\t\t$smartyEmployee->assign('afternoon',$this->pi_getLL('tx_civserv_pi1_organisation.afternoon','in the afternoon'));\n\n\t\t$smartyEmployee->assign('organisation_label',$this->pi_getLL('tx_civserv_pi1_employee.organisation','Organisation'));\n\t\t$smartyEmployee->assign('room_label',$this->pi_getLL('tx_civserv_pi1_employee.room','Room'));\n\t\t//the image_employee_label is not being used yet\n\t\tif (intval($employee_rows['em_address']) == 2) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_female.image','Image of employee'));\n\t\t} else if (intval($employee_rows['em_address']) == 1) {\n\t\t\t$smartyEmployee->assign('image_employee_label',$this->pi_getLL('tx_civserv_pi1_employee_male.image','Image of employee'));\n\t\t}\n\n\t\tif ($searchBox) {\n\t\t\t//$_SERVER['REQUEST_URI'] = $this->pi_linkTP_keepPIvars_url(array(mode => 'search_result'),0,1); //dropped this according to instructions from security review\n\t\t\t$smartyTop15->assign('searchbox', $this->pi_list_searchBox('',true));\n\t\t}\n\t\t$GLOBALS['TSFE']->page['title']=$this->pi_getLL('tx_civserv_pi1_employee.employee_plural','Employees');\n\t\treturn true;\n\t}", "function getBasicDetails($sek_id)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n $stmt = \"SELECT\r\n *\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE\r\n sek_id= \" . $db->quote($sek_id);\r\n\r\n try {\r\n $res = $db->fetchRow($stmt, array(), Zend_Db::FETCH_ASSOC);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n\r\n $res['sek_title_db'] = Search_Key::makeSQLTableName($res['sek_title']);\r\n return $res;\r\n }", "public function get_details($id)\n {\n $q=$this->db->where(['dist_id'=>$id])->get('distributor');\n\t\treturn $res=$q->result_array()[0];\t\n }" ]
[ "0.7443607", "0.69970787", "0.6909756", "0.64773667", "0.6369049", "0.6357228", "0.6215434", "0.61938334", "0.6173934", "0.6131351", "0.61127067", "0.61127067", "0.6099434", "0.6086556", "0.6030992", "0.60074526", "0.6003254", "0.5993721", "0.5988407", "0.59492934", "0.594116", "0.59391475", "0.59219", "0.5883901", "0.5872791", "0.58709383", "0.5861921", "0.58396745", "0.5823998", "0.577738", "0.5772935", "0.5753783", "0.5752836", "0.57507694", "0.5750519", "0.57426244", "0.5735363", "0.5717535", "0.5712347", "0.5708558", "0.57078725", "0.5701643", "0.5697168", "0.56724817", "0.5667796", "0.5649875", "0.5649875", "0.5649875", "0.5646728", "0.56431794", "0.5637106", "0.5633396", "0.5630018", "0.5628376", "0.5622374", "0.5613969", "0.5600589", "0.55961406", "0.55961406", "0.55961406", "0.55961406", "0.5593987", "0.5593972", "0.55939317", "0.55939317", "0.55929774", "0.55929774", "0.55929774", "0.55837363", "0.55837363", "0.55837363", "0.5582257", "0.5576971", "0.5573702", "0.55734074", "0.55725217", "0.55716705", "0.55690885", "0.55632806", "0.5561945", "0.5560489", "0.5555769", "0.5550912", "0.5550438", "0.55496484", "0.5548928", "0.5532393", "0.5530144", "0.55282056", "0.5524387", "0.5515454", "0.55137324", "0.5509801", "0.5507566", "0.55042076", "0.5501724", "0.55002564", "0.5494106", "0.54902744", "0.5489911", "0.5488402" ]
0.0
-1
Send reminder messages to the list of appointments that have been passed to us
function sendReminders($appointmentList) { // get appointment details and email address JLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php'); $appointmentModel = new SalonBookModelAppointments(); foreach ($appointmentList as $appointment) { $mailingInfo = $appointmentModel->detailsForMail($appointment['id']); // clear any old recipients $this->email = NULL; $this->setSuccessMessage($mailingInfo); // $this->mailer->addBCC("[email protected]"); $this->sendMail(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function sendAssignmentNotification()\n {\n \t$ctime = date('Y-m-d'); //get current day\n \n \t//get facebook id from the user setting for facebook reminder\n \t$this->PleAssignmentReminder->virtualFields = array('tid' => 'PleUserMapTwitter.twitterId');\n \n \t//get last sent id\n \t$last_sent_id = $this->PleLastReminderSent->find('first',array('conditions' => array('PleLastReminderSent.date' => $ctime, 'PleLastReminderSent.type' => 'twitter')));\n \n \tif( count($last_sent_id) > 0 ) {\n \t\t$options['conditions'][] = array('PleAssignmentReminder.id >' => $last_sent_id['PleLastReminderSent']['last_sent_rid']);\n \t}\n \n \t//get appController class object\n \t$obj = new AppController();\n \t$assignments = $obj->getAssignmentConstraints();\n \n \t//get today assignments\n \n \t$options['conditions'][] = $assignments;\n \t$options['fields'] = array('id', 'user_id', 'assignment_uuid', 'assignment_title', 'due_date', 'course_id');\n \t$options['order'] = array('PleAssignmentReminder.id ASC');\n \n \t//execute query\n \t$assignmnet_details = $this->PleAssignmentReminder->find('all', $options);\n \t\n \n \t//send twitter reminder\n \tforeach( $assignmnet_details as $assignmnet_detail ) {\n\t $user_id = $assignmnet_detail['PleAssignmentReminder']['user_id'];\n \t\t//$to_twitter = $assignmnet_detail['PleAssignmentReminder']['tid'];\n \t\t$body = $assignmnet_detail['PleAssignmentReminder']['assignment_title'];\n\t\t$course_id = $assignmnet_detail['PleAssignmentReminder']['course_id'];\n \t\t\n\t\t//get twitter users array if user is instructor\n \t\t$twitter_users_array = $this->getChildren( $user_id, $course_id );\n\t\t\n \t\t//set display date for assignments\n \t\t$originalDate = $assignmnet_detail['PleAssignmentReminder']['due_date'];\n\t\tif($originalDate != \"\"){\n \t\t$newDate = date(\"F d, Y\", strtotime($originalDate));\n \t\t$due_date = \" due on $newDate\";\n\t\t}else{\n\t\t \t$due_date = \" is due on NA\";\n\t\t }\n \t\t\n \t\t//compose mail date\n \t\t$mail_data = \"Assignment Reminder! $course_id. Your assignment, $body, $due_date.\";\n \t\t$subject = $course_id.\" - \".$body;\n \n\t\t//send the reminder to multiple users\n \t\tforeach ($twitter_users_array as $to_twitter_data ) {\n\t\t$to_twitter = $to_twitter_data['twitter_id'];\n \t\t$to_id = $to_twitter_data['id'];\n \t\t$send_twitter = $this->sendNotification( $to_twitter, $mail_data );\n \n \t\t//check for if facebook reminder sent\n \t\tif ( $send_twitter == 1) {\n \n \t\t\t//remove the previous entry of current date\n \t\t\t$this->PleLastReminderSent->deleteAll(array('PleLastReminderSent.date'=>$ctime, 'PleLastReminderSent.type'=>'twitter'));\n \t\t\t$this->PleLastReminderSent->create();\n \n \t\t\t//update the table for sent facebook reminder\n \t\t\t$data['PleLastReminderSent']['last_sent_rid'] = $assignmnet_detail['PleAssignmentReminder']['id'];\n \t\t\t$data['PleLastReminderSent']['type'] = 'twitter';\n \t\t\t$data['PleLastReminderSent']['date'] = $ctime;\n \t\t\t$this->PleLastReminderSent->save($data);\n \n \t\t\t//create the CSV user data array\n \t\t\t$csv_data = array('id'=>$to_id, 'tid'=>$to_twitter, 'mail_data'=> $mail_data);\n \n \t\t\t//write the csv\n \t\t\t$this->writeTwitterCsv($csv_data);\n \n \t\t\t//unset the csv data array\n \t\t\tunset($csv_data);\n \t\t} else if ( $send_twitter == 2) { //twitter app not following case(can be used for future for notification on dashboard)\n \t\t\t\n \t\t} else {\n \t\t\t//handling for twitter reminder failure\n\t \t\t$tw_data = array();\n\t \t\t$tw_data['AssignmentTwitterFailure']['twitter_id'] = $to_twitter;\n\t \t\t$tw_data['AssignmentTwitterFailure']['mail_data'] = $mail_data;\n\t \t\t$this->AssignmentTwitterFailure->create();\n\t \t\t$this->AssignmentTwitterFailure->save($tw_data);\n \t\t}\n\t\t}\n \t}\n }", "public function testGetMessageListAppointments()\r\n\t{\r\n\t\t// Create an event to make sure we have at least one\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My Test Event\");\r\n\t\t$obj->setValue(\"ts_start\", date(\"m/d/Y\") . \" 12:00 PM\");\r\n\t\t$obj->setValue(\"ts_end\", date(\"m/d/Y\") . \" 01:00 PM\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t// Get events\r\n\t\t$events = $this->backend->GetMessageList(\"calendar_root\", time()); // second param cuts off to today\r\n\t\t$found = false;\r\n\t\tforeach ($events as $evt)\r\n\t\t{\r\n\t\t\tif ($evt[\"id\"] == $eid)\r\n\t\t\t\t$found = true;\r\n\t\t}\r\n\t\t$this->assertTrue($found);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "protected function executeReminder()\n\t{\n\t\t$url\t= $this->getClass( 'Url' );\n\t\t$mail\t= $this->getClass( 'Mail' );\n\t\t$date\t= date( 'Y-m-d', ( time() + ( self::NUM_DAYS_BEFORE_MATCH_REMINDER * 24 * 60 * 60 ) ) );\n\n\t\t$match\t= $this->getData( 'MatchModel', 'getMatchByDate', array( 'date' => $date ) );\n\t\tif ( !isset( $match[0] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$match\t\t\t\t\t= array_shift( $match );\n\t\t$match['day_formated']\t= date( 'd/m/Y', strtotime( $match['day'] ) );\n\t\t$join_url\t\t\t\t= $url->buildUrl( 'Match', 'Call', array( $match['id_match'] ) );\n\n\t\t$mail->setContentType( 'text/html', 'utf8' );\n\t\t$mail->setFrom( FROM_EMAIL );\n\t\t$mail->setSubject( \"Call {$match['day_formated']}. Are you going to play?\" );\n\t\t$mail->setBody( \"We are going to play versus '{$match['rival']}' in \" . self::NUM_DAYS_BEFORE_MATCH_REMINDER . \" days and you aren't provided availability.\\n\\nIn order to close match as soon as possible, please provide here your availability <a href='$join_url'>$join_url</a>\\n\\nThank you\" );\n\n\t\t$players\t= $this->getData( 'MatchModel', 'getPlayersNotJoinedToMatch', array( 'id_match' => $match['id_match'], 'match_type' => $match['type'] ) );\n\t\tforeach( $players as $player )\n\t\t{\n\t\t\t$mail->setReceiver( $player['email'] );\n\t\t\t$mail->send();\n\t\t\t$mail->resetReceiver();\n\t\t}\n\t}", "public static function soon()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}", "public function sendReminder(){\n $sid = getenv('ACCOUNT_SID');\n $token = getenv('TWILIO_TOKEN');\n $sandbox_number=getenv('WHATSAPP_SANDBOX_NUMBER');\n $subscriber_number = \"your phone number\";\n $message = $this->todaysScripture(true);\n\n $twilio = new Client($sid, $token);\n $message = $twilio->messages\n ->create(\"whatsapp:\".$subscriber_number,\n array(\n \"from\" => \"whatsapp:\".$sandbox_number,\n \"body\" => $message\n )\n );\n }", "public function onManagerAppointments() {\nglobal $_LW, $title;\nif (!$_LW->userSetting('core_globals')) { // disallow access for non-global perm\n\tdie(header('Location: /livewhale/'));\n};\n$GLOBALS['dropdown_checked']=$this->dropdown('checked_appointments'); // create checked items dropdown menu\n$title='Appointment Slots'; // set title\n$GLOBALS['manager_appointments']=$_LW->showManager('<ul id=\"manager_appointments\" class=\"manager simple list-group\"/>', '<li id=\"item{id}\" class=\"list-group-item\">\n\t<input class=\"with_this\" type=\"checkbox\" name=\"items[]\" value=\"{id}\"/>\n\t<h5>{title}</h5>\n\t<input type=\"hidden\" name=\"appointments[]\" value=\"{id}\"/>\n</li>', 'managerQuery', 'formatManager');\n}", "public function actionNotifyToJoin(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->subject = \"We are happy to see you soon on Cofinder\"; // 11.6. title change\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n $c = 0;\n foreach ($invites as $user){\n \n $create_at = strtotime($user->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue; \n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'invitation-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n $activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can \".$activation_url.\"!\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n Slack::message(\"CRON >> Invite to join reminders: \".$c);\n return 0;\n }", "public function indexAction() {\n\t\t$count1 = 0;\n\t\t$invoices = Mage::getModel( 'invoicereminder/invoicereminder' )->getCollection()->getItems();\n\t\tforeach ( $invoices as $invoice ) {\n\t\t\t$count1 = $count1 + $invoice->getInvoicereminders();\n\t\t}\n\n\t\t// Send the reminders\n\t\tMage::getModel( 'invoicereminder/sender' )->prepareMail();\n\n\t\t// Calculate the total of send items after sending\n\t\t$count2 = 0;\n\t\t$invoices = Mage::getModel( 'invoicereminder/invoicereminder' )->getCollection()->getItems();\n\t\tforeach ( $invoices as $invoice ) {\n\t\t\t$count2 = $count2 + $invoice->getInvoicereminders();\n\t\t}\n\n\t\t// Output the total number of sent reminders\n\t\tMage::getSingleton( 'adminhtml/session' )->addSuccess( Mage::helper( 'invoicereminder' )->__( '%d reminder(s) sent', ( $count2 - $count1 ) ) );\n\t\t$this->getResponse()->setRedirect( $this->getUrl( '*/view/' ) );\n\n\t}", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "static public function sendReminders($vars)\n {\n global $whups_driver;\n\n if ($vars->get('id')) {\n $info = array('id' => $vars->get('id'));\n } elseif ($vars->get('queue')) {\n $info['queue'] = $vars->get('queue');\n if ($vars->get('category')) {\n $info['category'] = $vars->get('category');\n } else {\n // Make sure that resolved tickets aren't returned.\n $info['category'] = array('unconfirmed', 'new', 'assigned');\n }\n } else {\n throw new Whups_Exception(_(\"You must select at least one queue to send reminders for.\"));\n }\n\n $tickets = $whups_driver->getTicketsByProperties($info);\n self::sortTickets($tickets);\n if (!count($tickets)) {\n throw new Whups_Exception(_(\"No tickets matched your search criteria.\"));\n }\n\n $unassigned = $vars->get('unassigned');\n $remind = array();\n foreach ($tickets as $info) {\n $info['link'] = self::urlFor('ticket', $info['id'], true, -1);\n $owners = current($whups_driver->getOwners($info['id']));\n if (!empty($owners)) {\n foreach ($owners as $owner) {\n $remind[$owner][] = $info;\n }\n } elseif (!empty($unassigned)) {\n $remind['**' . $unassigned][] = $info;\n }\n }\n\n /* Build message template. */\n $view = new Horde_View(array('templatePath' => WHUPS_BASE . '/config'));\n $view->date = strftime($GLOBALS['prefs']->getValue('date_format'));\n\n /* Get queue specific notification message text, if available. */\n $message_file = WHUPS_BASE . '/config/reminder_email.plain';\n if (file_exists($message_file . '.local.php')) {\n $message_file .= '.local.php';\n } else {\n $message_file .= '.php';\n }\n $message_file = basename($message_file);\n\n foreach ($remind as $user => $utickets) {\n if (empty($user) || !count($utickets)) {\n continue;\n }\n $view->tickets = $utickets;\n $subject = _(\"Reminder: Your open tickets\");\n $whups_driver->mail(array('recipients' => array($user => 'owner'),\n 'subject' => $subject,\n 'view' => $view,\n 'template' => $message_file,\n 'from' => $user));\n }\n }", "public function getFollowUpAppointments($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $currentDateTime = \"STR_TO_DATE('\" . DateTimeService::getNowDateTimeInUtc() . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingEnd BETWEEN DATE_SUB({$currentDateTime}, INTERVAL 172800 SECOND) AND {$currentDateTime}\n AND DATE_ADD(a.bookingEnd, INTERVAL {$notification->getTimeAfter()->getValue()} SECOND)\n < {$currentDateTime}\n AND a.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function handle()\n {\n $agencies = Agency::all();\n\n foreach ($agencies as $agency){\n $tasks_with_custom_reminder = tasks_with_custom_reminder($agency->id);\n $tasks_reminder = tasks_reminder($agency->id);\n\n $content = '<p>Hi {STAFF_NAME},</p>\n <p>Reminder The Task <strong>#{TASK_ID}</strong> &nbsp;has a deadline to you at <strong>{TIME}</strong> in <strong>{DEADLINE}</strong>.</p>\n <p>Please check the task and Update it.</p>\n <p><br><a href=\"{TASK_URL}\"><strong>View Task</strong></a><br><br>Regards<br>The {SITE_NAME} Team</p>';\n $subject = 'TASK DEADLINE';\n\n $merged = array_merge($tasks_with_custom_reminder, $tasks_reminder);\n\n foreach ($merged as $date_remind => $custom_reminder){\n\n\n if (date('Y-m-d') == $date_remind){\n\n foreach ($custom_reminder as $time_remind => $tasks){\n\n if (date('H:i').':00' == $time_remind){\n// if ($time_remind == $time_remind){\n foreach ($tasks as $task){\n\n $staffs = $task->staff;\n $company_name = $task->agency && $task->agency->company_name_en ? $task->agency->company_name_en : 'Broker';\n foreach ($staffs as $staff){\n\n $link = 'activity/tasks/'.$task->agency_id.'/show/'.$task->id;\n $message = str_replace(\"{STAFF_NAME}\",$staff->name_en,$content);\n $message = str_replace(\"{TASK_ID}\",$task->id,$message);\n $message = str_replace(\"{DEADLINE}\",$task->deadline,$message);\n $message = str_replace(\"{{TIME}}\",$task->time,$message);\n $message = str_replace(\"{TASK_URL}\",url($link),$message);\n $message = str_replace(\"{SITE_NAME}\",$company_name,$message);\n\n SendEmail::dispatch($staff->email, $message, $subject);\n\n event(new CronJobMailEvent($task ,$staff->id,'Send Email To Reminder Staff The Deadline',\n 'task_reminder'));\n// Mail::to($staff->email)->send(new EmailGeneral($message, $subject ));\n\n }\n Notification::send($staffs, new CronJobMailNotification($task,\n 'Send Email To Reminder Staff The Deadline','task_reminder'));\n\n }\n }\n }\n }\n }\n }\n return 0;\n }", "function send_reminders_to_supervisors($courseid){\n\n global $DB, $CFG;\n $numsheets = count_unsigned_timesheets($courseid);\n $numalerts = count_outstanding_alerts($courseid);\n\n if($numsheets == 0 && $numalerts == 0) return 0;\n\n $coursecon = get_context_instance(CONTEXT_COURSE, $courseid); \n $teachers = get_enrolled_users($coursecon, 'mod/assignment:grade');\n\n $course = $DB->get_record('course', array('id'=>$courseid));\n\n $subj = '['.$course->shortname.'] Notice: '.\n ($numsheets + $numalerts).' item(s) need your attention';\n\n $from = generate_email_supportuser();\n\n $msg = 'Hello!<br /><br />This is a reminder that you have '.\n ($numsheets+$numalerts).' item(s) that require your attention. <br /><br />'.\n '<ul>';\n \n if($numsheets > 0){\n $msg .=\n '<li>'.$numsheets.' timesheet(s). To inspect these timesheets, '.\n 'visit <a href=\"'. $CFG->wwwroot.'/blocks/timetracker/supervisorsig.php?id='.\n $courseid.'\">this link</a>.</li>';\n }\n\n if($numalerts > 0){\n $msg .=\n '<li>'.$numalerts.' alert(s). To inspect these alerts, '.\n 'visit <a href=\"'. $CFG->wwwroot.'/blocks/timetracker/managealerts.php?id='.\n $courseid.'\">this link</a>. As a reminder, <span style=\"font-weight: bold\">'.\n 'workers cannot sign their timesheets if there are outstanding alerts.</span></li>';\n } \n $msg .=\n '</ul><br /><br />'.\n 'We, and your workers, '.\n 'appreciate your prompt attention to this matter.<br />'.\n '<br />Thanks,<br /><br />'.\n '<br />The TimeTracker Development Team';\n \n $count = 0;\n foreach($teachers as $teacher){\n $ok = email_to_user($teacher, $from, $subj, \n format_text_email($msg, FORMAT_HTML), $msg, '', '', false);\n if(!$ok){\n error_log('Error sending timesheet reminder email to: '.\n $teacher->firstname.' '.$teacher->lastname);\n } else {\n $count++;\n }\n }\n return $count;\n}", "public function agenda_reminder($id,$team_id= null){\n\t\t$from = date('H:i:s',strtotime ( '-70 min' , strtotime (date('H:i:s')) ));\n\t \t$to = date('H:i:s');\n\n\t $agendas = AgendaMast::whereBetween('required_at',array($from,$to))\n\t ->where('days_active','like','%'.date('N').'%')\n\t ->get(); \n\n\t foreach($agendas as $agenda){\n\t \t$users = User::whereIn('id', json_decode($agenda->permissions)->can_respond)->get();\n\t\t $team = null;\n\t\t Notification::send($users, new SendAgendaMessage($agenda,$team));\n\t }\n\t }", "protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "private function upcoming_bills_reminder()\n\t{\n\t\t$recipients = array();\n\t\t$recipient = array();\n\t\t$this->load->model('Membership_model');\n\t\t$this->load->model('Accounts_model');\n\t\t$this->load->model('Settings_model');\n\t\t\n\t\t$result = $this->Membership_model->get_members();\n\t\tforeach ($result as $member)\n\t\t{\n\t\t\t$days = $this->Settings_model->email_reminder_days_get($member->id);\n\t\t\tif ($days > 0) // only do this if they want email reminders \n\t\t\t{\n\t\t\t\t$recipient['email_address'] = $member->email_address;\n\t\t\t\t$billcount = 0;\n\t\t\t\t$accounts_due = $this->Accounts_model->get_accounts_due($member->id);\n\t\t\t\t$recipient['message'] = \"G'day\";\n\t\t\t\tif ($member->first_name != '') $recipient['message'] .= \"&nbsp;\".$member->first_name;\n\t\t\t\t$recipient['message'] .= \",<br><br>Derek from remember-my-bills here. As promised, here's a list of bills due in the next \".$days.\" days<hr>\";\n\t\t\t\tforeach ($accounts_due as $account) {\n\t\t\t\t\t$billcount += 1;\n\t\t\t\t\t$recipient['message'] .= \n\t\t\t\t\t\t$account->account.\" bill for \".\n\t\t\t\t\t\t$account->amount.\" is due by \".\n\t\t\t\t\t\tdate($this->Settings_model->date_format_get_php($member->id), strtotime($account->next_due)).\"<br>\";\n\t\t\t\t}\n\t\t\t\t$recipient['message'] .= \"<Br><br>Go to <a href='http://rememberthebills.com'>http://rememberthebills.com</a> to pay them.\";\n\t\t\t\t$recipient['message'] .= \"<Br><br>Enjoy your day!<br><br>The remember-the-bills team.\";\n\t\t\t\t\n\t\t\t\t$recipient['subject'] = \"You have \".$billcount.\" bill\".($billcount > 1 ? \"s\" : \"\").\" due within the next \".$days.\" day\".($days > 1 ? \"s\" : \"\");\n\t\t\t\t//$data['ignoreMenu'] = 'true';\n\t\t\t\t//$data['main_content'] = 'email_view';\n\t\t\t\t//$recipient['message'] = $this->load->view('includes/template.php', $data, true);\n\t\t\t\t\n\t\t\t\tarray_push($recipients, $recipient);\n\t\t\t}\n\t\t}\n\t\treturn $recipients;\n\t}", "private function notify_on_add($meet, $location)\n { \n $subject = 'Shackmeet Announcement - ' . $meet->title;\n $body = $this->build_create_message($meet, $location);\n \n $notification_users = $this->load_users_to_notify();\n \n foreach ($notification_users as $user)\n {\n // Prevent shackmessages from being sent to yourself. Unless you're me. I get all the shackmessages.\n if ($user['username'] == $this->current_user->username && $user['username'] != 'omnova') \n continue;\n \n if ($user['notify_option'] == 2 || ($user['notify_option'] == 1 && $this->eligible_for_notification($user['latitude'], $user['longitude'], $location->latitude, $location->longitude, $user['notify_max_distance'])))\n { \n // Insert SM message into the queue\n if ($user['notify_shackmessage'] == 1)\n {\n $message = Model::factory('message_queue');\n $message->message_type_id = 1;\n $message->message_recipients = $user['username'];\n $message->message_subject = $subject;\n $message->message_body = $body;\n $message->meet_id = $meet->meet_id;\n $message->notification_reason_id = 1;\n $message->insert(); \n }\n \n // Insert email message into the queue\n if ($user['notify_email'] == 1)\n {\n $message = Model::factory('message_queue');\n $message->message_type_id = 2;\n $message->message_recipients = $user['email_address'];\n $message->message_subject = $subject;\n $message->message_body = $body;\n $message->meet_id = $meet->meet_id;\n $message->notification_reason_id = 1;\n $message->insert();\n }\n }\n }\n }", "public function send_meeting()\n {\n // save meeting\n if($this->user['is_matched'] > 0) {\n $update['data']['from'] = $this->session->userdata('user_id');\n $update['data']['to'] = $this->user['is_matched'];\n $update['data']['meeting_subject'] = $this->input->post('meeting_subject');\n $update['data']['meeting_desc'] = $this->input->post('meeting_desc');\n $update['data']['month'] = $this->input->post('month');\n $update['data']['day'] = $this->input->post('day');\n $update['data']['year'] = $this->input->post('year');\n $update['data']['start_ampm'] = $this->input->post('start_ampm');\n $update['data']['end_ampm'] = $this->input->post('end_ampm');\n $update['data']['stamp'] = date(\"Y-m-d H:i:s\");\n $update['data']['start_time'] = $this->input->post('start_time');\n $update['data']['end_time'] = $this->input->post('end_time');\n\n $update['table'] = 'meetings';\n $update['data']['ical'] = encrypt_url($this->Application_model->insert($update));\n\n // send emails to each party\n\n $match = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n $update['data']['who'][] = $match['first_name'] . \" \" . $match['last_name'];\n $update['data']['who'][] = $this->user['first_name'] . \" \" . $this->user['last_name'];\n\n //convert date and time to nice format\n $nice_date = date('D M d, Y',strtotime($this->input->post('day').\"-\".$this->input->post('month').\"-\".$this->input->post('year')));\n $update['data']['nice_date'] = $nice_date;\n\n // to requesting user\n $data = array();\n $data['user'] = $this->user['first_name'] . \" \" . $this->user['last_name'];\n $data['message'] = $update['data'];\n $message = $this->load->view('/dash/email/meeting', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($this->user['email']);\n\n $full_subject = \"Invitation: \" . $nice_date . \" \" . $this->input->post('start_time') . \"\" . $this->input->post('start_ampm') . \" - \" . $this->input->post('end_time') . \"\" . $this->input->post('end_ampm') . \" (\" . $this->user['first_name'] . \" \" . $this->user['last_name'] . \")\";\n\n $this->email->subject($full_subject);\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n\n // to invitee\n $data = array();\n $data['user'] = $match['first_name'] . \" \" . $match['last_name'];\n $data['message'] = $update['data'];\n $message = $this->load->view('/dash/email/meeting', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($match['email']);\n\n $full_subject = \"Invitation: \" . $nice_date . \" \" . $this->input->post('start_time') . \"\" . $this->input->post('start_ampm') . \" - \" . $this->input->post('end_time') . \"\" . $this->input->post('end_ampm') . \" (\" . $match['first_name'] . \" \" . $match['last_name'] . \")\";\n\n $this->email->subject($full_subject);\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n\n $this->session->set_flashdata(\n 'message',\n '<div class=\"alert alert-success\">Meeting Request Sent.</div>'\n );\n\n redirect('/dashboard/match','refresh');\n }else{\n\n redirect('/dashboard','refresh');\n\n }\n\n }", "public function appointments()\n {\n return view('patient.pending-appointments');\n }", "public function send_reminder()\n\t{\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$device_id = $this->input->post('device_id');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nWear facemask and faceshield properly. Bring Ballpen.\";\n\t \t\t$message .= \"\\nSalamat po.\";\n\t\t\t$this->send_text($message,$contact_number,$device_id);\n\t\t}\n\t}", "function send_first_reminder()\n\t{\n\t\tlog_message('debug', '_message_cron/send_first_reminder');\n\t\t# get non-responsive invites that are more than FIRST_INVITE_PERIOD days old\n\t\t$list = $this->_query_reader->get_list('get_non_responsive_invitations', array('days_old'=>FIRST_INVITE_PERIOD, 'limit_text'=>' LIMIT '.MAXIMUM_INVITE_BATCH_LIMIT, 'old_message_code'=>'invitation_to_join_clout'));\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [1] list='.json_encode($list));\n\t\t# resend old invite as a reminder\n\t\t$results = array();\n\t\tforeach($list AS $i=>$row){\n\t\t\t$results[$i] = $this->_query_reader->run('resend_old_invite', array('invite_id'=>$row['invite_id'], 'new_code'=>'first_reminder_to_join_clout', 'new_status'=>'pending'));\n\t\t}\n\t\tlog_message('debug', '_message_cron/send_first_reminder:: [2] results='.json_encode($results));\n\t\t$reason = empty($results)? 'no-users': '';\n\t\treturn array('result'=>(get_decision($results)? 'SUCCESS': 'FAIL'), 'count'=>count($results), 'reason'=>$reason);\n\t}", "public function actionSuggestions(){\n return 0;\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail'];\n \n // send newsletter to all in waiting list\n $invites = Invite::model()->findAll(\"NOT ISNULL(`key`)\");\n foreach ($invites as $user){\n \n $create_at = strtotime($stat->time_invited);\n if ($create_at < strtotime('-8 week') || $create_at >= strtotime('-1 day')) continue; \n if (!\n (($create_at >= strtotime('-1 week')) || \n (($create_at >= strtotime('-4 week')) && ($create_at < strtotime('-3 week'))) || \n (($create_at >= strtotime('-8 week')) && ($create_at < strtotime('-7 week'))) )\n ) continue;\n \n //set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'suggestion-created';\n $ml->user_to_id = $user->id;\n $ml->save();\n\n $message->subject = \"We are happy to see you interested in Cofinder\"; // 11.6. title change\n \n $content = \"This is just a friendly reminder to activate your account on Cofinder.\n <br /><br />\n Cofinder is a web platform through which you can share your ideas with the like minded entrepreneurs, search for people to join your project or join an interesting project yourself.\n <br /><br />If we got your attention you can !\";\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n }\n return 0;\n\t}", "public function trainingVideoReminderMail() \n {\n $data = $this->BusinessOwner->find('all',array(\n 'conditions'=>array('BusinessOwner.group_role' => array('leader', 'co-leader'),'BusinessOwner.is_unlocked'=> 0),\n 'fields' => array('BusinessOwner.email','BusinessOwner.fname','BusinessOwner.lname','BusinessOwner.group_role')\n ));\n if(!empty($data)) {\n foreach($data as $row) { \n $emailLib = new Email();\n $subject = \"FoxHopr: Watch Training Video\";\n $template = \"training_video_reminder\";\n $format = \"both\";\n $to=$row['BusinessOwner']['email'];\n $emailLib->sendEmail($to,$subject,array('username'=>$row['BusinessOwner']['fname'].' '.$row['BusinessOwner']['lname']),$template,$format);\n }\n }\n }", "public function broadcastOn()\n {\n return ['ticket'];\n }", "public function booking_notifications() {\n $data = $this->class->get_all_active_classes();// model for data. \n log_message(\"debug\", \"Found active classes: \".count($data)); \n foreach ($data as $class) { \n log_message(\"debug\", \"Processing class ID: \" . $class->class_id);\n $current_date = date('Y-m-d');\n $freq1_date = NULL;\n $freq2_date = NULL;\n $freq3_date = NULL;\n $managers = NULL;\n if($class->min_reqd_noti_freq1 != 0) {\n $freq1_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq1 day\" . $class->class_start_date) );\n } \n if($class->min_reqd_noti_freq2 != 0) {\n $freq2_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq2 day\" . $class->class_start_date) );\n }\n if($class->min_reqd_noti_freq3 != 0) {\n $freq3_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq3 day\" . $class->class_start_date) );\n }\n if(strtotime($freq1_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n } else if(strtotime($freq2_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n } else if(strtotime($freq3_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n }\n if (!empty($managers)) { \n foreach ($managers as $user) {\n $total_enrol_count = 0;\n $subject = NULL;\n $noti_msg_txt = NULL;\n log_message('debug', ' Sending notification to ' . $user->registered_email_id);\n if (!empty($user->registered_email_id)) {\n $total_enrol_count = $this->class->class_enrol_count($class->course_id, $class->class_id); \n $subject = \"Class booking notifications for '\".$class->class_name.\"'\";\n $noti_msg_txt = \"Dear \".$user->first_name.\" \".$user->last_name.\", <br/><br/>\"\n . \"Total seats booked in the class '\".$class->class_name.\"' as on '\".date('d-m-Y').\"' is: <b>'\".$total_enrol_count.\"'</b>\"; \n $send_result = $this->sendBookingEmail($user->registered_email_id, $noti_msg_txt, $subject);\n if (!$send_result) {\n log_message('error', ' ERROR sending notification to ' . $user->registered_email_id);\n $last_error = $this->email->print_debugger();\n log_message('error', $last_error); \n }\n } else {\n $error = ' User [ID:' . $user->user_id . '] email is empty.';\n log_message('error', $error); \n }\n }\n }\n } \n echo \"OK\";\n }", "public function getAppointmentsList() {\nglobal $_LW;\ninclude $_LW->INCLUDES_DIR_PATH.'/core/modules/core/includes/class.livewhale_manager.php'; // include manager class\n$_LW->module='appointments';\n$GLOBALS['manager_appointments']=$_LW->showManager('<ul id=\"manager_appointments\" class=\"manager simple list-group\"/>', '<li id=\"item{id}\" class=\"{class} list-group-item\">\n\t{checkbox}\n\t<h5>{title}</h5>\n\t{appointments}\n</li>', 'managerQuery', 'formatManager');\nreturn $_LW->xphp->parseString('<xphp var=\"manager_appointments\"/>');\n}", "function resendApplicationEmail(){\n\t\t//echo \"resend... AppReID: \" . $_POST['appReId'];\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\t\t\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $_POST['appReId']);\n\t\tif(!$bCanceled)\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\telse\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t\t//echo \" Count: \" . count($link);\n\t\t\t//echo \" Item: \" . $link[0][0];\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\tif(!$mailer->sendApplicationEmail2(1, $link, $this->getEventById(), false)){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}else{\n\t\t\techo \"No Records found\";\n\t\t}\n\t\treturn true;\n\t}", "public function reminder() {\n $this->load->model('Reminder_Model');\n $userbean = $this->session->userdata('userbean');\n $data['remindList'] = $this->Reminder_Model->getReminderList(\"ALL\",$userbean->userid);\n $this->load->view('reminder_view/reminder', $data);\n }", "public function getAppointments(){\n\t\tif (Auth::user()->type==4) {\n\t\t\t# code...\n\t\t\treturn redirect()->back(); \n\t\t}\n\t\t$todays = $this->getTodayAppointments(); \n\t\treturn view('appointments.nurseAppointments',compact('todays'));\n\t}", "public function broadcastOn()\n {\n return ['ticket_'.$this->ticket->id];\n }", "public function index()\n {\n $userss = User::where('role_id','=','2')->get();\n foreach($userss as $userwithrole) {\n $userwithrole->notify(new NotifyUsersMeeting());\n event(new eventTrigger($userwithrole));\n //$userwithrole->notify(new NotifyUsersMeeting($userwithrole));\n }\n //$users = DB::table('users')->where('role_id', 2)->get();\n //$users = Auth::user();\n //$users->notify(new NotifyUsersMeeting());\n //notify(new NotifyUsersMeeting());\n //event(new eventTrigger());\n return redirect('home');\n }", "public function run()\n {\n $lists = collect([\n [ //Draft Job Reminder - Couple\n 'notification_event_id' => 1,\n 'email_template_id' => 2,\n 'frequency' => 'realtime',\n 'subject' => 'New admin user created',\n 'body' => '\n <p>Email: [email]</p>\n <p>First Name: [first_name]</p>\n <p>Last Name: [last_name]</p>\n ',\n 'button' => null,\n 'button_link' => null,\n 'recipient' => 'super_admin',\n 'tokens_subject' => null,\n 'tokens_body' => '[first_name],[last_name],[email]',\n 'type' => 'email'\n ],\n [ //Draft Job Reminder - Couple\n 'notification_event_id' => 8,\n 'email_template_id' => 2,\n 'frequency' => 'realtime',\n 'subject' => 'New Job Quote Submitted',\n 'body' => '\n <p>Vendor Name: [vendor_name]</p>\n <p>Title: [couple_title]</p>\n <p>Amount: [amount]</p>\n <p>Total: [total]</p>\n <p>Date Submitted: [created_at]</p>\n ',\n 'button' => null,\n 'button_link' => null,\n 'recipient' => 'admin',\n 'tokens_subject' => null,\n 'tokens_body' => '[vendor_name],[couple_title],[amount],[total],[created_at]',\n 'type' => 'email'\n ],\n [ //Draft Job Reminder - Couple\n 'notification_event_id' => 38,\n 'email_template_id' => 2,\n 'frequency' => 'realtime',\n 'subject' => 'Job Quote Accepted',\n 'body' => '\n <p>Vendor Name: [vendor_name]</p>\n <p>Title: [couple_title]</p>\n <p>Amount: [amount]</p>\n <p>Total: [total]</p>\n ',\n 'button' => null,\n 'button_link' => null,\n 'recipient' => 'admin',\n 'tokens_subject' => null,\n 'tokens_body' => '[vendor_name],[couple_title],[amount],[total]',\n 'type' => 'email'\n ],\n [ //Balance Paid - Couple\n 'notification_event_id' => 23,\n 'email_template_id' => 2,\n 'frequency' => 'realtime',\n 'subject' => 'Balance Paid',\n 'body' => '\n <p>[couple_title] paid in full to [business_name]</p>\n ',\n 'button' => null,\n 'button_link' => null,\n 'recipient' => 'admin',\n 'tokens_subject' => null,\n 'tokens_body' => '[couple_title],[business_name]',\n 'type' => 'email'\n ],\n ])->reduce(function ($lists, $list) {\n $lists[] = [\n 'notification_event_id' => $list['notification_event_id'],\n 'email_template_id' => $list['email_template_id'],\n 'frequency' => $list['frequency'],\n 'subject' => $list['subject'],\n 'body' => $list['body'],\n 'button' => $list['button'],\n 'button_link' => $list['button_link'],\n 'recipient' => $list['recipient'],\n 'tokens_subject' => $list['tokens_subject'],\n 'tokens_body' => $list['tokens_body'],\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n 'type' => $list['type'],\n ];\n\n return $lists;\n });\n\n DB::table('email_notifications')->insert($lists);\n }", "function relist_notifications($old, $new) {\r\n $functions=1;\r\n include(\"config.php\"); // php functions\r\n\r\n\r\n $task = mysql_fetch_array(mysql_query(\"SELECT * FROM tasks WHERE id = '$old' LIMIT 1\")); //original task details\r\n $joins = mysql_query(\"SELECT * FROM joins WHERE task = '$old'\"); // people who had joined that task (if any)\r\n $subject = \"Task re-listed - \" . $task[\"title\"];\r\n \r\n while ($info = mysql_fetch_array($joins)){\r\n \r\n $member = mysql_fetch_array(mysql_query(\"SELECT * FROM `users` WHERE id = '\".$info[\"user\"].\"' LIMIT 1\"));\r\n $message = \"\r\n <p>\".$member[\"firstname\"].\",</p>\r\n \r\n <p>Recently a task closed which you had joined, however not enough others had joined to activate it. The lister has now re-listed the task on another date, so we thought we'd let you know incase you were interested in re-joining.</p>\r\n \r\n <p>You can view the new listing and join the task here:</p>\r\n \r\n <p style='padding-left: 40px;'><a href='$domain\" . task_link($new) . \"'>$domain\" . task_link($new) . \"</a></p>\r\n \r\n <p>Thanks for being a part of Volunteezy!</p> \r\n \";\r\n \r\n send_email($member[\"email\"], $subject, $message);\r\n \r\n addlog(\"Sent email to user \".$info[\"user\"].\" to let them know that task $old has been relisted as task $new\");\r\n }\r\n \r\n \r\n}", "function confirm_reservations($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n $reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id'=>$reservation->recurrence_id,'location'=>$reservation->location));\n \n foreach($reservations as $res){\n $res->confirm = 1;\n $DB->update_record('roomscheduler_reservations', $res);\n }\n}", "public function newappointment(){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->newEntity();\n if ($this->request->is('post')) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n $appointment->user_id = $this->Auth->user('id');\n if ( $appointments_table->save($appointment)) {\n //log what just happened\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Scheduled Appointment', $this->Auth->user('id'), 'Doctor scheduled an appointment', $ip, 'Add');\n $this->Flash->success(__('The appointment has been saved.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be saved. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n \n $this->viewBuilder()->setLayout('backend');\n }", "public function reminder_send(){\n \t/*\n \t//reminder send\n \t$total = $this->db->where(array('reminder_send' => 'no', 'id' => 1))->get('samplings')->num_rows(); \n \tif($total == 1){\n\t \t$up_result = $this->db->where('id', 1)->update('samplings', array('reminder_send' => 'yes'));\n\t \tif($up_result){ //yet //test\n\t \t\t$query = \"SELECT * FROM sample_users WHERE iris_redemption = 'yet' and iris_reminder = 'yet' and sampling_id = 1 order by id asc\";\n\t\t \t$data = $this->db->query($query)->result_array();\n\t\t \t//echo count($data);\n\t\t \t//exit;\n\t\t \t\n\t\t \t//\n\t\t \tif(count($data)){\n\t\t\t\t\tforeach ($data as $user_detail) {\n\t\t\t\t\t \t$email_subject = \"Redemption of Sulwhasoo Complimentary Anti-Aging Kit.\"; \n\t\t\t\t\t\t$email_body = \"<p>Hi \".$user_detail['first_name'].\" \".$user_detail['family_name'].\", </p>\n\t\t\t\t\t\t\t<p>Thank you for taking part in the Sulwhasoo Complimentary Anti-Aging Kit. You are entitled to redeem your trial kit.</p>\n\t\t\t\t\t\t\t<p>We have noticed that you have not redeemed your Sulwhasoo Complimentary Anti-Aging Kit*. Your trial kit will be ready for collection only at Sulwhasoo booth at ION Orchard L1 Atrium from <b>now till 6th September 2017</b>. You may redeem your trial kit by presenting the QR Code below.</p>\n\t\t\t\t\t\t\t<p><b>Strictly one redemption is allowed per person.</b></p>\n\t\t\t\t\t\t\t<p>The Organizer reserves the right to request written proof of NRIC number before collection of trial kit. The Organizer reserves the right to forfeit the campaign for any fans who do not provide the required details upon receiving the request/notification from the Organizer. </p>\n\t\t\t\t\t\t\t<p>Trial kit are not exchangeable, transferable or redeemable in any other form for whatever reason. </p>\n\t\t\t\t\t\t\t<p>Please present the email upon redemption. </p>\n\t\t\t\t\t\t\t<p>QR Code : <img src='\".$user_detail['qr_code'].\"'>\n\t\t\t\t\t\t\t<br>Unique Code :\". $user_detail['iris_code'].\"</p>\n\t\t\t\t\t\t\t<p>Terms and Conditions apply.</p>\n\t\t\t\t\t\t\t<p>*While stocks last.</p>\n\t\t\t\t\t\t\t<p>Regards,\n\t\t\t\t\t\t\t<br>Sulwhasoo Singapore</p>\n\t\t\t\t\t\t\";\t\t\t\n\t\t\t\t\t\t$this->load->library('email');\n\t\t\t\t\t\t$config['mailtype'] = \"html\";\n\t\t\t\t\t\t$this->email->initialize($config);\n\t\t\t\t\t\t$this->email->from(\"[email protected]\",\"Sulwhasoo Singapore\");\n\t\t\t\t\t\t$this->email->to($user_detail['email']);\n\t\t\t\t\t\t$this->email->subject($email_subject);\n\t\t\t\t\t\t$this->email->message($email_body);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->email->send()) {\n\t\t\t\t\t\t\t$sql = \"Update sample_users SET iris_reminder = 'sent' WHERE id = \".$user_detail['id'];\n \t\t\t\t\t\t$this->db->query($sql); \t\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\t\n\t\t\t\t//\n\t\t\t\t\n\t \t}else{\n\t \t\treturn false;\n\t \t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t\t*/\n }", "public function frontliner_reminder()\n\t{\n\t\t$this->load->model('General_model');\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nA1 required to bring any of the ff as proof:\";\n\t \t\t$message .= \"\\nPRC, COE as medical frontliner, Certificate of Training.\";\n\t \t\t$message .= \"\\n DO NOT REPLY.\";\n\t\t\t$this->send_text($message,$contact_number);\n\t\t}\n\t}", "function pp_events_send_attend_notification( $to_user_id = 0, $from_user_id = 0, $post_id = 0 ) {\r\n\r\n\tif ( empty( $to_user_id ) || empty( $from_user_id ) || empty( $post_id ) )\r\n\t\treturn;\r\n\r\n\t$bp = buddypress();\r\n\r\n\r\n\t$send_notify = get_post_meta( $post_id, 'event-attend-notify', true );\r\n\r\n\tif ( ! empty( $send_notify ) ) {\r\n\r\n\t\tbp_notifications_add_notification( array(\r\n\t\t\t'user_id' => $to_user_id,\r\n\t\t\t'item_id' => $post_id,\r\n\t\t\t'secondary_item_id' => $from_user_id,\r\n\t\t\t'component_name' => $bp->events->id,\r\n\t\t\t'component_action' => 'event_attender'\r\n\t\t) );\r\n\t}\r\n\r\n\r\n\t// Check to see if the Event owner wants emails\r\n\tif( 'yes' == get_user_meta( (int)$to_user_id, 'notification_events', true ) ) {\r\n\r\n\t\t$sender_name = bp_core_get_user_displayname( $from_user_id, false );\r\n\t\t$receiver_name = bp_core_get_user_displayname( $to_user_id, false );\r\n\t\t$receiver_email = bp_core_get_user_email( $to_user_id );\r\n\r\n\t\t$sender_profile_link = trailingslashit( bp_core_get_user_domain( $from_user_id ) );\r\n\t\t$event_link = get_permalink( $post_id );\r\n\r\n\t\t$attendees = get_post_meta( $post_id, 'event-attendees', true );\r\n\t\tif( in_array( $from_user_id, $attendees ) )\r\n\t\t\t$going = __( 'is attending your Event', 'bp-simple-events' );\r\n\t\telse\r\n\t\t\t$going = __( 'is not attending your Event', 'bp-simple-events' );\r\n\r\n\t\t// Set up and send the message\r\n\t\t$to = $receiver_email;\r\n\t\t$subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s %s', 'bp-simple_events' ), stripslashes( $sender_name ), $going );\r\n\r\n\r\n\t\t$message = sprintf( __(\r\n'%s %s\r\n\r\nTo see %s\\'s profile: %s\r\n\r\nEvent: %s\r\n\r\n---------------------\r\n', 'bp-simple_events' ), $sender_name, $going, $sender_name, $sender_profile_link, $event_link );\r\n\r\n\t\t// Only add the link to email notifications settings if the component is active\r\n\t\tif ( bp_is_active( 'settings' ) ) {\r\n\t\t\t$receiver_settings_link = trailingslashit( bp_core_get_user_domain( $to_user_id ) . bp_get_settings_slug() . '/notifications' );\r\n\t\t\t$message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'bp-simple_events' ), $receiver_settings_link );\r\n\t\t}\r\n\r\n\t\twp_mail( $to, $subject, $message );\r\n\r\n\t}\r\n}", "function update_activity_send_sms_email_to_visitors($activity_id) {\n // , auto-generate meeting_ID\n $date = date('Ymd');\n\n $visitors = $this->Activity_model->get_activity_visitors_by_activity_id($activity_id);\n $activity_details = $this->Activity_model->get_daily_activity_by_activity_id($activity_id);\n\n $host_info = $this->Activity_Model->get_emp_info_by_empcode($activity_details->HOST_EMP);\n $host_name = $host_info->EMP_FNAME .' '. $host_info->EMP_LNAME;\n\n if($visitors) {\n foreach ($visitors as $visitor) {\n $meeting_ID = $date . str_pad($visitor->VISITOR_ID, 4, '0', STR_PAD_LEFT);\n $this->Activity_Model->update_visit_log_meeting_id($meeting_ID, $visitor->VISITOR_ID);\n\n $visitors_name = $visitor->VISIT_FNAME .' '. $visitor->VISIT_LNAME;\n $sms_message = \"Good day, \".$visitors_name.\"! Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. Your meeting ID is \".$meeting_ID.\". Please check your e-mail for further details. Thank you!\";\n\n $email_message = \"Dear \".$visitors_name.\": <br><br> Good Day! <br><br>\n Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. <br><br>\n Your meeting ID is \".$meeting_ID.\". <br><br>\n If you encountered any technical problems, please contact \".$host_name.\" at \".$host_info->EMAIL_ADDRESS.\" or \".$host_info->MOBILE_NO.\".\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n $this->sms->send( array('mobile' => $visitor->MOBILE_NO, 'message' => $sms_message) );\n $this->send_email($visitor->EMAIL_ADDRESS, 'ETS – '.$visitor->MEETING_ID.' - MEETING UPDATE', $email_message);\n\n // SMS EMAIL TO HOST_EMPLOYEE FOR MEETING ID\n $sms_message = \"Good day, \".$host_name.\"! Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". Please check your e-mail for the meeting confirmation. Please disregard this message if you already complied. Thank you!\";\n\n $email_message = \"Dear \".$host_name.\": <br><br> Good Day! <br><br>\n Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". <br><br>\n To confirm the meeting, please copy the link below and paste it into your browser’s address bar. <br><br>\".base_url('login').\" <br><br>Please disregard this message if you already complied.\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n if($host_info->MOBILE_NO <> 0) {\n $this->sms->send( array('mobile' => $host_info->MOBILE_NO, 'message' => $sms_message) );\n }\n\n if($host_info->EMAIL_ADDRESS) {\n $this->send_email($host_info->EMAIL_ADDRESS, 'ETS – VISITOR’S MEETING CONFIRMATION', $email_message);\n }\n\n }\n }\n\n\n\n \n }", "public function runNotifications():void;", "public function accept_all()\n {\n $ids = $_POST['ids'];\n foreach ($ids as $id) {\n $accepted = EventMobile::find($id);\n $accepted->update(['event_status_id' => 2]);\n $accepted->save();\n //Notify Each event owner\n $event_owner = $accepted->user;\n if ($event_owner) {\n $notification_message['en'] = 'YOUR EVENT IS APPROVED';\n $notification_message['ar'] = 'تم الموافقة على الحدث';\n $notification = $this->NotifcationService->save_notification($notification_message, 3, 4, $accepted->id, $event_owner->id);\n $this->NotifcationService->PushToSingleUser($event_owner, $notification);\n }\n //get users have this event in their interests\n $this->NotifcationService->EventInterestsPush($accepted);\n }\n\n }", "protected function sendNotification(){\n\t\t$events = Event::getEvents(0);\n\t\t\n\t\t\n\t\tforeach($events as $event)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$eventType = $event['eventType'];\n\t\t\t$message = '';\n\t\t\n\t\t\t//notify followers\n\t\t\tif($eventType == Event::POST_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' added a new post.';\n\t\t\telse if($eventType == Event::POST_LIKED)\n\t\t\t\t$message = $event['raiserName'] . ' liked a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t$message = $event['raiserName'] . ' flagged a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t$message = $event['raiserName'] . ' commented on a post of ' . $event['relatedUserName'];\n\t\t\telse if($eventType == Event::RESTAURANT_MARKED_FAVOURITE)\n\t\t\t\t$message = $event['raiserName'] . ' marked a restaurant as favourite.';\n\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t$message = $event['raiserName'] . ' is now following ' . $event['relatedUserName'];\n\t\t\n\t\t\tif(!empty($message))\n\t\t\t{\n\t\t\t\t//fetch all followers of the event raiser or related user\n\t\t\t\t$sql = Follower::getQueryForFollower($event['raiserId']);\n\t\t\n\t\t\t\tif($event['relatedUserId'])\n\t\t\t\t\t$sql .= ' OR f.followedUserId =' . $event['relatedUserId'];\n\t\t\n// \t\t\t\t$followers = Yii::app()->db->createCommand($sql)->queryAll(true);\n// \t\t\t\tforeach($followers as $follower)\n// \t\t\t\t{\n// \t\t\t\t\tif($follower['id'] != $event['raiserId'] && $follower['id'] != $event['relatedUserId'])\n// \t\t\t\t\t{\n// // \t\t\t\t\t\t$did = Notification::saveNotification($follower['id'], Notification::NOTIFICATION_GROUP_WORLD, $message, $event['id']);\n// // \t\t\t\t\t\terror_log('DID : => '.$did);\n// \t\t\t\t\t\t//send push notification\n// \t\t\t\t\t\t/**----- commented as no followers will be notified, as suggested by the client\n// \t\t\t\t\t\t$session = Session::model()->findByAttributes(array('deviceToken'=>$follower['deviceToken']));\n// \t\t\t\t\t\tif($session)\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t$session->deviceBadge += 1;\n// \t\t\t\t\t\t$session->save();\n// \t\t\t\t\t\tsendApnsNotification($follower['deviceToken'], $message, $follower['deviceBadge']);\n// \t\t\t\t\t\t}\n// \t\t\t\t\t\t*****/\n// \t\t\t\t\t}\n// \t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//notify the related user\n\t\t\tif($event['relatedUserId'] && $event['relatedUserId'] != $event['raiserId'])\n\t\t\t{\n\t\t\t\tif($eventType == Event::POST_LIKED)\n\t\t\t\t\t$message = $event['raiserName'] . ' liked your post.';\n\t\t\t\telse if($eventType == Event::POST_FLAGGED)\n\t\t\t\t\t$message = $event['raiserName'] . ' flagged your post.';\n\t\t\t\telse if($eventType == Event::COMMENT_CREATED)\n\t\t\t\t\t$message = $event['raiserName'] . ' commented on your post.';\n\t\t\t\telse if($eventType == Event::USER_FOLLOWED)\n\t\t\t\t\t$message = $event['raiserName'] . ' is now following you.';\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_COMMENT){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a comment.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\telse if($eventType == Event::USER_MENTIONED_POST){\n\t\t\t\t\t$message = $event['raiserName'] . ' mentioned you in a post.';\n// \t\t\t\t\t$eventType = Event::COMMENT_CREATED;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($message))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\t\t\t\t\t$session = Session::model()->findByAttributes(array('userId'=>$event['relatedUserId']));\n// \t\t\t\t\terror_log('SESSION_LOG : '. print_r( $session, true ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!is_null($session) && !empty($session) && $session->deviceToken)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$notifyData = array(\n// \t\t\t\t\t\t\t\t\"id\" => $notfyId,\n// \t\t\t\t\t\t\t\t\"receiverId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"notificationGroup\" => Notification::NOTIFICATION_GROUP_YOU,\n\t\t\t\t\t\t\t\t\"alert\" => $message,\n// \t\t\t\t\t\t\t\t\"eventId\" => $event['id'],\n// \t\t\t\t\t\t\t\t\"isSeen\" => \"0\",\n\t\t\t\t\t\t\t\t\"eventType\" => $eventType,\n// \t\t\t\t\t\t\t\t\"raiserId\" => $event['raiserId'],\n// \t\t\t\t\t\t\t\t\"raiserName\" => $event['raiserName'],\n// \t\t\t\t\t\t\t\t\"relatedUserId\" => $event['relatedUserId'],\n// \t\t\t\t\t\t\t\t\"relatedUserName\" => $event['relatedUserName'],\n\t\t\t\t\t\t\t\t\"elementId\" => $event['elementId'],\n\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n// \t\t\t\t\t\t\t\t\"isNotified\" => $event['isNotified'],\n\t\t\t\t\t\t\t\t'badge' => $session->deviceBadge,\n\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo 'Notify Data : ';\n// \t\t\t\t\t\tprint_r($notifyData);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$session->deviceBadge += 1;\n\t\t\t\t\t\t$session->save();\n\t\t\t\t\t\tsendApnsNotification($session->deviceToken, $message, $session->deviceBadge, $notifyData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}elseif( isset($event['message']) && $event['message'] !=null){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$devices = array();\n\t\t\t\t$sql = 'SELECT id, deviceToken, deviceBadge from session where role=\"manager\"';\n\t\t\t\t\n\t\t\t $rows = Yii::app()->db->createCommand($sql)->queryAll(true);\n\t\t \t$chunk=1;\t\t \n\t\t \n\t\t\t\tforeach ($rows as $row){\n\t\t\t\t\t$devices[] = array(\n\t\t\t\t\t\t\t'deviceToken'=>$row['deviceToken'],\n\t\t\t\t\t\t\t'notifyData' => array('aps'=> array(\n\t\t\t\t\t\t\t\t\t\"alert\" => $event['message'],\n\t\t\t\t\t\t\t\t\t\"eventType\" => $event['eventType'],\n\t\t\t\t\t\t\t\t\t\"elementId\" => $event['id'],\n\t\t\t\t\t\t\t\t\t\"eventDate\" => $event['eventDate'],\n\t\t\t\t\t\t\t\t\t'badge' => $row['deviceBadge'],\n\t\t\t\t\t\t\t\t\t'sound' => 'default'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif($chunk > 4){\n\t\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\t\t$chunk=1;\n\t\t\t\t\t\t$devices = array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$chunk++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($devices)){\n\t\t\t\t\techo 'Sending...'.date(DATE_RFC850).\"\\n\";\n\t\t\t\t\tsendApnsNotification($devices, '');\n\t\t\t\t\techo 'done '.date(DATE_RFC850).\"\\n\";\n\t\t\t\t}\n// \t\t\t\t$notfyId = Notification::saveNotification($event['relatedUserId'], Notification::NOTIFICATION_GROUP_YOU, $message, $event['id']);\n\n// \t\t\t\t$insertSql = 'INSERT into notification (receiverId, notificationGroup, message, eventId) (select id, \"1\", \"'.$event['message'].'\", '.$event['id'].' from user where isDisabled = 0 and role=\"manager\")';\n// \t\t\t\tYii::app()->db->createCommand($insertSql)->query();\n\t\t\t\t\n\t\t\t}\n\t\t\tEvent::model()->updateByPk($event['id'], array('isNotified'=>1));\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function notifyRSVPRegistered( $data )\n {\n $subject = \"Event Manager - RSVP Registered\";\n\n $msg = '\n <img src=\"http://' . $_SERVER['HTTP_HOST'] . '/images/event.png\" width=\"200\" height=\"200\" alt=\"Event Manager Banner\"/>\n\n <br><br>\n Hello ' . $data['Eid'] . ',\n\n <br><br>\n We have received your RSVP on ' . date(\"m/d/Y\") . ' through the event management platform.\n\n <br><br>\n\n <hr>\n\n <br>\n\n <table>\n <tr>\n <td colspan=\"2\">\n Reservation Information\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n ---------------------------------------------------------\n </td>\n </tr>\n <tr>\n <td width=\"50%\">\n Your EID:\n </td>\n <td width=\"50%\">' .\n $data['Eid'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Name:\n </td>\n <td>' .\n $data['Name'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Date:\n </td>\n <td>' .\n $data['Date'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Location:\n </td>\n <td>' .\n $data['Location'] . '\n </td>\n </tr>\n </table>\n\n <br><br>\n\n An iCal has been attached for your convenience, please use it to add a reminder to your calendar.\n\n <br><br>\n\n Thank you,\n <br>\n Event Manager<br><br>';\n\n return $this->sendEmail( array( \"subject\"=>$subject, \"msg\"=>$msg, \"email\"=>$data['Email'], \"name\"=>$data['Eid'], \"iCal\"=>$data['iCal'] ) );\n }", "public function reminders()\r\n {\r\n $this->CI->db->where('rel_id', $this->leadId);\r\n $this->CI->db->where('rel_type', 'lead');\r\n $this->CI->db->where('staff', $this->staffId);\r\n $this->CI->db->where('isnotified', 0);\r\n\r\n return $this->CI->db->count_all_results('reminders');\r\n }", "public function remind(Request $request)\n {\n $request->validate([\n 'term_id' => 'required|string|exists:terms,id',\n ]);\n\n $term = Term::find($request->input('term_id'));\n if (! $term->applications_close) {\n // The term MUST have an Applications Close date set.\n // Otherwise, emails will have issues rendering.\n abort(400, 'This term has not been fully configured. Please set an application closure date in the term settings.');\n }\n\n $shows = $term->shows()->where('submitted', false)->with('hosts')->get();\n\n foreach ($shows as $show) {\n if ($show->hosts->count > 0) {\n Mail::to($show->hosts)->queue(new ShowReminder($show));\n }\n }\n }", "protected function respondToAppointment($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_response'] == '' || $args['ent_pas_email'] == '' || $args['ent_book_type'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $patData = $this->_getEntityDet($args['ent_pas_email'], '2');\n\n $oneHourBefore = date('Y-m-d H:i:s', strtotime('-1 hour', strtotime($args['ent_appnt_dt'])));\n\n if ($args['ent_book_type'] == '1')\n $checkApptStr = \" and appointment_dt between ('\" . $oneHourBefore . \"' and '\" . $args['ent_appnt_dt'] . \"')\";\n else\n $checkApptStr = \" and appointment_dt = '\" . $args['ent_appnt_dt'] . \"'\";\n\n $getApptDetQry = \"select status from appointment where mas_id = '\" . $this->User['entityId'] . \"' and status = '2'\" . $checkApptStr;\n\n if (mysql_num_rows(mysql_query($getApptDetQry, $this->db->conn)) > 0)\n return $this->_getStatusMessage(60, 60);\n\n $getApptDetQry = \"select status, appt_type from appointment where mas_id = '\" . $this->User['entityId'] . \"' and appointment_dt = '\" . $args['ent_appnt_dt'] . \"' and slave_id = '\" . $patData['slave_id'] . \"' order by appointment_id DESC\";\n $apptDet = mysql_fetch_assoc(mysql_query($getApptDetQry, $this->db->conn));\n\n if ($apptDet['status'] == '4')\n return $this->_getStatusMessage(41, 3);\n\n if ($apptDet['status'] == '10')\n return $this->_getStatusMessage(72, 72);\n\n if ($apptDet['status'] > '1')\n return $this->_getStatusMessage(40, 40);\n\n $updateString = '';\n\n// if ($args['ent_book_type'] == '1')\n// $updateString = \", appointment_dt = '\" . $this->curr_date_time . \"'\";\n\n $updateResponseQry = \"update appointment set status = '\" . $args['ent_response'] . \"'\" . $updateString . \" where mas_id = '\" . $this->User['entityId'] . \"' and slave_id = '\" . $patData['slave_id'] . \"' and appointment_dt = '\" . $args['ent_appnt_dt'] . \"' and status = 1\";\n mysql_query($updateResponseQry, $this->db->conn);\n\n if (mysql_affected_rows() <= 0)\n return $this->_getStatusMessage(102, $updateResponseQry);\n\n// if ($args['ent_response'] == '2') {\n// $notifType = 2;\n// $message = \"Your appointment with \" . $this->User['firstName'] . \" is confirmed for \" . date('m/d/Y h:i a', strtotime($args['ent_appnt_dt'])) . \" on \" . $this->appName . \"!\";\n// } else {\n// $notifType = 10;\n// $message = \"Your appointment with \" . $this->User['firstName'] . \" is rejected for \" . date('m/d/Y h:i a', strtotime($args['ent_appnt_dt'])) . \" on \" . $this->appName . \"!\";\n// }\n\n if ($args['ent_book_type'] == '1' && $args['ent_response'] == '2') {\n// $deleteAllSessionsQry = \"update master set status = '5' where mas_id = '\" . $this->User['entityId'] . \"'\";\n// mysql_query($deleteAllSessionsQry, $this->db->conn);\n// if (mysql_affected_rows() < 0)\n// return $this->_getStatusMessage(70, $deleteAllSessionsQry);\n\n $location = $this->mongo->selectCollection('location');\n\n $location->update(array('user' => (int) $this->User['entityId']), array('$set' => array('status' => 4)));\n } else if ($args['ent_book_type'] == '2' && $args['ent_response'] == '2') {\n \n }\n\n// $this->ios_cert_path = $this->ios_roadyo_pas;\n// $this->ios_cert_pwd = $this->ios_pas_pwd;\n// $aplPushContent = array('alert' => $message, 'nt' => $notifType, 'sname' => $this->User['firstName'], 'dt' => $this->curr_date_time, 'sound' => 'default');\n// $andrPushContent = array(\"payload\" => $message, 'action' => $notifType, 'sname' => $this->User['firstName'], 'dt' => $this->curr_date_time);\n// $pushNum = $this->_sendPush($this->User['entityId'], array($patData['slave_id']), $message, '2', $this->User['firstName'], $this->curr_date_time, '2', $aplPushContent, $andrPushContent);\n\n return $this->_getStatusMessage(40, 40);\n }", "public function broadcastOn()\n {\n return ['appointmentCancelled'];\n }", "public function sendReminder()\n {\n $token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTU4MDU1OTc5OCwiZXhwIjo0MTAyNDQ0ODAwLCJ1aWQiOjc3MTA4LCJyb2xlcyI6WyJST0xFX1VTRVIiXX0.0itAev15AZH70jnynEZbqL5K0Z_YQe-Kvp1m5MZ_Ij0\";\n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n\n $accountsdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date = CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n $accountsoverdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date < CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n foreach($accountsdue as $key => $account){\n \n $smsBody= $currentTime . \" \" . $account->account_number . \"/\" . $account->account_name . \". Your account is due today.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody;\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n \n //\n }\n\n foreach($accountsoverdue as $key => $account){\n \n $smsBody= $account->account_number . \"/\" . $account->account_name . \". Your account is overdue.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody . \" \";\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n }\n }", "public function toMail($notifiable)\n {\n $currentDateTime = Carbon::now();\n $newDateTime = date_add($currentDateTime, date_interval_create_from_date_string(\"5 days\"));\n return (new MailMessage)\n ->line(\n 'We`re thrilled to have you abroad.\n Please come to the office at 12 Darling Road on '.date_format($newDateTime, 'Y-m-d').'. We are open 24 hrs ')\n ->line('Your Loan '.$this->loan->name.'We looking forward to see you')\n ->action('Not Sure Choose Again!', route('display.loans'))\n ->line('Thank you for using our application!');\n }", "public function viewappointments(){\n $appointments_table = TableRegistry::get('Appointments');\n $appointments = $appointments_table->find()->contain(['Users','Patients'])->order(['appointment_date'=>'DESC']);\n $this->set('appointments', $appointments);\n $this->viewBuilder()->setLayout('backend');\n }", "public function handle()\n {\n \tLog::info(\"<//------------------- AppointmentReminder -------------------> \");\n \t\n\t\t$results = DB::select ( DB::raw ( \"SELECT a103_name, a103_lastname, a102_name, a102_lastname,\n\t\t\t\t\t\t a103_email, a114_startdate, a114_starttime, a102_email, a016_name\n\t\t\t\t\tFROM t114_appointment\n\t\t\t\t\tINNER JOIN t103_prospect ON ( a114_prospectid = a103_id ) \n\t\t\t\t\tINNER JOIN t102_associate ON ( a102_id = a114_associateid ) \n\t\t\t\t\tINNER JOIN t016_appointment_location ON ( a016_id = a114_locationid ) \n\t\t\t\t\tWHERE DATE( a114_startdate ) = ( CURDATE( ) + INTERVAL 1 DAY ) \n\t\t\t\t\tAND a114_companyid = 69 \") ); //( SELECT 1 FROM dual )\n\t\t\t\t\n\t\tLog::info(\" There were found \". count($results). \" appointments \");\n\t\t\n\t\t$contEmail = 0;\n\t\tforeach ($results as $appointment) {\n\t\t\t\n\t\t\t/*$arrayEmail = [];\t\n\t\t\t$arrayEmail[] += $appointment->a102_email;\n\t\t\t*/\n\t\t\t$associateName = $appointment->a102_name . \" \" . $appointment->a102_lastname;;\n\t\t\t$prospectName = $appointment->a103_name . ' '. $appointment->a103_lastname;\n\t\t\t\n\t\t\t/*if($appointment->a103_email != \"\")\n\t\t\t{\n\t\t\t\t/*$arrayEmail[][0] += $appointment->a103_email;\n\t\t\t\t$arrayEmail[][1] += $prospectName;\n\t\t\t\t\n\t\t\t\t//add message to cance\n\t\t\t\t//Please feel free to call ys with any needed changes.\n\t\t\t\t//If you have any question regarding your appointment, please call\t\t\t\t \n\t\t\t}*/\n\t\t\t\n\t\t\t$emailContent = array(\n\t\t\t\t\t'name' => $appointment->a103_name . ' '. $appointment->a103_lastname,\n\t\t\t\t\t'associate' => $associateName,\n\t\t\t\t\t'time' => Util::getTimeFormat( $appointment->a114_starttime),\n\t\t\t\t\t'location' => $appointment->a016_name, \n\t\t\t\t\t'date' => Util::getStringFormat2($appointment->a114_startdate));\n\t\t\t\n\t\t\t$email = $appointment->a102_email;\n\t\t\t\n\t\t\t$contEmail += Mail::send('emails.app-remainder',\n\t\t\t\t\t$emailContent,\n\t\t\t\t\tfunction ($message) use ($email, $associateName)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message->to($email, $associateName);\n\t\t\t\t\t\t$message->bcc(\"[email protected]\", \"Admin\");\n\t\t\t\t\t\t$message->subject('You have an appointment!');\n\t\t\t\t\t}\n\t\t\t);\n\t\t}\n\t\t\n\t\tLog::info(\" There were sent \". $contEmail. \" emails \");\n\t\t\n\t\tLog::info(\"<------------------- AppointmentReminder -------------------//> \");\n }", "public function cron(){\n\n $servers = $this->getServers();\n $emails = Notification::all();\n \n foreach ($servers as $server){\n //Get the server metrics and thresholds\n $this->getServerThresholds( $server ); \n\n $msg = \"\";\n\n if( isset($server->warnings) && count($server->warnings) > 0 ){\n // Got the message\n foreach( $server->warnings as $warning){\n $msg[] = $warning ;\n }\n //Store the notification\n //Save notification on messages table\n $this->storeServerNotifications($msg, $server->id);\n \n //Get the users for notification\n foreach( $emails as $item){\n $user = User::where('email', $item->email )->first();\n $user->notify( new ServerThresholdReached( $msg ) ); \n }\n \n }\n\n //echo $server->name . \" / \" . implode(\",\",$msg) . \"<br/>\"; \n //Notify users of the issue \n }\n }", "function main() {\r\n $restaurants_list = getOrders();\r\n \r\n \r\n if ( count($restaurants_list) > 0 ) {\r\n \r\n //POPULATE RESTAURANTS WITH DATA (EMAIL, FAX, WHATSAPP)\r\n $ready_restaurants_list = populateWithData($restaurants_list);\r\n \r\n //SEND MESSAGES TO EVERY RESTAURANT FROM THE ARRAY $ready_restaurants_list\r\n sendMessages($ready_restaurants_list, TEST_MODE);\r\n \r\n echo '<pre>'; var_dump($ready_restaurants_list); echo '</pre>';\r\n } else {\r\n echo \"No orders for the last 24h.\";\r\n }\r\n}", "public function actionNoActivity(){\n $message = new YiiMailMessage;\n $message->view = 'system';\n $message->from = Yii::app()->params['noreplyEmail']; \n \n $users = User::model()->findAll(\"(lastvisit_at + INTERVAL 2 MONTH) < CURDATE() AND newsletter=1\");\n $c = 0;\n foreach ($users as $user){\n $lastvisit_at = strtotime($user->lastvisit_at);\n\n if ($lastvisit_at < strtotime('-1 year')) continue; // we give up after a year\n //if ($lastvisit_at > strtotime('-2 month')) continue; // don't notify before inactive for 2 months\n \n if (!\n (($lastvisit_at >= strtotime('-3 month')) || \n (($lastvisit_at >= strtotime('-7 month')) && ($lastvisit_at < strtotime('-6 month'))) || \n (($lastvisit_at >= strtotime('-12 month')) && ($lastvisit_at < strtotime('-11 month'))) )\n ) continue;\n \n//set mail tracking\n $mailTracking = mailTrackingCode($user->id);\n $ml = new MailLog();\n $ml->tracking_code = mailTrackingCodeDecode($mailTracking);\n $ml->type = 'no-activity-reminder';\n $ml->user_to_id = $user->id;\n $ml->save();\n \n $message->subject = $user->name.\" did you forget about us?\";\n \n //$activation_url = '<a href=\"'.absoluteURL().\"/user/registration?id=\".$user->key.'\">Register here</a>';\n //\n //$activation_url = mailButton(\"Register here\", absoluteURL().\"/user/registration?id=\".$user->key,'success',$mailTracking,'register-button');\n $content = \"Since your last visit we got some awesome new \".mailButton('projects', absoluteURL().'/project/discover','link', $mailTracking,'projects-button').\" and interesting \".\n mailButton('people', absoluteURL().'/person/discover','link', $mailTracking,'people-button').\" signup at Cofinder.\n <br /><br />\n Why don't you check them out on \".mailButton('Cofinder', 'http://www.cofinder.eu','success', $mailTracking,'cofinder-button');\n \n $message->setBody(array(\"content\"=>$content,\"email\"=>$user->email,\"tc\"=>$mailTracking), 'text/html');\n $message->setTo($user->email);\n Yii::app()->mail->send($message);\n $c++;\n }\n \n Slack::message(\"CRON >> No activity reminders: \".$c);\n }", "public function getCustomersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved'\n AND a.notifyParticipants = 1 AND\n a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function notify()\n {\n /*$data = DB::select(DB::raw(\"SELECT license_type_id from `license_type_vehicle` where CURDATE()+INTERVAL 31 DAY =`license_end_on`\"));\n if(!empty($result)) {\n $data = array('license_type_id' => ,$result->license_type_id, 'vehicle_id' => $result->vehicle_id, '' );\n }\n DB::table('users')->insert([\n ['email' => '[email protected]', 'votes' => 0],\n ['email' => '[email protected]', 'votes' => 0]\n ]);*/\n $results = DB::table('license_type_vehicle')\n ->join('vehicles', 'vehicles.id', '=', 'license_type_vehicle.vehicle_id') \n ->select('license_type_vehicle.license_type_id', 'license_type_vehicle.vehicle_id','vehicles.client_id')\n ->where( 'license_type_vehicle.license_end_on', '=','CURDATE()+INTERVAL 30 DAY')\n ->get();\n print_r($results);\n /* Mail::send('emails.welcome', ['key' => 'value'], function($message)\n {\n $message->to('[email protected]', 'John Smith')->subject('Welcome!');\n });*/\n \n }", "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function onValidateAppointments() {\nglobal $_LW;\nif (!empty($_LW->save_data['title'])) { // format title\n\t$_LW->save_data['title']=rawurldecode($_LW->save_data['title']); // decode title\n\t$_LW->save_data['title']=preg_replace('~[^a-zA-Z0-9 \\-\\.,&;:\\'\"“”‘’]~', '', $_LW->save_data['title']); // strip disallowed chars from title\n\t$_LW->save_data['title']=preg_replace('~&([^\\s])|&$~', '\\\\1', $_LW->save_data['title']); // force amps to be followed by a space\n\t$_LW->save_data['title']=$_LW->setFormatSanitize($_LW->save_data['title']); // sanitize title\n\t$_LW->save_data['title']=str_replace(['’', '”', '‘', '“'], [\"'\", '\"', \"'\", '\"'], $_LW->save_data['title']); // convert smart quotes\n\tif ($_LW->save_mode=='update') { // if updating appointment\n\t\tif ($_LW->dbo->query('select', '1', 'livewhale_appointments', 'id!='.(int)$_LW->save_id.' AND title='.$_LW->escape($_LW->save_data['title']))->exists()->run()) { // if there is already an appointment slot by that name\n\t\t\t$_LW->REGISTERED_MESSAGES['failure'][]='An appointment slot by that name already exists.';\n\t\t};\n\t}\n\telse if ($_LW->save_mode=='create') { // else if creating appointment\n\t\tif ($_LW->dbo->query('select', '1', 'livewhale_appointments', 'title='.$_LW->escape($_LW->save_data['title']))->exists()->run()) { // if there is already an appointment slot by that name\n\t\t\t$_LW->REGISTERED_MESSAGES['failure'][]='An appointment slot by that name already exists.';\n\t\t};\n\t};\n};\n}", "public function run()\n {\n $freelunches = [\n ['reason' => 'Because I can.', 'from_id' => 2, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ['reason' => 'Because I can.', 'from_id' => 3, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ['reason' => 'Because I can.', 'from_id' => 2, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ['reason' => 'Because I can.', 'from_id' => 3, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ['reason' => 'Because I can.', 'from_id' => 2, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ['reason' => 'Because I can.', 'from_id' => 3, 'to_id' => 1, 'expires_at' => Carbon::tomorrow()],\n ];\n\n foreach ($freelunches as $freelunch) {\n Freelunch::create($freelunch);\n }\n }", "function update_event_notice($userId, $promotionId, $storeId, $attendStatus, $eventStatus, $scheduledTime, $baseUrl)\n\t{\n\t\tlog_message('debug', '_event/update_event_notice');\n\t\tlog_message('debug', '_event/update_event_notice:: [1] userId='.$userId.' promotionId='.$promotionId.' storeId='.$storeId.' attendStatus='.$attendStatus.' eventStatus='.$eventStatus.' scheduledTime='.json_encode($scheduledTime));\n $msg='';\n\n $status = $this->_query_reader->get_row_as_array('get_previous_attend_status',array(\n 'promotion_id'=>$promotionId,\n\t\t 'user_id'=>$userId\n ));\n\n log_message('debug', '_event/update_event_notice:: [2] status='.json_encode($status));\n\n $result = $this->_query_reader->run('add_promotion_notice',array(\n 'promotion_id'=>$promotionId,\n 'user_id'=>$userId,\n 'store_id'=>$storeId,\n 'attend_status'=>$attendStatus,\n 'event_status'=>$eventStatus\n ));\n\n # Get details of the event\n $eventDetails = $this->get_event_details($userId, $promotionId);\n $eventDetails = $eventDetails[0];\n log_message('debug', '_event/update_event_notice:: [3] eventDetails='.json_encode($eventDetails));\n\n # If user response maybe(pending) and need reservation then schedule two reminder to send out in the future\n\t\tif($attendStatus == 'pending' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'Y'){\n\n $templateVariables = array('storename'=>$eventDetails['store_name'],\n 'promotiontitle'=>$eventDetails['promotion_title'],\n 'eventlink'=>$baseUrl.\"c/\".encrypt_value($eventDetails['event_id'].\"--\".format_id($userId).\"--reserve\"));\n\n $template = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'first_event_reminder')\n ));\n log_message('debug', '_event/update_event_notice:: [4] template='.json_encode($template));\n\n $reminder1 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'schedule_send',\n \t\t\t\t\t\t'message'=>array(\n \t\t\t\t\t\t\t'senderType'=>'user',\n \t\t\t\t\t\t\t'sendToType'=>'list',\n \t\t\t\t\t\t\t'sendTo'=>array($userId),\n 'template'=>$template,\n 'templateId'=>$template['id'],\n \t\t\t\t\t\t\t'subject'=>$template['subject'],\n \t\t\t\t\t\t\t'body'=>$template['details'],\n 'sms'=>$template['sms'],\n \t\t\t\t\t\t\t'saveTemplate'=>'N',\n \t\t\t\t\t\t\t'scheduledSendDate'=>$scheduledTime[0],\n \t\t\t\t\t\t\t'sendDate'=>'',\n \t\t\t\t\t\t\t'methods'=>array(\"system\",\"email\",\"sms\"),\n 'templateVariables'=> $templateVariables\n \t\t\t\t\t\t),\n \t\t\t\t\t\t'userId'=>$userId,\n \t\t\t\t\t\t'organizationId'=>'',\n \t\t\t\t\t\t'organizationType'=>''\n \t\t\t));\n\n $template = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'second_event_reminder')\n ));\n log_message('debug', '_event/update_event_notice:: [5] template='.json_encode($template));\n\n $reminder2 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'schedule_send',\n \t\t\t\t\t\t'message'=>array(\n \t\t\t\t\t\t\t'senderType'=>'user',\n \t\t\t\t\t\t\t'sendToType'=>'list',\n \t\t\t\t\t\t\t'sendTo'=>array($userId),\n 'template'=>$template,\n 'templateId'=>$template['id'],\n \t\t\t\t\t\t\t'subject'=>$template['subject'],\n \t\t\t\t\t\t\t'body'=>$template['details'],\n 'sms'=>$template['sms'],\n \t\t\t\t\t\t\t'saveTemplate'=>'N',\n \t\t\t\t\t\t\t'scheduledSendDate'=>$scheduledTime[1],\n \t\t\t\t\t\t\t'sendDate'=>'',\n \t\t\t\t\t\t\t'methods'=>array(\"system\",\"email\",\"sms\"),\n 'templateVariables'=>$templateVariables\n \t\t\t\t\t\t),\n \t\t\t\t\t\t'userId'=>$userId,\n \t\t\t\t\t\t'organizationId'=>'',\n \t\t\t\t\t\t'organizationType'=>''\n \t\t\t));\n\n\t\t}\n\n # If the status was pending then delete the reminder messages\n if( $status['attend_status'] == 'pending' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'Y' && $result) {\n\n $template1 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'first_event_reminder')\n ));\n\n $template2 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'second_event_reminder')\n ));\n\n $result = $this->_query_reader->run('delete_reminder_messages',array(\n 'user_id'=>$userId,\n 'store_name'=>$eventDetails['store_name'],\n 'template_id'=>implode(\"','\", array($template1['id'],$template2['id']))\n ));\n\n # If the event doesn't need reservation then delete record if user change their mind to maybe or not going\n } else if ( $status['attend_status'] == 'confirmed' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'N' && $result){\n\n $result = $this->_query_reader->run('delete_reservation_record',array(\n 'user_id'=>$userId,\n 'promotion_id'=>$promotionId\n ));\n }\n\n\t\tlog_message('debug', '_event/update_event_notice:: [6] result='.json_encode($result));\n return array('result'=>(!empty($result) && $result? 'SUCCESS': 'FAIL'), 'msg'=>$msg);\n\t}", "public function action_index()\r\n {\r\n\t\t\\Package::load('email');\r\n\t\t$mode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : null;\r\n\r\n // getting current date\r\n\t\tdate_default_timezone_set('Asia/Ho_Chi_Minh');\r\n $cDate = date('Y-m-d');\r\n\r\n\t\tif ($mode === 'now'){\r\n\t\t\t$dataSet = Model_Publishdate::find(\r\n\t\t\tarray(\r\n\t\t\t\t\t'select' => array('*'),\r\n\t\t\t\t\t'where' => DB::expr(\"DATEDIFF(publish_date, now()) = 0 AND status = \" . Model_Publishdate::STATUS_CREATED)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\r\n\t\t\tif ($mode === 'now' && isset($dataSet))\r\n\t\t\t{\r\n\t\t\t\tforeach($dataSet as $publishData)\r\n\t\t\t\t{\r\n\t\t\t\t\t$luna = ($publishData->luna_date ? $publishData->luna_date : '');\r\n\r\n\t\t\t\t\t$dataMailing = array('email' => $publishData->email, 'luna' => $luna , 'message' => $publishData->message, 'token' => $publishData->token);\r\n\t\t\t\t\r\n\t\t\t\t\t$result = $this->cron_mail($dataMailing);\r\n\t\t\t\t\tif ($result == true){\r\n\t\t\t\t\t\t$publishData->set(array(\r\n\t\t\t\t\t\t\t'status' => Model_Publishdate::STATUS_PUPBLISHED,\r\n\t\t\t\t\t\t\t'run_date' => $cDate\r\n\t\t\t\t\t\t));\r\n\r\n\t\t\t\t\t\t$publishData->save();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }", "public function actionOrganizersAlert(){\n\t\t$startDate = new \\Datetime();\n\t\t$startDate->modify('next friday');\n\n\t\t\n\t\t$events = $this->getEvents( 9 , self::ALL_FILTER, $startDate );\n\t\t$events_per_email = array();\n\n \tforeach ($events as $event) {\n \t\t// var_dump($event);\n \t\t// Official creator of the event\n \t\tif( isset($event['email']) ){\n \t\t\t$email = $event['email'];\n \t\t\t$emails[ $email ] = $email;\n \t\t\t$events_per_email[$email][$event['id']] = $event;\n \t\t}\n \t\t\n \t\t// Mailto in the event\n \t\tif( isset($event['description']) ){\n \t\t\t$event_html = $event['description'];\n \t\t\t// preg_match_all(\"#mailto:([a-z0-9\\.\\-\\_]*@[a-z0-9\\.\\_\\-]*)#\",$event_html,$matches1,PREG_SET_ORDER);\n\t\t\t\tpreg_match_all('/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i',$event_html,$matches,PREG_SET_ORDER);\n\n\t\t\t\tif($matches){\n\t\t\t\t\tforeach($matches as $match){\n\t\t\t\t\t\t$email = $match[0];\n\t\t\t\t\t\tif( strlen($email) > 5 ){\n\t\t\t\t\t\t\t$emails[$email] = $email;\n\t\t\t\t\t\t\t$events_per_email[$email][$event['id']] = $event;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n \t\t\n \t}\n\n\n \t$emails = array_filter( $emails , function($email){\n \t\t$excludes = array( '[email protected]' , '[email protected]', '[email protected]', '[email protected]');\n \t\tif( !in_array( $email, $excludes ) ){\n \t\t\treturn true;\n \t\t}\n \t\treturn false;\n \t} );\n\n \tvar_dump(array_values($emails));\n \t// die();\n \tforeach ($emails as $email) {\n \t\tYii::$app->mailer->compose('alert',[ 'events' => $events_per_email[$email]])\n\t ->setFrom('[email protected]')\n\t ->setBcc('[email protected]')\n\t \t->setTo($email)\n\t ->setSubject('Milonga.be : please check your events')\n\t ->send();\n \t}\n\t}", "public function show(PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }", "function findAppointmentsDue(){\n\t$db = dbConnect();\n\n\t$sql = \"SELECT id FROM Appointment WHERE start_date > date_add(NOW(),INTERVAL 15 MINUTE) AND start_date <= date_add(NOW(),INTERVAL 30 MINUTE) AND status = 2 AND (type = 0 OR type = 1)\";\n\n\t$results = $db->query($sql);\n\n\treturn $results;\n}", "public function todayBirthday_notification() {\n $this->layout = 'front_end';\n $todayDate = date('Y-m-d');\n $users = $this->User->userList();\n foreach ($users as $value) {\n $userEmail= $value['User']['email'];\n $userName= $value['User']['first_name'];\n $birthdaydata = $this->User->userBirthday($todayDate);\n foreach ($birthdaydata as $birthdayvalue) {\n $birthday_boy_name= $birthdayvalue['User']['name'];\n $url = Router::url(array(\n 'controller' => 'users',\n 'action' => 'login', ), true);\n $dataArry = array('birthday_boy_name'=>$birthday_boy_name,\n 'user_name'=>$userName,\n 'url'=>$url, );\n if ($userName != $publisher_name) {\n $Email = new Email();\n $send = $Email->sendEmail($userEmail, 'Birthday Notification', 'today_birthday_notification', $dataArry);\n }\n }\n }\n }", "public function testSaveAppointment()\r\n\t{\r\n\t\t// Set testing timezone\r\n\t\t$cur_tz = date_default_timezone_get();\r\n\t\tdate_default_timezone_set('America/Los_Angeles'); // -8\r\n\r\n\t\t$app = new SyncAppointment();\r\n\t\t$app->timezone = base64_encode($this->backend->getSyncBlobFromTZ(TimezoneUtil::GetFullTZ()));\r\n\t\t$app->starttime = strtotime(\"1/1/2011 11:11 AM\");\r\n\t\t$app->endtime = strtotime(\"1/1/2011 12:11 PM\");\r\n\t\t$app->subject = \"New async unit test event\";\r\n\t\t$app->uid = 'unittestevnt1';\r\n\t\t$app->location = 'My House';\r\n\t\t$app->recurrence = new SyncRecurrence();\r\n\t\t$app->alldayevent = null;\r\n\t\t//$app->reminder = null;\r\n\t\t//$app->attendees = null;\r\n\t\t$app->body = \"Notes here\";\r\n\t\t//$app->exceptions = null;\r\n\t\t$app->recurrence->type = 1; // weekly\r\n\t\t$app->recurrence->interval = 1; // Every week\r\n\t\t$app->recurrence->dayofweek = $app->recurrence->dayofweek | WEEKDAY_WEDNESDAY; // Every wednesday\r\n\t\t$app->recurrence->until = strtotime(\"3/1/2011\");\r\n\r\n\t\t$obj = $this->backend->saveAppointment(\"\", $app);\r\n\t\t$eid = $obj->id;\r\n\r\n\t\t// Test timezone by making the local timezone New York +3 hours\r\n\t\tdate_default_timezone_set('America/New_York'); // -5\r\n\r\n\t\t// Make sure we have a new event id\r\n $this->assertTrue(is_numeric($eid) && $eid > 0);\r\n\r\n\t\t// Test stat\r\n\t\t//$stat = $this->backend->StatMessage(\"calendar_root\", $eid);\r\n\t\t//$this->assertEquals($stat['id'], $eid);\r\n\r\n\t\t// Make sure backend had fully populated contact\r\n\t\t$obj = new CAntObject_CalendarEvent($this->dbh, $eid, $this->user);\r\n\t\t$this->assertEquals($obj->getValue(\"name\"), $app->subject);\r\n\t\t// Because we changed timezones, the times should be 3 hours later in EST\r\n\t\t$this->assertEquals(strtotime($obj->getValue(\"ts_start\")), strtotime(\"01/01/2011 02:11 pm\"));\r\n\t\t$this->assertEquals(strtotime($obj->getValue(\"ts_end\")), strtotime(\"01/01/2011 03:11 pm\"));\r\n\r\n\t\t// Check recurrence\r\n\t\t$recur = $obj->getRecurrencePattern();\r\n\t\t$this->assertEquals($recur->type, RECUR_WEEKLY);\r\n\t\t$this->assertEquals(strtotime($recur->dateEnd), strtotime(\"3/1/2011\"));\r\n\t\t$this->assertEquals($recur->dayOfWeekMask, WEEKDAY_WEDNESDAY);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t\tdate_default_timezone_set($cur_tz);\r\n }", "public function index()\r\n {\r\n if (!auth()->user()->can('send_notification')) {\r\n abort(403, 'Unauthorized action.');\r\n }\r\n\r\n $business_id = request()->session()->get('user.business_id');\r\n\r\n $customer_notifications = NotificationTemplate::customerNotifications();\r\n\r\n $module_customer_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'customer']);\r\n\r\n if (!empty($module_customer_notifications)) {\r\n foreach ($module_customer_notifications as $module_customer_notification) {\r\n $customer_notifications = array_merge($customer_notifications, $module_customer_notification);\r\n }\r\n }\r\n\r\n foreach ($customer_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $customer_notifications[$key]['subject'] = $notification_template['subject'];\r\n $customer_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $customer_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $customer_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $customer_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $supplier_notifications = NotificationTemplate::supplierNotifications();\r\n\r\n $module_supplier_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'supplier']);\r\n\r\n if (!empty($module_supplier_notifications)) {\r\n foreach ($module_supplier_notifications as $module_supplier_notification) {\r\n $supplier_notifications = array_merge($supplier_notifications, $module_supplier_notification);\r\n }\r\n }\r\n\r\n foreach ($supplier_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $supplier_notifications[$key]['subject'] = $notification_template['subject'];\r\n $supplier_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $supplier_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $supplier_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $supplier_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n\r\n $business_notifications = NotificationTemplate::businessNotifications();\r\n\r\n $module_business_notifications = $this->moduleUtil->getModuleData('notification_list', ['notification_for' => 'business']);\r\n\r\n if (!empty($module_business_notifications)) {\r\n foreach ($module_business_notifications as $module_business_notification) {\r\n $business_notifications = array_merge($business_notifications, $module_business_notification);\r\n }\r\n }\r\n\r\n foreach ($business_notifications as $key => $value) {\r\n $notification_template = NotificationTemplate::getTemplate($business_id, $key);\r\n $business_notifications[$key]['subject'] = $notification_template['subject'];\r\n $business_notifications[$key]['email_body'] = $notification_template['email_body'];\r\n $business_notifications[$key]['sms_body'] = $notification_template['sms_body'];\r\n $business_notifications[$key]['auto_send'] = $notification_template['auto_send'];\r\n $business_notifications[$key]['auto_send_sms'] = $notification_template['auto_send_sms'];\r\n }\r\n\r\n $tags = NotificationTemplate::notificationTags();\r\n\r\n return view('notification_template.index')\r\n ->with(compact('customer_notifications', 'supplier_notifications', 'business_notifications', 'tags'));\r\n }", "function get_appointment_times($db, $appointments) {\n $unavailable_times = array();\n $available_times = array();\n foreach ($appointments as $appointment) {\n array_push($unavailable_times, date(\"Y-m-d H:i:s\", strtotime($appointment['appt_time'])));\n }\n foreach ($unavailable_times as $unavailable_time) {\n $possible_time = date(\"Y-m-d H:i:s\", strtotime($unavailable_time . \"+1 hour\"));\n if (!in_array($possible_time, $unavailable_times)) {\n array_push($available_times, $possible_time);\n }\n }\n return $available_times;\n}", "function send_second_reminder()\n\t{\n\t\tlog_message('debug', '_message_cron/send_second_reminder');\n\t\t# get non-responsive invites that are more than FIRST_INVITE_PERIOD days old\n\t\t$list = $this->_query_reader->get_list('get_non_responsive_invitations', array('days_old'=>SECOND_INVITE_PERIOD, 'limit_text'=>' LIMIT '.MAXIMUM_INVITE_BATCH_LIMIT, 'old_message_code'=>'first_reminder_to_join_clout'));\n\t\tlog_message('debug', '_message_cron/send_second_reminder:: [1] list='.json_encode($list));\n\t\t# check if the user has the limit rule applying to them\n\t\t$results = array();\n\t\tforeach($list AS $i=>$row){\n\t\t\t$results[$i] = $this->_query_reader->run('resend_old_invite', array('invite_id'=>$row['invite_id'], 'new_code'=>'second_reminder_to_join_clout', 'new_status'=>'pending'));\n\t\t}\n\t\tlog_message('debug', '_message_cron/send_second_reminder:: [2] results='.json_encode($results));\n\t\tif(empty($results)) $reason = 'no-users';\n\t\n\t\treturn array('result'=>(get_decision($results)? 'SUCCESS': 'FAIL'), 'count'=>count($results), 'reason'=>$reason);\n\t}", "public function events()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n // Gets all appointments from the school\n $user = Sentry::getUser();\n\n // Check if user is superAdmin\n if ($user->hasAccess('school')) {\n $appointments = Appointment::get()->load('group.school')->toArray();\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(\n Input::get('callback')\n ); //return View::make('calendar.events');\n\n } else {\n // If user is not superAdmin, show groups based on the school of the logged in user\n $user->load('school.groups.appointments.group.school');\n $appointments = [];\n\n // Loop through groups to get all appointments\n foreach ($user->school->groups as $group) {\n foreach ($group->appointments as $appointment) {\n array_push($appointments, $appointment);\n }\n }\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(Input::get('callback'));\n }\n }\n }", "public static function remindAssignedUser() {\n $unrespondedToTickets = Self::getUnrespondedToTickets(15);\n\n if($unrespondedToTickets->count() > 0) {\n foreach($unrespondedToTickets as $ticket) {\n $vendor = $ticket->assignedTo;\n\n $message = \"<p>Hello {$vendor->name}.<br/> You are yet to respond to the ticket ID <a href='{{ route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]) }}''>#{{$ticket->ticket_id}}</p>. <p>If further delayed, your unit head would be notified of your delayed response to this ticket. <br/><br/>Thank you</p>\";\n $title = \"Ticket #{$ticket->ticket_id} is yet to receive a response\";\n send_email($vendor->name, $vendor->email, $message, route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]), $title);\n\n }\n }\n }", "public function cronjob(){\n\t\t//Debug::printr('yo');die;\n\t\t$this->_reportsModel = $this->loadModel('reports');\n\t\t$this->_usersModel = $this->loadModel('users');\n\t\t$this->_notificationsModel = $this->loadModel('notifications');\n\n\t\t//First we're going to check our checkins and send a reminder\n\t\t//$check_ins = $this->_reportsModel->getUpcomingCheckIns();\n\t\tif(isset($check_ins) && !empty($check_ins)){\n\t\t\tforeach ($check_ins as $key => $checkin) {\n\t\t\t\tif(isset($checkin['user_ids']) && !empty($checkin['user_ids'])){\n\t\t\t\t\t$user_ids = explode(',', $checkin['user_ids']);\n\t\t\t\t\tforeach ($user_ids as $key2 => $user_id) {\n\t\t\t\t\t\t$user = $this->_usersModel->getUserReport($checkin['id'], $user_id);\n\t\t\t\t\t\t//if the user still has not checkedin then hit them with a reminder email and notification\n\t\t\t\t\t\tif(isset($user) && !empty($user) && empty($user[0]['check_in_signature'])){\n\t\t\t\t\t\t\t//notification creation\n\t\t\t\t\t\t\t$data['text'] = 'A check in process requires you\\'re approval. Please review check in at the following link. <a href = \"'.SITE_URL.'reports/checkin/'.$checkin['property_id'].'\">Link</a>';\n\t\t $data['user_id'] = $user_id;\n\t\t $this->_notificationsModel->createData($data);\n\n\t\t //Email setup\n\t\t $this->_view->data['name'] = $user[0]['firstname'].' '.$user[0]['surname'];\n\t\t $this->_view->data['message'] = 'A check in process requires you\\'re approval. Please review check in at the following link.';\n\t\t $this->_view->data['button_link'] = SITE_URL.'reports/checkin/'.$checkin['property_id'];\n\t\t $this->_view->data['button_text'] = 'Review Check In';\n\n\t\t // Need to create email\n\t\t $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n\t\t Html::sendEmail($user[0]['email'], 'Checkmate - A Check in needs your approval.', SITE_EMAIL, $message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Now we're going to check our check outs and send a reminder\n\t\t//$check_outs = $this->_reportsModel->getUpcomingCheckOuts();\n\t\tif(isset($check_outs) && !empty($check_outs)){\n\t\t\tforeach ($check_outs as $key => $checkout) {\n\t\t\t\tif(isset($checkout['user_ids']) && !empty($checkout['user_ids'])){\n\t\t\t\t\t$user_ids = explode(',', $checkout['user_ids']);\n\t\t\t\t\tforeach ($user_ids as $key2 => $user_id) {\n\t\t\t\t\t\t$user = $this->_usersModel->getUserReport($checkout['id'], $user_id);\n\t\t\t\t\t\t//if the user still has not checkedin then hit them with a reminder email and notification\n\t\t\t\t\t\tif(isset($user) && !empty($user) && empty($user[0]['check_out_signature'])){\n\t\t\t\t\t\t\t//notification creation\n\t\t\t\t\t\t\t$data['text'] = 'A check out process requires you\\'re approval. Please review check out at the following link. <a href = \"'.SITE_URL.'reports/checkout/'.$checkout['property_id'].'\">Link</a>';\n\t\t $data['user_id'] = $user_id;\n\t\t $this->_notificationsModel->createData($data);\n\n\t\t //Email setup\n\t\t $this->_view->data['name'] = $user[0]['firstname'].' '.$user[0]['surname'];\n\t\t $this->_view->data['message'] = 'A check out process requires you\\'re approval. Please review check out at the following link.';\n\t\t $this->_view->data['button_link'] = SITE_URL.'reports/checkout/'.$checkout['property_id'];\n\t\t $this->_view->data['button_text'] = 'Review Check Out';\n\n\t\t // Need to create email\n\t\t $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n\t\t Html::sendEmail($user[0]['email'], 'Checkmate - A Check out needs your approval.', SITE_EMAIL, $message);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Now we're gonna remove old notifications\n\t\t$this->_notificationsModel->deleteOld();\n\n\t\t//If a check in has just passed its cut off day and no agreement has been made then email the peoples!\n\t\t$reports = $this->_reportsModel->getExpiredCheckIns();\n\t\tif(isset($reports) && !empty($reports)){\n\t\t\tforeach ($reports as $key => $report) {\n\t\t\t\tif(isset($report['user_ids']) && !empty($report['user_ids'])){\n\t\t\t\t\t$user_ids = explode(',', $report['user_ids']);\n\t\t\t\t\tforeach ($user_ids as $key2 => $user_id) {\n\t\t\t\t\t\t$user = $this->_usersModel->getUserReport($report['id'], $user_id);\n\t\t\t\t\t\tif(isset($user) && !empty($user)){\n\t\t\t\t\t\t\t//notification creation\n\t\t\t\t\t\t\t$data['text'] = 'Agreement regarding a check in could not be reached. Checkmate is independently reviewing the check in and will make a decision based on the information provided within 24/48 hours.';\n\t\t $data['user_id'] = $user_id;\n\t\t $this->_notificationsModel->createData($data);\n\n\t\t //Email setup\n\t\t $this->_view->data['name'] = $user[0]['firstname'].' '.$user[0]['surname'];\n\t\t $this->_view->data['message'] = 'Agreement regarding a check in could not be reached. Checkmate is independently reviewing the check in and will make a decision based on the information provided within 24/48 hours.';\n\t\t $this->_view->data['button_link'] = SITE_URL.'users/dashboard/';\n\t\t $this->_view->data['button_text'] = 'Checkmate Site.';\n\n\t\t // Need to create email\n\t\t $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n\t\t Html::sendEmail($user[0]['email'], 'Checkmate - Agreement regarding a check in could not be reached.', SITE_EMAIL, $message);\n\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Need to email site admin now so they know to review the disagreement.\n \t$this->_view->data['name'] = 'Site Admin';\n $this->_view->data['message'] = 'Agreement regarding a check in could not be reached. Please review and make a decision.';\n $this->_view->data['button_link'] = SITE_URL.'backoffice/reports/edit/'.$report['id'];\n $this->_view->data['button_text'] = 'Review Check In';\n\n // Need to create email\n $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n Html::sendEmail(SITE_EMAIL, 'Checkmate - Agreement regarding a check in could not be reached.', SITE_EMAIL, $message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//If a check out has just passed its cut off day and no agreement has been made then email the peoples!\n\t\t$reports = $this->_reportsModel->getExpiredCheckOuts();\n\t\tif(isset($reports) && !empty($reports)){\n\t\t\tforeach ($reports as $key => $report) {\n\t\t\t\tif(isset($report['user_ids']) && !empty($report['user_ids'])){\n\t\t\t\t\t$user_ids = explode(',', $report['user_ids']);\n\t\t\t\t\tforeach ($user_ids as $key2 => $user_id) {\n\t\t\t\t\t\t$user = $this->_usersModel->getUserReport($report['id'], $user_id);\n\t\t\t\t\t\tif(isset($user) && !empty($user)){\n\t\t\t\t\t\t\t//notification creation\n\t\t\t\t\t\t\t$data['text'] = 'Agreement regarding a check out could not be reached. Checkmate is independently reviewing the check out and will make a decision based on the information provided within 24/48 hours.';\n\t\t $data['user_id'] = $user_id;\n\t\t $this->_notificationsModel->createData($data);\n\n\t\t //Email setup\n\t\t $this->_view->data['name'] = $user[0]['firstname'].' '.$user[0]['surname'];\n\t\t $this->_view->data['message'] = 'Agreement regarding a check out could not be reached. Checkmate is independently reviewing the check out and will make a decision based on the information provided within 24/48 hours.';\n\t\t $this->_view->data['button_link'] = SITE_URL.'users/dashboard/';\n\t\t $this->_view->data['button_text'] = 'Checkmate Site.';\n\n\t\t // Need to create email\n\t\t $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n\t\t Html::sendEmail($user[0]['email'], 'Checkmate - Agreement regarding a check out could not be reached.', SITE_EMAIL, $message);\n\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Need to email site admin now so they know to review the disagreement.\n \t$this->_view->data['name'] = 'Site Admin';\n $this->_view->data['message'] = 'Agreement regarding a check out could not be reached. Please review and make a decision.';\n $this->_view->data['button_link'] = SITE_URL.'backoffice/reports/edit/'.$report['id'];\n $this->_view->data['button_text'] = 'Review Check Out';\n\n // Need to create email\n $message = $this->_view->renderToString('email-templates/general-message-with-button', 'blank-layout');\n Html::sendEmail(SITE_EMAIL, 'Checkmate - Agreement regarding a check out could not be reached.', SITE_EMAIL, $message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getBorrowReminder() {\n $dataReminder = DB::table('settings')->where('name', 'dayredm')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n $toDate = Carbon::now()->addDays($dataReminder->content);\n\n $data = Borrow::where('status', '<', '20')->whereBetween( 'ngaydaohan', array($fromDate->toDateTimeString(), $toDate->toDateTimeString()) )->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $userObj = User::where('id', $record->uid)->first();\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'], 'REMINDER_1');\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '20'));\n }\n } else {\n echo 'No data';\n }\n }", "function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}", "public function index()\n {\n //add a really old appointment\n $temp[] = \\Calendar::event(\n \"work\",\n false,\n \"1886-01-01T00:00:00\",\n \"1886-01-01T00:00:00\"\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n\n\n if(session(\"accountType\") == \"patient\"){\n return redirect(\"/patients/\".session('accountID'));\n }\n else if(session(\"accountType\") == \"doctor\"){\n $appointments = Appointment::where('doctor_id',session('accountID'))->get();\n // return $as;\n foreach($appointments as $appointment){\n $temp[] = \\Calendar::event(\n $appointment->event,\n false,\n $appointment->startTime,\n $appointment->endTime\n );\n $calendar = \\Calendar::addEvents($temp)->setOptions(['firstDay' => 1])->setCallbacks([]);\n }\n \n \n //$calendar = \\Calendar::addEvents($events2)->setOptions(['firstDay' => 1])->setCallbacks([]);\n return view('home', array('calendar'=>$calendar));\n }\n else if(session(\"accountType\") == \"nurse\"){ \n return redirect(\"/patients\");\n }\n // return redirect(\"/hospitals\");\n return view('home', array('calendar'=>$calendar));\n // return session('accountType');\n }", "public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }", "function unattended() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'queued') \".\n\t\t\t\t\"AND `startTime` <= ?\",\n\t\t\t\tCalendar::unattended());\n\t\t\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->unattended();\n\t}", "function generateSystemReminders(){\n\tremindAboutGuardsPastLeave();\n\tremindAboutContractsAboutToExpire();\n\tremindAboutDBbackup();\n\tremindAboutGuardsGoingOnLeave();\n\tremindAboutLongServiceGuards();\n}", "public static function setMeetingReminders($meeting_id,$chosen_time=false) {\n $mtg = Meeting::findOne($meeting_id);\n if ($chosen_time ===false) {\n $chosen_time = Meeting::getChosenTime($meeting_id);\n }\n // create attendees list for organizer and participants\n $attendees = array();\n $attendees[0]=$mtg->owner_id;\n $cnt =1;\n foreach ($mtg->participants as $p) {\n if ($p->status ==Participant::STATUS_DEFAULT) {\n $attendees[$cnt]=$p->participant_id;\n $cnt+=1;\n }\n }\n // for each attendee\n foreach ($attendees as $a) {\n // for their reminders\n $rems = Reminder::find()->where(['user_id'=>$a])->all();\n foreach ($rems as $rem) {\n // create a meeting reminder for that reminder at that time\n MeetingReminder::create($meeting_id,$a,$rem->id,$rem->duration);\n }\n }\n }", "private function mailer($id)\n {\n //server\n $server = Servers::where('server_id', $id)->firstOrFail();\n $server_name = $server->server_name;\n //apps\n $server_apps = ServerApp::where('server_id', $id)->get();\n //find the apps\n foreach ($server_apps as $serverapp)\n {\n $app_id = $serverapp->app_id;\n $appfunctionaladmincount = $this->countAppFunctionalAdmin($app_id);\n //check if persons exist\n if ($appfunctionaladmincount >=1){\n //find the persons\n $appfunctionaladmin = App_FunctionalAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($appfunctionaladmin as $functionaladmin)\n {\n $person_mail = $functionaladmin->persons->person_email;\n //run the mails\n if (filter_var($person_mail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_mail)){\n Mail::to($person_mail)->send(new OSnotifyMail($app_name,$server_name,$person_mail));\n }\n }\n }\n } \n $apptechadmincount = $this->countAppTechAdmin($app_id);\n if($apptechadmincount >=1){\n $apptechadmin = App_TechAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($apptechadmin as $techadmin)\n {\n $person_techmail = $techadmin->persons->person_email;\n //run the mails\n if (filter_var($person_techmail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_techmail)){\n Mail::to($person_techmail)->send(new OSnotifyMail($app_name,$server_name,$person_techmail));\n }\n } \n }\n }\n\n }\n }", "public function mailRentalPeriodReminder(Request $request)\n {\n $bike = new Bike(['name' => 'Sample Bike']);\n $bike->id = 1;\n $mail = new Mail\\RentalPeriodReminder($bike);\n \n return $mail;\n }", "private function onboardUsers()\n {\n foreach ($this->users as $user) {\n $token = $user->generateMagicToken();\n $user->sendNotification(new OnboardEmail($user, $token));\n }\n }", "public function onManagerSubmitAppointments() {\nglobal $_LW;\nif (!empty($_LW->_POST['dropdown_checked']) && !empty($_LW->_POST['items'])) { // handle checked item requests\n\t$this->saveChecked($_LW->_POST['dropdown_checked'], $_LW->_POST['items']);\n};\n}", "private function notifyORS() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ORSNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $ORSNotification = new ORSNotification($subject, $emailBody);\r\n try {\r\n $ORSNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to ORS : '. $e);\r\n }\r\n }", "public function run()\n\t{\n\t\t\\DB::table('password_reminders')->delete();\n \n\t\t\\DB::table('password_reminders')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'token' => 'f68e65b2d418e589ff35afeace4f90a9',\n\t\t\t\t'created_at' => '2015-04-21 12:05:46',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'token' => '20481468d4b84c7b3571988fd60d73eb',\n\t\t\t\t'created_at' => '2015-04-24 08:07:57',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'token' => 'f70dfe036a832993b218d5190b9ec6d6',\n\t\t\t\t'created_at' => '2015-04-24 08:53:48',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'token' => 'a094060c0b718e1aac338c7ebdcf8a23',\n\t\t\t\t'created_at' => '2015-04-24 08:56:33',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'email' => '[email protected]',\n\t\t\t\t'token' => 'a5091480c8da0822cdd5c834ada9dfb7',\n\t\t\t\t'created_at' => '2015-04-24 08:58:23',\n\t\t\t),\n\t\t));\n\t}", "private function sendDailyPubEmail()\n {\n foreach(Publisher::all() as $publisher) {\n $message = (new PublisherDaily($publisher->id))->onQueue('platform-processing');\n Mail::to($publisher->email,$publisher->name)->send($message);\n Log::info(\"Sent Daily Email To: \" . $publisher->email);\n }\n }", "function request_feedback(){\n\t\t$response = $this->InteractModal->get_task();\n\t\tif(!empty($response)){\n\t\t\tforeach($response as $response_data){\n\t\t\t\t$task_id = $response_data['task_id'];\t\t\t\t\t\n\t\t\t\t$schedule_date = $response_data['schedule_date'];\n\t\t\t\t$listingdate = date_create($schedule_date);\n\t\t\t\t$time= date_format($listingdate,\"l d - M, Y h:i A\");\n\t\t\t\t$_details = $response_data['details'];\n\t\t\t\t$details = unserialize( $_details );\n\t\t\t\t$username = $details['user_name'];\n\t\t\t\t$contact = $details['contact_number'];\n\t\t\t\t$email_id = $details['showing_email'];\n\t\t\t\t$upcoming_all_showings = $this->InteractModal->get_fedback_links( $task_id );\n\t\t\t$config = array(\n\t\t\t\t'smtp_user' => '[email protected]',\n\t\t\t\t'mailtype' => 'html',\n\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t'starttls' => true,\n\t\t\t\t'newline' => \"\\r\\n\",\n\t\t\t\t\n\t\t\t);\n\t\t\t\tif(!empty($upcoming_all_showings)){\n\t\t\t\tforeach($upcoming_all_showings as $upcoming_showing){\n\t\t\t\t\t$feedback_link= $upcoming_showing['link'];\n\t\t\t\t\t$address= $upcoming_showing['property_address'];\n\t\t\t\t\t$broker_id= $upcoming_showing['broker_id'];\n\t\t\t\t\t$response = $this->InteractModal->signature_user_email($broker_id);\n\t\t\t\t\t$email_broker = $response[0]['user_email'];\n\t\t\t\t\t$concerned_person = $this->InteractModal->get_user_meta($broker_id,'concerned_person'); \n\t\t\t\t\n\t\t\t$subject = 'Please provide feedback for our recent showing';\n\t\t\t$msg = 'Hi,<br /><br />We would really appreciate your feedback, please tell us what you thought about your recent showing at \"'. $address .'\" on \"'. $time .'\". <br /><a href=\"'. $feedback_link .'\">Please click here to submit your feedback </a> <br /><br /> Thank you,<br /> <br /> '. $concerned_person .' <br /> '. $contact .' <br /> '. $email_broker .'';\n\t\t\t$this->load->library('email', $config);\n\t\t\t$this->email->from('[email protected]', 'InteractRE');\n\t\t\t$this->email->set_header('InteractACM', 'InteractACM Notifications');\n\t\t\t$this->email->to( $email_id );\n\t\t\t$this->email->subject( $subject );\n\t\t\t$this->email->message( $msg ); \n\t\t\n\t\t\tif( $this->email->send() ){\n\t\t\t\t$data= array(\n\t\t\t'request_feedback' => 0,\n\t\t\t);\n\t\t\t$response = $this->InteractModal->update_task_details($data,$task_id);\n\t\t\t}else{\n\t\t\techo'Unable to send feedback link at this time. Please try again';\n\t\t} \n\t\t\t}}\n\t\t\t}\n\t\t}\n }", "protected function notifyBorrowers()\n\t{\n\t\t$leadTime = $this->getLeadTime();\n\t\t$from = Carbon::now()->addDays($leadTime - 1)->toDateString();\n\t\t$to = Carbon::now()->addDays($leadTime)->toDateString();\n\n\t\tItemRental::with('borrower')->where('status', ItemRental::STATUS_INITIATED)\n\t\t\t->whereNull('borrower_shipped_at')\n\t\t\t->whereBetween('return_on', [$from, $to])\n\t\t\t->chunk(self::CHUNK, function($rentals) {\n\t\t\t\t/** @var ItemRental $rental */\n\t\t\t\tforeach ($rentals as $rental) {\n\t\t\t\t\t$this->notifyUserAboutRental($rental->borrower, $rental);\n\t\t\t\t}\n\t\t\t});\n\t}", "public function bookappointment($input) {\n $appointments = new UserAppointments();\n $appointments->user_id = access()->id();\n $appointments->service_provider_id = $input['touser'];\n $appointments->appointment_date = date('Y-m-d h:i:s', strtotime($input['appointmentdate']));\n $appointments->services = $input['appointmentservices'];\n $appointments->save();\n $servicesSelected = json_decode($input['appointmentservices'], true);\n\n $fromuser = User::findOrFail(access()->id());\n $touser = User::findOrFail($input['touser']);\n\n Mail::send('emails.appointmentfrom', ['appointment' => $appointments->appointment_date, 'servicesSelected' => $servicesSelected], function ($message) use ($fromuser, $touser) {\n $message->from($touser->email, app_name());\n $message->to($fromuser->email, $fromuser->name)->subject(app_name() . ': New Appointment');\n });\n\n return Mail::send('emails.appointmentwith', ['appointment' => $appointments->appointment_date, 'servicesSelected' => $servicesSelected], function ($message) use ($fromuser, $touser) {\n\n $message->from($fromuser->email, app_name());\n $message->to($touser->email, $touser->name)->subject(app_name() . ': New Appointment');\n });\n }", "public function agent_email_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n\n $agent_email = $this->input->post(\"agent_email\",true); //agent email id\n $mail_body = $this->input->post(\"mail_body\",true);\n $from_name = \"Dubai Private Tour\";\n $from_email = \"[email protected]\";\n \n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $mail_body, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Email has been sent to agent successfully!');\n redirect('admin/tour-booking');\n }", "public function broadcastOn()\n {\n\n return [\"new_survey_response\"];\n\n }", "public function run()\r\n {\r\n Notification::create([\r\n 'id' => 1,\r\n 'image' => 'assets/images/notifications/reminder.png',\r\n 'title' => 'Follow Up Reminder',\r\n 'message' => '{CONTACT} Follow Up Reminder. Go to \"My Task\" to complete action.',\r\n 'type' => 'reminder',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 2,\r\n 'image' => 'assets/images/notifications/thumbs-down.png',\r\n 'title' => '{CONTACT} not interested',\r\n 'message' => '{REASON_NOT_INTERESTED}',\r\n 'type' => 'not-interested',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 3,\r\n 'image' => 'assets/images/notifications/order.png',\r\n 'title' => 'New Order Update',\r\n 'message' => '{STEP_TITLE} was completed by {COMPANY} for {CONTACT}.',\r\n 'type' => 'step-completed',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 4,\r\n 'image' => 'assets/images/notifications/video.png',\r\n 'title' => 'Video Started',\r\n 'message' => '{CONTACT} is watching the video titled {VIDEO_TITLE}.',\r\n 'type' => 'video',\r\n 'sound' => 's_tracking',\r\n 'android_channel_id' => 'tracking',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 5,\r\n 'image' => 'assets/images/notifications/order.png',\r\n 'title' => 'New Order Submitted',\r\n 'message' => '{CONTACT} submitted an new order.',\r\n 'type' => 'new-order',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 6,\r\n 'image' => 'assets/images/notifications/cross.png',\r\n 'title' => 'Order Canceled',\r\n 'message' => 'Order was canceled for {CONTACT} by {COMPANY}. Please review the message in todays task to learn more.',\r\n 'type' => 'order-cancelled',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 7,\r\n 'image' => 'assets/images/notifications/faq.png',\r\n 'title' => 'Article Read',\r\n 'message' => '{CONTACT} read the article on {ARTICLE_TITLE}',\r\n 'type' => 'article-read',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 8,\r\n 'image' => 'assets/images/notifications/brochure.png',\r\n 'title' => 'Booklet Read',\r\n 'message' => '{CONTACT} has read the Booklet. Nice Job {USER}!',\r\n 'type' => 'brochure-read',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 9,\r\n 'image' => 'assets/images/notifications/brochure.png',\r\n 'title' => 'Booklet Downloaded',\r\n 'message' => '{CONTACT} downloaded the software-demand.com Booklet',\r\n 'type' => 'brochure-downloaded',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 10,\r\n 'image' => 'assets/images/notifications/appointment.png',\r\n 'title' => 'New Appointment',\r\n 'message' => 'You have an appointment right now with {CONTACT}!',\r\n 'type' => 'appointment-now',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 11,\r\n 'image' => 'assets/images/notifications/support.png',\r\n 'title' => 'New Ticket',\r\n 'message' => 'A new ticket from {FROM} has been submitted for titled {TITLE}.',\r\n 'type' => 'new-ticket',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 12,\r\n 'image' => 'assets/images/notifications/support.png',\r\n 'title' => 'New Reply',\r\n 'message' => 'A new reply from {FROM} has been posted for the support ticket titled {TITLE}.',\r\n 'type' => 'new-reply',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 13,\r\n 'image' => 'assets/images/notifications/new_lead.png',\r\n 'title' => 'New Opt In Page Lead',\r\n 'message' => 'Just in! A new opt in page lead.',\r\n 'type' => 'new-lead',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 14,\r\n 'image' => 'assets/images/notifications/new_lead.png',\r\n 'title' => 'New Opt In Page Lead Handoff',\r\n 'message' => 'Just in! A new opt in page lead handed off to {SALES_SUPPORT}. We will keep you informed on the progress.',\r\n 'type' => 'handedoff-lead',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 15,\r\n 'image' => 'assets/images/notifications/new_lead.png',\r\n 'title' => 'New Handoff Referral',\r\n 'message' => 'Just in! A new handoff referral from {FROM}',\r\n 'type' => 'new-handoff-referral',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 16,\r\n 'image' => 'assets/images/notifications/new_lead.png',\r\n 'title' => 'New Team Support Referral',\r\n 'message' => 'Just in! A new team support referral from {FROM}',\r\n 'type' => 'new-team-support-referral',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 17,\r\n 'image' => 'assets/images/notifications/flame.png',\r\n 'title' => 'New Hot Lead',\r\n 'message' => '{CONTACT} became a hot lead. Go to \"Hot Lead\" for activity details.',\r\n 'type' => 'third-base',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 18,\r\n 'image' => 'assets/images/notifications/flame-green.png',\r\n 'title' => 'Education Completed',\r\n 'message' => '{CONTACT} software-demand.com completed education! Connect with team support to move customer forward.',\r\n 'type' => 'ki-completed',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 19,\r\n 'image' => 'assets/images/notifications/testimonial-video.png',\r\n 'title' => 'Video Started',\r\n 'message' => '{CONTACT} is watching the testimonial video from {VIDEO_TITLE}.',\r\n 'type' => 'testimonial-video-started',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 20,\r\n 'image' => 'https://dev.springaqua.com/api/assets/images/money.png',\r\n 'title' => 'Commission Paid',\r\n 'message' => 'We paid you, congrats.',\r\n 'type' => 'commission-paid',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 21,\r\n 'image' => 'assets/images/notifications/new.png',\r\n 'title' => 'Commission Posted',\r\n 'message' => 'A new commission posted. Go to \"My B.O.B\" for details.',\r\n 'type' => 'commission-posted',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 22,\r\n 'image' => 'assets/images/notifications/reminder.png',\r\n 'title' => 'Reset Funnel',\r\n 'message' => ' {CONTACT} funnel has been reset.',\r\n 'type' => 'reset-funnel',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 23,\r\n 'image' => 'assets/images/notifications/reminder.png',\r\n 'title' => 'New Personal Notes',\r\n 'message' => '{USER} added personal note',\r\n 'type' => 'personal-notes',\r\n 'sound' => 's_new_order',\r\n 'android_channel_id' => 'new_order',\r\n 'navigate_to' => '/tasks-list'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 24,\r\n 'image' => 'assets/images/notifications/reminder.png',\r\n 'title' => 'New Appointment',\r\n 'message' => 'You have an appointment in an hour. This is now in your Today\\'s Task awaiting your completion.',\r\n 'type' => 'appointment-task',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n\r\n Notification::create([\r\n 'id' => 25,\r\n 'image' => 'assets/images/customer.png',\r\n 'title' => 'Congratulations!',\r\n 'message' => 'Congratulations! You\\'re an agent now',\r\n 'type' => 'become-agent',\r\n 'sound' => 's_update',\r\n 'android_channel_id' => 'update',\r\n 'navigate_to' => '/notifications'\r\n ]);\r\n }", "public function store(Request $request)\n {\n// dd($request);\n $request->validate([\n 'patient_id' => 'required',\n 'doctor_id' => 'required',\n 'doctor_schedule_id' => 'required',\n 'time' => 'required',\n 'type' => 'required',\n 'description' => 'required'\n ]);\n $appointmentNumber = sprintf(\"%03u-%s-%s\", $request->doctor_id, $request->date, $request->time);\n $oldApp = Appointment::where('appointment_number',$appointmentNumber)->where('status',0)->get();\n if ($oldApp->count() > 0){\n return back()->with('warning','You have already booked Appoitment for the selected date and time');\n }\n // dd($appointmentNumber);\n $data = [\n 'doctor_id' => $request->doctor_id,\n 'patient_id' => $request->patient_id,\n 'doctor_schedule_id' => $request->doctor_schedule_id,\n 'appointment_number' => $appointmentNumber,\n 'reason' => $request->description,\n 'time' => $request->time,\n 'type' => $request->type,\n ];\n // dd($data);\n $newApp = Appointment::create($data);\n $notification = [\n 'message' => 'appointment Has Been Created',\n 'date' => $request->date,\n 'time' => $request->time,\n 'patient' => $newApp->patient->name,\n 'doctor' => $newApp->doctor->name,\n ];\n\n if (isset($request->referral)) {\n $newApp->update(['referred_from' => $request->referral]);\n Appointment::findOrFail($request->referral)->update(['status' => 2, 'referred_to' => $newApp->id]);\n $notification['message'] = 'Appointment Referred';\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n return back()->with('success', 'Referred to another doctor successfully');\n }\n $newApp->patient->user->notify(new AppointmentNotification($notification));\n $newApp->doctor->user->notify(new AppointmentNotification($notification));\n if (isset($request->payment) && $request->payment == 'true'){\n $newApp->update(['isPaid'=>true]);\n Payment::create([\n 'appointment_id' => $newApp->id,\n 'amount' => $newApp->doctor->fees\n ]);\n }\n if ($newApp->type == 'Video'){\n $newApp->update(['meeting_link'=>$request->meeting_link]);\n }\n return back()->with('success', 'Appointment Created Successfully');\n // dd($request);\n }", "public function Action_Reminder()\n {\n $this->Chunk_Init();\n\n if ( $_REQUEST['Users']['Keystring'] != Zero_App::$Users->Keystring )\n {\n $this->SetMessage(-1, ['Контрольная строка не верна']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $this->Model->Load_Email($_REQUEST['Users']['Email']);\n if ( 0 == $this->Model->ID )\n {\n $this->SetMessage(-1, ['Пользователь не найден']);\n $this->Chunk_View();\n return $this->View;\n }\n\n $password = substr(md5(uniqid(mt_rand())), 0, 10);\n $this->Model->Password = md5($password);\n $this->Model->Save();\n\n $subject = \"Reminder access details \" . HTTP;\n $View = new Zero_View('Zero_Users_ReminderMail');\n $View->Assign('Users', $this->Model);\n $View->Assign('password', $password);\n $message = $View->Fetch();\n\n $email = [\n 'Reply' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'From' => ['Name' => Zero_App::$Config->Site_Name, 'Email' => Zero_App::$Config->Site_Email],\n 'To' => [\n $this->Model->Email => $this->Model->Name,\n ],\n 'Subject' => \"Reminder access details \" . HTTP,\n 'Message' => $message,\n 'Attach' => [],\n ];\n $cnt = Helper_Mail::SendMessage($email);\n if ( 0 < $cnt )\n $this->SetMessageError(-1, [\"Реквизиты не отправлены на почту\"]);\n else\n $this->SetMessage(0, [\"Реквизиты отправлены на почту\"]);\n $this->Chunk_View();\n return $this->View;\n }", "public function cronNotifyRecipients()\n\t{\n\t\t// Check if notifications should be send.\n\t\tif (!$GLOBALS['TL_CONFIG']['avisota_send_notification'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->loadLanguageFile('avisota_subscription');\n\n\t\t$entityManager = EntityHelper::getEntityManager();\n\t\t$subscriptionRepository = $entityManager->getRepository('Avisota\\Contao:RecipientSubscription');\n\t\t$intCountSend = 0;\n\n\t\t$resendDate = $GLOBALS['TL_CONFIG']['avisota_notification_time'] * 24 * 60 * 60;\n\t\t$now = time();\n\n\t\t// Get all recipients.\n\t\t$queryBuilder = EntityHelper::getEntityManager()->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t\t->select('r')\n\t\t\t\t->from('Avisota\\Contao:Recipient', 'r')\n\t\t\t\t->innerJoin('Avisota\\Contao:RecipientSubscription', 's', 'WITH', 's.recipient=r.id')\n\t\t\t\t->where('s.confirmed=0')\n\t\t\t\t->andWhere('s.reminderCount < ?1')\n\t\t\t\t->setParameter(1, $GLOBALS['TL_CONFIG']['avisota_notification_count']);\n\t\t$queryBuilder->orderBy('r.email');\n\t\t\n\t\t// Execute Query.\n\t\t$query = $queryBuilder->getQuery();\n\t\t$integratedRecipients = $query->getResult();\n\t\t\n\t\t// Check each recipient with open subscription.\n\t\tforeach ($integratedRecipients as $integratedRecipient)\n\t\t{\n\t\t\t$subscriptions = $subscriptionRepository->findBy(array('recipient' => $integratedRecipient->id, 'confirmed' => 0), array('updatedAt' => 'asc'));\n\t\t\t$tokens = array();\n\t\t\t$blnNotify = false;\n\n\t\t\tforeach ($subscriptions as $subscription)\n\t\t\t{\n\t\t\t\t// Check if we are over the $resendDate date.\n\t\t\t\tif (($subscription->updatedAt->getTimestamp() + $resendDate) > $now)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Set some data.\n\t\t\t\t$blnNotify = true;\n\t\t\t\t$tokens[] = $subscription->getToken();\n\n\t\t\t\t// Update the subscription.\n\t\t\t\t$subscription->updatedAt = new \\Datetime();\n\t\t\t\t$subscription->reminderSent = new \\Datetime();\n\t\t\t\t$subscription->reminderCount = $subscription->reminderCount + 1;\n\n\t\t\t\t// Save.\n\t\t\t\t$entityManager->persist($subscription);\n\t\t\t}\n\n\t\t\t// Check if we have to send a notify and if we have a subscription module.\n\t\t\tif ($blnNotify && $subscription->getSubscriptionModule())\n\t\t\t{\n\t\t\t\t$subscription = $subscriptions[0];\n\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'email' => $integratedRecipient->email,\n\t\t\t\t\t'token' => implode(',', $tokens),\n\t\t\t\t);\n\n\t\t\t\t$arrPage = $this->Database\n\t\t\t\t\t\t->prepare('SELECT * FROM tl_page WHERE id = (SELECT avisota_form_target FROM tl_module WHERE id = ?)')\n\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t->execute($subscription->getSubscriptionModule())\n\t\t\t\t\t\t->fetchAssoc();\n\n\t\t\t\t$objNextPage = $this->getPageDetails($arrPage['id']);\n\t\t\t\t$strUrl = $this->generateFrontendUrl($objNextPage->row(), null, $objNextPage->rootLanguage);\n\n\t\t\t\t$url = $this->generateFrontendUrl($arrPage);\n\t\t\t\t$url .= (strpos($url, '?') === false ? '?' : '&');\n\t\t\t\t$url .= http_build_query($parameters);\n\n\t\t\t\t$newsletterData = array();\n\t\t\t\t$newsletterData['link'] = (object) array(\n\t\t\t\t\t\t\t'url' => \\Environment::getInstance()->base . $url,\n\t\t\t\t\t\t\t'text' => $GLOBALS['TL_LANG']['avisota_subscription']['confirmSubscription'],\n\t\t\t\t);\n\n\t\t\t\t// Try to send the email.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->sendMessage($integratedRecipient, $GLOBALS['TL_CONFIG']['avisota_notification_mail'], $GLOBALS['TL_CONFIG']['avisota_default_transport'], $newsletterData);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exc)\n\t\t\t\t{\n\t\t\t\t\t$this->log(sprintf('Unable to send reminder to \"%s\" with error message - %s', $integratedRecipient->email, $exc->getMessage()), __CLASS__ . ' | ' . __FUNCTION__, TL_ERROR);\n\t\t\t\t}\n\n\t\t\t\t// Update recipient;\n\t\t\t\t$integratedRecipient->updatedAt = new \\DateTime();\n\n\t\t\t\t// Set counter.\n\t\t\t\t$intCountSend++;\n\t\t\t}\n\n\t\t\t// Send only 5 mails per run.\n\t\t\tif ($intCountSend >= 5)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$entityManager->flush();\n\t}", "public function getProvidersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.persons AS booking_persons, \n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'provider_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "private function sendNotification(Application $app){\n }" ]
[ "0.8026194", "0.7020604", "0.67048925", "0.66590756", "0.6545574", "0.64621097", "0.6336447", "0.6316557", "0.6287346", "0.6232709", "0.620149", "0.6109475", "0.60863554", "0.60080373", "0.5963936", "0.59571224", "0.5953585", "0.5945126", "0.5907907", "0.59026027", "0.58853006", "0.5856908", "0.5852093", "0.5791652", "0.5748522", "0.57464886", "0.5729569", "0.5676186", "0.5674008", "0.5656599", "0.5655047", "0.56513685", "0.5633347", "0.5633125", "0.56256795", "0.56252974", "0.5623379", "0.5610168", "0.55863494", "0.5579744", "0.5574072", "0.5566955", "0.5566336", "0.5559092", "0.55506384", "0.5543358", "0.55383885", "0.55331874", "0.55294037", "0.55234045", "0.5511799", "0.5505506", "0.55011636", "0.54975504", "0.5495866", "0.54937446", "0.5480066", "0.5477508", "0.5470836", "0.5458949", "0.54506886", "0.5445104", "0.5442407", "0.54392225", "0.54369867", "0.5426223", "0.54245114", "0.5422541", "0.54211026", "0.5420758", "0.5419471", "0.5419393", "0.5414471", "0.5409882", "0.54089147", "0.5408879", "0.5408604", "0.5407406", "0.54016465", "0.5400028", "0.5391091", "0.53884417", "0.53877383", "0.53869456", "0.53772134", "0.537352", "0.5370344", "0.53662044", "0.53618705", "0.5359526", "0.53567183", "0.5356156", "0.5355868", "0.535071", "0.5347377", "0.5346688", "0.5339201", "0.5337518", "0.53368384", "0.53361535" ]
0.7875032
1
Make a grid builder.
protected function grid($id) { $grid = new Grid(new Attendee); $grid->model() ->orderBy('id', 'desc') ->where('event_id', $id) ->whereNotNull('canceled_at'); $grid->disableActions(); $grid->disableCreateButton(); $grid->disableRowSelector(); $grid->filter(function ($filter) use ($id) { $filter->equal('ticket_type')->select(\App\Models\EventMultiplePrice::where('event_id', $id)->get(['name_en', 'id'])->pluck('name_en', 'id')); $filter->equal('seat_no'); $filter->equal('email'); $filter->equal('mobile'); $filter->equal('qr'); $filter->equal('seat_id'); }); $grid->id('ID'); $grid->ticketType()->name_en('Ticket Type'); $grid->qr('QR'); $grid->seat_no('Seat No#'); $grid->email('Email'); $grid->name('Name'); $grid->mobile('Mobile'); $grid->created_at('Created Date'); $grid->canceled_at('Canceled Date'); $grid->column('Booking')->display(function () { $link = route('admin.booking', $this->booking_id); return "<a class=\"btn btn-xs btn-default grid-open-map\" href='{$link}'> <i class=\"fa fa-user\"> View</i> </a>"; }); return $grid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId) {\n if ($formId) {\n $form = Formulario::find($formId);\n return \"<span>{$form['name']}</span>\";\n }\n });\n\n $grid->model()->orderBy('id', 'asc');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "public function getGridBuilder($name);", "protected function grid()\n {\n $grid = new Grid(new Good);\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('名称'));\n $grid->column('unit', __('单位'));\n //$grid->column('list_img', __('商品图片'))->image()->width(10);\n $grid->column('amount', __('价格'));\n $grid->column('created_at', __('创建时间'));\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableFilter();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('image', __('Image'));\n $grid->column('user_roles', __('User roles'));\n $grid->column('intro', __('Intro'));\n $grid->column('details', __('Details'));\n $grid->column('start_at', __('Start at'));\n $grid->column('end_at', __('End at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('location', __('Location'));\n $grid->column('fee', __('Fee'));\n $grid->column('involves', __('Involves'));\n $grid->column('involves_min', __('Involves min'));\n $grid->column('involves_max', __('Involves max'));\n $grid->column('status', __('Status'));\n $grid->column('organizers', __('Organizers'));\n $grid->column('views', __('Views'));\n $grid->column('collectors_num', __('Collectors num'));\n $grid->column('is_stick', __('Is stick'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new NewEnergy());\n\n $grid->column('user_id', __('用户'));\n $grid->column('car_id', __('车辆ID'));\n $grid->column('start_mileage', __('开始里程'));\n $grid->column('end_mileage', __('结束里程'));\n $grid->column('mileage', __('里程'));\n $grid->column('type', __('车辆类型'));\n $grid->column('status', __('状态'));\n $grid->column('remark', __('备注'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MachinesStyle());\n\n $grid->model()->latest();\n \n $grid->column('id', __('索引'))->sortable();\n\n $grid->column('style_name', __('型号名称'))->help('机具的型号名称');\n\n $grid->column('machines_fact.factory_name', __('所属厂商'))->help('机具型号所属的厂商');\n\n // $grid->column('machines_fact.machines_types.name', __('所属类型'))->help('机具型号所属的类型');\n\n $grid->column('created_at', __('创建时间'))->date('Y-m-d H:i:s')->help('机具型号的创建时间');\n\n $grid->column('updated_at', __('修改时间'))->date('Y-m-d H:i:s')->help('机具型号的最后修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Enseignant());\n\n $grid->column('id', __('Id'));\n $grid->column('matricule', __('Matricule'));\n $grid->column('nom', __('Nom'));\n $grid->column('postnom', __('Postnom'));\n $grid->column('prenom', __('Prenom'));\n $grid->column('sexe', __('Sexe'));\n $grid->column('grade', __('Grade'));\n $grid->column('fonction', __('Fonction'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new LotteryCode());\n $grid->model()->orderBy('prizes_time', 'desc');\n $grid->id('Id');\n $grid->code('抽奖码');\n $grid->batch_num('批次号');\n $grid->prizes_name('奖品');\n $grid->valid_period('有效期');\n $grid->prizes_time('抽奖时间');\n $grid->award_status('发奖状态')->editable('select', [0 => '未发放', 1 => '已发放']);\n $grid->disableCreateButton();\n $grid->disableActions();\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n // 在这里添加字段过滤器\n $filter->like('code', '抽奖码');\n $filter->like('batch_num', '批次号');\n $filter->between('prizes_time', '抽奖时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Boarding());\n\n $grid->column('id', __('Id'));\n $grid->column('pet.name', __('Pet Name'));\n $grid->column('reservation.date', __('Reservation Date'));\n $grid->column('cage_id', __('Cage Number'));\n $grid->column('end_date', __('End date'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function($filter){\n\n $filter->disableIdFilter();\n $filter->like('pet.name', 'Pet Name');\n \n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Engine());\n\n $grid->column('id', __('#'));\n $grid->column('power_station_id', __('Power station'))\n ->display(function ($userId) {\n $u = PowerStation::find($userId);\n if (!$u)\n return \"-\";\n return $u->name;\n })\n ->sortable();\n $grid->column('name', __('Tank Name'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new gameLog());\n\n $grid->column('onlyId', ___('OnlyId'));\n $grid->column('bigBlindIndex', ___('BigBlindIndex'));\n $grid->column('gameNums', ___('GameNums'));\n $grid->column('smallBlindIndex', ___('SmallBlindIndex'));\n $grid->column('tableCards', ___('TableCards'));\n $grid->column('tableId', ___('TableId'));\n $grid->column('tableSeat1Str1', ___('TableSeat1Str1'));\n $grid->column('tableSeat1Str2', ___('TableSeat1Str2'));\n $grid->column('tableSeat1Str3', ___('TableSeat1Str3'));\n $grid->column('tableSeat1Str4', ___('TableSeat1Str4'));\n $grid->column('tableSeat1Str5', ___('TableSeat1Str5'));\n $grid->column('tableSeat1Str6', ___('TableSeat1Str6'));\n $grid->column('tableSeat1Str7', ___('TableSeat1Str7'));\n $grid->column('time', ___('Time'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Work);\n\n $grid->id('Id')->sortable();;\n $grid->name(trans('Название'))->sortable();;\n $grid->description(trans('Описание'))->sortable();;\n $grid->order_id(trans('Порядок'))->sortable();;\n\n $grid->paginate(20);\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('name', trans('Название'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Cate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('link', __('Link'));\n $grid->column('thumb', __('Thumb'));\n $grid->column('status', __('Status'));\n $grid->column('sort', __('Sort'));\n $grid->column('createtime', __('Createtime'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new BrandCooperation);\n\n $grid->sort('排序')->editable()->sortable();\n $grid->name('品牌名称');\n $grid->is_show('是否显示')->editable('select', [1 => '显示', 0 => '隐藏']);\n $grid->created_at('添加时间')->sortable();\n\n// $grid->actions(function ($actions) {\n// $actions->disableView(); // 禁用查看\n// });\n\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n // 查询\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->like('name', '品牌名称');\n $filter->equal('is_show', '显隐')->radio([1 => '显示', 0 => '隐藏']);\n });\n\n return $grid;\n }", "public function buildGrid() {\n // Processing Grids\n if ($this->getContext('container.grids')) {\n $grids = new VTCore_Bootstrap_Grid_Column($this->getContext('container.grids'));\n $this->addClass($grids->getClass(), 'grids');\n }\n\n return $this;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('ID');\n $grid->name('Название');\n //$grid->intro_img('Превью');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity);\n\n $grid->id('Id');\n $grid->log_name('Log name');\n $grid->description('Description');\n $grid->subject_id('Subject id');\n $grid->subject_type('Subject type');\n $grid->causer_id('Causer id');\n $grid->causer_type('Causer type');\n $grid->properties('Properties');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableEdit();\n $actions->disableView();\n });\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->between('created_at', '创建时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Banner);\n\n $grid->id('Id');\n $grid->title('Title');\n $grid->image('Image')->display(function($image) {\n return '<img width=\"30\" src=\"' . (env('APP_URL') . '/storage/' . ($image ?: 'images/default.png')) . '\"\"/>';\n });\n $grid->status('Status');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->id('ID')->sortable();\n\n $grid->company_id('公司名称')->display(function ($company_id) {\n $company = Company::find($company_id);\n if ($company) {\n return $company->company_name;\n }\n return $company_id;\n });\n $grid->project_name('项目名称')->sortable();\n $grid->link_url('项目链接');\n $grid->display('公开度')->display(function ($display) {\n return $display == 0 ? '公开' : '私密';\n });\n $grid->created_at('添加时间')->sortable();\n\n return $grid;\n }", "protected function constructGrid()\n {\n // jquery script for loading first page of grid\n $table = \"\n <script type=\\\"text/javascript\\\">\n // load first page\n WschangeModelPagination(\n '$this->_id',\n '$this->_action',\n '$this->_modelName',\n '$this->noDataText',\n $this->itemsPerPage,\n $this->showEdit,\n '$this->_order',\n '$this->_formId',\n 0,\n '$this->_id'+'_0',\n '$this->_edit_action',\n '$this->_delete_action'\n );\n </script>\n \";\n\n // container for edit dialog\n if ($this->showEdit) {\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'\"></div>';\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'_new\"></div>';\n }\n\n // title\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-1\">';\n $table .= '<h1>'.$this->_model->metaName.'</h1>';\n $table .= '</div>';\n $table .= '</div>';\n\n // add and search controls\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-2\">';\n $table .= '<form class=\"uk-form uk-form-horizontal\">';\n $table .= '<fieldset data-uk-margin>';\n // new item button\n if ($this->showEdit) {\n $table .= '<button class=\"uk-button uk-button-success\"'\n .' data-uk-modal=\"{target:\\'#'.$this->_formId\n .'_new\\', center:true}\"'\n .' id=\"btn_create_'.$this->_id.'\"'\n .' type=\"button\" onclick=\"WseditModelID('\n .'\\''.$this->_formId.'_new\\', '\n .'\\''.$this->_modelName.'\\', '\n .'0, \\''.$this->_edit_action.'\\')\">';\n $table .= '<i class=\"uk-icon-plus\"></i>';\n $table .= '</button>';\n }\n // search control\n $table .= '<input';\n $table .= ' type=\"text\" id=\"search_'.$this->_id.'\"';\n $table .= '/>';\n $table .= '<button class=\"uk-button\"'\n .' id=\"btn_search_'.$this->_id\n .'\" type=\"button\" onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .'0, \\''.$this->_id.'\\'+\\'_0\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\">';\n $table .= '<i class=\"uk-icon-search\"></i>';\n $table .= '</button>';\n\n $table .= '</fieldset>';\n $table .= '</form>';\n $table .= '</div>';\n $table .= '</div>';\n\n // Grid View table\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-1-1\">';\n $table .= '<div class=\"uk-overflow-container\">';\n $table .= '<table class=\"uk-table uk-table-hover uk-table-striped\">';\n $table .= '<thead>';\n $table .= '<tr>';\n foreach ($this->_model->columns as $column) {\n if (!in_array($column, $this->_model->hiddenColumns)) {\n if (isset($this->_model->columnHeaders[$column])) {\n $table .= '<th>'\n .$this->_model->columnHeaders[$column];\n $table .= '</th>';\n } else {\n $table .= '<th>'.$column.'</th>';\n }\n }\n }\n if ($this->showEdit) {\n $table .= '<th></th>';\n }\n $table .= '</tr>';\n $table .= '</thead>';\n\n // container of table data loaded from AJAX request\n $table .= '<tbody id=\"'.$this->_id.'\"></tbody>';\n\n // end of grid table\n $table .= '</table>';\n $table .= '</div>';\n $table .= '</div>';\n $table .= '</div>';\n\n // get number ow rows from query so that we can make pager\n $db = new WsDatabase();\n $countQuery = 'SELECT COUNT(*) AS nrows FROM '.$this->_model->tableName;\n $result = $db->query($countQuery);\n $this->nRows = intval($result[0]['nrows']);\n $db->close();\n\n // number of items in pager\n $nPages = $this->getPagination($this->nRows);\n\n // construct pager\n $table .= '<ul class=\"uk-pagination uk-pagination-left\">';\n // links to pages\n for ($i = 0; $i < $nPages; $i++) {\n $table .= '<li>';\n $table .= '\n <a id=\"'.$this->_id.'_'.$i.'\"\n href=\"javascript:void(0)\"\n onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .$i.',\\''.$this->_id.'_'.$i.'\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\"/>'\n .($i+1).'</a>';\n $table .= '</li>';\n }\n // end of pager\n $table .= '</ul>';\n\n // end of master div element\n $table .= '<br/>';\n\n $table .= '<script type=\"text/javascript\">'\n .'$(\"#search_'.$this->_id.'\").keydown(function(event) {'\n .' if(event.keyCode == 13) {'\n .' event.preventDefault();'\n .' $(\"#btn_search_'.$this->_id.'\").click();'\n .' }'\n .'});'\n .'</script>';\n\n unset($i, $nPages, $db, $result, $countQuery);\n return $table;\n }", "protected function grid()\n {\n $grid = new Grid(new Clinic());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('image', __('Image'))->image();\n $grid->column('name', __('Name'))->filter();\n $grid->column('type', __('Type'))->using(['1' => 'Clinic', '2' => 'Hospital'])->filter();\n $grid->column('email', __('Email'))->filter();\n $grid->column('phone', __('Phone'))->filter();\n $grid->column('address', __('Address'))->filter();\n $grid->column('website_url', __('Website url'))->link()->filter();\n $grid->column('profile_finish', __('Profile finish'))->bool()->filter();\n $grid->column('status', __('Status'))->bool()->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Information);\n\n $grid->model()->where('adminuser_id', '=', Admin::user()->id);\n $grid->disableCreateButton();\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('项目名称'));\n $grid->column('content', __('项目简介'))->limit(30);\n $grid->column('industry', __('行业类别'));\n $grid->column('investment', __('投资金额')); \n $grid->column('cont_name', __('资方联系人'));\n $grid->column('cont_phone', __('资方联系方式'));\n $grid->column('staff_name', __('工作人员姓名'));\n $grid->column('staff_phone', __('工作人员电话'));\n $grid->column('created_at', __('上报时间'));\n $grid->column('updated_at', __('更新时间'));\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('name', '项目名称');\n $filter->like('cont_name', '资方联系人');\n $filter->like('content', '项目情况');\n });\n\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n $grid->column('id', __('Id'));\n $grid->column('currency', __('Currency'));\n $grid->column('amount', __('Amount'));\n $grid->column('state', __('State'));\n $grid->column('game_id', __('Game id'));\n $grid->column('user_id', __('User id'));\n $grid->column('product_id', __('Product id'));\n $grid->column('product_name', __('Product name'));\n $grid->column('cp_order_id', __('Cp order id'));\n $grid->column('callback_url', __('Callback url'));\n $grid->column('callback_info', __('Callback info'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Dictionary());\n $grid->disableRowSelector();\n $grid->disableExport();\n\n $grid->column('id', __('Id'));\n $grid->column('type', __('Type'))->display(function () {\n return $this->type ? Dictionary::TYPES[$this->type] : null;\n })->label();\n $grid->column('option', __('Option'));\n $grid->column('slug', __('Slug'));\n $grid->column('alternative', __('Alternative'));\n $grid->column('approved', __('Approved'))->switch();\n $grid->column('sort', __('Sort'));\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->expand();\n $filter->where(function ($query) {\n $query->where('dictionaries.type', '=', $this->input);\n }, __('Фильтровать по типу'))->select(Dictionary::TYPES);\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SpecificationTemplate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('keys', __('Keys'))->display(function ($keys) {\n return implode(',', $keys);\n });\n $grid->column('content', __('Content'))->display(function ($content) {\n return implode('<br/>', array_map(fn($values) => implode(',', $values), $content));\n });\n $grid->column('sort', __('Sort'))->editable();\n $grid->column('is_display', __('Is display'))->switch();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->actions(function (Grid\\Displayers\\Actions $actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n\n //only display paid order\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('order number');\n $grid->column('user.name', 'Buyer');\n $grid->total_amount('Total Amount')->sortable();\n $grid->paid_at('Paid Time')->sortable();\n $grid->ship_status('Shipment')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('Refund Status')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Book());\n\n $grid->column('id', __('Id'));\n $grid->author()->display(function($v) {\n return $v['name'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('year', __('Year'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Blog());\n\n $grid->column('id', __('Id'));\n $grid->column('title', __('Title'));\n $grid->column('sub_title', __('Sub title'));\n $grid->column('tag', __('Tag'));\n $grid->column('body', __('Body'));\n $grid->column('posted_by', __('Posted by'));\n $grid->column('posted_at', __('Posted at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new PointMachine());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('point.name', __('Point name'));\n $grid->column('machine_no', __('Machine no'));\n // 1-自助型 2-全自动型\n $grid->column('type', __('Type'))->display(function ($type) {\n return $type == 1 ? '自助型 ' : '全自动型';\n });\n $grid->column('cost', __('Cost'));\n $grid->column('cost_at', __('Cost at'));\n $grid->column('build_at', __('Build at'));\n $grid->column('remark', __('Remark'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n $grid->column('id', __('Id'));\n $grid->column('sort', __('Sort'));\n $grid->column('name', __('Name'));\n $grid->column('slug', __('Slug'));\n $grid->column('description', __('field.description'))->display(function ($item) {\n return mb_strimwidth($item, 0, 500, '...');\n });\n $grid->column('files', __('field.images'))->display(function () {\n $images = array();\n foreach ($this->files as $file) {\n array_push($images, preg_replace(\"/images\\//\", \"images/small.\", $file->file));\n }\n return $images;\n })->carousel(150, 100);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Talent);\n\n $grid->column('talents_id', 'ID');\n $grid->column('name', '姓名')->filter('like');\n $grid->column('sex', '性别')->filter('like');\n $grid->column('jobtitle', '工作单位及职务')->filter('like');\n $grid->column('education', '学历学位')->filter('like');\n $grid->column('university', '毕业院校与专业')->filter('like');\n $grid->column('major', '目前的专业/技术特长')->filter('like');\n $grid->column('linkphone', '联系电话')->filter('like');\n $grid->exporter(new TalentExporter());\n $grid->actions(function ($actions) {\n // 去掉查看\n $actions->disableView();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Resources);\n\n $grid->id('ID');\n $grid->type('类型')->using(Resources::TYPE)->filter(Resources::TYPE);\n $grid->name('名称');\n $grid->url('图片')->image();\n $grid->sort_num('排序')->editable()->sortable();\n $grid->memo('备注');\n\n $grid->disableExport();\n $grid->disableFilter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SiteHelp);\n\n $grid->model()->latest();\n\n $grid->filter(function ($filter) {\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->equal('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->select(SiteHelpCategory::pluck('name', 'id'));\n $filter->like('title', __('site-help::help.title'));\n $filter->equal('status', __('site-help::help.status.label'))\n ->select(__('site-help::help.status.value'));\n });\n\n $grid->column('thumbnail', __('site-help::help.thumbnail'))->image('', 66);\n $grid->column('id', __('site-help::help.id'));\n $grid->column('category.name', __('site-help::help.site_help_category_id'));\n $grid->column('title', __('site-help::help.title'));\n $grid->column('useful', __('site-help::help.useful'));\n $grid->column('status', __('site-help::help.status.label'))\n ->using(__('site-help::help.status.value'));\n $grid->column('created_at', __('admin.created_at'));\n $grid->column('updated_at', __('admin.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Platform());\n\n $grid->column('platform_number', __('Platform number'));\n $grid->column('platform_name', __('Platform name'))->label()\n ->expand(function ($model){\n $shops = $model->shops()->get()->map(function ($shop){\n return $shop->only(['shop_number', 'shop_name']);\n });\n\n return new Table([__('Platform number'), __('Platform name')], $shops->toArray());\n });\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->equal('platform_number', __('Platform number'));\n $filter->like('platform_name', __('Platform name'));\n });\n\n $grid->paginate(10);\n\n $grid->disableRowSelector();\n\n $grid->actions(function ($actions){\n $actions->disableView();\n $actions->disableDelete();\n });\n\n return $grid;\n }", "public function getDatagridViewBuilder();", "protected function grid()\n {\n $grid = new Grid(new Barang());\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('nama', 'Nama');\n });\n $grid->column('id', __('Id'));\n $grid->column('nama', __('Nama'));\n $grid->column('harga', __('Harga Beli'));\n $grid->column('harga_jual', __('Harga Jual'));\n $grid->column('satuan_id', __('Satuan id'))->display(function($satuan) {\n return Satuan::find($satuan)->nama;\n });\n $grid->column('jumlah_unit', __('Jumlah Unit'));\n $grid->column('parent_id', 'Parent')->display(function($id) {\n if($id) {\n return Barang::find($id)->nama;\n }\n else {\n return null;\n }\n });\n $grid->column('b_pengiriman', __('Pengiriman'));\n $grid->column('b_keamanan', __('Keamanan'));\n // $grid->column('created_at', __('Created at'));\n // $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Collect());\n $grid->disableActions();\n $grid->disableCreateButton();\n $grid->column('name','姓名');\n $grid->column('phone','手机号');\n $grid->column('address','地址');\n $grid->column('time','时间');\n $grid->column('message','备注');\n\n $postsExporter = new ColectExport();\n $postsExporter->fileName = date('Y-m-d H:i:s').'.xlsx';\n $grid->exporter($postsExporter);\n $url = url()->current();\n $url .= \"?_export_=all\";\n $grid->tools(function ($tools)use($grid,$url){\n $tools->append(new Export($grid,$url));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Customer);\n $grid->model()->where('is_delete',0)->orderBy('id','desc');\n $grid->id('ID')->sortable();\n $grid->code('客户编号');\n $grid->name('客户名称');\n $grid->contactor('联系人');\n $grid->tel('联系电话');\n $grid->email('邮箱');\n $grid->address('地址');\n $grid->receivables('应收账款数字');\n\n $grid->create_time('创建时间')->display(function ($create_time) {\n return date('Y-m-d H:i',$create_time);\n })->sortable();\n\n // 查询过滤\n $grid->filter(function($filter){\n $filter->column(1/2, function ($filter) {\n $filter->like('code', '客户编号');\n $filter->like('name', '客户名称');\n });\n $filter->column(1/2, function ($filter) {\n $filter->like('contactor', '联系人');\n $filter->like('tel', '联系电话');\n $filter->use(new TimestampBetween('create_time','创建时间'))->datetime();\n });\n\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Setting());\n\n $grid->column('id', __('Id'));\n $grid->column('member_fee', __('Member fee'));\n $grid->column('task_rate', __('Task rate'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HhxEquip());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('hhx_travel_id', __(trans('hhx.hhx_travel_id')))->display(function ($hhx_travel_id){\n return self::getTravelService()->getNameByTravelId($hhx_travel_id);\n });\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.equip_status'));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Sections());\n\n $grid->column('id', __('ID'))->editable() -> sortable();\n $grid->column('name', __('Nazwa'))->editable() -> sortable();\n $grid->column('pageId', __('ID sekcji (w sensie HTML)'))->editable() -> sortable();\n $grid->column('content', __('Zawartość'))->editable() -> sortable();\n $grid->column('style', __('Style(CSS)'))->editable() -> sortable();\n $grid->column('created_at', __('Utworzono')) -> sortable();\n $grid->column('updated_at', __('Zauktalizowano')) -> sortable() ;\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MethodPrice);\n\n $grid->id('ID');\n $grid->entity('Сущность')->select(Pest::all()->pluck('name','id'));\n $grid->method('Сущность')->select(Method::all()->pluck('name','id'));\n $grid->chemical('Сущность')->select(Chemical::all()->pluck('name','id'));\n $grid->square_1('Сущность')->select(Chemical::all()->pluck('name','id'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feedback);\n $grid->column('id', 'ID');\n $grid->column('content', '内容');\n $grid->column('member', '用户')->display(function(){\n return $this->member->nickname;\n });\n $grid->column('created_at', '时间');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Site());\n\n $grid->id('ID');\n $grid->category()->title('分类');\n $grid->title('标题');\n $grid->thumb('图标')->gallery(['width' => 50, 'height' => 50]);\n $grid->describe('描述')->limit(40);\n $grid->url('地址');\n\n $grid->disableFilter();\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n\n $grid->id('Id');\n $grid->title(trans('admin.title'));\n $grid->slogan(trans('admin.slogan'));\n $grid->name(trans('admin.name'));\n $grid->price(trans('admin.price'))->editable();\n $grid->created_at(trans('admin.created_at'));\n $grid->updated_at(trans('admin.updated_at'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n $grid->model()->orderBy('created_at','desc');\n\n $grid->column('id', __('Id'));\n $grid->column('log_name', __('Log name'))->using($this->log_name);\n $grid->column('description', __('Description'))->limit(10);\n $grid->column('subject_id', __('Subject id'));\n $grid->column('subject_type', __('Subject type'));\n $grid->column('causer_id', __('Causer id'));\n $grid->column('causer_type', __('Causer type'));\n $grid->column('properties', __('Properties'))->display(function ($properties) {\n $properties = [\n '详情' => isset($properties['description']) ? $properties['description'] : '',\n '备注' => isset($properties['remark']) ? $properties['remark'] : '',\n ];\n return new Table([], $properties);\n });\n $grid->column('created_at', __('Created at'))->sortable();\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter) {\n\n $filter->equal('log_name', __('Log name'))->select($this->log_name);\n\n });\n\n #禁用创建按钮\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableView();\n $actions->disableEdit();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Usertype());\n\n $grid->column('id', 'ID');\n $grid->column('usertype', '分类名称');\n $grid->column('created_at', '创建时间');\n $grid->column('updated_at', '修改时间');\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableColumnSelector();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Regional());\n\n $grid->column('id', 'ID');\n $grid->column('logo', 'Logo')->image('', '50', '50');\n $grid->column('name', 'Nama');\n $grid->column('address', 'Alamat');\n $grid->column('created_at', 'Dibuat')->date('d-m-Y');\n $grid->column('updated_at', 'Diubah')->date('d-m-Y');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Plan);\n $grid->model()->whereHas('category');\n\n $grid->column('category.name', __('Категория'));\n $grid->column('count', __('План'))->editable()->sortable();\n $grid->column('month_name', __('Месяц'));\n $grid->column('year', __('Год'))->sortable();\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order());\n\n $grid->column('id', __('Id'));\n $grid->column('trip', __('Trip'))->display(function () {\n return $this->trip->name;\n });\n $grid->column('user', __('User'))->display(function () {\n return $this->user->name . ' ' . $this->user->surname . \" ({$this->user->email})\";\n });\n $grid->column('paid', __('Paid'))->bool()->filter([\n 0 => 'No',\n 1 => 'Yes',\n ]);\n $grid->column('reservation_expires', __('Reservation expires'))->sortable();\n $grid->column('price', __('Price'));\n\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Terrace());\n\n $grid->column('id', __('Id'))->sortable()->style('text-align:center');\n $grid->column('image', __('平台图片'))->style('text-align:center')->image();\n $grid->column('name', __('平台名称'))->style('text-align:center');\n $grid->column('path', __('外链'))->style('text-align:center');\n $grid->column('notice_info', __('提示语'))->style('text-align:center');\n $grid->column('status', __('状态'))->display(function($status){\n return $status == 1 ? '未推荐' : '已推荐';\n })->style('text-align:center');\n $grid->column('created_at', __('创建时间'))->style('text-align:center');\n $grid->disableExport();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->add(new Terracedel());\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatUser);\n\n $grid->column('id', __('ID'));\n $grid->column('nick_name', __('昵称'));\n $grid->column('name', __('用户名'));\n $grid->column('password', __('密码'));\n $grid->column('mobile', __('手机号'));\n $grid->column('mini_program_open_id', __('OpenId'));\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Code());\n\n\n \n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->column(1 / 2, function ($filter) {\n $filter->like('phone', '手机号');\n $filter->like('ip', 'IP');\n });\n\n $filter->column(1 / 2, function ($filter) {\n $filter->between('created_at', '时间范围')->datetime();\n });\n\n\n });\n\n\n // $grid->column('id', __('Id'));\n $grid->column('phone', __('手机号'))->filter('like');\n $grid->column('code', __('验证码'));\n $grid->column('created_at', __('发送时间'));\n $grid->column('used_at', __('使用时间'));\n $grid->column('ip', __('IP'));\n $grid->model()->latest();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Purchase());\n\n $grid->column('id', \"编号\");\n $grid->column('consumer_name', \"客户\")->display(function () {\n return $this->consumer->full_name;\n });\n $grid->column('house_readable_name', \"房源\")->display(function () {\n return $this->house->readable_name;\n });\n $grid->column('started_at', \"生效日期\");\n $grid->column('ended_at', \"结束日期\");\n $grid->column('sell_type', \"出售方式\")->display(function ($sell_type) {\n return Purchase::$type[$sell_type];\n });\n $grid->column('price', \"成交价格\")->display(function ($price) {\n return \"¥$price\";\n });\n $grid->column('created_at', \"创建日期\");\n $grid->column('updated_at', \"更新日期\");\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Gys);\n\n $grid->id('Id');\n $grid->name('公司名称');\n $grid->tel('联系人电话');\n $grid->file('营业执照')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->hyzz('资质证书')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->type('类型');\n $grid->username('用户名称');\n $grid->password('密码');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n $grid->status('账户状态')->radio([\n 0=> '审核中',\n 1=> '审核通过',\n 2=> '冻结账户'\n ]);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n// $grid->column('id', __('Id'));\n $grid->column('date', __('Дата'));\n $grid->column('name', __('Город'))->display(function () {\n return '<a href=\"/admin/city-users?set='.$this->id.'\">'.$this->name.'</a>';\n });\n $grid->column('image', 'Картинка')->display(function () {\n $str = $this->image!='' ? '<img src=\"/uploads/images/'.$this->image.'\" height=\"100\"/>' : '';\n return $str;\n });\n// $grid->column('text', __('Text'));\n $grid->column('show', 'Активен')->display(function () {\n return $this->show ? 'да' : 'нет';\n });\n// $grid->column('orders', __('Orders'));\n// $grid->column('created_at', __('Created at'));\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('Id');\n $grid->parent_id('父ID');\n $grid->name('名称');\n $grid->order('排序');\n $grid->image('图片');\n $grid->index_template('首页模版');\n $grid->detail_template('详情模版');\n $grid->status('Status')->display(function ($status){\n return $status ? '<p class=\"text-success\">启用</p>' : '<p class=\"text-muted\">禁用</p>';\n });\n $grid->created_at('创建时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Member());\n\n $grid->column('id', 'id')->sortable();\n $grid->column('username','用户名');\n $grid->column('phone', '手机号')->display(function() {\n return substr($this->phone, 0, 3).'****'.substr($this->phone, 7);\n });\n $grid->column('avatar', '头像')->image('', 50, 50);\n $grid->column('created_at', '注册时间')->sortable();\n $grid->disableCreateButton();\n $grid->disableExport();\n $grid->disableActions();\n $grid->filter(function ($filter) {\n\n // 设置created_at字段的范围查询\n $filter->between('created_at', '创建时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid() {\n\t\t$grid = new Grid(new Payment);\n\t\t$grid->disableCreateButton();\n\t\t$grid->column('id', __('Id'));\n\t\t$grid->column('user_id', __('用户'));\n\t\t// $grid->column('app_id', __('App id'));\n\t\t$grid->column('price', __('金额'));\n\t\t$grid->column('transaction_id', __('三方订单号'));\n\t\t$grid->column('out_trade_no', __('平台订单号'));\n\t\t$grid->column('type', __('订单类型'))->using(['20' => '商城订单']);\n\t\t$grid->column('status', __('状态'))->using(['0' => '未支付', '1' => '已支付', '2' => '未支付']);\n\t\t// $grid->column('other', __('Other'));\n\t\t$grid->column('payment_at', __('支付时间'));\n\t\t$grid->column('created_at', __('创建时间'));\n\t\t$grid->column('updated_at', __('更新时间'));\n\n\t\treturn $grid;\n\t}", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->id('Id');\n $grid->name('商品名');\n $grid->column('category.name', '品类');\n $grid->fabric('Fabric');\n $grid->gsm('Gsm');\n $grid->material('Material');\n $grid->attach('Attach');\n $grid->head_image('商品图')->image('http://yujiaknit.test/images/', 100, 100);\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->filter(function ($filter) {\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feed());\n\n $grid->column('id', __('Id'));\n $grid->column('url', __('url'));\n $grid->column('id_author', __('Id author'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Withdrawal());\n\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n $filter->like('name', __('分区名称'));\n });\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('uid', __('用户昵称(UID)'))->display(function ($uid) {\n return UsersInfo::where('id',$uid)->value('nickname').\"({$uid})\";\n });\n $grid->column('real_name', __('实名姓名'));\n $grid->column('id_card', __('身份证号码'));\n $grid->column('mobile', __('联系电话'));\n $grid->column('amount', __('提现数量'));\n $grid->column('status', __('状态'))->display(function ($status) {\n return Withdrawal::$status[$status];\n });\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('修改时间'));\n\n $grid->disableActions();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StationBannerImage());\n\n $grid->column('id', __('Id'));\n $grid->column('station.station_name', __('測站'));\n $grid->column('image', __('輪播圖'))->image('', '50');\n $grid->column('url', __('連結'))->link();\n $grid->column('order', __('排序'));\n $grid->column('valid_at', __('有效日期'));\n $grid->column('mod_user', __('異動人員'));\n $grid->column('updated_at', __('異動時間'));\n\n if (Admin::user()->username != 'admin') {\n $grid->model()->where('station_id', '=', Admin::user()->station_id);\n }\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new KuponGroup);\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name',__('Nama'));\n $grid->column('total',__('Jumlah Kupon'));\n $grid->column('amount_per_kupon',__('Nilai Per Kupon'));\n $grid->column('expired',__('Kedaluwarsa'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n return Admin::grid(Classroom::class, function (Grid $grid) {\n\n $grid->id('ID')->sortable();\n\n // $grid->column();\n\n $grid->column('number', '编号');\n $grid->column('name', '名称');\n $grid->column('location', '地点');\n $grid->column('square', '面积');\n $grid->column('floor', '楼层');\n $grid->column('is_free', '是否空闲');\n $grid->column('building_name', '建筑物名称');\n\n $grid->created_at();\n $grid->updated_at();\n });\n }", "protected function grid()\n {\n $grid = new Grid(new Milestone);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('type', __('Type'))->select(Milestone::TYPE_MAP);\n $grid->column('version', __('Version'));\n $grid->column('content', __('Content'));\n $grid->column('detail', __('Detail'));\n $grid->column('created_at', __('Created at'))->sortable()->hide();\n $grid->column('updated_at', __('Updated at'))->sortable()->hide();\n\n $grid->model()->orderBy('id', 'desc');\n\n $grid->filter(function ($filter) {\n $filter->equal('version', '版本');\n $filter->like('content', '内容');\n $filter->equal('type', '类型')->select(Milestone::TYPE_MAP);\n $filter->between('created_at', '创建时间')->datetime();\n $filter->between('updated_at', '更新时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Test());\n\n $grid->id('编号');\n $grid->name('教师姓名');\n $grid->work_point('教学分数');\n $grid->science_point('科研分数');\n $grid->disableCreateButton();\n $grid->disableFilter();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new UserHealth());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('height', __('Height'))->filter();\n $grid->column('weight', __('Weight'))->filter();\n $grid->column('blood_pressure', __('Blood pressure'))->filter();\n $grid->column('sugar_level', __('Sugar level'))->filter();\n $grid->column('blood_type', __('Blood type'))->filter();\n $grid->column('muscle_mass', __('Muscle mass'))->filter();\n $grid->column('metabolism', __('Metabolism'))->filter();\n $grid->column('genetic_history', __('Genetic history'))->filter();\n $grid->column('illness_history', __('Illness history'))->filter();\n $grid->column('allergies', __('Allergies'))->filter();\n $grid->column('prescription', __('Prescription'))->filter();\n $grid->column('operations', __('Operations'))->filter();\n $grid->column('user_id', __('User id'))->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n return $grid;\n }", "protected function grid()\n { \n \n $grid = new Grid(new Blog);\n\n $grid->id('Id')->sortable();\n $grid->title('标题');\n // $grid->content('内容');\n $grid->logo('图片')->display(function ($value) {\n return \"<img width='50' src='/upload/$value'>\";\n });\n $grid->discuss('评论');\n $grid->display('浏览');\n \n $grid->lab_id('标签')->display(function ($value) {\n $lab_name = Lab::select('lab_name')->where('id',$value)->get();\n \n return $lab_name[0]->lab_name;\n });\n\n $grid->cat_id('分类')->display(function ($value) {\n $cat_name = Cat::select('cat_name')->where('id',$value)->get();\n return $cat_name[0]->cat_name;\n });\n \n\n\n $grid->created_at('添加时间');\n \n $grid->actions(function ($actions){\n $actions->disableView();\n });\n\n $grid->filter(function($filter){\n $filter->like('title', '标题');\n $filter->like('content', '内容');\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('surname', __('Surname'));\n $grid->column('email', __('Email'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category());\n $grid->model()->small();\n \n $grid->quickCreate(function (Grid\\Tools\\QuickCreate $create) {\n $create->text('erp_id', 'ERP ID');\n $create->text('name', '小分類名稱');\n $create->select('parent_id', __('中分類'))->options(\n Category::Mid()->pluck('name', 'id')\n );\n $create->text('type','分級(不需改)')->default(3);\n });\n\n $grid->column('erp_id', __('ERP Id'));\n $grid->column('name', __('小分類名稱'));\n $grid->column('parent_id', __('中分類'))->display(function($userId) {\n return Category::find($userId)->name;\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatEvent);\n\n $grid->id('Id');\n $grid->title('事件标题');\n $grid->key('Key');\n $grid->event('事件类型')->using(WechatEvent::EVENTLIST);\n $grid->method('执行方法');\n $grid->column('message.title', '消息标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Station());\n\n $grid->column('id', __('Id'));\n $grid->column('area.area_name', __(trans('admin.area_name')));\n $grid->column('station_code', __(trans('admin.station_code')));\n $grid->column('station_name', __(trans('admin.station_name')));\n $grid->column('telno', __(trans('admin.telno')));\n $grid->column('order', __(trans('admin.order')));\n $grid->column('valid_at', __(trans('admin.valid_at')));\n $grid->column('mod_user', __(trans('admin.mod_user')));\n $grid->column('updated_at', __(trans('admin.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GithubRepositories());\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('项目名'))->limit(20);\n $grid->column('full_name', __('项目全名'))->limit(40);\n $grid->column('description', __('简介'))->limit(60);\n// $grid->column('owner', __('作者资料'));\n $grid->column('html_url', __('网页地址'))->link();\n// $grid->column('original_data', __('原始数据'));\n $grid->column('created_at', __('创建时间'));\n// $grid->column('updated_at', __('更新时间'));\n\n //快捷搜索\n $grid->quickSearch('name', 'full_name', 'description');\n\n //倒叙\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->column('id', __('Id'));\n $grid->column('type.name', __('分类名称'));\n $grid->column('recommend.name', __('推荐名称'));\n $grid->column('name', __('产品名称'));\n $grid->column('description', __('产品描述'));\n $states = [\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n ];\n $grid->column('pop', __('推荐'))->switch($states);\n $grid->column('logo','logo图')->display(function (){\n if ($this->logo){\n return '<div class=\"pop\"><img src='.env('APP_URl').'/uploads/'.$this->logo.' style=\"width:100px;height:100px;\"></div>';\n }else{\n return ;\n }\n });\n $grid->column('price', __('价格'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Student);\n\n $grid->id('Id');\n $grid->surname('Фамилия');\n $grid->name('Имя');\n $grid->family_name('Отчество');\n $grid->telegram_id('Telegram-id');\n $grid->email('Email');\n $grid->number('Контактный телефон');\n $grid->groups_id('Группа')->using(Group::all()->pluck('name', 'id')->toArray());\n $grid->created_at('Создание записи');\n $grid->updated_at('Редактирование записи');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n $grid->id('ID')->sortable();\n $grid->name('名称');\n $grid->type('分类')->display(function($status) {\n $arr = (new AdminModel('goods_type'))->getAll('',['type','id']);\n foreach ($arr as $key => $value) {\n if($status==$value['id']) return $value['type']; \n }\n \n });\n $grid->cover('商品大图')->image('',70, 70);\n $grid->image('详情图')->image('',70, 70);\n $grid->stock('库存');\n $grid->price('积分价格');\n $grid->status('状态')->display(function($status) {\n if($status==1) return \"上架中\";\n if($status==0) return \"已下架\"; \n });\n $grid->disableExport();//禁用导出数据按钮\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();//禁用查询过滤器\n });\n \n \n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title_designer_cn', '标题(设计师)');\n $filter->like('title_name_cn', '标题(项目名称)');\n $filter->like('title_intro_cn', '标题(项目介绍)');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->title_designer_cn('标题(中)')->display(function () {\n return CurrentModel::formatTitle($this, 'cn');\n });\n $grid->title_designer_en('标题(英)')->display(function () {\n return CurrentModel::formatTitle($this, 'en');\n });\n $grid->article_status('状态')->display(function ($article_status) {\n switch ($article_status) {\n case '0' :\n $article_status = '草稿';\n break;\n case '1' :\n $article_status = '审核中';\n break;\n case '2' :\n $article_status = '已发布';\n break;\n }\n return $article_status;\n });\n $grid->release_time('发布时间')->sortable();\n \n // $grid->column('created_at', __('发布时间'));\n $grid->created_at('添加时间')->sortable();\n // $grid->column('updated_at', __('添加时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatMessage);\n\n $grid->id('Id');\n $grid->msg_type('消息类型');\n $grid->media_id('素材id');\n $grid->title('标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('field.id'));\n $grid->column('name', __('Name'));\n $grid->column('email', __('Email'));\n $grid->column('email_verified_at', __('Email verified at'));\n $grid->column('password', __('Password'));\n $grid->column('remember_token', __('Remember token'));\n $grid->column('point', __('Point'));\n $grid->column('status', __('field.status'));\n $grid->column('created_at', __('field.created_at'));\n $grid->column('updated_at', __('field.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n $grid->model()->where('type',$this->getProductType())->orderBy('id','desc');\n //调用自定义的Grid\n\n $this->customGird($grid);\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new News);\n\n $grid->id('Id');\n $grid->title('题目');\n $grid->category_id('分类ID');\n // $grid->content('内容');\n $grid->thumbnail('封面图');\n $grid->status('状态');\n $grid->read_count('阅读数量');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new DbTop());\n $grid->header(function ($query) {\n $alread = DbTop::whereStatus(1)->count();\n $notyet = DbTop::whereStatus(0)->count();\n $notok = DbTop::whereStatus(2)->count();\n $pan = DbTop::where('pan_url', '<>', '')->count();\n $x = '已看:' . $alread . '<br />未看:' . $notyet . '<br />不感兴趣:' . $notok . '<br />资源:' . $pan;\n return '<div class=\"alert alert-success\" role=\"alert\">' . $x . '</div>';\n });\n $grid->column('no', __(trans('hhx.no')))->display(function ($no) {\n return 'No.' . $no;\n });\n $grid->column('img', __(trans('hhx.img')))->image();\n $grid->column('c_title', __(trans('hhx.c_title')))->display(function () {\n return $this->c_title . ' ' . $this->year;\n });\n $grid->column('rating_num', __(trans('hhx.rating_num')));\n $grid->column('inq', __(trans('hhx.inq')));\n $grid->column('actor', __(trans('hhx.actor')));\n $grid->column('type', __(trans('hhx.type')));\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.db_status'));\n $grid->filter(function ($filter) {\n $filter->like('c_title', '中文名');\n $filter->like('year', '年');\n $filter->like('status', trans('hhx.status'))->select(config('hhx.db_status'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Drug);\n\n $grid->id('ID');\n $grid->street_name('«Уличное» название');\n $grid->city('Город');\n $grid->column('photo_drug','Фотография наркотика')->display(function () {\n $photo = Photo::whereDrugId($this->id)->where('type', 0)->first();\n\n if ($photo) {\n return $photo->photo;\n } else {\n return '';\n }\n })->image();\n\n $grid->column('confirm', 'Подтверждение')->display(function ($confirm) {\n if ($confirm) {\n return '✅Подтверждено';\n } else {\n return '❌Не подтверждено';\n }\n });\n $grid->updated_at('Дата изменения');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Profile());\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name', __('ID'))->sortable();\n $grid->column('surname', __('ID'))->sortable();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku);\n\n $grid->column('id', 'ID');\n $grid->column('name', 'sku名称')->editable();\n $grid->column('sku_number', 'sku编号')->editable();\n // $grid->column('description', 'sku描述');\n $grid->product(\"所属商品\")->display(function ($product) {\n return $product['name'];\n });\n $grid->column('price', '原价')->editable();\n $grid->column('stock', '库存量')->editable();\n $grid->column('is_on_sale', '是否上架')->using([0 => '否', 1 => '是']);\n $grid->column('primary_picture', '商品主图');\n $grid->column('retail_price', '零售价格')->editable();\n $grid->column('is_promotion', '是否促销')->using([0 => '否', 1 => '是']);\n $grid->column('promotion_price', '促销价格')->editable();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Leavetime());\n $grid->filter(function ($filter) {\n $filter->like('designer.name', '设计师');\n $filter->between('created_at','创建时间')->datetime();\n });\n $grid->column('id', __('Id'));\n $grid->column('designer.name', __('设计师'));\n $grid->column('type', __('请假类型'))->display(function ($value) {\n return $value ? '半天' : '全天';\n });\n $grid->column('date', __('请假日期'));\n $grid->column('time', __('时间段'))->display(function ($time) {\n $html = '';\n foreach ($time as $k => $value){\n $work = Worktime::where('id','=',$value)->first();\n if($work){\n $html .= \"<span class='label label-success' style='margin-left: 10px'>{$work['time']}</span>\";\n }else{\n $html = '';\n }\n\n }\n return $html;\n });\n $grid->column('created_at', __('创建日期'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n //$actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku());\n\n $grid->column('id', __('Id'));\n $grid->column('product', __('产品'))->display(function ($product){\n return $product['title'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('price', __('Price'));\n $grid->column('stock', __('Stock'));\n $grid->column('options', __('sku规格'))->display(function ($options){\n if (count($options) > 0){\n $strOption = '';\n foreach ($options as $option) {\n $strOption .= \"<p>{$option['product_property_name']}:{$option['product_property_value']}</p>\";\n }\n return $strOption;\n }\n return '';\n });\n\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n // 只展示已支付的订单,并且默认按支付时间倒序排序\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('订单流水号');\n //展示关联关系的字段时,使用column方法\n $grid->column('user.name','买家');\n $grid->total_amount('总金额')->sortable();\n $grid->paid_at('支付时间')->sortable();\n $grid->ship_status('物流')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('退款状态')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n // 禁用创建按钮,后台不需要创建订单\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n // 禁用删除和编辑按钮\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n// return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SkuModel);\n\n $grid->column('s_id', __('skuid'));\n $grid->column('sku_num', __('编号'));\n $grid->column('goods_id', __('商品id'));\n $grid->column('sku_name', __('sku名称'));\n $grid->column('sku_price', __('Sku价格'));\n $grid->column('sku_goods_repertory', __('库存'));\n $grid->column('sku_goods_img', __('照片'))->image();\n $grid->column('created_at', __('添加时间'));\n $grid->column('updated_at', __('修改时间'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StockProduct);\n\n $grid->column('id', __('Id'));\n // $grid->column('product_id', __('Product id'))->modal('Product Name', function($model){\n // $products = $model->product()->get()->map(function($product) {\n // return $product->only('id','product_name');\n // });\n // return new Table(['ID', 'Product Name'], $products->toArray());\n // });\n $grid->column('product.product_name', __('Name'));\n $grid->column('moq', __('Moq'));\n $grid->column('quantity', __('Quantity'));\n $grid->column('price', __('Price'));\n $grid->column('note', __('Note'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Project());\n $grid->model()->orderBy('id', 'desc');\n $grid->id('ID')->sortable();\n $grid->name('项目名称')->editable();\n $grid->url('项目地址')->link();\n $grid->username('账号');\n $grid->password('密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],\n ];\n $grid->status('状态')->switch($status);\n $grid->created_at('创建时间');\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Subscribe());\n $grid->column('number', __('商品编号'));\n $grid->column('name', __('商品名称'));\n $grid->column('subtitle', __('商品副标题'));\n $grid->column('price', __('单价'));\n $grid->column('quantity', __('库存'));\n $grid->column('type', __('分类'));\n $grid->column('status', __('状态'));\n $grid->column('recommend', __('推荐'));\n $grid->column('sold', __('总售量'));\n $grid->column('integral', __('返还碳积分'));\n $grid->column('emission', __('返还碳减排'));\n $grid->column('place', __('地点'));\n $grid->column('maintenance', __('养护'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GroupTask());\n $grid->column('name', __('messages.name'));\n $grid->column('active', __('messages.active'))->switch();\n $grid->column('sort', __('messages.sort'))->editable();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HotRank());\n\n// $grid->column('id', __('Id'));\n $grid->column('sort', __('排序'))->editable();\n $grid->column('nickname', __('昵称'));\n $grid->column('avatar', __('头像'))->image();\n $grid->column('gender', __('性别'))->using([\n 1 => '男',\n 2 => '女'\n ]);\n// $grid->column('role', __('Role'));\n// $grid->column('intro', __('Intro'));\n $grid->column('fans', __('粉丝数'));\n $grid->column('red_book_link', __('小红书链接'));\n $grid->column('red_book_fans', __('小红书粉丝'));\n $grid->column('douyin_link', __('抖音链接'));\n $grid->column('douyin_fans', __('抖音粉丝'));\n $grid->column('created_at', __('创建时间'));\n $grid->actions(function ($actions) use ($grid) {\n // 去掉删除\n// $actions->disableDelete();\n// // 去掉编辑\n// $actions->disableEdit();\n // 去掉查看\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new TaskOrder);\n $grid->model()->orderBy('id', 'desc');\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->equal('eid','快递单号')->integer();\n $filter->equal('store','快递网点')->select(storedatas(1));\n $filter->equal('etype','快递公司')->select(edatas());\n $filter->equal('sname','客服名称');\n $filter->between('created_at', '导入时间')->datetime();\n });\n $grid->id('ID');\n $grid->eid('快递单号');\n $grid->sname('客服名称');\n $grid->store('快递网点');\n $grid->etype('快递公司');\n\n $grid->created_at('分配时间');\n //$grid->updated_at('分配时间');\n $excel = new ExcelExpoter();\n $excel->setAttr([ '快递单号','快递网点','快递公司','负责客服','导入时间'], ['eid','store','etype','sname','created_at']);\n $grid->exporter($excel);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new AnswerList);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('title', trans('admin.title_answer'))->width(500);\n $grid->column('A', trans('admin.A'))->width(150);\n $grid->column('B', trans('admin.B'))->width(150);\n $grid->column('C', trans('admin.C'))->width(150);\n $grid->column('D', trans('admin.D'))->width(150);\n $grid->column('correct', trans('admin.correct'))->width(100);\n $grid->column('status', trans('admin.status'))->using(AnswerList::STATUSES)->label(['warning', 'primary']);\n $grid->column('created_at', trans('admin.created_at'));\n $grid->column('updated_at', trans('admin.updated_at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->column(1 / 2, function ($filter) {\n $filter->equal('id', __('Id'));\n });\n $filter->column(1 / 2, function ($filter) {\n $filter->like('title', trans('admin.title'));\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new userWhitelist());\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->like('accountName', ___('accountName'));\n });\n $grid->column('id', ___('Id'));\n $grid->column('accountId', ___('AccountId'));\n $grid->column('accountName', ___('AccountName'));\n $grid->column('nickName', ___('NickName'));\n\n return $grid;\n }", "protected function grid()\n {\n $Adv=new Adv();\n $grid = new Grid($Adv);\n\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"value\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"array\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"array\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>\"start_time\",\"title\"=>\"活动开始时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"end_time\",\"title\"=>\"活动结束时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"array\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::setlist_show($grid,$list_array);\n\n $grid->filter(function($filter) use($platform,$type){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->in('platform', \"平台\")->multipleSelect($platform);\n $filter->in('type', \"类型\")->multipleSelect($type);\n });\n return $grid;\n }" ]
[ "0.72541326", "0.7218252", "0.7064843", "0.70040804", "0.6995721", "0.69847125", "0.695367", "0.6928443", "0.6927314", "0.69256824", "0.6923453", "0.69233567", "0.6922796", "0.6907988", "0.6889554", "0.6888196", "0.6878719", "0.6845261", "0.68254143", "0.6818076", "0.6810526", "0.6801908", "0.68007404", "0.6792371", "0.67900723", "0.6785066", "0.67814827", "0.67809147", "0.6773841", "0.67679495", "0.6767842", "0.67664576", "0.67600983", "0.6759144", "0.6747873", "0.67451704", "0.6735288", "0.6732706", "0.6727944", "0.6718374", "0.6718129", "0.67142314", "0.6713679", "0.67077774", "0.66969377", "0.66829485", "0.6681708", "0.66795236", "0.66743", "0.6665543", "0.66581196", "0.6655195", "0.6648576", "0.6647211", "0.6639091", "0.6634314", "0.66231555", "0.6622456", "0.6605076", "0.6601071", "0.6595906", "0.6595102", "0.6593814", "0.65931946", "0.6590833", "0.65907514", "0.65832734", "0.657433", "0.6573453", "0.65642095", "0.65639156", "0.655778", "0.65577185", "0.6556319", "0.6553949", "0.6552593", "0.6549884", "0.6542962", "0.65393496", "0.65337956", "0.6528965", "0.6526889", "0.65218806", "0.650997", "0.6508564", "0.65050364", "0.6498207", "0.6491189", "0.647587", "0.6474169", "0.6469046", "0.6464774", "0.6463954", "0.64510244", "0.6450445", "0.6450348", "0.64481837", "0.64450586", "0.6444865", "0.6443929", "0.64308834" ]
0.0
-1
Make a grid builder.
protected function gridBooking($id) { $grid = new Grid(new BookingDetail()); $grid->model() ->orderBy('id', 'desc') ->where('booking_id', $id); $grid->disableActions(); $grid->disableCreateButton(); $grid->disableRowSelector(); $grid->id('ID'); $grid->groupPrice()->name_en('Group Price'); $grid->quantity('Quantity'); $grid->total_price('Total Price'); $grid->created_at('Created At'); return $grid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId) {\n if ($formId) {\n $form = Formulario::find($formId);\n return \"<span>{$form['name']}</span>\";\n }\n });\n\n $grid->model()->orderBy('id', 'asc');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Direction());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('intro', __(trans('hhx.intro')));\n $grid->column('Img', __(trans('hhx.img')))->image();\n $grid->column('status', __(trans('hhx.status')))->using(config('hhx.status'));\n $grid->column('order_num', __(trans('hhx.order_num')));\n $grid->column('all_num', __(trans('hhx.all_num')));\n $grid->column('this_year', __(trans('hhx.this_year')));\n $grid->column('stock', __(trans('hhx.stock')));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "public function getGridBuilder($name);", "protected function grid()\n {\n $grid = new Grid(new Good);\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('名称'));\n $grid->column('unit', __('单位'));\n //$grid->column('list_img', __('商品图片'))->image()->width(10);\n $grid->column('amount', __('价格'));\n $grid->column('created_at', __('创建时间'));\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableFilter();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('image', __('Image'));\n $grid->column('user_roles', __('User roles'));\n $grid->column('intro', __('Intro'));\n $grid->column('details', __('Details'));\n $grid->column('start_at', __('Start at'));\n $grid->column('end_at', __('End at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('location', __('Location'));\n $grid->column('fee', __('Fee'));\n $grid->column('involves', __('Involves'));\n $grid->column('involves_min', __('Involves min'));\n $grid->column('involves_max', __('Involves max'));\n $grid->column('status', __('Status'));\n $grid->column('organizers', __('Organizers'));\n $grid->column('views', __('Views'));\n $grid->column('collectors_num', __('Collectors num'));\n $grid->column('is_stick', __('Is stick'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new NewEnergy());\n\n $grid->column('user_id', __('用户'));\n $grid->column('car_id', __('车辆ID'));\n $grid->column('start_mileage', __('开始里程'));\n $grid->column('end_mileage', __('结束里程'));\n $grid->column('mileage', __('里程'));\n $grid->column('type', __('车辆类型'));\n $grid->column('status', __('状态'));\n $grid->column('remark', __('备注'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MachinesStyle());\n\n $grid->model()->latest();\n \n $grid->column('id', __('索引'))->sortable();\n\n $grid->column('style_name', __('型号名称'))->help('机具的型号名称');\n\n $grid->column('machines_fact.factory_name', __('所属厂商'))->help('机具型号所属的厂商');\n\n // $grid->column('machines_fact.machines_types.name', __('所属类型'))->help('机具型号所属的类型');\n\n $grid->column('created_at', __('创建时间'))->date('Y-m-d H:i:s')->help('机具型号的创建时间');\n\n $grid->column('updated_at', __('修改时间'))->date('Y-m-d H:i:s')->help('机具型号的最后修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Enseignant());\n\n $grid->column('id', __('Id'));\n $grid->column('matricule', __('Matricule'));\n $grid->column('nom', __('Nom'));\n $grid->column('postnom', __('Postnom'));\n $grid->column('prenom', __('Prenom'));\n $grid->column('sexe', __('Sexe'));\n $grid->column('grade', __('Grade'));\n $grid->column('fonction', __('Fonction'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new LotteryCode());\n $grid->model()->orderBy('prizes_time', 'desc');\n $grid->id('Id');\n $grid->code('抽奖码');\n $grid->batch_num('批次号');\n $grid->prizes_name('奖品');\n $grid->valid_period('有效期');\n $grid->prizes_time('抽奖时间');\n $grid->award_status('发奖状态')->editable('select', [0 => '未发放', 1 => '已发放']);\n $grid->disableCreateButton();\n $grid->disableActions();\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n // 在这里添加字段过滤器\n $filter->like('code', '抽奖码');\n $filter->like('batch_num', '批次号');\n $filter->between('prizes_time', '抽奖时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Boarding());\n\n $grid->column('id', __('Id'));\n $grid->column('pet.name', __('Pet Name'));\n $grid->column('reservation.date', __('Reservation Date'));\n $grid->column('cage_id', __('Cage Number'));\n $grid->column('end_date', __('End date'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function($filter){\n\n $filter->disableIdFilter();\n $filter->like('pet.name', 'Pet Name');\n \n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Engine());\n\n $grid->column('id', __('#'));\n $grid->column('power_station_id', __('Power station'))\n ->display(function ($userId) {\n $u = PowerStation::find($userId);\n if (!$u)\n return \"-\";\n return $u->name;\n })\n ->sortable();\n $grid->column('name', __('Tank Name'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new gameLog());\n\n $grid->column('onlyId', ___('OnlyId'));\n $grid->column('bigBlindIndex', ___('BigBlindIndex'));\n $grid->column('gameNums', ___('GameNums'));\n $grid->column('smallBlindIndex', ___('SmallBlindIndex'));\n $grid->column('tableCards', ___('TableCards'));\n $grid->column('tableId', ___('TableId'));\n $grid->column('tableSeat1Str1', ___('TableSeat1Str1'));\n $grid->column('tableSeat1Str2', ___('TableSeat1Str2'));\n $grid->column('tableSeat1Str3', ___('TableSeat1Str3'));\n $grid->column('tableSeat1Str4', ___('TableSeat1Str4'));\n $grid->column('tableSeat1Str5', ___('TableSeat1Str5'));\n $grid->column('tableSeat1Str6', ___('TableSeat1Str6'));\n $grid->column('tableSeat1Str7', ___('TableSeat1Str7'));\n $grid->column('time', ___('Time'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Work);\n\n $grid->id('Id')->sortable();;\n $grid->name(trans('Название'))->sortable();;\n $grid->description(trans('Описание'))->sortable();;\n $grid->order_id(trans('Порядок'))->sortable();;\n\n $grid->paginate(20);\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('name', trans('Название'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Cate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('link', __('Link'));\n $grid->column('thumb', __('Thumb'));\n $grid->column('status', __('Status'));\n $grid->column('sort', __('Sort'));\n $grid->column('createtime', __('Createtime'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new BrandCooperation);\n\n $grid->sort('排序')->editable()->sortable();\n $grid->name('品牌名称');\n $grid->is_show('是否显示')->editable('select', [1 => '显示', 0 => '隐藏']);\n $grid->created_at('添加时间')->sortable();\n\n// $grid->actions(function ($actions) {\n// $actions->disableView(); // 禁用查看\n// });\n\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n // 查询\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->like('name', '品牌名称');\n $filter->equal('is_show', '显隐')->radio([1 => '显示', 0 => '隐藏']);\n });\n\n return $grid;\n }", "public function buildGrid() {\n // Processing Grids\n if ($this->getContext('container.grids')) {\n $grids = new VTCore_Bootstrap_Grid_Column($this->getContext('container.grids'));\n $this->addClass($grids->getClass(), 'grids');\n }\n\n return $this;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('ID');\n $grid->name('Название');\n //$grid->intro_img('Превью');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity);\n\n $grid->id('Id');\n $grid->log_name('Log name');\n $grid->description('Description');\n $grid->subject_id('Subject id');\n $grid->subject_type('Subject type');\n $grid->causer_id('Causer id');\n $grid->causer_type('Causer type');\n $grid->properties('Properties');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableEdit();\n $actions->disableView();\n });\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->between('created_at', '创建时间')->datetime();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Banner);\n\n $grid->id('Id');\n $grid->title('Title');\n $grid->image('Image')->display(function($image) {\n return '<img width=\"30\" src=\"' . (env('APP_URL') . '/storage/' . ($image ?: 'images/default.png')) . '\"\"/>';\n });\n $grid->status('Status');\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->id('ID')->sortable();\n\n $grid->company_id('公司名称')->display(function ($company_id) {\n $company = Company::find($company_id);\n if ($company) {\n return $company->company_name;\n }\n return $company_id;\n });\n $grid->project_name('项目名称')->sortable();\n $grid->link_url('项目链接');\n $grid->display('公开度')->display(function ($display) {\n return $display == 0 ? '公开' : '私密';\n });\n $grid->created_at('添加时间')->sortable();\n\n return $grid;\n }", "protected function constructGrid()\n {\n // jquery script for loading first page of grid\n $table = \"\n <script type=\\\"text/javascript\\\">\n // load first page\n WschangeModelPagination(\n '$this->_id',\n '$this->_action',\n '$this->_modelName',\n '$this->noDataText',\n $this->itemsPerPage,\n $this->showEdit,\n '$this->_order',\n '$this->_formId',\n 0,\n '$this->_id'+'_0',\n '$this->_edit_action',\n '$this->_delete_action'\n );\n </script>\n \";\n\n // container for edit dialog\n if ($this->showEdit) {\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'\"></div>';\n $table .= '<div class=\"uk-modal\" id=\"'.$this->_formId.'_new\"></div>';\n }\n\n // title\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-1\">';\n $table .= '<h1>'.$this->_model->metaName.'</h1>';\n $table .= '</div>';\n $table .= '</div>';\n\n // add and search controls\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-small-1-1 uk-width-medium-1-2\">';\n $table .= '<form class=\"uk-form uk-form-horizontal\">';\n $table .= '<fieldset data-uk-margin>';\n // new item button\n if ($this->showEdit) {\n $table .= '<button class=\"uk-button uk-button-success\"'\n .' data-uk-modal=\"{target:\\'#'.$this->_formId\n .'_new\\', center:true}\"'\n .' id=\"btn_create_'.$this->_id.'\"'\n .' type=\"button\" onclick=\"WseditModelID('\n .'\\''.$this->_formId.'_new\\', '\n .'\\''.$this->_modelName.'\\', '\n .'0, \\''.$this->_edit_action.'\\')\">';\n $table .= '<i class=\"uk-icon-plus\"></i>';\n $table .= '</button>';\n }\n // search control\n $table .= '<input';\n $table .= ' type=\"text\" id=\"search_'.$this->_id.'\"';\n $table .= '/>';\n $table .= '<button class=\"uk-button\"'\n .' id=\"btn_search_'.$this->_id\n .'\" type=\"button\" onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .'0, \\''.$this->_id.'\\'+\\'_0\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\">';\n $table .= '<i class=\"uk-icon-search\"></i>';\n $table .= '</button>';\n\n $table .= '</fieldset>';\n $table .= '</form>';\n $table .= '</div>';\n $table .= '</div>';\n\n // Grid View table\n $table .= '<div class=\"uk-grid\">';\n $table .= '<div class=\"uk-width-1-1\">';\n $table .= '<div class=\"uk-overflow-container\">';\n $table .= '<table class=\"uk-table uk-table-hover uk-table-striped\">';\n $table .= '<thead>';\n $table .= '<tr>';\n foreach ($this->_model->columns as $column) {\n if (!in_array($column, $this->_model->hiddenColumns)) {\n if (isset($this->_model->columnHeaders[$column])) {\n $table .= '<th>'\n .$this->_model->columnHeaders[$column];\n $table .= '</th>';\n } else {\n $table .= '<th>'.$column.'</th>';\n }\n }\n }\n if ($this->showEdit) {\n $table .= '<th></th>';\n }\n $table .= '</tr>';\n $table .= '</thead>';\n\n // container of table data loaded from AJAX request\n $table .= '<tbody id=\"'.$this->_id.'\"></tbody>';\n\n // end of grid table\n $table .= '</table>';\n $table .= '</div>';\n $table .= '</div>';\n $table .= '</div>';\n\n // get number ow rows from query so that we can make pager\n $db = new WsDatabase();\n $countQuery = 'SELECT COUNT(*) AS nrows FROM '.$this->_model->tableName;\n $result = $db->query($countQuery);\n $this->nRows = intval($result[0]['nrows']);\n $db->close();\n\n // number of items in pager\n $nPages = $this->getPagination($this->nRows);\n\n // construct pager\n $table .= '<ul class=\"uk-pagination uk-pagination-left\">';\n // links to pages\n for ($i = 0; $i < $nPages; $i++) {\n $table .= '<li>';\n $table .= '\n <a id=\"'.$this->_id.'_'.$i.'\"\n href=\"javascript:void(0)\"\n onclick=\"WschangeModelPagination('\n .'\\''.$this->_id.'\\', '\n .'\\''.$this->_action.'\\', '\n .'\\''.$this->_modelName.'\\', '\n .'\\''.$this->noDataText.'\\', '\n .$this->itemsPerPage.', '\n .$this->showEdit.', '\n .'\\''.$this->_order.'\\', '\n .'\\''.$this->_formId.'\\', '\n .$i.',\\''.$this->_id.'_'.$i.'\\', '\n .'\\''.$this->_edit_action.'\\', '\n .'\\''.$this->_delete_action.'\\')\"/>'\n .($i+1).'</a>';\n $table .= '</li>';\n }\n // end of pager\n $table .= '</ul>';\n\n // end of master div element\n $table .= '<br/>';\n\n $table .= '<script type=\"text/javascript\">'\n .'$(\"#search_'.$this->_id.'\").keydown(function(event) {'\n .' if(event.keyCode == 13) {'\n .' event.preventDefault();'\n .' $(\"#btn_search_'.$this->_id.'\").click();'\n .' }'\n .'});'\n .'</script>';\n\n unset($i, $nPages, $db, $result, $countQuery);\n return $table;\n }", "protected function grid()\n {\n $grid = new Grid(new Clinic());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('image', __('Image'))->image();\n $grid->column('name', __('Name'))->filter();\n $grid->column('type', __('Type'))->using(['1' => 'Clinic', '2' => 'Hospital'])->filter();\n $grid->column('email', __('Email'))->filter();\n $grid->column('phone', __('Phone'))->filter();\n $grid->column('address', __('Address'))->filter();\n $grid->column('website_url', __('Website url'))->link()->filter();\n $grid->column('profile_finish', __('Profile finish'))->bool()->filter();\n $grid->column('status', __('Status'))->bool()->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Information);\n\n $grid->model()->where('adminuser_id', '=', Admin::user()->id);\n $grid->disableCreateButton();\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('项目名称'));\n $grid->column('content', __('项目简介'))->limit(30);\n $grid->column('industry', __('行业类别'));\n $grid->column('investment', __('投资金额')); \n $grid->column('cont_name', __('资方联系人'));\n $grid->column('cont_phone', __('资方联系方式'));\n $grid->column('staff_name', __('工作人员姓名'));\n $grid->column('staff_phone', __('工作人员电话'));\n $grid->column('created_at', __('上报时间'));\n $grid->column('updated_at', __('更新时间'));\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('name', '项目名称');\n $filter->like('cont_name', '资方联系人');\n $filter->like('content', '项目情况');\n });\n\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n $grid->column('id', __('Id'));\n $grid->column('currency', __('Currency'));\n $grid->column('amount', __('Amount'));\n $grid->column('state', __('State'));\n $grid->column('game_id', __('Game id'));\n $grid->column('user_id', __('User id'));\n $grid->column('product_id', __('Product id'));\n $grid->column('product_name', __('Product name'));\n $grid->column('cp_order_id', __('Cp order id'));\n $grid->column('callback_url', __('Callback url'));\n $grid->column('callback_info', __('Callback info'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Dictionary());\n $grid->disableRowSelector();\n $grid->disableExport();\n\n $grid->column('id', __('Id'));\n $grid->column('type', __('Type'))->display(function () {\n return $this->type ? Dictionary::TYPES[$this->type] : null;\n })->label();\n $grid->column('option', __('Option'));\n $grid->column('slug', __('Slug'));\n $grid->column('alternative', __('Alternative'));\n $grid->column('approved', __('Approved'))->switch();\n $grid->column('sort', __('Sort'));\n\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->expand();\n $filter->where(function ($query) {\n $query->where('dictionaries.type', '=', $this->input);\n }, __('Фильтровать по типу'))->select(Dictionary::TYPES);\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SpecificationTemplate());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('keys', __('Keys'))->display(function ($keys) {\n return implode(',', $keys);\n });\n $grid->column('content', __('Content'))->display(function ($content) {\n return implode('<br/>', array_map(fn($values) => implode(',', $values), $content));\n });\n $grid->column('sort', __('Sort'))->editable();\n $grid->column('is_display', __('Is display'))->switch();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->actions(function (Grid\\Displayers\\Actions $actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n\n\n //only display paid order\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('order number');\n $grid->column('user.name', 'Buyer');\n $grid->total_amount('Total Amount')->sortable();\n $grid->paid_at('Paid Time')->sortable();\n $grid->ship_status('Shipment')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('Refund Status')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Book());\n\n $grid->column('id', __('Id'));\n $grid->author()->display(function($v) {\n return $v['name'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('year', __('Year'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Blog());\n\n $grid->column('id', __('Id'));\n $grid->column('title', __('Title'));\n $grid->column('sub_title', __('Sub title'));\n $grid->column('tag', __('Tag'));\n $grid->column('body', __('Body'));\n $grid->column('posted_by', __('Posted by'));\n $grid->column('posted_at', __('Posted at'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new PointMachine());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('point.name', __('Point name'));\n $grid->column('machine_no', __('Machine no'));\n // 1-自助型 2-全自动型\n $grid->column('type', __('Type'))->display(function ($type) {\n return $type == 1 ? '自助型 ' : '全自动型';\n });\n $grid->column('cost', __('Cost'));\n $grid->column('cost_at', __('Cost at'));\n $grid->column('build_at', __('Build at'));\n $grid->column('remark', __('Remark'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n $grid->column('id', __('Id'));\n $grid->column('sort', __('Sort'));\n $grid->column('name', __('Name'));\n $grid->column('slug', __('Slug'));\n $grid->column('description', __('field.description'))->display(function ($item) {\n return mb_strimwidth($item, 0, 500, '...');\n });\n $grid->column('files', __('field.images'))->display(function () {\n $images = array();\n foreach ($this->files as $file) {\n array_push($images, preg_replace(\"/images\\//\", \"images/small.\", $file->file));\n }\n return $images;\n })->carousel(150, 100);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Talent);\n\n $grid->column('talents_id', 'ID');\n $grid->column('name', '姓名')->filter('like');\n $grid->column('sex', '性别')->filter('like');\n $grid->column('jobtitle', '工作单位及职务')->filter('like');\n $grid->column('education', '学历学位')->filter('like');\n $grid->column('university', '毕业院校与专业')->filter('like');\n $grid->column('major', '目前的专业/技术特长')->filter('like');\n $grid->column('linkphone', '联系电话')->filter('like');\n $grid->exporter(new TalentExporter());\n $grid->actions(function ($actions) {\n // 去掉查看\n $actions->disableView();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Resources);\n\n $grid->id('ID');\n $grid->type('类型')->using(Resources::TYPE)->filter(Resources::TYPE);\n $grid->name('名称');\n $grid->url('图片')->image();\n $grid->sort_num('排序')->editable()->sortable();\n $grid->memo('备注');\n\n $grid->disableExport();\n $grid->disableFilter();\n\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SiteHelp);\n\n $grid->model()->latest();\n\n $grid->filter(function ($filter) {\n\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->equal('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->select(SiteHelpCategory::pluck('name', 'id'));\n $filter->like('title', __('site-help::help.title'));\n $filter->equal('status', __('site-help::help.status.label'))\n ->select(__('site-help::help.status.value'));\n });\n\n $grid->column('thumbnail', __('site-help::help.thumbnail'))->image('', 66);\n $grid->column('id', __('site-help::help.id'));\n $grid->column('category.name', __('site-help::help.site_help_category_id'));\n $grid->column('title', __('site-help::help.title'));\n $grid->column('useful', __('site-help::help.useful'));\n $grid->column('status', __('site-help::help.status.label'))\n ->using(__('site-help::help.status.value'));\n $grid->column('created_at', __('admin.created_at'));\n $grid->column('updated_at', __('admin.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Platform());\n\n $grid->column('platform_number', __('Platform number'));\n $grid->column('platform_name', __('Platform name'))->label()\n ->expand(function ($model){\n $shops = $model->shops()->get()->map(function ($shop){\n return $shop->only(['shop_number', 'shop_name']);\n });\n\n return new Table([__('Platform number'), __('Platform name')], $shops->toArray());\n });\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->equal('platform_number', __('Platform number'));\n $filter->like('platform_name', __('Platform name'));\n });\n\n $grid->paginate(10);\n\n $grid->disableRowSelector();\n\n $grid->actions(function ($actions){\n $actions->disableView();\n $actions->disableDelete();\n });\n\n return $grid;\n }", "public function getDatagridViewBuilder();", "protected function grid()\n {\n $grid = new Grid(new Barang());\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->like('nama', 'Nama');\n });\n $grid->column('id', __('Id'));\n $grid->column('nama', __('Nama'));\n $grid->column('harga', __('Harga Beli'));\n $grid->column('harga_jual', __('Harga Jual'));\n $grid->column('satuan_id', __('Satuan id'))->display(function($satuan) {\n return Satuan::find($satuan)->nama;\n });\n $grid->column('jumlah_unit', __('Jumlah Unit'));\n $grid->column('parent_id', 'Parent')->display(function($id) {\n if($id) {\n return Barang::find($id)->nama;\n }\n else {\n return null;\n }\n });\n $grid->column('b_pengiriman', __('Pengiriman'));\n $grid->column('b_keamanan', __('Keamanan'));\n // $grid->column('created_at', __('Created at'));\n // $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Collect());\n $grid->disableActions();\n $grid->disableCreateButton();\n $grid->column('name','姓名');\n $grid->column('phone','手机号');\n $grid->column('address','地址');\n $grid->column('time','时间');\n $grid->column('message','备注');\n\n $postsExporter = new ColectExport();\n $postsExporter->fileName = date('Y-m-d H:i:s').'.xlsx';\n $grid->exporter($postsExporter);\n $url = url()->current();\n $url .= \"?_export_=all\";\n $grid->tools(function ($tools)use($grid,$url){\n $tools->append(new Export($grid,$url));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Customer);\n $grid->model()->where('is_delete',0)->orderBy('id','desc');\n $grid->id('ID')->sortable();\n $grid->code('客户编号');\n $grid->name('客户名称');\n $grid->contactor('联系人');\n $grid->tel('联系电话');\n $grid->email('邮箱');\n $grid->address('地址');\n $grid->receivables('应收账款数字');\n\n $grid->create_time('创建时间')->display(function ($create_time) {\n return date('Y-m-d H:i',$create_time);\n })->sortable();\n\n // 查询过滤\n $grid->filter(function($filter){\n $filter->column(1/2, function ($filter) {\n $filter->like('code', '客户编号');\n $filter->like('name', '客户名称');\n });\n $filter->column(1/2, function ($filter) {\n $filter->like('contactor', '联系人');\n $filter->like('tel', '联系电话');\n $filter->use(new TimestampBetween('create_time','创建时间'))->datetime();\n });\n\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Setting());\n\n $grid->column('id', __('Id'));\n $grid->column('member_fee', __('Member fee'));\n $grid->column('task_rate', __('Task rate'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HhxEquip());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __(trans('hhx.name')));\n $grid->column('hhx_travel_id', __(trans('hhx.hhx_travel_id')))->display(function ($hhx_travel_id){\n return self::getTravelService()->getNameByTravelId($hhx_travel_id);\n });\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.equip_status'));\n $grid->column('created_at', __(trans('hhx.created_at')));\n $grid->column('updated_at', __(trans('hhx.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Sections());\n\n $grid->column('id', __('ID'))->editable() -> sortable();\n $grid->column('name', __('Nazwa'))->editable() -> sortable();\n $grid->column('pageId', __('ID sekcji (w sensie HTML)'))->editable() -> sortable();\n $grid->column('content', __('Zawartość'))->editable() -> sortable();\n $grid->column('style', __('Style(CSS)'))->editable() -> sortable();\n $grid->column('created_at', __('Utworzono')) -> sortable();\n $grid->column('updated_at', __('Zauktalizowano')) -> sortable() ;\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new MethodPrice);\n\n $grid->id('ID');\n $grid->entity('Сущность')->select(Pest::all()->pluck('name','id'));\n $grid->method('Сущность')->select(Method::all()->pluck('name','id'));\n $grid->chemical('Сущность')->select(Chemical::all()->pluck('name','id'));\n $grid->square_1('Сущность')->select(Chemical::all()->pluck('name','id'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feedback);\n $grid->column('id', 'ID');\n $grid->column('content', '内容');\n $grid->column('member', '用户')->display(function(){\n return $this->member->nickname;\n });\n $grid->column('created_at', '时间');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Site());\n\n $grid->id('ID');\n $grid->category()->title('分类');\n $grid->title('标题');\n $grid->thumb('图标')->gallery(['width' => 50, 'height' => 50]);\n $grid->describe('描述')->limit(40);\n $grid->url('地址');\n\n $grid->disableFilter();\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n\n $grid->id('Id');\n $grid->title(trans('admin.title'));\n $grid->slogan(trans('admin.slogan'));\n $grid->name(trans('admin.name'));\n $grid->price(trans('admin.price'))->editable();\n $grid->created_at(trans('admin.created_at'));\n $grid->updated_at(trans('admin.updated_at'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableExport();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Activity());\n $grid->model()->orderBy('created_at','desc');\n\n $grid->column('id', __('Id'));\n $grid->column('log_name', __('Log name'))->using($this->log_name);\n $grid->column('description', __('Description'))->limit(10);\n $grid->column('subject_id', __('Subject id'));\n $grid->column('subject_type', __('Subject type'));\n $grid->column('causer_id', __('Causer id'));\n $grid->column('causer_type', __('Causer type'));\n $grid->column('properties', __('Properties'))->display(function ($properties) {\n $properties = [\n '详情' => isset($properties['description']) ? $properties['description'] : '',\n '备注' => isset($properties['remark']) ? $properties['remark'] : '',\n ];\n return new Table([], $properties);\n });\n $grid->column('created_at', __('Created at'))->sortable();\n $grid->column('updated_at', __('Updated at'));\n\n $grid->filter(function ($filter) {\n\n $filter->equal('log_name', __('Log name'))->select($this->log_name);\n\n });\n\n #禁用创建按钮\n $grid->disableCreateButton();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->disableView();\n $actions->disableEdit();\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Usertype());\n\n $grid->column('id', 'ID');\n $grid->column('usertype', '分类名称');\n $grid->column('created_at', '创建时间');\n $grid->column('updated_at', '修改时间');\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n $grid->disableColumnSelector();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Regional());\n\n $grid->column('id', 'ID');\n $grid->column('logo', 'Logo')->image('', '50', '50');\n $grid->column('name', 'Nama');\n $grid->column('address', 'Alamat');\n $grid->column('created_at', 'Dibuat')->date('d-m-Y');\n $grid->column('updated_at', 'Diubah')->date('d-m-Y');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Plan);\n $grid->model()->whereHas('category');\n\n $grid->column('category.name', __('Категория'));\n $grid->column('count', __('План'))->editable()->sortable();\n $grid->column('month_name', __('Месяц'));\n $grid->column('year', __('Год'))->sortable();\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order());\n\n $grid->column('id', __('Id'));\n $grid->column('trip', __('Trip'))->display(function () {\n return $this->trip->name;\n });\n $grid->column('user', __('User'))->display(function () {\n return $this->user->name . ' ' . $this->user->surname . \" ({$this->user->email})\";\n });\n $grid->column('paid', __('Paid'))->bool()->filter([\n 0 => 'No',\n 1 => 'Yes',\n ]);\n $grid->column('reservation_expires', __('Reservation expires'))->sortable();\n $grid->column('price', __('Price'));\n\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Terrace());\n\n $grid->column('id', __('Id'))->sortable()->style('text-align:center');\n $grid->column('image', __('平台图片'))->style('text-align:center')->image();\n $grid->column('name', __('平台名称'))->style('text-align:center');\n $grid->column('path', __('外链'))->style('text-align:center');\n $grid->column('notice_info', __('提示语'))->style('text-align:center');\n $grid->column('status', __('状态'))->display(function($status){\n return $status == 1 ? '未推荐' : '已推荐';\n })->style('text-align:center');\n $grid->column('created_at', __('创建时间'))->style('text-align:center');\n $grid->disableExport();\n\n $grid->actions(function ($actions) {\n $actions->disableDelete();\n $actions->add(new Terracedel());\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatUser);\n\n $grid->column('id', __('ID'));\n $grid->column('nick_name', __('昵称'));\n $grid->column('name', __('用户名'));\n $grid->column('password', __('密码'));\n $grid->column('mobile', __('手机号'));\n $grid->column('mini_program_open_id', __('OpenId'));\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Code());\n\n\n \n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n\n $filter->column(1 / 2, function ($filter) {\n $filter->like('phone', '手机号');\n $filter->like('ip', 'IP');\n });\n\n $filter->column(1 / 2, function ($filter) {\n $filter->between('created_at', '时间范围')->datetime();\n });\n\n\n });\n\n\n // $grid->column('id', __('Id'));\n $grid->column('phone', __('手机号'))->filter('like');\n $grid->column('code', __('验证码'));\n $grid->column('created_at', __('发送时间'));\n $grid->column('used_at', __('使用时间'));\n $grid->column('ip', __('IP'));\n $grid->model()->latest();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Purchase());\n\n $grid->column('id', \"编号\");\n $grid->column('consumer_name', \"客户\")->display(function () {\n return $this->consumer->full_name;\n });\n $grid->column('house_readable_name', \"房源\")->display(function () {\n return $this->house->readable_name;\n });\n $grid->column('started_at', \"生效日期\");\n $grid->column('ended_at', \"结束日期\");\n $grid->column('sell_type', \"出售方式\")->display(function ($sell_type) {\n return Purchase::$type[$sell_type];\n });\n $grid->column('price', \"成交价格\")->display(function ($price) {\n return \"¥$price\";\n });\n $grid->column('created_at', \"创建日期\");\n $grid->column('updated_at', \"更新日期\");\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Specialization);\n\n $grid->id('Id');\n $grid->full_name('Полное найменование');\n $grid->short_name('Краткое найменование');\n $grid->code('Код специальности');\n $grid->cathedra_id('Кафедра')->using(Cathedra::all()->pluck('abbreviation', 'id')->toArray());\n $grid->created_at('Создано');\n $grid->updated_at('Обновлено');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Gys);\n\n $grid->id('Id');\n $grid->name('公司名称');\n $grid->tel('联系人电话');\n $grid->file('营业执照')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->hyzz('资质证书')->display(function ($v){\n $str = '';\n foreach (explode(',',$v) as $item){\n $str.= '<a target=\"_blank\" href=\"'.env('APP_URL').$item.'\"><img src=\"'.env('APP_URL').$item.'\" width=\"100\" style=\"padding:10px;border:solid #eee 1px;border-radius:3px;margin-right:3px\"/></a>';\n }\n return $str;\n });\n $grid->type('类型');\n $grid->username('用户名称');\n $grid->password('密码');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n $grid->status('账户状态')->radio([\n 0=> '审核中',\n 1=> '审核通过',\n 2=> '冻结账户'\n ]);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new City());\n\n// $grid->column('id', __('Id'));\n $grid->column('date', __('Дата'));\n $grid->column('name', __('Город'))->display(function () {\n return '<a href=\"/admin/city-users?set='.$this->id.'\">'.$this->name.'</a>';\n });\n $grid->column('image', 'Картинка')->display(function () {\n $str = $this->image!='' ? '<img src=\"/uploads/images/'.$this->image.'\" height=\"100\"/>' : '';\n return $str;\n });\n// $grid->column('text', __('Text'));\n $grid->column('show', 'Активен')->display(function () {\n return $this->show ? 'да' : 'нет';\n });\n// $grid->column('orders', __('Orders'));\n// $grid->column('created_at', __('Created at'));\n// $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category);\n\n $grid->id('Id');\n $grid->parent_id('父ID');\n $grid->name('名称');\n $grid->order('排序');\n $grid->image('图片');\n $grid->index_template('首页模版');\n $grid->detail_template('详情模版');\n $grid->status('Status')->display(function ($status){\n return $status ? '<p class=\"text-success\">启用</p>' : '<p class=\"text-muted\">禁用</p>';\n });\n $grid->created_at('创建时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Member());\n\n $grid->column('id', 'id')->sortable();\n $grid->column('username','用户名');\n $grid->column('phone', '手机号')->display(function() {\n return substr($this->phone, 0, 3).'****'.substr($this->phone, 7);\n });\n $grid->column('avatar', '头像')->image('', 50, 50);\n $grid->column('created_at', '注册时间')->sortable();\n $grid->disableCreateButton();\n $grid->disableExport();\n $grid->disableActions();\n $grid->filter(function ($filter) {\n\n // 设置created_at字段的范围查询\n $filter->between('created_at', '创建时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid() {\n\t\t$grid = new Grid(new Payment);\n\t\t$grid->disableCreateButton();\n\t\t$grid->column('id', __('Id'));\n\t\t$grid->column('user_id', __('用户'));\n\t\t// $grid->column('app_id', __('App id'));\n\t\t$grid->column('price', __('金额'));\n\t\t$grid->column('transaction_id', __('三方订单号'));\n\t\t$grid->column('out_trade_no', __('平台订单号'));\n\t\t$grid->column('type', __('订单类型'))->using(['20' => '商城订单']);\n\t\t$grid->column('status', __('状态'))->using(['0' => '未支付', '1' => '已支付', '2' => '未支付']);\n\t\t// $grid->column('other', __('Other'));\n\t\t$grid->column('payment_at', __('支付时间'));\n\t\t$grid->column('created_at', __('创建时间'));\n\t\t$grid->column('updated_at', __('更新时间'));\n\n\t\treturn $grid;\n\t}", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->id('Id');\n $grid->name('商品名');\n $grid->column('category.name', '品类');\n $grid->fabric('Fabric');\n $grid->gsm('Gsm');\n $grid->material('Material');\n $grid->attach('Attach');\n $grid->head_image('商品图')->image('http://yujiaknit.test/images/', 100, 100);\n $grid->created_at('Created at');\n $grid->updated_at('Updated at');\n\n $grid->filter(function ($filter) {\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Feed());\n\n $grid->column('id', __('Id'));\n $grid->column('url', __('url'));\n $grid->column('id_author', __('Id author'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Withdrawal());\n\n $grid->filter(function($filter){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n $filter->like('name', __('分区名称'));\n });\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('uid', __('用户昵称(UID)'))->display(function ($uid) {\n return UsersInfo::where('id',$uid)->value('nickname').\"({$uid})\";\n });\n $grid->column('real_name', __('实名姓名'));\n $grid->column('id_card', __('身份证号码'));\n $grid->column('mobile', __('联系电话'));\n $grid->column('amount', __('提现数量'));\n $grid->column('status', __('状态'))->display(function ($status) {\n return Withdrawal::$status[$status];\n });\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('修改时间'));\n\n $grid->disableActions();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StationBannerImage());\n\n $grid->column('id', __('Id'));\n $grid->column('station.station_name', __('測站'));\n $grid->column('image', __('輪播圖'))->image('', '50');\n $grid->column('url', __('連結'))->link();\n $grid->column('order', __('排序'));\n $grid->column('valid_at', __('有效日期'));\n $grid->column('mod_user', __('異動人員'));\n $grid->column('updated_at', __('異動時間'));\n\n if (Admin::user()->username != 'admin') {\n $grid->model()->where('station_id', '=', Admin::user()->station_id);\n }\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new KuponGroup);\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name',__('Nama'));\n $grid->column('total',__('Jumlah Kupon'));\n $grid->column('amount_per_kupon',__('Nilai Per Kupon'));\n $grid->column('expired',__('Kedaluwarsa'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n return Admin::grid(Classroom::class, function (Grid $grid) {\n\n $grid->id('ID')->sortable();\n\n // $grid->column();\n\n $grid->column('number', '编号');\n $grid->column('name', '名称');\n $grid->column('location', '地点');\n $grid->column('square', '面积');\n $grid->column('floor', '楼层');\n $grid->column('is_free', '是否空闲');\n $grid->column('building_name', '建筑物名称');\n\n $grid->created_at();\n $grid->updated_at();\n });\n }", "protected function grid()\n {\n $grid = new Grid(new Milestone);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('type', __('Type'))->select(Milestone::TYPE_MAP);\n $grid->column('version', __('Version'));\n $grid->column('content', __('Content'));\n $grid->column('detail', __('Detail'));\n $grid->column('created_at', __('Created at'))->sortable()->hide();\n $grid->column('updated_at', __('Updated at'))->sortable()->hide();\n\n $grid->model()->orderBy('id', 'desc');\n\n $grid->filter(function ($filter) {\n $filter->equal('version', '版本');\n $filter->like('content', '内容');\n $filter->equal('type', '类型')->select(Milestone::TYPE_MAP);\n $filter->between('created_at', '创建时间')->datetime();\n $filter->between('updated_at', '更新时间')->datetime();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Test());\n\n $grid->id('编号');\n $grid->name('教师姓名');\n $grid->work_point('教学分数');\n $grid->science_point('科研分数');\n $grid->disableCreateButton();\n $grid->disableFilter();\n $grid->disableActions();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new UserHealth());\n\n $grid->column('id', __('Id'))->filter();\n $grid->column('height', __('Height'))->filter();\n $grid->column('weight', __('Weight'))->filter();\n $grid->column('blood_pressure', __('Blood pressure'))->filter();\n $grid->column('sugar_level', __('Sugar level'))->filter();\n $grid->column('blood_type', __('Blood type'))->filter();\n $grid->column('muscle_mass', __('Muscle mass'))->filter();\n $grid->column('metabolism', __('Metabolism'))->filter();\n $grid->column('genetic_history', __('Genetic history'))->filter();\n $grid->column('illness_history', __('Illness history'))->filter();\n $grid->column('allergies', __('Allergies'))->filter();\n $grid->column('prescription', __('Prescription'))->filter();\n $grid->column('operations', __('Operations'))->filter();\n $grid->column('user_id', __('User id'))->filter();\n $grid->column('created_at', __('Created at'))->filter();\n $grid->column('updated_at', __('Updated at'))->filter();\n\n return $grid;\n }", "protected function grid()\n { \n \n $grid = new Grid(new Blog);\n\n $grid->id('Id')->sortable();\n $grid->title('标题');\n // $grid->content('内容');\n $grid->logo('图片')->display(function ($value) {\n return \"<img width='50' src='/upload/$value'>\";\n });\n $grid->discuss('评论');\n $grid->display('浏览');\n \n $grid->lab_id('标签')->display(function ($value) {\n $lab_name = Lab::select('lab_name')->where('id',$value)->get();\n \n return $lab_name[0]->lab_name;\n });\n\n $grid->cat_id('分类')->display(function ($value) {\n $cat_name = Cat::select('cat_name')->where('id',$value)->get();\n return $cat_name[0]->cat_name;\n });\n \n\n\n $grid->created_at('添加时间');\n \n $grid->actions(function ($actions){\n $actions->disableView();\n });\n\n $grid->filter(function($filter){\n $filter->like('title', '标题');\n $filter->like('content', '内容');\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('Id'));\n $grid->column('name', __('Name'));\n $grid->column('surname', __('Surname'));\n $grid->column('email', __('Email'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Category());\n $grid->model()->small();\n \n $grid->quickCreate(function (Grid\\Tools\\QuickCreate $create) {\n $create->text('erp_id', 'ERP ID');\n $create->text('name', '小分類名稱');\n $create->select('parent_id', __('中分類'))->options(\n Category::Mid()->pluck('name', 'id')\n );\n $create->text('type','分級(不需改)')->default(3);\n });\n\n $grid->column('erp_id', __('ERP Id'));\n $grid->column('name', __('小分類名稱'));\n $grid->column('parent_id', __('中分類'))->display(function($userId) {\n return Category::find($userId)->name;\n });\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatEvent);\n\n $grid->id('Id');\n $grid->title('事件标题');\n $grid->key('Key');\n $grid->event('事件类型')->using(WechatEvent::EVENTLIST);\n $grid->method('执行方法');\n $grid->column('message.title', '消息标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Station());\n\n $grid->column('id', __('Id'));\n $grid->column('area.area_name', __(trans('admin.area_name')));\n $grid->column('station_code', __(trans('admin.station_code')));\n $grid->column('station_name', __(trans('admin.station_name')));\n $grid->column('telno', __(trans('admin.telno')));\n $grid->column('order', __(trans('admin.order')));\n $grid->column('valid_at', __(trans('admin.valid_at')));\n $grid->column('mod_user', __(trans('admin.mod_user')));\n $grid->column('updated_at', __(trans('admin.updated_at')));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GithubRepositories());\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('name', __('项目名'))->limit(20);\n $grid->column('full_name', __('项目全名'))->limit(40);\n $grid->column('description', __('简介'))->limit(60);\n// $grid->column('owner', __('作者资料'));\n $grid->column('html_url', __('网页地址'))->link();\n// $grid->column('original_data', __('原始数据'));\n $grid->column('created_at', __('创建时间'));\n// $grid->column('updated_at', __('更新时间'));\n\n //快捷搜索\n $grid->quickSearch('name', 'full_name', 'description');\n\n //倒叙\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n\n $grid->column('id', __('Id'));\n $grid->column('type.name', __('分类名称'));\n $grid->column('recommend.name', __('推荐名称'));\n $grid->column('name', __('产品名称'));\n $grid->column('description', __('产品描述'));\n $states = [\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n ];\n $grid->column('pop', __('推荐'))->switch($states);\n $grid->column('logo','logo图')->display(function (){\n if ($this->logo){\n return '<div class=\"pop\"><img src='.env('APP_URl').'/uploads/'.$this->logo.' style=\"width:100px;height:100px;\"></div>';\n }else{\n return ;\n }\n });\n $grid->column('price', __('价格'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Student);\n\n $grid->id('Id');\n $grid->surname('Фамилия');\n $grid->name('Имя');\n $grid->family_name('Отчество');\n $grid->telegram_id('Telegram-id');\n $grid->email('Email');\n $grid->number('Контактный телефон');\n $grid->groups_id('Группа')->using(Group::all()->pluck('name', 'id')->toArray());\n $grid->created_at('Создание записи');\n $grid->updated_at('Редактирование записи');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Goods);\n $grid->id('ID')->sortable();\n $grid->name('名称');\n $grid->type('分类')->display(function($status) {\n $arr = (new AdminModel('goods_type'))->getAll('',['type','id']);\n foreach ($arr as $key => $value) {\n if($status==$value['id']) return $value['type']; \n }\n \n });\n $grid->cover('商品大图')->image('',70, 70);\n $grid->image('详情图')->image('',70, 70);\n $grid->stock('库存');\n $grid->price('积分价格');\n $grid->status('状态')->display(function($status) {\n if($status==1) return \"上架中\";\n if($status==0) return \"已下架\"; \n });\n $grid->disableExport();//禁用导出数据按钮\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();//禁用查询过滤器\n });\n \n \n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title_designer_cn', '标题(设计师)');\n $filter->like('title_name_cn', '标题(项目名称)');\n $filter->like('title_intro_cn', '标题(项目介绍)');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->title_designer_cn('标题(中)')->display(function () {\n return CurrentModel::formatTitle($this, 'cn');\n });\n $grid->title_designer_en('标题(英)')->display(function () {\n return CurrentModel::formatTitle($this, 'en');\n });\n $grid->article_status('状态')->display(function ($article_status) {\n switch ($article_status) {\n case '0' :\n $article_status = '草稿';\n break;\n case '1' :\n $article_status = '审核中';\n break;\n case '2' :\n $article_status = '已发布';\n break;\n }\n return $article_status;\n });\n $grid->release_time('发布时间')->sortable();\n \n // $grid->column('created_at', __('发布时间'));\n $grid->created_at('添加时间')->sortable();\n // $grid->column('updated_at', __('添加时间'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new WechatMessage);\n\n $grid->id('Id');\n $grid->msg_type('消息类型');\n $grid->media_id('素材id');\n $grid->title('标题');\n $grid->created_at('创建时间');\n $grid->updated_at('修改时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new User());\n\n $grid->column('id', __('field.id'));\n $grid->column('name', __('Name'));\n $grid->column('email', __('Email'));\n $grid->column('email_verified_at', __('Email verified at'));\n $grid->column('password', __('Password'));\n $grid->column('remember_token', __('Remember token'));\n $grid->column('point', __('Point'));\n $grid->column('status', __('field.status'));\n $grid->column('created_at', __('field.created_at'));\n $grid->column('updated_at', __('field.updated_at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Product);\n $grid->model()->where('type',$this->getProductType())->orderBy('id','desc');\n //调用自定义的Grid\n\n $this->customGird($grid);\n $grid->actions(function ($actions) {\n $actions->disableView();\n $actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new News);\n\n $grid->id('Id');\n $grid->title('题目');\n $grid->category_id('分类ID');\n // $grid->content('内容');\n $grid->thumbnail('封面图');\n $grid->status('状态');\n $grid->read_count('阅读数量');\n $grid->created_at('创建时间');\n $grid->updated_at('更新时间');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new DbTop());\n $grid->header(function ($query) {\n $alread = DbTop::whereStatus(1)->count();\n $notyet = DbTop::whereStatus(0)->count();\n $notok = DbTop::whereStatus(2)->count();\n $pan = DbTop::where('pan_url', '<>', '')->count();\n $x = '已看:' . $alread . '<br />未看:' . $notyet . '<br />不感兴趣:' . $notok . '<br />资源:' . $pan;\n return '<div class=\"alert alert-success\" role=\"alert\">' . $x . '</div>';\n });\n $grid->column('no', __(trans('hhx.no')))->display(function ($no) {\n return 'No.' . $no;\n });\n $grid->column('img', __(trans('hhx.img')))->image();\n $grid->column('c_title', __(trans('hhx.c_title')))->display(function () {\n return $this->c_title . ' ' . $this->year;\n });\n $grid->column('rating_num', __(trans('hhx.rating_num')));\n $grid->column('inq', __(trans('hhx.inq')));\n $grid->column('actor', __(trans('hhx.actor')));\n $grid->column('type', __(trans('hhx.type')));\n $grid->column('status', __(trans('hhx.status')))->select(config('hhx.db_status'));\n $grid->filter(function ($filter) {\n $filter->like('c_title', '中文名');\n $filter->like('year', '年');\n $filter->like('status', trans('hhx.status'))->select(config('hhx.db_status'));\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Drug);\n\n $grid->id('ID');\n $grid->street_name('«Уличное» название');\n $grid->city('Город');\n $grid->column('photo_drug','Фотография наркотика')->display(function () {\n $photo = Photo::whereDrugId($this->id)->where('type', 0)->first();\n\n if ($photo) {\n return $photo->photo;\n } else {\n return '';\n }\n })->image();\n\n $grid->column('confirm', 'Подтверждение')->display(function ($confirm) {\n if ($confirm) {\n return '✅Подтверждено';\n } else {\n return '❌Не подтверждено';\n }\n });\n $grid->updated_at('Дата изменения');\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Profile());\n\n $grid->column('id', __('ID'))->sortable();\n $grid->column('name', __('ID'))->sortable();\n $grid->column('surname', __('ID'))->sortable();\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku);\n\n $grid->column('id', 'ID');\n $grid->column('name', 'sku名称')->editable();\n $grid->column('sku_number', 'sku编号')->editable();\n // $grid->column('description', 'sku描述');\n $grid->product(\"所属商品\")->display(function ($product) {\n return $product['name'];\n });\n $grid->column('price', '原价')->editable();\n $grid->column('stock', '库存量')->editable();\n $grid->column('is_on_sale', '是否上架')->using([0 => '否', 1 => '是']);\n $grid->column('primary_picture', '商品主图');\n $grid->column('retail_price', '零售价格')->editable();\n $grid->column('is_promotion', '是否促销')->using([0 => '否', 1 => '是']);\n $grid->column('promotion_price', '促销价格')->editable();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Leavetime());\n $grid->filter(function ($filter) {\n $filter->like('designer.name', '设计师');\n $filter->between('created_at','创建时间')->datetime();\n });\n $grid->column('id', __('Id'));\n $grid->column('designer.name', __('设计师'));\n $grid->column('type', __('请假类型'))->display(function ($value) {\n return $value ? '半天' : '全天';\n });\n $grid->column('date', __('请假日期'));\n $grid->column('time', __('时间段'))->display(function ($time) {\n $html = '';\n foreach ($time as $k => $value){\n $work = Worktime::where('id','=',$value)->first();\n if($work){\n $html .= \"<span class='label label-success' style='margin-left: 10px'>{$work['time']}</span>\";\n }else{\n $html = '';\n }\n\n }\n return $html;\n });\n $grid->column('created_at', __('创建日期'));\n $grid->actions(function ($actions) {\n $actions->disableView();\n //$actions->disableDelete();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n $grid->model()->orderBy('id', 'desc');\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new ProductSku());\n\n $grid->column('id', __('Id'));\n $grid->column('product', __('产品'))->display(function ($product){\n return $product['title'];\n });\n $grid->column('title', __('Title'));\n $grid->column('description', __('Description'));\n $grid->column('price', __('Price'));\n $grid->column('stock', __('Stock'));\n $grid->column('options', __('sku规格'))->display(function ($options){\n if (count($options) > 0){\n $strOption = '';\n foreach ($options as $option) {\n $strOption .= \"<p>{$option['product_property_name']}:{$option['product_property_value']}</p>\";\n }\n return $strOption;\n }\n return '';\n });\n\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Order);\n // 只展示已支付的订单,并且默认按支付时间倒序排序\n $grid->model()->whereNotNull('paid_at')->orderBy('paid_at', 'desc');\n\n $grid->no('订单流水号');\n //展示关联关系的字段时,使用column方法\n $grid->column('user.name','买家');\n $grid->total_amount('总金额')->sortable();\n $grid->paid_at('支付时间')->sortable();\n $grid->ship_status('物流')->display(function($value) {\n return Order::$shipStatusMap[$value];\n });\n $grid->refund_status('退款状态')->display(function($value) {\n return Order::$refundStatusMap[$value];\n });\n // 禁用创建按钮,后台不需要创建订单\n $grid->disableCreateButton();\n $grid->actions(function ($actions) {\n // 禁用删除和编辑按钮\n $actions->disableDelete();\n $actions->disableEdit();\n });\n $grid->tools(function ($tools) {\n // 禁用批量删除按钮\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n// return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new SkuModel);\n\n $grid->column('s_id', __('skuid'));\n $grid->column('sku_num', __('编号'));\n $grid->column('goods_id', __('商品id'));\n $grid->column('sku_name', __('sku名称'));\n $grid->column('sku_price', __('Sku价格'));\n $grid->column('sku_goods_repertory', __('库存'));\n $grid->column('sku_goods_img', __('照片'))->image();\n $grid->column('created_at', __('添加时间'));\n $grid->column('updated_at', __('修改时间'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new StockProduct);\n\n $grid->column('id', __('Id'));\n // $grid->column('product_id', __('Product id'))->modal('Product Name', function($model){\n // $products = $model->product()->get()->map(function($product) {\n // return $product->only('id','product_name');\n // });\n // return new Table(['ID', 'Product Name'], $products->toArray());\n // });\n $grid->column('product.product_name', __('Name'));\n $grid->column('moq', __('Moq'));\n $grid->column('quantity', __('Quantity'));\n $grid->column('price', __('Price'));\n $grid->column('note', __('Note'));\n $grid->column('created_at', __('Created at'));\n $grid->column('updated_at', __('Updated at'));\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Project());\n $grid->model()->orderBy('id', 'desc');\n $grid->id('ID')->sortable();\n $grid->name('项目名称')->editable();\n $grid->url('项目地址')->link();\n $grid->username('账号');\n $grid->password('密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],\n ];\n $grid->status('状态')->switch($status);\n $grid->created_at('创建时间');\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->disableFilter();\n $grid->disableExport();\n $grid->disableRowSelector();\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new Subscribe());\n $grid->column('number', __('商品编号'));\n $grid->column('name', __('商品名称'));\n $grid->column('subtitle', __('商品副标题'));\n $grid->column('price', __('单价'));\n $grid->column('quantity', __('库存'));\n $grid->column('type', __('分类'));\n $grid->column('status', __('状态'));\n $grid->column('recommend', __('推荐'));\n $grid->column('sold', __('总售量'));\n $grid->column('integral', __('返还碳积分'));\n $grid->column('emission', __('返还碳减排'));\n $grid->column('place', __('地点'));\n $grid->column('maintenance', __('养护'));\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GroupTask());\n $grid->column('name', __('messages.name'));\n $grid->column('active', __('messages.active'))->switch();\n $grid->column('sort', __('messages.sort'))->editable();\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new HotRank());\n\n// $grid->column('id', __('Id'));\n $grid->column('sort', __('排序'))->editable();\n $grid->column('nickname', __('昵称'));\n $grid->column('avatar', __('头像'))->image();\n $grid->column('gender', __('性别'))->using([\n 1 => '男',\n 2 => '女'\n ]);\n// $grid->column('role', __('Role'));\n// $grid->column('intro', __('Intro'));\n $grid->column('fans', __('粉丝数'));\n $grid->column('red_book_link', __('小红书链接'));\n $grid->column('red_book_fans', __('小红书粉丝'));\n $grid->column('douyin_link', __('抖音链接'));\n $grid->column('douyin_fans', __('抖音粉丝'));\n $grid->column('created_at', __('创建时间'));\n $grid->actions(function ($actions) use ($grid) {\n // 去掉删除\n// $actions->disableDelete();\n// // 去掉编辑\n// $actions->disableEdit();\n // 去掉查看\n $actions->disableView();\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new TaskOrder);\n $grid->model()->orderBy('id', 'desc');\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->equal('eid','快递单号')->integer();\n $filter->equal('store','快递网点')->select(storedatas(1));\n $filter->equal('etype','快递公司')->select(edatas());\n $filter->equal('sname','客服名称');\n $filter->between('created_at', '导入时间')->datetime();\n });\n $grid->id('ID');\n $grid->eid('快递单号');\n $grid->sname('客服名称');\n $grid->store('快递网点');\n $grid->etype('快递公司');\n\n $grid->created_at('分配时间');\n //$grid->updated_at('分配时间');\n $excel = new ExcelExpoter();\n $excel->setAttr([ '快递单号','快递网点','快递公司','负责客服','导入时间'], ['eid','store','etype','sname','created_at']);\n $grid->exporter($excel);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new AnswerList);\n\n $grid->column('id', __('Id'))->sortable();\n $grid->column('title', trans('admin.title_answer'))->width(500);\n $grid->column('A', trans('admin.A'))->width(150);\n $grid->column('B', trans('admin.B'))->width(150);\n $grid->column('C', trans('admin.C'))->width(150);\n $grid->column('D', trans('admin.D'))->width(150);\n $grid->column('correct', trans('admin.correct'))->width(100);\n $grid->column('status', trans('admin.status'))->using(AnswerList::STATUSES)->label(['warning', 'primary']);\n $grid->column('created_at', trans('admin.created_at'));\n $grid->column('updated_at', trans('admin.updated_at'));\n\n $grid->filter(function ($filter){\n $filter->disableIdFilter();\n $filter->column(1 / 2, function ($filter) {\n $filter->equal('id', __('Id'));\n });\n $filter->column(1 / 2, function ($filter) {\n $filter->like('title', trans('admin.title'));\n });\n });\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new userWhitelist());\n $grid->filter(function ($filter) {\n $filter->disableIdFilter();\n $filter->like('accountName', ___('accountName'));\n });\n $grid->column('id', ___('Id'));\n $grid->column('accountId', ___('AccountId'));\n $grid->column('accountName', ___('AccountName'));\n $grid->column('nickName', ___('NickName'));\n\n return $grid;\n }", "protected function grid()\n {\n $Adv=new Adv();\n $grid = new Grid($Adv);\n\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"value\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"array\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"array\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>\"start_time\",\"title\"=>\"活动开始时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"end_time\",\"title\"=>\"活动结束时间\",\"type\"=>\"value\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"array\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::setlist_show($grid,$list_array);\n\n $grid->filter(function($filter) use($platform,$type){\n // 去掉默认的id过滤器\n $filter->disableIdFilter();\n\n $filter->in('platform', \"平台\")->multipleSelect($platform);\n $filter->in('type', \"类型\")->multipleSelect($type);\n });\n return $grid;\n }" ]
[ "0.72541326", "0.7218252", "0.7064843", "0.70040804", "0.6995721", "0.69847125", "0.695367", "0.6928443", "0.6927314", "0.69256824", "0.6923453", "0.69233567", "0.6922796", "0.6907988", "0.6889554", "0.6888196", "0.6878719", "0.6845261", "0.68254143", "0.6818076", "0.6810526", "0.6801908", "0.68007404", "0.6792371", "0.67900723", "0.6785066", "0.67814827", "0.67809147", "0.6773841", "0.67679495", "0.6767842", "0.67664576", "0.67600983", "0.6759144", "0.6747873", "0.67451704", "0.6735288", "0.6732706", "0.6727944", "0.6718374", "0.6718129", "0.67142314", "0.6713679", "0.67077774", "0.66969377", "0.66829485", "0.6681708", "0.66795236", "0.66743", "0.6665543", "0.66581196", "0.6655195", "0.6648576", "0.6647211", "0.6639091", "0.6634314", "0.66231555", "0.6622456", "0.6605076", "0.6601071", "0.6595906", "0.6595102", "0.6593814", "0.65931946", "0.6590833", "0.65907514", "0.65832734", "0.657433", "0.6573453", "0.65642095", "0.65639156", "0.655778", "0.65577185", "0.6556319", "0.6553949", "0.6552593", "0.6549884", "0.6542962", "0.65393496", "0.65337956", "0.6528965", "0.6526889", "0.65218806", "0.650997", "0.6508564", "0.65050364", "0.6498207", "0.6491189", "0.647587", "0.6474169", "0.6469046", "0.6464774", "0.6463954", "0.64510244", "0.6450445", "0.6450348", "0.64481837", "0.64450586", "0.6444865", "0.6443929", "0.64308834" ]
0.0
-1
Creates data provider instance with search query applied
public function search($params) { $query = IndicadorPlan::find(); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'ID_EVENTO' => $this->ID_EVENTO, 'ID_PLAN' => $this->ID_PLAN, 'CATEGORIA' => $this->CATEGORIA, 'ID_ALERTA' => $this->ID_ALERTA, 'FECHA_CREACION' => $this->FECHA_CREACION, 'FECHA_INICIO_VIGENCIA' => $this->FECHA_INICIO_VIGENCIA, 'FECHA_FIN_VIGENCIA' => $this->FECHA_FIN_VIGENCIA, 'ESTATUS' => $this->ESTATUS, 'ACTIVO' => $this->ACTIVO, 'ID_USUARIO' => $this->ID_USUARIO, ]); $query->andFilterWhere(['like', 'TITULO', $this->TITULO]) ->andFilterWhere(['like', 'DATA', $this->DATA]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }", "protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search() {\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $this->getSearchCriteria(),\n\t\t\t'sort' => array(\n\t\t\t\t'defaultOrder' => 't.id DESC',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'client_id' => array(\n\t\t\t\t\t\t'asc' => 'client_name asc',\n\t\t\t\t\t\t'desc' => 'client_name desc',\n\t\t\t\t\t),\n\t\t\t\t\t'*',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => Yii::app()->config->get('global.per_page'),)\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('id', $this->id, true);\n $criteria->compare('level', $this->level);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('ip_create', $this->ip_create, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function prepareDataProvider()\n\t{\n\t $searchModel = new \\app\\models\\ClearanceSearch(); \n\t\treturn $searchModel->search(\\Yii::$app->request->queryParams);\n\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }", "public function getDataProvider(array $query = []);", "protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n $query = Hotel::find();\n // add conditions that should always apply here\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n // grid filtering conditions\n $query->availables($this->quantity_of_guests);\n $query->andFilterWhere([\n 'hotel_id' => $this->hotel_id,\n 'price_per_guest' => $this->price_per_guest,\n ]);\n $query->andFilterWhere(['like', 'city_name', $this->city_name]);\n return $dataProvider;\n \n }", "public function search()\n\t{\n\t $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('projection',$this->projection,true);\n\t\t$criteria->compare('username',Yii::app()->user->id);\n\t\t$criteria->compare('title',$this->title);\n\t\t$criteria->compare('url',$this->url);\n\t return new CActiveDataProvider(get_class($this), array(\n\t 'criteria'=> $criteria,\n\t 'sort'=>array(\n\t 'defaultOrder'=>'name ASC',\n\t ),\n\t 'pagination'=>array(\n\t 'pageSize'=>10\n\t ),\n\t ));\n\t}", "private function _getDataProvider($query, $params){\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'user_id' => $this->user_id,\n 'profile_id' => $this->profile_id,\n 'authentication_method_id' => $this->authentication_method_id,\n 'status' => $this->status,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n ]);\n\n $query->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'auth_key', $this->auth_key])\n ->andFilterWhere(['like', 'password_hash', $this->password_hash])\n ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }", "public function getMetadataQueryProviderWrapper();", "protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }", "public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\n }", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\t\t//TODO: update search criteria\n\t\t$criteria->compare('id', $this->id, true);\n\t\t$criteria->compare('event_id', $this->event_id, true);\n\t\t$criteria->compare('standard_intervention_exists', $this->standard_intervention_exists);\n\t\t$criteria->compare('details', $this->details);\n\t\t$criteria->compare('interventions_id', $this->interventions_id);\n\t\t$criteria->compare('description', $this->description);\n\t\t$criteria->compare('patient_factors', $this->patient_factors);\n\t\t$criteria->compare('patient_factor_details', $this->patient_factor_details);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public static function new_search_record()\n\t{\n\t\treturn new user_record_search();\n\t}", "public function search() {\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('content', $this->content, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('author', $this->author, true);\n\t\t$criteria->compare('type', $this->type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('uid', $this->uid);\n $criteria->compare('token', $this->token, true);\n $criteria->compare('created', $this->created, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('keyword_id', $this->keyword_id);\n $criteria->compare('visits', $this->visits);\n $criteria->compare('page_views', $this->page_views);\n $criteria->compare('parsing', $this->parsing);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 50),\n ));\n }", "protected function getNewSearchModel()\n {\n $searchModelName = $this->getSearchModelName();\n return new $searchModelName;\n }", "public function search()\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchdatas(){\r\n\t\t// should not be searched.\r\n\t\t$conditions=array();\r\n\t\t$params=array();\r\n\t\t$page_params=array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$sort=new CSort();\r\n \t$sort->attributes=array();\r\n \t$sort->defaultOrder=\"t.create_time ASC\";\r\n \t$sort->params=$page_params;\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t 'condition'=>'',\r\n\t\t\t 'params'=>array(),\r\n\t\t\t 'with'=>array(\"User\",\"District\"),\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n 'pageSize'=>'20',\r\n 'params'=> $page_params,\r\n ),\r\n 'sort'=>$sort,\r\n\t\t));\r\n\t}", "public function search()\n {\n\n $query = Board::find()->where(['user_id' => $this->user_id]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n\n ]\n ],\n ]);\n\n return $dataProvider;\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('post_id', $this->post_id);\n $criteria->compare('language_id', $this->language_id);\n $criteria->compare('header', $this->header, true);\n $criteria->compare('text', $this->text, true);\n\t\t$criteria->compare('rating',$this->rating);\n\t\t$criteria->compare('author_id',$this->author_id);\n\t\t$criteria->compare('date_add',$this->date_add,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('who', $this->who);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('rate', $this->rate);\n $criteria->compare('knowledge', $this->knowledge);\n $criteria->compare('behavior', $this->behavior);\n $criteria->compare('motivation', $this->motivation);\n $criteria->compare('rate', $this->who_ip);\n $criteria->compare('is_checked', $this->is_checked);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array(\n 'defaultOrder' => array(\n 'date' => CSort::SORT_DESC,\n ),\n ),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('name', $this->name, true);\n $criteria->compare('latitude', $this->latitude);\n $criteria->compare('longitude', $this->longitude);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('vicinity', $this->vicinity, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function parametersAndQueriesDataProvider() {}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('region_id', $this->region_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t $this->StateProcess(get_class($this).'_'.Y::app()->params['cfgName']);\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n $criteria->compare('title_adm',$this->title,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'id DESC'),\n 'pagination'=>array('pageSize'=>Config::$data['base']->pageSize)\n\t\t));\n\t}", "public function search($params,$query=null)\n {\n if(!$query) $query = RestClient::find();\n\n $query = $query->joinWith(['hospital']) \n ->joinWith(['hospital.sales']);\n //$query = $query->joinWith('mingrui_comments');\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n \n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n //var_dump($params);exit;\n return $dataProvider;\n }\n \n // grid filtering conditions\n $query->andFilterWhere([\n 'rest_client.id' => $this->id, \n 'age' => $this->age, \n 'hospital_id' => $this->hospital_id, \n ]);\n\n $query->andFilterWhere(['like', 'rest_client.name', $this->name])\n ->andFilterWhere(['like', 'sex', $this->sex])\n ->andFilterWhere(['like', 'birthplace', $this->birthplace])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'tel', $this->tel])\n ->andFilterWhere(['like', 'school', $this->school])\n ->andFilterWhere(['like', 'education', $this->education])\n ->andFilterWhere(['like', 'experience', $this->experience])\n ->andFilterWhere(['like', 'employed', $this->employed])\n ->andFilterWhere(['like', 'department', $this->department])\n ->andFilterWhere(['like', 'worktime', $this->worktime])\n ->andFilterWhere(['like', 'position', $this->position])\n ->andFilterWhere(['like', 'speciality', $this->speciality])\n ->andFilterWhere(['like', 'hobby', $this->hobby])\n ->andFilterWhere(['like', 'notes', $this->notes])\n ->andFilterWhere(['like', 'zhuren', $this->zhuren])\n ->andFilterWhere(['like', 'pianhao', $this->pianhao]) \n ->andFilterWhere(['like', 'rest_danwei.name', $this->hospitalname])\n ->andFilterWhere(['like', 'rest_sales.name', $this->salesname])\n ;\n\n // echo $query->createCommand()->getRawSql(); exit; \n return $dataProvider;\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('agreement',$this->agreement);\n\t\t$criteria->compare('date',$this->date,true);\n\t\t$criteria->compare('user',$this->user);\n\t\t$criteria->compare('new_status',$this->new_status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n\t\t$criteria = $this->getDbCriteria();\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('subject', $this->subject, true);\n\t\t$criteria->compare('status', $this->status);\n\t\t$criteria->compare('template.name', $this->template_id, true);\n\n\t\t$sort = new CSort;\n\t\t$sort->defaultOrder = 'id DESC';\n\n\t\treturn new NActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t\t'sort' => $sort,\n\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t),\n\t\t\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('query_id',$this->query_id,true);\n $criteria->compare('se_id',$this->se_id,true);\n $criteria->compare('se_page',$this->se_page,true);\n $criteria->compare('se_url',$this->se_url,true);\n $criteria->compare('visits',$this->visits);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 25),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('acquisition_date_id', $this->acquisition_date_id);\n $criteria->compare('acquisition_type_id', $this->acquisition_type_id);\n $criteria->compare('location_id', $this->location_id);\n $criteria->compare('number', $this->number, true);\n $criteria->compare('annotation', $this->annotation, true);\n $criteria->compare('location_coordinates_id', $this->location_coordinates_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('id_client', $this->id_client);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('date_birth', $this->date_birth, true);\n $criteria->compare('gender', $this->gender);\n\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('domain', $this->domain, true);\n $criteria->compare('ru_domain', $this->ru_domain, true);\n $criteria->compare('page', $this->ru_domain);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public static function new_search_record()\n\t{\n\t\treturn new league_record_search();\n\t}", "public function search()\n {\n $query = Story::find()\n ->owner()\n ->globalChannel()\n ->orderBy(['_id' => SORT_ASC])\n ->active();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false\n ]);\n\n return $dataProvider;\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('project_id', $this->project_id);\n $criteria->compare('num', $this->num);\n $criteria->compare('team_strength', $this->team_strength);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "private function instantiate_search_page() {\n // Build the search_types_fields and search_types_label arrays out of post_types_defs\n $search_types_fields = array();\n $search_types_label = array();\n foreach ( $this->post_type_defs as $post_type ) {\n $search_types_fields[ $post_type[ 'slug' ] ] = $post_type[ 'fields' ];\n $search_types_label[ $post_type[ 'slug' ] ] = $post_type[ 'plural_name' ];\n }\n $this->search_page = new HRHS_Search( array(\n // Using the default slug and title for now\n 'search_types_fields' => $search_types_fields,\n 'search_types_label' => $search_types_label\n ) );\n }", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search($query);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('summ', $this->summ, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nrs', $this->nrs, true);\n $criteria->compare('supplier_name', $this->supplier_name, true);\n $criteria->compare('npwp', $this->npwp, true);\n $criteria->compare('bank_name', $this->bank_name, true);\n $criteria->compare('bank_account_number', $this->bank_account_number, true);\n $criteria->compare('created_at', $this->created_at, true);\n $criteria->compare('created_by', $this->created_by);\n $criteria->compare('updated_at', $this->updated_at, true);\n $criteria->compare('updated_by', $this->updated_by);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'defaultOrder' => 'id DESC',\n ),\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('did',$this->did);\n\t\t$criteria->compare('date_prod',$this->date_prod,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('len',$this->len,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere([\n\t 'id' => $this->id,\n\t 'ord' => $this->ord,\n\t 'type' => $this->type,\n\t ])\n\t ->andFilterWhere(['like', 'code', $this->code])\n ->andFilterWhere(['like', 'name', $this->name]);\n\n return $this->dataProvider;\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n $criteria = new CDbCriteria();\n \n $criteria->compare('question_id', $this->question_id);\n $criteria->compare('student_id', $this->student_id);\n $criteria->compare('answer_id', $this->answer_id);\n $criteria->compare('answer_text', $this->answer_text, true);\n $criteria->compare('answer_number', $this->answer_number, true);\n $criteria->compare('exec_time', $this->exec_time);\n $criteria->compare('result', $this->result);\n $criteria->compare('test_result', $this->test_result);\n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('createDate', $this->createDate);\n $criteria->compare('lastUpdated', $this->lastUpdated);\n $criteria->compare('trackingKey', $this->trackingKey);\n $criteria->compare('email', $this->email);\n $criteria->compare('leadscore', $this->leadscore);\n\n if (!Yii::app()->user->isGuest) {\n $pageSize = Profile::getResultsPerPage();\n } else {\n $pageSize = 20;\n }\n\n return new SmartActiveDataProvider(get_class($this), array(\n 'pagination' => array(\n 'pageSize' => $pageSize,\n ),\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n// @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('options', $this->options, true);\n $criteria->compare('autoreplys', $this->autoreplys, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function googleSearch()\n {\n $search = new \\Hoor\\Search\\Google(get_search_query(), $this->getIndex());\n $this->data['search'] = $search;\n $this->data['results'] = $search->results;\n }", "protected function addSearchConfigs()\n {\n\n $this['textQueryBuilder'] = function () {\n return new TextQueryBuilder();\n };\n\n $this['searchManager'] = function ($c) {\n return new SearchManager($c['databaseAdapter'], $c['queue'], $c['request'], array(\n $c['textQueryBuilder']\n ));\n };\n\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('district_id', $this->district_id);\n\t\t$criteria->compare('active', $this->active);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('issue_date', $this->issue_date, true);\n\n\t\treturn new CActiveDataProvider($this, array('criteria' => $criteria,));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('hol_id', $this->hol_id);\n $criteria->compare('loc_id', $this->loc_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere(['id' => $this->id])\n\t ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'type', $this->type]);\n\n return $this->dataProvider;\n }", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria = new CDbCriteria;\r\n\r\n\t\t$criteria->compare('doc_num', $this->doc_num, true);\r\n\t\t$criteria->compare('doc_num2', $this->doc_num2);\r\n\t\t$criteria->compare('doc_date', $this->doc_date, true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n $criteria->compare('productCategoryId', $this->productCategoryId, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('level', $this->level);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('wikilink', $this->wikilink, true);\n\t\t$criteria->compare('picture', $this->picture, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('modification_date', $this->modification_date, true);\n\t\t$criteria->compare('featured', $this->featured);\n\t\t$criteria->compare('users_found', $this->users_found);\n\t\t$criteria->compare('gpsdata', $this->gpsdata);\n\t\t$criteria->compare('category', $this->category);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_start',$this->date_start,true);\n\t\t$criteria->compare('date_end',$this->date_end,true);\n\t\t$criteria->compare('count_attempt',$this->count_attempt);\n\t\t$criteria->compare('count_questions',$this->count_questions);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('author',$this->author,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('latitud',$this->latitud,true);\n\t\t$criteria->compare('longitud',$this->longitud,true);\n\t\t$criteria->compare('telefono',$this->telefono,true);\n\t\t$criteria->compare('direccion',$this->direccion,true);\n\t\t$criteria->compare('web',$this->web,true);\n\t\t$criteria->compare('activo',$this->activo);\n\t\t$criteria->compare('userId',$this->userId);\n\t\t$criteria->compare('ratingGeneral',$this->ratingGeneral);\n\t\t$criteria->compare('youtubeUrl',$this->youtubeUrl,true);\n\t\t$criteria->compare('esDestacado',$this->esDestacado);\n\t\t$criteria->compare('aprobado',$this->aprobado);\n $criteria->compare('regionId',$this->regionId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('id_answer',$this->id_answer);\n\t\t$criteria->compare('mark',$this->mark);\n\t\t$criteria->compare('comment',$this->comment,true);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('read_mark',$this->read_mark,true);\n\t\t$criteria->compare('marked_by',$this->marked_by,true);\n\t\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('sn',$this->sn,true);\n\t\t$criteria->compare('fn',$this->fn,true);\n\t\t$criteria->compare('region',$this->region);\n\t\t$criteria->compare('postal',$this->postal,true);\n\t\t$criteria->compare('inn',$this->inn,true);\n\t\t$criteria->compare('ogrn',$this->ogrn,true);\n\t\t$criteria->compare('okpo',$this->okpo,true);\n\t\t$criteria->compare('adress',$this->adress,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('okved',$this->okved,true);\n\t\t$criteria->compare('oid',$this->oid,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('st',$this->st);\n\t\t$criteria->compare('alias',$this->alias,true);\n\t\t$criteria->compare('alias2',$this->alias2,true);\n\t\t$criteria->compare('alias3',$this->alias3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('cardid', $this->cardid, true);\n $criteria->compare('subclassid', $this->subclassid, true);\n $criteria->compare('cardname', $this->cardname, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('pid', $this->pid, true);\n $criteria->compare('userName', $this->userName, true);\n $criteria->compare('userEmail', $this->userEmail, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('userId', $this->userId, true);\n $criteria->compare('visibility', $this->visibility);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('recordId', $this->recordId, true);\n $criteria->compare('info', $this->info, true);\n $criteria->compare('new', $this->new, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('user', $this->user, true);\n $criteria->compare('amount', $this->amount);\n $criteria->compare('currency', $this->currency, true);\n $criteria->compare('valid_from', $this->valid_from, true);\n $criteria->compare('valid_to', $this->valid_to, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search () {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('title', $this->title, true);\n\t\t$criteria->compare('description', $this->description, true);\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('required', $this->required);\n\t\t$criteria->compare('cId', $this->cId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('frequency_band',$this->frequency_band,true);\n\n\t\t$criteria->compare('date_of_issue',$this->date_of_issue,true);\n\n\t\t$criteria->compare('date_of_renewal',$this->date_of_renewal,true);\n\n\t\t$criteria->compare('emission',$this->emission,true);\n\n\t\t$criteria->compare('tolerance',$this->tolerance,true);\n\n\t\t$criteria->compare('application_vsat_id',$this->application_vsat_id,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('contact_number', $this->contact_number, true);\n $criteria->compare('city', $this->city, true);\n $criteria->compare('gender', $this->gender, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = 'createDate, employeeId';\n\t\t$criteria->distinct = true;\n\t\t$criteria->addCondition('employeeId=\"' . $this->employeeId . '\" AND createDate between \"' . $this->startDate . '\" AND \"' . $this->endDate . '\"');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}" ]
[ "0.7773856", "0.674291", "0.65721744", "0.6503215", "0.6472826", "0.6389071", "0.63745373", "0.6287255", "0.62671757", "0.62457365", "0.62425256", "0.62123144", "0.61969537", "0.6172912", "0.61250603", "0.6123412", "0.6116283", "0.61031115", "0.6101092", "0.608637", "0.6081774", "0.6081262", "0.6073599", "0.60723656", "0.60405684", "0.6040201", "0.6035497", "0.60331875", "0.60318124", "0.60199106", "0.6013893", "0.5998194", "0.59764904", "0.59671843", "0.59620416", "0.59579474", "0.59551156", "0.5941564", "0.5935285", "0.590389", "0.5899341", "0.5895071", "0.5894937", "0.5888715", "0.58834034", "0.5882613", "0.58762497", "0.58638185", "0.5860362", "0.5846486", "0.58438134", "0.5839541", "0.5829547", "0.5825096", "0.5821819", "0.5821492", "0.5816446", "0.5815201", "0.58059967", "0.58025193", "0.57952476", "0.5785819", "0.57808983", "0.57782406", "0.57766914", "0.5775805", "0.57744527", "0.57744527", "0.57744527", "0.57722074", "0.5771512", "0.5770783", "0.5769345", "0.57683945", "0.57675093", "0.576178", "0.57557786", "0.5747564", "0.5746954", "0.5745489", "0.5741678", "0.57375383", "0.57335705", "0.57302207", "0.57280165", "0.5726227", "0.57238483", "0.57218784", "0.5715393", "0.57136387", "0.5713353", "0.5711261", "0.5710481", "0.571002", "0.57075536", "0.57075375", "0.57060134", "0.5704971", "0.5703576", "0.57000446", "0.5696112" ]
0.0
-1
Creates data provider instance with search query applied
public function searchByCompany($params, $id) { $query = IndicadorPlan::findBySql('select * from tbl_indicador_plan where id_plan in (select id_plan from tbl_plan where id_comision in (select id_comision_mixta from tbl_comision_mixta_cap where id_empresa = '.$id.' AND activo=1) AND activo=1) AND activo=1'); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere([ 'ID_EVENTO' => $this->ID_EVENTO, 'ID_PLAN' => $this->ID_PLAN, 'CATEGORIA' => $this->CATEGORIA, 'ID_ALERTA' => $this->ID_ALERTA, 'FECHA_CREACION' => $this->FECHA_CREACION, 'FECHA_INICIO_VIGENCIA' => $this->FECHA_INICIO_VIGENCIA, 'FECHA_FIN_VIGENCIA' => $this->FECHA_FIN_VIGENCIA, 'ESTATUS' => $this->ESTATUS, 'ACTIVO' => $this->ACTIVO, 'ID_USUARIO' => $this->ID_USUARIO, ]); $query->andFilterWhere(['like', 'TITULO', $this->TITULO]) ->andFilterWhere(['like', 'DATA', $this->DATA]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }", "protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search() {\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $this->getSearchCriteria(),\n\t\t\t'sort' => array(\n\t\t\t\t'defaultOrder' => 't.id DESC',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'client_id' => array(\n\t\t\t\t\t\t'asc' => 'client_name asc',\n\t\t\t\t\t\t'desc' => 'client_name desc',\n\t\t\t\t\t),\n\t\t\t\t\t'*',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => Yii::app()->config->get('global.per_page'),)\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('id', $this->id, true);\n $criteria->compare('level', $this->level);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('ip_create', $this->ip_create, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function prepareDataProvider()\n\t{\n\t $searchModel = new \\app\\models\\ClearanceSearch(); \n\t\treturn $searchModel->search(\\Yii::$app->request->queryParams);\n\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }", "public function getDataProvider(array $query = []);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n $query = Hotel::find();\n // add conditions that should always apply here\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n // grid filtering conditions\n $query->availables($this->quantity_of_guests);\n $query->andFilterWhere([\n 'hotel_id' => $this->hotel_id,\n 'price_per_guest' => $this->price_per_guest,\n ]);\n $query->andFilterWhere(['like', 'city_name', $this->city_name]);\n return $dataProvider;\n \n }", "public function search()\n\t{\n\t $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('projection',$this->projection,true);\n\t\t$criteria->compare('username',Yii::app()->user->id);\n\t\t$criteria->compare('title',$this->title);\n\t\t$criteria->compare('url',$this->url);\n\t return new CActiveDataProvider(get_class($this), array(\n\t 'criteria'=> $criteria,\n\t 'sort'=>array(\n\t 'defaultOrder'=>'name ASC',\n\t ),\n\t 'pagination'=>array(\n\t 'pageSize'=>10\n\t ),\n\t ));\n\t}", "public function getMetadataQueryProviderWrapper();", "private function _getDataProvider($query, $params){\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'user_id' => $this->user_id,\n 'profile_id' => $this->profile_id,\n 'authentication_method_id' => $this->authentication_method_id,\n 'status' => $this->status,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n ]);\n\n $query->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'auth_key', $this->auth_key])\n ->andFilterWhere(['like', 'password_hash', $this->password_hash])\n ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }", "public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\n }", "protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\t\t//TODO: update search criteria\n\t\t$criteria->compare('id', $this->id, true);\n\t\t$criteria->compare('event_id', $this->event_id, true);\n\t\t$criteria->compare('standard_intervention_exists', $this->standard_intervention_exists);\n\t\t$criteria->compare('details', $this->details);\n\t\t$criteria->compare('interventions_id', $this->interventions_id);\n\t\t$criteria->compare('description', $this->description);\n\t\t$criteria->compare('patient_factors', $this->patient_factors);\n\t\t$criteria->compare('patient_factor_details', $this->patient_factor_details);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public static function new_search_record()\n\t{\n\t\treturn new user_record_search();\n\t}", "public function search() {\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('content', $this->content, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('author', $this->author, true);\n\t\t$criteria->compare('type', $this->type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('uid', $this->uid);\n $criteria->compare('token', $this->token, true);\n $criteria->compare('created', $this->created, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('keyword_id', $this->keyword_id);\n $criteria->compare('visits', $this->visits);\n $criteria->compare('page_views', $this->page_views);\n $criteria->compare('parsing', $this->parsing);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 50),\n ));\n }", "protected function getNewSearchModel()\n {\n $searchModelName = $this->getSearchModelName();\n return new $searchModelName;\n }", "public function search()\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchdatas(){\r\n\t\t// should not be searched.\r\n\t\t$conditions=array();\r\n\t\t$params=array();\r\n\t\t$page_params=array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$sort=new CSort();\r\n \t$sort->attributes=array();\r\n \t$sort->defaultOrder=\"t.create_time ASC\";\r\n \t$sort->params=$page_params;\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t 'condition'=>'',\r\n\t\t\t 'params'=>array(),\r\n\t\t\t 'with'=>array(\"User\",\"District\"),\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n 'pageSize'=>'20',\r\n 'params'=> $page_params,\r\n ),\r\n 'sort'=>$sort,\r\n\t\t));\r\n\t}", "public function search()\n {\n\n $query = Board::find()->where(['user_id' => $this->user_id]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n\n ]\n ],\n ]);\n\n return $dataProvider;\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('post_id', $this->post_id);\n $criteria->compare('language_id', $this->language_id);\n $criteria->compare('header', $this->header, true);\n $criteria->compare('text', $this->text, true);\n\t\t$criteria->compare('rating',$this->rating);\n\t\t$criteria->compare('author_id',$this->author_id);\n\t\t$criteria->compare('date_add',$this->date_add,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('who', $this->who);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('rate', $this->rate);\n $criteria->compare('knowledge', $this->knowledge);\n $criteria->compare('behavior', $this->behavior);\n $criteria->compare('motivation', $this->motivation);\n $criteria->compare('rate', $this->who_ip);\n $criteria->compare('is_checked', $this->is_checked);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array(\n 'defaultOrder' => array(\n 'date' => CSort::SORT_DESC,\n ),\n ),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('name', $this->name, true);\n $criteria->compare('latitude', $this->latitude);\n $criteria->compare('longitude', $this->longitude);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('vicinity', $this->vicinity, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function parametersAndQueriesDataProvider() {}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('region_id', $this->region_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t $this->StateProcess(get_class($this).'_'.Y::app()->params['cfgName']);\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n $criteria->compare('title_adm',$this->title,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'id DESC'),\n 'pagination'=>array('pageSize'=>Config::$data['base']->pageSize)\n\t\t));\n\t}", "public function search($params,$query=null)\n {\n if(!$query) $query = RestClient::find();\n\n $query = $query->joinWith(['hospital']) \n ->joinWith(['hospital.sales']);\n //$query = $query->joinWith('mingrui_comments');\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n \n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n //var_dump($params);exit;\n return $dataProvider;\n }\n \n // grid filtering conditions\n $query->andFilterWhere([\n 'rest_client.id' => $this->id, \n 'age' => $this->age, \n 'hospital_id' => $this->hospital_id, \n ]);\n\n $query->andFilterWhere(['like', 'rest_client.name', $this->name])\n ->andFilterWhere(['like', 'sex', $this->sex])\n ->andFilterWhere(['like', 'birthplace', $this->birthplace])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'tel', $this->tel])\n ->andFilterWhere(['like', 'school', $this->school])\n ->andFilterWhere(['like', 'education', $this->education])\n ->andFilterWhere(['like', 'experience', $this->experience])\n ->andFilterWhere(['like', 'employed', $this->employed])\n ->andFilterWhere(['like', 'department', $this->department])\n ->andFilterWhere(['like', 'worktime', $this->worktime])\n ->andFilterWhere(['like', 'position', $this->position])\n ->andFilterWhere(['like', 'speciality', $this->speciality])\n ->andFilterWhere(['like', 'hobby', $this->hobby])\n ->andFilterWhere(['like', 'notes', $this->notes])\n ->andFilterWhere(['like', 'zhuren', $this->zhuren])\n ->andFilterWhere(['like', 'pianhao', $this->pianhao]) \n ->andFilterWhere(['like', 'rest_danwei.name', $this->hospitalname])\n ->andFilterWhere(['like', 'rest_sales.name', $this->salesname])\n ;\n\n // echo $query->createCommand()->getRawSql(); exit; \n return $dataProvider;\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('agreement',$this->agreement);\n\t\t$criteria->compare('date',$this->date,true);\n\t\t$criteria->compare('user',$this->user);\n\t\t$criteria->compare('new_status',$this->new_status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('query_id',$this->query_id,true);\n $criteria->compare('se_id',$this->se_id,true);\n $criteria->compare('se_page',$this->se_page,true);\n $criteria->compare('se_url',$this->se_url,true);\n $criteria->compare('visits',$this->visits);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 25),\n ));\n }", "public function search() {\n\n\t\t$criteria = $this->getDbCriteria();\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('subject', $this->subject, true);\n\t\t$criteria->compare('status', $this->status);\n\t\t$criteria->compare('template.name', $this->template_id, true);\n\n\t\t$sort = new CSort;\n\t\t$sort->defaultOrder = 'id DESC';\n\n\t\treturn new NActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t\t'sort' => $sort,\n\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t),\n\t\t\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('acquisition_date_id', $this->acquisition_date_id);\n $criteria->compare('acquisition_type_id', $this->acquisition_type_id);\n $criteria->compare('location_id', $this->location_id);\n $criteria->compare('number', $this->number, true);\n $criteria->compare('annotation', $this->annotation, true);\n $criteria->compare('location_coordinates_id', $this->location_coordinates_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('id_client', $this->id_client);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('date_birth', $this->date_birth, true);\n $criteria->compare('gender', $this->gender);\n\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('domain', $this->domain, true);\n $criteria->compare('ru_domain', $this->ru_domain, true);\n $criteria->compare('page', $this->ru_domain);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public static function new_search_record()\n\t{\n\t\treturn new league_record_search();\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('project_id', $this->project_id);\n $criteria->compare('num', $this->num);\n $criteria->compare('team_strength', $this->team_strength);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n $query = Story::find()\n ->owner()\n ->globalChannel()\n ->orderBy(['_id' => SORT_ASC])\n ->active();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false\n ]);\n\n return $dataProvider;\n }", "private function instantiate_search_page() {\n // Build the search_types_fields and search_types_label arrays out of post_types_defs\n $search_types_fields = array();\n $search_types_label = array();\n foreach ( $this->post_type_defs as $post_type ) {\n $search_types_fields[ $post_type[ 'slug' ] ] = $post_type[ 'fields' ];\n $search_types_label[ $post_type[ 'slug' ] ] = $post_type[ 'plural_name' ];\n }\n $this->search_page = new HRHS_Search( array(\n // Using the default slug and title for now\n 'search_types_fields' => $search_types_fields,\n 'search_types_label' => $search_types_label\n ) );\n }", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search($query);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('summ', $this->summ, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nrs', $this->nrs, true);\n $criteria->compare('supplier_name', $this->supplier_name, true);\n $criteria->compare('npwp', $this->npwp, true);\n $criteria->compare('bank_name', $this->bank_name, true);\n $criteria->compare('bank_account_number', $this->bank_account_number, true);\n $criteria->compare('created_at', $this->created_at, true);\n $criteria->compare('created_by', $this->created_by);\n $criteria->compare('updated_at', $this->updated_at, true);\n $criteria->compare('updated_by', $this->updated_by);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'defaultOrder' => 'id DESC',\n ),\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('did',$this->did);\n\t\t$criteria->compare('date_prod',$this->date_prod,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('len',$this->len,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere([\n\t 'id' => $this->id,\n\t 'ord' => $this->ord,\n\t 'type' => $this->type,\n\t ])\n\t ->andFilterWhere(['like', 'code', $this->code])\n ->andFilterWhere(['like', 'name', $this->name]);\n\n return $this->dataProvider;\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n $criteria = new CDbCriteria();\n \n $criteria->compare('question_id', $this->question_id);\n $criteria->compare('student_id', $this->student_id);\n $criteria->compare('answer_id', $this->answer_id);\n $criteria->compare('answer_text', $this->answer_text, true);\n $criteria->compare('answer_number', $this->answer_number, true);\n $criteria->compare('exec_time', $this->exec_time);\n $criteria->compare('result', $this->result);\n $criteria->compare('test_result', $this->test_result);\n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('createDate', $this->createDate);\n $criteria->compare('lastUpdated', $this->lastUpdated);\n $criteria->compare('trackingKey', $this->trackingKey);\n $criteria->compare('email', $this->email);\n $criteria->compare('leadscore', $this->leadscore);\n\n if (!Yii::app()->user->isGuest) {\n $pageSize = Profile::getResultsPerPage();\n } else {\n $pageSize = 20;\n }\n\n return new SmartActiveDataProvider(get_class($this), array(\n 'pagination' => array(\n 'pageSize' => $pageSize,\n ),\n 'criteria' => $criteria,\n ));\n }", "public function googleSearch()\n {\n $search = new \\Hoor\\Search\\Google(get_search_query(), $this->getIndex());\n $this->data['search'] = $search;\n $this->data['results'] = $search->results;\n }", "public function search() {\n// @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('options', $this->options, true);\n $criteria->compare('autoreplys', $this->autoreplys, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "protected function addSearchConfigs()\n {\n\n $this['textQueryBuilder'] = function () {\n return new TextQueryBuilder();\n };\n\n $this['searchManager'] = function ($c) {\n return new SearchManager($c['databaseAdapter'], $c['queue'], $c['request'], array(\n $c['textQueryBuilder']\n ));\n };\n\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('district_id', $this->district_id);\n\t\t$criteria->compare('active', $this->active);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('issue_date', $this->issue_date, true);\n\n\t\treturn new CActiveDataProvider($this, array('criteria' => $criteria,));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('hol_id', $this->hol_id);\n $criteria->compare('loc_id', $this->loc_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere(['id' => $this->id])\n\t ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'type', $this->type]);\n\n return $this->dataProvider;\n }", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria = new CDbCriteria;\r\n\r\n\t\t$criteria->compare('doc_num', $this->doc_num, true);\r\n\t\t$criteria->compare('doc_num2', $this->doc_num2);\r\n\t\t$criteria->compare('doc_date', $this->doc_date, true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n $criteria->compare('productCategoryId', $this->productCategoryId, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('level', $this->level);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('wikilink', $this->wikilink, true);\n\t\t$criteria->compare('picture', $this->picture, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('modification_date', $this->modification_date, true);\n\t\t$criteria->compare('featured', $this->featured);\n\t\t$criteria->compare('users_found', $this->users_found);\n\t\t$criteria->compare('gpsdata', $this->gpsdata);\n\t\t$criteria->compare('category', $this->category);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_start',$this->date_start,true);\n\t\t$criteria->compare('date_end',$this->date_end,true);\n\t\t$criteria->compare('count_attempt',$this->count_attempt);\n\t\t$criteria->compare('count_questions',$this->count_questions);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('author',$this->author,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('latitud',$this->latitud,true);\n\t\t$criteria->compare('longitud',$this->longitud,true);\n\t\t$criteria->compare('telefono',$this->telefono,true);\n\t\t$criteria->compare('direccion',$this->direccion,true);\n\t\t$criteria->compare('web',$this->web,true);\n\t\t$criteria->compare('activo',$this->activo);\n\t\t$criteria->compare('userId',$this->userId);\n\t\t$criteria->compare('ratingGeneral',$this->ratingGeneral);\n\t\t$criteria->compare('youtubeUrl',$this->youtubeUrl,true);\n\t\t$criteria->compare('esDestacado',$this->esDestacado);\n\t\t$criteria->compare('aprobado',$this->aprobado);\n $criteria->compare('regionId',$this->regionId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('id_answer',$this->id_answer);\n\t\t$criteria->compare('mark',$this->mark);\n\t\t$criteria->compare('comment',$this->comment,true);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('read_mark',$this->read_mark,true);\n\t\t$criteria->compare('marked_by',$this->marked_by,true);\n\t\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('sn',$this->sn,true);\n\t\t$criteria->compare('fn',$this->fn,true);\n\t\t$criteria->compare('region',$this->region);\n\t\t$criteria->compare('postal',$this->postal,true);\n\t\t$criteria->compare('inn',$this->inn,true);\n\t\t$criteria->compare('ogrn',$this->ogrn,true);\n\t\t$criteria->compare('okpo',$this->okpo,true);\n\t\t$criteria->compare('adress',$this->adress,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('okved',$this->okved,true);\n\t\t$criteria->compare('oid',$this->oid,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('st',$this->st);\n\t\t$criteria->compare('alias',$this->alias,true);\n\t\t$criteria->compare('alias2',$this->alias2,true);\n\t\t$criteria->compare('alias3',$this->alias3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('pid', $this->pid, true);\n $criteria->compare('userName', $this->userName, true);\n $criteria->compare('userEmail', $this->userEmail, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('userId', $this->userId, true);\n $criteria->compare('visibility', $this->visibility);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('recordId', $this->recordId, true);\n $criteria->compare('info', $this->info, true);\n $criteria->compare('new', $this->new, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('cardid', $this->cardid, true);\n $criteria->compare('subclassid', $this->subclassid, true);\n $criteria->compare('cardname', $this->cardname, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search () {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('title', $this->title, true);\n\t\t$criteria->compare('description', $this->description, true);\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('required', $this->required);\n\t\t$criteria->compare('cId', $this->cId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('user', $this->user, true);\n $criteria->compare('amount', $this->amount);\n $criteria->compare('currency', $this->currency, true);\n $criteria->compare('valid_from', $this->valid_from, true);\n $criteria->compare('valid_to', $this->valid_to, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('frequency_band',$this->frequency_band,true);\n\n\t\t$criteria->compare('date_of_issue',$this->date_of_issue,true);\n\n\t\t$criteria->compare('date_of_renewal',$this->date_of_renewal,true);\n\n\t\t$criteria->compare('emission',$this->emission,true);\n\n\t\t$criteria->compare('tolerance',$this->tolerance,true);\n\n\t\t$criteria->compare('application_vsat_id',$this->application_vsat_id,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('contact_number', $this->contact_number, true);\n $criteria->compare('city', $this->city, true);\n $criteria->compare('gender', $this->gender, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function getSearch();" ]
[ "0.7776391", "0.674156", "0.65730786", "0.6503003", "0.6469594", "0.6389097", "0.6374101", "0.6287539", "0.6266928", "0.6247957", "0.6242205", "0.62108004", "0.61968905", "0.61715287", "0.61234176", "0.6122084", "0.6115937", "0.6102408", "0.60996807", "0.6086734", "0.6081817", "0.60791403", "0.6074548", "0.60704637", "0.60409164", "0.6040313", "0.60368943", "0.6033655", "0.6031917", "0.6022966", "0.6014882", "0.59992594", "0.5975997", "0.59654135", "0.5961024", "0.5958534", "0.595563", "0.5941156", "0.59343797", "0.59037733", "0.59003067", "0.58949953", "0.58946407", "0.58884186", "0.5883683", "0.5883673", "0.5876662", "0.5863458", "0.58630157", "0.5846105", "0.58444965", "0.58408946", "0.5832145", "0.58260906", "0.5820797", "0.5820132", "0.58190143", "0.5815525", "0.58105236", "0.5802746", "0.57951474", "0.578614", "0.57808596", "0.5778348", "0.5777004", "0.5775309", "0.5774964", "0.5774964", "0.5774964", "0.5772719", "0.5772095", "0.57709086", "0.5769777", "0.57693154", "0.57686865", "0.5761494", "0.5756875", "0.5746955", "0.57460034", "0.5745408", "0.5741245", "0.57375276", "0.57329607", "0.57307583", "0.57299185", "0.5727107", "0.57238865", "0.5722369", "0.57151777", "0.5713694", "0.5713497", "0.57117736", "0.57107955", "0.57102096", "0.5708674", "0.57081705", "0.57076347", "0.5705474", "0.5703548", "0.5699881", "0.5695578" ]
0.0
-1
/ Check the sum of the products is the same as in total
public function testFindSum() { $json = Scraper::start(); $array = json_decode($json, true); //print_r($array['total']); $input = $array['results']; $total = $array['total']; $sumFinder = new SumFinderClass($input); $this->assertEquals($total, $sumFinder->findSum()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function hasTotal() {\n return $this->_has(1);\n }", "public function verifyProduct($product): bool\r\n {\r\n $prod = $this->getProductById($product[\"product-id\"]);\r\n if ($prod[\"price\"] == $product[\"unit-price\"] &&\r\n \\Mpopa\\Helper::compareFloats($product[\"total\"], ($prod[\"price\"] * $product[\"quantity\"]))\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n }", "private function update_total_of_cart() {\n\t\t// Get products\n\t\t$products = $this->get_current_products();\n\n\t\t// Loop through and add subtotals\n\t\t$total = 0;\n\t\tforeach ($products as $product) {\n\t\t\t$total += $product[\"subtotal\"];\n\t\t}\n\n\t\t// Check if promo code attached and delete if total drops below minimum amount\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Yes, it does, check to see if still above minimum amount\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 2) {\n\t\t\t\tif ($total < $promo_code->minimum_amount) {\n\t\t\t\t\t$this->remove_promo_code();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Update and save\n\t\t$this->cart_total = $total;\n\t\t$this->save();\n\t}", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function individual_products_total() {\n\n foreach($this->remaining_category_price as $remaining_category_prices){\n $this->individual_products_total += $remaining_category_prices['price'];\n }\n\n }", "public function hasSum() {\n return $this->_has(5);\n }", "function cart_total_it($type)\n {\n $carted = $this->cart->contents();\n $ret = 0;\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n $ret += $items[$type] * $items['qty'];\n }\n return $ret;\n } else {\n return false;\n }\n }", "public function isEqualDrTotal($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$crvalue = $values[0];\n\t\t$drvalue = $this->data['Entry']['dr_total'];\n\n\t\tif ($drvalue == $crvalue) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function testCartTotalAmount()\n {\n $items = new MollieLineItemCollection([\n new MollieLineItem(\n '',\n '',\n 1,\n new LineItemPriceStruct(2.73, 2.73, 0.44, 19),\n '',\n '',\n '',\n ''\n ),\n new MollieLineItem(\n '',\n '',\n 2,\n new LineItemPriceStruct(1, 2, 0.47, 19),\n '',\n '',\n '',\n ''\n ),\n ]);\n\n $this->assertEquals(4.73, $items->getCartTotalAmount());\n }", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "private function checkProducts()\n {\n $products = Product::with('prices')->get();\n $errors = [];\n foreach ($products as $product) {\n $basePrice = $product->prices->where('currency_id', Currency::defaultCurrency()->id)->first();\n if ( ! $basePrice) {\n $errors[] = sprintf(\n 'The product \"%s (%s)\" has no price set for your default currency.',\n $product->name,\n $product->id\n );\n }\n }\n\n return count($errors) > 0 ? implode(\"\\n\", $errors) : true;\n }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "function inventory_total($inventory) {\n $inventory_total = 0;\n foreach ($inventory as $product_id => $quantity) {\n $inventory_total += $quantity;\n }\n return $inventory_total;\n}", "public function testTotalAndCoupon()\n {\n $input = [0, 2, 5, 8];\n $coupon = 0.20;\n\n // Execute total() with the array and the additional value of coupon and save to variable\n $output = $this->Receipt->total($input, $coupon);\n $this->assertEquals(\n 12, // Expected value\n $output, // Value returned by total()\n 'When summing the total should equal 12' // Message to return in case of error\n );\n }", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "public function _validarProducto()\n {\n $listaProductos = Producto::_traerProductos();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n foreach($listaProductos as $unProducto)\n { \n if($this->_codigo == $unProducto->_codigo)\n {\n if($this->_stock != $unProducto->_stock)\n {\n //Son iguales con distinto stock, se actualiza.\n $unProducto->_stock = $this->_stock;\n Producto::_actualizarProducto($listaProductos);\n $retorno = 0;\n break;\n }\n else\n {\n //Son iguales con mismo stock, no pasa la validación.\n $retorno = 1;\n break;\n }\n \n }\n }\n \n return $retorno;\n }", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "function total_price($cart){\n $price = 0.0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $bookprice = getbookprice($isbn);\n if($bookprice){\n $price += $bookprice * $qty;\n }\n }\n }\n return $price;\n }", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "public function testTotal()\n {\n\n \t$data = [\n \t\t'base_price' => 10,\n \t\t'spacing_cost' => 10,\n \t\t'work_level_cost' => 50,\n \t\t'urgency_cost' => 20,\n \t\t'number_of_pages' => 5,\n \t\t'total_additional_services_cost' => 10\n \t\t// 'vat' => 100\n \t];\n\n $foo = self::getMethod('calculate');\n $cartService = new CartService();\n $response = $foo->invokeArgs($cartService, [$data]);\n\n $this->assertEquals(410, $response);\n }", "public function hasQuantity(): bool;", "private function dataHasTotal()\n {\n return array_key_exists('total', $this->data);\n }", "public function test_quantity_by_product()\n {\n $order1 = \\App\\Order::find(1);\n $product5 = \\App\\Product::find(5);\n $product7 = \\App\\Product::find(7);\n $product8 = \\App\\Product::find(8);\n $product20 = \\App\\Product::find(20);\n\n $this->assertEquals(4, $this->orders_service->getQuantityByProduct($order1, $product5));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product7));\n $this->assertEquals(2, $this->orders_service->getQuantityByProduct($order1, $product8));\n $this->assertEquals(1, $this->orders_service->getQuantityByProduct($order1, $product20));\n }", "public function check_product_items(){\n\t\t$arr = $this->arr_product_items;\n\t\t//taxper\n\t\tif(isset($arr['taxper']))\n\t\t\t$this->arr_product_items['taxper'] = (float)$arr['taxper'];\n\t\telse\n\t\t\t$this->arr_product_items['taxper'] = 0;\n\t\t//sizew_unit\n\t\tif(!isset($arr['sizew_unit']) || $arr['sizew_unit']=='')\n\t\t\t$this->arr_product_items['sizew_unit'] = 'in';\n\t\t//sizeh_unit\n\t\tif(!isset($arr['sizeh_unit']) || $arr['sizeh_unit']=='')\n\t\t\t$this->arr_product_items['sizeh_unit'] = 'in';\n\t\t//sizew\n\t\tif(isset($arr['sizew']))\n\t\t\t$this->arr_product_items['sizew'] = (float)$arr['sizew'];\n\t\telse\n\t\t\t$this->arr_product_items['sizew'] = 0;\n\t\t//sizeh\n\t\tif(isset($arr['sizeh']))\n\t\t\t$this->arr_product_items['sizeh'] = (float)$arr['sizeh'];\n\t\telse\n\t\t\t$this->arr_product_items['sizeh'] = 0;\n\t\t//quantity\n\t\tif(isset($arr['quantity']))\n\t\t\t$this->arr_product_items['quantity'] = (float)$arr['quantity'];\n\t\telse\n\t\t\t$this->arr_product_items['quantity'] = 0;\n\n\t\t//adj_qty\n\t\t$this->arr_product_items['adj_qty'] = 0;\n\n\t\t//oum\n\t\tif(!isset($arr['oum']))\n\t\t\t$this->arr_product_items['oum'] = 'unit';\n\n\t\t//oum_depend\n\t\tif(!isset($arr['oum_depend']))\n\t\t\t$this->arr_product_items['oum_depend'] = 'unit';\n\t\tif(isset($arr['oum_depend']) && $arr['oum_depend']=='Sq. ft.')\n\t\t\t$this->arr_product_items['oum_depend'] = 'Sq.ft.';\n\n\t\t//sell_price\n\t\tif(isset($arr['sell_price']))\n\t\t\t$this->arr_product_items['sell_price'] = (float)$arr['sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['sell_price'] = 0;\n\n\t\t//plus_sell_price\n\t\tif(isset($arr['plus_sell_price']))\n\t\t\t$this->arr_product_items['plus_sell_price'] = (float)$arr['plus_sell_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_sell_price'] = 0;\n\n\t\t//plus_price\n\t\tif(isset($arr['plus_unit_price']))\n\t\t\t$this->arr_product_items['plus_unit_price'] = (float)$arr['plus_unit_price'];\n\t\telse\n\t\t\t$this->arr_product_items['plus_unit_price'] = 0;\n\n\t\t//reset unit_price\n\t\t\t$this->arr_product_items['unit_price'] = 0;\n\t\t//reset sub_total\n\t\t\t$this->arr_product_items['sub_total'] = 0;\n\t\t//reset tax\n\t\t\t$this->arr_product_items['tax'] = 0;\n\t\t//reset amount\n\t\t\t$this->arr_product_items['amount'] = 0;\n\n\t}", "public function calculate_cart_total()\r\n\t{\r\n\t\t$cart_total = 0;\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['shipping_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['surcharge_total'];\r\n\t\t$cart_total += (! $this->flexi_cart->cart_prices_inc_tax()) ? $this->flexi->cart_contents['summary']['tax_total'] : 0; \r\n\t\t\r\n\t\t$this->flexi->cart_contents['summary']['total'] = $this->format_calculation($cart_total);\r\n\t\t\t\t\r\n\t\treturn TRUE; \r\n\t}", "public function getSumma()\n {\n $summa = 0;\n\n foreach ($purchases as $purchase) {//place for future comments\n\n if($purchase->status_bought == 1)\n {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != 0 && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != 0)\n\n {//\n\n if (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2)) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif(round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;//\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n } elseif (round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n } elseif (round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n // \n } elseif($purchase->first()->book->discont_privat != 0 && $purchase->magazin->discont_privat != 0)\n\n {//\n if($purchase->first()->book->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n\n }\n\n elseif($purchase->magazin->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n //\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {//\n\n if($purchase->first()->book->author->status_discont_id == 1) \n\n {//\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n elseif($purchase->magazin->author->status_discont_id == 1) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n // \n } else \n\n {//\n\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n } \n\n }\n return $summa;\n\n }", "public function check_total_count($group_id)\n {\n //get total bottle count of this group\n $total = $max = 0;\n $wechat_order_products = WechatOrderProduct::where('group_id', $group_id)->where('group_id', '!=', null)->get()->all();\n foreach ($wechat_order_products as $wop) {\n $total += $wop->total_count;\n $count_by_order_type = $this->get_count_by_order_type($wop->order_type);\n if ($max < $count_by_order_type) {\n $max = $count_by_order_type;\n }\n }\n\n if ($total < $max) {\n return false;\n } else {\n return true;\n }\n\n }", "public function obtenerTotalProductos($productos,$cantidad){\n\t\t$total = 0;\n\t\tfor ($i = 0; $i < count($productos); $i++) {\n\t\t\t$this->db->where('idProducto',$productos[$i]);\n\t\t\t$precio = $this->db->get('productos');\n\t\t\tif($precio -> num_rows() > 0) {\n\t\t\t\tforeach ($precio->result() as $producto){\n\t\t\t\t\t$mul = $producto->precio_publico * $cantidad[$i]; \n\t\t\t\t}\n\t\t\t\t$total = $total + $mul;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\treturn $total;\n\t}", "function _geneshop_update_total() {\n if (empty($_SESSION['basket']['items'])) {\n unset($_SESSION['basket']);\n }\n elseif (variable_get('geneshop_show_price', FALSE) && variable_get('geneshop_price_field', '')) {\n $sum = 0;\n foreach ($_SESSION['basket']['items'] as $item) {\n $sum += $item['price'];\n }\n $_SESSION['basket']['total_sum'] = $sum;\n }\n}", "private function compute()\n {\n if ($this->computed) {\n return true;\n }\n\n $this->load('items');\n\n foreach ($this->items as $item) {\n $this->_total += ($item->amount) / 100;\n $this->_gst += ($item->gst) / 100;\n $this->_pst += ($item->pst) / 100;\n }\n\n $this->computed = true;\n }", "function db_sale_total_it($sale_id, $type)\n {\n $carted = json_decode($this->db->get_where('sale', array(\n 'sale_id' => $sale_id\n ))->row()->product_details, true);\n $ret = 0;\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n $ret += $items[$type] * $items['qty'];\n }\n return $ret;\n } else {\n return false;\n }\n }", "function cartTotal ($cartItems) {\n\n$grouped = $cartItems->groupBy(\"product_id\");\n$product_quantities = $grouped->map(function ($item, $key) {\n return [$key => $item->sum(\"qty\")];\n});\n$products_ids = array_keys($product_quantities->all());\n$products = Product::whereIn(\"id\", $products_ids)->select([\"price\", \"name\", \"id\", \"item_value_discount\", \"items_value_discount\", \"items_items_discount\"])->get();\n$products = $products->groupBy(\"id\");\n\n$item_value_discounts = collect([]);\n$items_value_discounts = collect([]);\n$items_items_discounts = collect([]);\n\nforeach ($products as $product) {\n if ($product[0]->item_value_discount) {\n \n $item_value_discounts->put($product[0]->id, $product[0]->getActiveItemValueDiscount());\n\n // $item_value_discounts = item_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_value_discounts) {\n $items_value_discounts->put($product[0]->id, $product[0]->getActiveItemsValueDiscount());\n // $items_value_discounts = items_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_items_discounts) {\n $items_items_discounts->put($product[0]->id, $product[0]->getActiveItemsItemsDiscount());\n // $items_items_discounts = items_items_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n}\n// return $item_value_discounts;\n// return $items_value_discounts;\n// return $items_items_discounts;\n\n// if ($item_value_discounts)\n// $item_value_discounts = $item_value_discounts->groupBy(\"product_id\");\n// if ($items_value_discounts)\n// $items_value_discounts = $items_value_discounts->groupBy(\"product_id\");\n// if ($items_items_discounts)\n// $items_items_discounts = $items_items_discounts->groupBy(\"product_id\");\n// return $item_value_discounts;\n\n// return $items_value_discounts;\n// return $items_items_discounts;\n$product_prices_qty = collect([]);\n$product_present = collect([]);\nforeach ($products_ids as $products_id) {\n $product_qty = $product_quantities[$products_id][$products_id];\n $items_items_discounts_product_qty = $product_quantities[$products_id][$products_id];\n if (isset($items_value_discounts[$products_id])) {\n if ($items_value_discounts[$products_id] !== []) {\n foreach ($items_value_discounts[$products_id] as $discount) {\n $count = floor($product_qty / $discount->items_count);\n if ($count) {\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $discount->items_count * $count,\n \"price\" => $count*$discount->items_value,\n ]);\n $product_qty = $product_qty - ($count * $discount->items_count);\n }\n }\n }\n }\n if (isset($item_value_discounts[$products_id])) {\n if ($item_value_discounts[$products_id] !== []) {\n foreach ($item_value_discounts[$products_id] as $discount) {\n if ($product_qty) {\n $price = $products[$products_id][0]->price;\n $value = $discount->value;\n $percent = $discount->percent;\n \n if ($value && $percent) {\n $price = $price - $value;\n } else if ($value && !$percent) {\n $price = $price - $value;\n } else {\n $price = $price - (($percent / 100) * $price);\n }\n $total = $price*$product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $product_qty,\n \"price\" => $total,\n ]);\n }\n }\n }\n }\n if (isset($items_items_discounts[$products_id])) {\n if ($items_items_discounts[$products_id] !== []) {\n $items_number = $items_items_discounts_product_qty;\n $max_get_number = 0;\n // $product_present = collect([]);\n foreach ($items_items_discounts[$products_id] as $discount) {\n $count = floor($items_number / $discount->buy_items_count);\n if (!$product_prices_qty->contains('product_id', $products_id)){\n $price = $products[$products_id][0]->price;\n $total = $price * $items_items_discounts_product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"qty\" => $items_items_discounts_product_qty,\n \"product_name\" => $products[$products_id][0]->name,\n \"price\" => $total,\n ]);\n }\n if ($count) {\n if ($discount->get_items_count > $max_get_number) {\n $max_get_number = $discount->get_items_count * $count;\n \n $offer = [\n \"product_id\" => $products_id,\n \"buy_items_count\" => $discount->buy_items_count,\n \"presents_count\" => $max_get_number,\n \"present_product_id\" => $discount->present_product_id,\n ];\n }\n }\n }\n $product_present->push($offer);\n }\n }\n}\n$data = [\"totals\" => $product_prices_qty, \"presents\" => $product_present];\nreturn $data;\n}", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "function total_sale($product_id, $field = 'qty')\n {\n $return = 0;\n $sales = $this->db->get('sale')->result_array();\n foreach ($sales as $row) {\n if ($a = $this->product_in_sale($row['sale_id'], $product_id, $field)) {\n $return += $a;\n }\n }\n return $return;\n }", "function total_price($totals){\n $sum = 0;\n $sub = 0;\n foreach($totals as $total ){\n $sum += $total['total_saleing_price'];\n $sub += $total['total_buying_price'];\n $profit = $sum - $sub;\n }\n return array($sum,$profit);\n}", "public function isQtyUsesDecimals($productId) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n $manageStock = $stockItem->getManageStock();\n if ($stockItem->getUseConfigManageStock()) {\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock', Mage::app()->getStore()->getStoreId());\n }\n if ($manageStock) {\n $isQtyDecimal = $stockItem->getIsQtyDecimal();\n if ($isQtyDecimal == 1) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n }", "public function _assertStoreCartHasProductsWithMinimalQuantity()\n {\n }", "public function getConsolidatedPackageValue($products, $allItems)\n {\n\tif(is_null($this->_orderItemValues)) {\n\t $this->_orderItemValues = $this->getOrderItemValues($allItems);\n }\n \n\t$total = 0;\n\tif(!empty($products)) {\n\t foreach($products as $sku => $qty) {\n\t\tfor($i = 1; $i <= $qty; $i++) {\n\t\t $val = array_pop($this->_orderItemValues[$sku]);\n\t\t if(!is_null($val))\n\t\t\t$total += (float)$val;\n\t\t}\n\t }\n\t}\n\t\n\treturn $total;\n }", "function order_contains_equal_plates_and_engravings($order) {\n if (!empty($order->commerce_line_items)) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n $plates = 0;\n $engravings = 0;\n\n foreach ($order_wrapper->commerce_line_items as $line_item_wrapper) {\n if (!empty($line_item_wrapper->value()->commerce_product) && $line_item_wrapper->commerce_product->value()->type == 'plates') {\n $plates++;\n }\n\n if ($line_item_wrapper->value()->type == 'engraving') {\n $engravings++;\n }\n }\n\n // If there is an equal number\n if (($engravings + $plates == 0) || ($engravings == $plates)) {\n return TRUE;\n }\n }\n\n return FALSE;\n}", "final public function addCanMakeATotal(): void\n {\n $this->assertEquals(2, add(1, 1));\n $this->assertEquals(0, add(1, -1));\n $this->assertEquals(-2, add(-1, -1));\n $this->assertEquals(3, add(1, 2));\n $this->assertEquals(-1, add(1, -2));\n $this->assertEquals(1234567940, add(50, 1234567890));\n // Test overflow\n $this->assertEquals(PHP_INT_MIN, add(1, PHP_INT_MAX));\n $this->assertEquals(PHP_INT_MAX, add(-1, PHP_INT_MIN));\n // This add function works on int not floats\n $this->assertEquals(2, add(1.1, 1.1));\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function testSum()\n {\n $this->assertEquals(6, $this->object->sum(function ($item) {\n return $item;\n }));\n }", "public function validateProductStock($productCart)\n {\n $productStock = $productCart->qty;\n\n $prodCartsSum = Cart::where('user_id', $productCart->user_id)\n ->where('id', '!=', $productCart->id)\n ->where('product_id', $productCart->product_id)\n ->get()->sum('qty');\n\n $prodStock = Product::find($productCart->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty = $productCart->qty >= $stock_qty ? $stock_qty : $productCart->qty;\n\n $productCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function checkout()\n {\n $sum = 0;\n\n $grouped = $this->group($this->books);\n\n foreach ($grouped as $books) {\n $groupSum = 0;\n\n foreach ($books as $book) {\n /** @var Book $book */\n $groupSum += $book->price;\n }\n\n $groupSum *= $this->getDiscountRate($books);\n $sum += $groupSum;\n }\n\n return $sum;\n }", "public function isAmountValid(TdbShopArticle $product, $requestedAmount);", "public function validarSumaPorcentajes($dataEspacios)\n {\n $suma = 0;\n foreach ($dataEspacios as $key => $value) {\n $suma += $value['valor'];\n }\n\n if ($suma === 100) {\n return true;\n }else{\n return false;\n }\n }", "function CheckPurchaseRetur($id_purchase,$id_purchase_production) {\n $data = $this->db\n ->select('count(id_purchase_retur) as total')\n ->where('id_purchase',$id_purchase)\n ->where('id_purchase_production',$id_purchase_production)\n ->limit(1)\n ->get('purchase_retur')\n ->row_array();\n \n if ($data['total'] > 0) {\n // return false if already retured\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public static function totalItem(){\n if(Auth::check()){\n $cart = cart::Where('user_id', Auth::id() )\n ->Where('order_id',NULL)\n ->get();\n }\n else{\n $cart = cart::Where('ip_address', request()->ip() )\n ->Where('order_id',NULL)\n ->get();\n }\n $totalItem=0;\n foreach ($cart as $value) {\n $totalItem += $value->product_quantity;\n }\n return $totalItem;\n\n}", "public function total();", "public function total();", "public function total();", "public function applyTotals ( ) {\n\t\t# Prepare\n\t\t$InvoiceItem = $this;\n\t\t\n\t\t# Apply Totals\n\t\tBal_Payment_Model_InvoiceItem::applyTotalsModel($InvoiceItem);\n\t\t\n\t\t# Return true\n\t\treturn true;\n\t}", "public function calculateProfit(): bool\n {\n return true;\n }", "public function calculateSumPriceUserData() {\n $submission_user_data = $this->CI->session->userdata('submission');\n $sum = 0;\n foreach ($submission_user_data as $submission) {\n foreach ($submission as $key => $field) {\n// preVarDump($field);\n $field = $this->CI->form_m->getFieldAsName($submission['event_id'], $key);\n if ($field & count($field->options) > 0) {\n foreach ($field->options as $key_option => $value) {\n if ($value->option_value == $field) {\n \n }\n }\n }\n //preVarDump($field);\n }\n }\n }", "public function testSum() {\n $variable1 = new qti_variable('single', 'integer', array('value' => 5));\r\n $this->assertEquals(15, qti_variable::sum($variable1, $variable1, $variable1)->value);\n }", "public function validateSetStock($setCart)\n {\n $setStock = $setCart->qty;\n\n foreach ($setCart->children as $key => $child) {\n if ($child->subproduct_id !== null) {\n $subCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('subproduct_id', $child->subproduct_id)\n ->get()->sum('qty');\n\n $subStock = SubProduct::find($child->subproduct_id)->stoc;\n $stock_qty = ($subStock - $subCartsSum) > 0 ? $subStock - $subCartsSum : 0;\n $qty = ($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }else{\n $prodCartsSum = Cart::where('user_id', $setCart->user_id)\n ->where('id', '!=', $child->id)\n ->where('product_id', $child->product_id)\n ->get()->sum('qty');\n\n\n $prodStock = Product::find($child->product_id)->stock;\n $stock_qty = ($prodStock - $prodCartsSum) > 0 ? $prodStock - $prodCartsSum : 0;\n $qty =($child->qty > $stock_qty) || ($child->qty === 0) ? $stock_qty : $child->qty;\n\n $child->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }\n }\n\n $stock_qty = $setCart->children->min('stock_qty');\n $qty = ($setCart->qty > $stock_qty) || ($setCart->qty === 0) ? $stock_qty : $setCart->qty;\n\n $setCart->update(['stock_qty' => $stock_qty, 'qty' => $qty]);\n }", "function my_check_cost_of_bookings() {\n if ( is_cart() || is_checkout() ) {\n $bookable_total = $bookable_minimum = 0;\n foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n if ( isset( $cart_item['booking'] ) ) {//the cart contains a bookable product\n $quantity = $cart_item['quantity'];\n $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );\n $bookable_minimum = 20;\n $price = $_product->get_price();\n $taxable = $_product->is_taxable();\n if ( $taxable ) {\n if ( WC()->cart->tax_display_cart == 'excl' ) {\n $product_subtotal = $_product->get_price_excluding_tax( $quantity );\n } else {\n $product_subtotal = $_product->get_price_including_tax( $quantity );\n }\n // Non-taxable\n } else {\n $product_subtotal = $price * $quantity;\n }\n $bookable_total += $product_subtotal;\n if ( $bookable_total >= $bookable_minimum ) {\n return;\n }\n }\n }\n if ( $bookable_total > $bookable_minimum ) {\n wc_add_notice( sprintf( '<strong>A Minimum of %s %s is required before checking out.</strong>' . '<br />Current cart\\'s total: %s %s', $bookable_minimum, get_option( 'woocommerce_currency'), $bookable_total,get_option( 'woocommerce_currency') ), 'error' );\n }\n }\n}", "function total_price(){\n\t$total = 0; // agei instantiate kore dilam j zero\n\tglobal $con;\n\t$ip=getIp();\n\t$sel_price = \"select * from cart where ip_add='$ip'\";\n\t$run_price=mysqli_query($con, $sel_price);\n\twhile($p_price=mysqli_fetch_array($run_price)){\n\t\t$pro_id=$p_price['p_id'];//ip address wise product er id ta dibe, from there we can tell what is the prrice of product\n\t\t$pro_price=\"select * from products where product_id='$pro_id'\"; // cart table theke product id ta niye seta k product table er product ider sathe match kortese\n\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){// product table theke product id wise product price ta niye ashtese\n\t\t\t\t$product_price= array($pp_price['product_price']); //that certain user joto product cart a add korsilo segula sob k akta array te rakhlam\n\t\t\t\t$values= array_sum($product_price); //oi uporer array er sumation kore show korbe akta value..like total value \n\t\t\t\t$total+=$values;\n\t\t\n\t\t}\n\n\t}\n\techo $total;\n}", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "public function calcTotal()\n {\n\n $productBusinessService = new ProductBusinessService();\n\n // create an array to hold all subtotals\n $subtotals_array = array();\n $this->total_price = 0;\n\n foreach ($this->items as $item => $qty) {\n\n // get the price of the product from the database\n $product = $productBusinessService->getProductByID($item);\n\n // calculate the total (price * quantity)\n $product_subtotal = $product->getPrice() * $qty;\n\n // add that subtotal to the subtotal array\n $subtotals_array = $subtotals_array + array($item => $product_subtotal);\n\n // add the item subtotal to the cart total\n $this->total_price += $product_subtotal;\n }\n\n // set the subtotals array\n $this->subtotals = $subtotals_array;\n }", "protected function get_is_total(): bool\n\t{\n\t\treturn $this->start === 0 && $this->end === $this->total - 1;\n\t}", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "abstract public function countTotal();", "private function _calculateTotalsOut()\n {\n $prodSql = new SqlStatement();\n $prodSql->select()\n ->distinct()\n ->from(array('p' => 'product'), array('p.*'));\n \n if ($this->subCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->innerJoin(array('cp' => 'category_path'), 'cp.category_id = p2c.category_id')\n ->where('cp.path_id = ?', array($this->subCategory));\n }\n elseif ($this->topCategory) \n {\n $prodSql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->where('p2c.category_id = ?', array($this->topCategory));\n }\n \n $searchConditions = $this->_prepareSearchConditions();\n if (count($searchConditions)) {\n $prodSql->innerJoin(array('pd' => 'product_description'), 'pd.product_id = p.product_id')\n ->multipleWhere($searchConditions, 'OR');\n }\n \n if ($this->conditions->price) {\n $prodSql->leftJoin(array('pd2' => 'product_discount'), 'pd2.product_id = p.product_id', array('discount' => 'MIN(pd2.price)'))\n ->leftJoin(array('ps' => 'product_special'), 'ps.product_id = p.product_id', array('special' => 'MIN(ps.price)'))\n ->where(\"(pd2.product_id IS NULL OR (\n pd2.quantity = '1'\n AND (pd2.date_start = '0000-00-00' OR pd2.date_start < NOW())\n AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())\n AND pd2.customer_group_id = '{$this->customerGroupId}') )\")\n ->where(\"(ps.product_id IS NULL OR (\n (ps.date_end = '0000-00-00' OR ps.date_end > NOW())\n AND (ps.date_start = '0000-00-00' OR ps.date_start < NOW())\n AND ps.customer_group_id = '{$this->customerGroupId}' ) )\")\n ->group(array('p.product_id'));\n \n if ($this->config->get('config_tax')) {\n $prodSql->select(array('fixed_tax', 'percent_tax'))\n ->leftJoin(array('tr1' => $this->subquery->fixedTax), 'tr1.tax_class_id = p.tax_class_id')\n ->leftJoin(array('tr2' => $this->subquery->percentTax), 'tr2.tax_class_id = p.tax_class_id');\n } else {\n $prodSql->select(array('fixed_tax' => '0', 'percent_tax' => '0'));\n }\n if ($this->conditions->price->min) {\n $prodSql->having(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $prodSql->having(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $prodSql->innerJoin(array('r1' => 'review'), 'r1.product_id = p.product_id', array('total' => 'AVG(rating)'))\n ->where(\"r1.status = '1'\")\n ->having('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')')\n ->group(array('p.product_id'));\n } \n\n if ($this->conditions->price || $this->conditions->rating) {\n $exclude = new SqlStatement();\n $exclude->select()->from(array('p' => self::RESULTS_TABLE));\n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $exclude->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $exclude->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n\n if ($this->conditions->rating) {\n $exclude->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n } else {\n $exclude = self::RESULTS_TABLE;\n }\n \n \n $inStock = (int)self::$IN_STOCK_STATUS;\n \n $sql = new SqlStatement();\n $sql->select(array(\n 'id' => \"af.group_id\", \n 'val' => \"IF (af.type = 'STOCK_STATUS' AND p.quantity > 0, {$inStock}, af.value)\", \n 'type' => 'af.type',\n ))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => $prodSql), 'af.product_id = p.product_id')\n ->innerJoin(array('p2s' => 'product_to_store'), 'p.product_id = p2s.product_id')\n ->leftJoin(array('exclude' => $exclude), 'af.product_id = exclude.product_id')\n ->where('exclude.product_id IS NULL')\n ->where('p2s.store_id = ?', (int)$this->config->get('config_store_id'))\n ->where(\"p.status = '1'\")\n ->where('p.date_available <= NOW()')\n ->group(array('af.product_id', 'af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n $con = array();\n foreach ($this->aggregate as $type => $group) {\n foreach ($group as $groupId => $values) {\n $a = strtolower(substr($type, 0, 1)) . $groupId;\n $sql->innerJoin(array($a => self::FILTERS_TABLE), 'p.product_id = ' . $a . '.product_id')\n ->where($a . '.type = ?', array($type))\n ->where($a . '.group_id = ?', array($groupId));\n // the following mess in conditions is caused by a need \n // of handling the correct stock status \"In stock\".\n if ($type !== 'STOCK_STATUS') {\n $where = \"$a.value IN (\" . implode(', ', $values) . \")\";\n } else {\n $where = array();\n foreach ($values as $val) {\n $where[] = \"($a.value = {$val}\" . ($val != $inStock ? ' AND p.quantity = 0' : ' OR p.quantity > 0') . \")\";\n }\n $where = \"(\" . implode(' OR ', $where) . \")\";\n }\n $sql->where(\"({$where} OR af.aggregate_filter_id = $a.aggregate_filter_id)\");\n }\n $con[] = \"(af.type = '$type' AND af.group_id IN (\" . implode(',', array_keys($group)) . \"))\";\n }\n $sql->multipleWhere($con);\n }\n \n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id');\n $vals = array();\n if (isset($this->aggregate['OPTION'])) {\n foreach ($this->aggregate['OPTION'] as $values) {\n $vals = array_merge($vals, $values);\n }\n }\n $or = array(\n '(pov1.quantity IS NULL AND p.quantity > 0)',\n 'pov.quantity > 0'\n );\n if (count($vals)) {\n $or[] = '(pov1.quantity > 0 AND pov1.option_value_id IN (' . implode(',', $vals) . '))';\n } else {\n $or[] = '(pov1.quantity > 0 AND af.type != \"OPTION\")';\n }\n $sql->where('(' . implode(' OR ', $or) . ')');\n }\n \n $groupSql = new SqlStatement();\n $groupSql->select(array('id', 'val', 'c' => 'COUNT(*)', 'type'))\n ->from(array('tt' => $sql))\n ->group(array('type', 'id', 'val'));\n \n $res = $this->db->query($groupSql);\n\n return $res->rows;\n }", "private function _calculateTotalsIn()\n {\n $inStockStatus = self::$IN_STOCK_STATUS;\n $sql = new SqlStatement();\n $sql->select(array(\n 'af.group_id', \n 'af.product_id', \n 'af.type',\n 'value' => 'IF(type = \\'STOCK_STATUS\\' AND p.quantity > 0, ' . $inStockStatus . ', value)'))\n ->from(array('af' => self::FILTERS_TABLE))\n ->innerJoin(array('p' => 'product'), 'af.product_id = p.product_id')\n ->innerJoin(array('exclude' => self::RESULTS_TABLE), 'af.product_id = exclude.product_id');\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n }\n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $sql->leftJoin(array('pov' => 'product_option_value'), 'af.product_id = pov.product_id AND af.value = pov.option_value_id AND af.type = \"OPTION\"')\n ->leftJoin(array('pov1' => 'product_option_value'), 'p.product_id = pov1.product_id')\n ->where('( (pov1.quantity IS NULL AND p.quantity > 0) OR '\n . '(pov1.quantity > 0 AND af.type != \"OPTION\") OR '\n . 'pov.quantity > 0 )')\n ->group(array('af.type', 'group_id', 'value', 'p.product_id'));\n }\n \n $sql2 = new SqlStatement();\n $sql2->select(array(\n 'id' => \"af.group_id\", \n 'val' => 'af.value', \n 'c' => 'COUNT(*)',\n 'type' => 'af.type',\n ))\n ->from(array('af' => $sql))\n ->group(array('af.type', 'af.group_id', 'af.value'));\n \n if (count($this->aggregate)) {\n foreach ($this->aggregate as $type => $group) {\n $sql2->where(\"((af.type = '$type' AND af.group_id NOT IN (\" . implode(',', array_keys($group)) . \")) OR af.type != '$type')\");\n }\n }\n \n $res = $this->db->query($sql2);\n \n return $res->rows;\n }", "function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "function montantTotal()\n{\n $total = 0;\n for ($i = 0; $i < count($_SESSION['panier']['id_produit']); $i++) {\n $total += $_SESSION['panier']['quantite'][$i] * $_SESSION['panier']['prix'][$i];\n }\n return round($total, 2);\n}", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "function producto_stock($codigo_producto, $idcolor, $idtalle,$cantidad)\n\t{\n\t\t$query=\"SELECT SUM(cantidad) AS cantidad_total FROM productos AS P inner join productos_stock as PS ON PS.idProducto = P.codigo WHERE codigo = '\".$codigo_producto. \"' and idcolor = '\".$idcolor. \"' and idtalle = '\".$idtalle. \"' group by codigo\";\n\t\t$result = mysql_query($query);\t\n\t\t\n\t\tif($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\tif($row[\"cantidad_total\"] > $cantidad)\n\t\t\t\t{\n\t\t\t\treturn(\"ok\");\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\treturn($row[\"cantidad_total\"]);\n\t\t\t\t}\n\t\t}\n\n\t}", "function getTotalPrice()\n {\n $total = 0;\n foreach ($_SESSION['cart'] as $key => $value) {\n $total += $_SESSION['cart'][$key]['total'];\n }\n return $total;\n }", "private function comparePrices()\n {\n $grandTotal = $this->quote->getGrandTotal();\n if ($this->pmtOrder->getShoppingCart()->getTotalAmount() != intval(strval(100 * $grandTotal))) {\n throw new \\Exception(self::VA_ERR_MSG);\n }\n }", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "function total_items($cart){\n $items = 0;\n if(is_array($cart)){\n foreach($cart as $isbn => $qty){\n $items += $qty;\n }\n }\n return $items;\n }", "public function validateStock()\n {\n $valid = true;\n $id_user = $this->session->userdata('id_user');\n $cart = $this->where('id_user', $id_user)->get();\n \n foreach ($cart as $row) {\n $this->table = 'barang';\n $barang = $this->where('id', $row->id_barang)->first(); \n \n if (($barang->qty - $row->qty) < 0) {\n $this->session->set_flashdata(\"qty_cartout_$row->id\", \"Stock hanya ada $barang->qty\");\n $valid = false;\n }\n\n $this->table = 'keranjang_keluar';\n }\n\n return $valid;\n }", "private function getOldTotal()\n {\n return $this->collection->items[$this->cart_hash]->total;\n }", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function checkProductsList() {\n if (!is_array($this->products) || !count($this->products)) {\n $this->logger->info(\"No \".$this->type.\" found in DST.\");\n }\n $this->logger->info(\"Checking products List\");\n foreach ($this->products as $sku => $product) {\n $errors = $this->pimhelper->check_one_reference($this->type, $product->getData());\n if ($errors > 0) {\n $this->logger->info($errors.\" Fields are missing in product : \".$sku);\n die;\n }\n }\n $this->logger->info(\"Fields were created in every products\");\n return true;\n }", "public function testIfMultiplicationsIsCorrect()\n {\n $params = [12,4];\n $response = $this->multiplicationObject->calculate($params);\n $this->assertEquals(48, $response);\n }", "public function doesProductsHaveDuplications()\n {\n $productIDs = array();\n foreach ($this->products as $product) {\n $productIDs[] = $product->product_id;\n }\n\n $uniqueProductIDs = array_unique($productIDs);\n return (count($productIDs) != count($uniqueProductIDs));\n }", "function total_price(){\n\t\n\t\t$total = 0;\n\t\t\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp(); \n\t\t\n\t\t\n\t\tif(isloggedin()){\n\t\t $c_id=$_SESSION['cid'];\n\t\t \n\t\t $sel_price = \"select * from cart where customer_id='$c_id'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t \n\t\t }\n\t\t}\n\t\telse{\n \t\t \n \t\t$sel_price = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t\n\t\t }\n\t\t\n\t\t}\n\t\t\n\t\techo \" €\" . $total.\" \";\n\t\t\n\t}", "function update_total_price() {\n if (!isset($_POST['hash']) || !isset($_POST['quantity'])) {\n exit;\n }\n\n $cart_item_key = $_POST['hash'];\n\n if (!isset(WC()->cart->get_cart()[$cart_item_key])) {\n exit;\n }\n\n $values = WC()->cart->get_cart()[$cart_item_key];\n\n $_product = $values['data'];\n\n // Sanitize\n $quantity = apply_filters('woocommerce_stock_amount_cart_item', apply_filters('woocommerce_stock_amount', preg_replace(\"/[^0-9\\.]/\", '', filter_var($_POST['quantity'], FILTER_SANITIZE_NUMBER_INT))), $cart_item_key);\n\n if ('' === $quantity || $quantity == $values['quantity'])\n exit;\n\n // Update cart validation\n $passed_validation = apply_filters('woocommerce_update_cart_validation', true, $cart_item_key, $values, $quantity);\n\n // is_sold_individually\n if ($_product->is_sold_individually() && $quantity > 1) {\n wc_add_notice(sprintf(__('You can only have 1 %s in your cart.', 'woocommerce'), $_product->get_title()), 'error');\n $passed_validation = false;\n }\n\n if ($passed_validation) {\n WC()->cart->set_quantity($cart_item_key, $quantity, false);\n }\n\n // Recalc our totals\n WC()->cart->calculate_totals();\n woocommerce_cart_totals();\n exit;\n}", "public function testTotalAmountCalculation(): void\n {\n $order = new Order('consumerIdTest123', '845126849', new \\DateTimeImmutable('midnight'), 'OrderNumber123', 7);\n $order->addOrderLine('productIdTest1', 2, 4.9);\n $order->addOrderLine('productIdTest2', 3, 10.5);\n\n static::assertEquals(41.3, $order->getAmount());\n }", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "public function hasPrice(){\n return $this->_has(12);\n }", "function total_price(){\n $ip_add=getRealIpAddr();\n $total=0;\n global $db;\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\n $run_price =mysqli_query($db,$sel_price);\n while($record=mysqli_fetch_array($run_price)){\n \n $prod_id=$record['p_id'];\n $prod_price=\"select * from products where product_id='$prod_id'\";\n $run_pro_price=mysqli_query($db,$prod_price);\n while($p_price=mysqli_fetch_array($run_pro_price)){\n $product_price=array($p_price['product_price']);\n $values=array_sum($product_price);\n $total = $total + $values;\n }\n }\n\n echo \"INR \" . $total;\n}", "public static function getTotalValueOfOrder()\n {\n \ttry\n \t{\n\t \t$storage = My_Zend_Globals::getStorage();\n\t \n\t \t$table = self::_TABLE_PRODUCT_ORDER_DETAIL;\n\t \n\t \t//Query data from database\n\t \t$select = $storage->select()\n\t\t\t\t\t \t->from($table,'sum(amount_total)')\n\t\t\t\t\t \t->where('order_status = ?', 2);\n\t \t \n\t \t$total = $storage->fetchCol($select);\n\t \t \n\t \t$total = intval($total['total']);\n\t \t\n\t \treturn $total;\n \t}\n \tcatch(Exception $e)\n \t{\n \t\treturn false;\n \t}\t \t\n }", "function twentynineteen_child_wc_qty_update_cart_validation( $passed, $cart_item_key, $values, $quantity ) {\n $product_min = twentynineteen_child_wc_min_limit( $values['product_id'] );\n\n if ( ! empty( $product_min ) ) {\n // min is empty\n if ( false !== $product_min ) {\n $new_min = $product_min;\n } \n }\n $product = wc_get_product( $values['product_id'] );\n $already_in_cart = twentynineteen_child_wc_cart_qty( $values['product_id'], $cart_item_key );\n if ( ( $already_in_cart + $quantity ) < $new_min ) {\n wc_add_notice( apply_filters( 'wc_qty_error_message', sprintf( esc_html__( 'You should have minimum of %1$s %2$s\\'s to %3$s.', 'twentynineteen-child-min-quantity' ),\n $new_min,\n $product->get_name(),\n '<a href=\"' . esc_url( wc_get_cart_url() ) . '\">' . esc_html__( 'your cart', 'twentynineteen-child-min-quantity' ) . '</a>'),\n $new_min ),\n 'error' );\n $passed = false;\n }\n return $passed;\n }", "public function isUnderTotal(ExecutionContext $context)\n {\n $this->ligne->getFreeTotal($credit, $debit, $this->id);\n\n $depassement = ($this->typeFacture->getSens() === true) ? $this->montant-$credit : $this->montant-$debit;\n\n if ($depassement > 0.001) { // compare with an epsilon!\n $context->addViolationAt('montant',\n 'Cette facture dépasse du total de la ligne de %montant% €',\n array('%montant%' => round($depassement, 2)),\n null);\n }\n }" ]
[ "0.6976303", "0.65637577", "0.65637577", "0.65637577", "0.65637577", "0.65637577", "0.6474571", "0.6466519", "0.63088095", "0.63087326", "0.6271597", "0.6254605", "0.6237829", "0.6214045", "0.6179753", "0.613032", "0.61138004", "0.60990864", "0.60984457", "0.6091491", "0.60886383", "0.60874426", "0.60582626", "0.6048367", "0.6023078", "0.60127705", "0.599317", "0.59894174", "0.59613544", "0.5960273", "0.5960104", "0.5940876", "0.5932793", "0.59294325", "0.59275776", "0.5925131", "0.5919953", "0.5919884", "0.5914619", "0.59052515", "0.59029907", "0.58955246", "0.58926356", "0.5875915", "0.5863331", "0.585598", "0.58501947", "0.5849277", "0.58348894", "0.5830683", "0.5827334", "0.5826209", "0.5813026", "0.5811427", "0.5802778", "0.57990533", "0.57795036", "0.5772205", "0.57639724", "0.57639724", "0.57639724", "0.5762726", "0.5759928", "0.57590604", "0.5754486", "0.57450145", "0.5740706", "0.57375735", "0.5726172", "0.57243925", "0.57207793", "0.5719041", "0.5716354", "0.57139885", "0.57046556", "0.5702136", "0.56863177", "0.56852126", "0.5684825", "0.5676921", "0.5671998", "0.5671602", "0.56680393", "0.56664556", "0.5665798", "0.5664355", "0.56612813", "0.56546026", "0.5644708", "0.5644375", "0.5644156", "0.5637035", "0.56366724", "0.56321", "0.5625038", "0.5623638", "0.5623439", "0.56231374", "0.56185615", "0.5617766", "0.5613546" ]
0.0
-1
Call the Model constructor
function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "function __construc()\r\n\t{\r\n\t\tparent::Model();\r\n\t}", "function __construct()\r\n {\r\n parent::Model();\r\n }", "function __construct() {\r\n parent::Model();\r\n }", "function __construct() {\n // Call the Model constructor \n parent::__construct();\n }", "public function __construct() {\n // Call the Model constructor\n parent::__construct();\n }", "private function __construct($model)\r\n {\r\n\r\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n parent::Model();\n }", "function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}", "public function __construct()\n\t{\n\t\tif (!$this->model_name)\n\t\t{\n\t\t\t$this->model_name = str_replace('Model_', '', get_class($this));\n\t\t}\n\t\t$this->model_name = strtolower($this->model_name);\n\t\t\n\t\t$this->_initialize_db();\n\t}", "public function __construct()\n {\n parent::Model();\n\n }", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "public function __construct()\n\t{\n\t\t// \\ladybug_dump($model);\n\t}", "function __construct () {\n\n\t\techo 'I am in Model';\n\n\t}", "public function __construct() {\n $this->openConnection();\n $this->model();\n }", "public function __construct()\n {\n $this->model = app()->make($this->model());\n }", "function __construct()\n {\n $this->openDatabaseConnection();\n $this->loadModel();\n }", "public function __construct(Model $model) {\n parent::__construct($model);\n \n }", "public function __construct()\n {\n $this->model = new BaseModel;\n }", "public function __construct()\n {\n parent::__construct();\n //自动加载相对应的数据模型\n if ($this->auto_load_model) {\n $model_name = $this->model_name ? $this->model_name . '_model' : $this->router->fetch_class() . '_model';\n $this->load->model($model_name, 'model');\n }\n $this->_set_user();\n $this->_check_resource();\n }", "public function __construct(){\n\t\tinclude_once(\"model/crews_model.php\");\n\t\t$this->model = new crews_model();\n\t}", "public function __construct($model) \n {\n parent::__construct($model);\n }", "public function __construct($initModel = true) {\n if ($initModel)\n $this->model = new Model();\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->model('data');\n\t}", "public function __construct() {\n $this->porcentajesCursoModel = $this->model('PorcentajesCursoModel');\n $this->tipoModuloModel = $this->model('TipoModuloModel');\n $this->cursoModel = $this->model('CursoModel');\n }", "public function __construct() {\n $this->docenteModel = $this->model('DocenteModel');\n }", "function __construct(Model $model)\n {\n $this->model=$model;\n }", "public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }", "public function __construct($model)\n {\n //\n $this->model = $model;\n }", "public function __construct() {\n\t\t$this->orgModel = new OrgModel(); // TODO: \n\t }", "public function __construct()\n {\n\n $this->SubCategory = new SubCategoriesModel;\n $this->Functions = new ModelFunctions();\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Callcenter_model');\n }", "public function __construct() {\n // und lädt das zugehörige Model\n $this->userModel = $this->model('User');\n }", "function __construct()\n {\n parent::__construct();\n $this->__resTraitConstruct();\n $this->load->model('VSMModel');\n $this->load->model('TextPreprocessingModel');\n\n }", "public function __CONSTRUCT(){\n $this->model = new Estadobien();\n }", "public function __construct()\r\n\t{\r\n\tparent::__construct();\r\n\t\r\n\t//load database libray manually\r\n\t$this->load->database();\r\n\t\r\n\t//load Model\r\n\t$this->load->model('Hello_Model');\r\n\t}", "function __construct() {\n\t\t$this->cotizacionModel = new cotizacionModel();\n\t}", "protected function _construct()\n {\n $this->_init(Model::class, ResourceModel::class);\n }", "public function __construct() {\n parent::__construct('md_rent_car', 'md_order');\n $this->log->log_debug('RentCarAffairModel model be initialized');\n }", "function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct()\n {\n $this->modelName = explode('.', Route::currentRouteName())[0];\n $this->model = new Model($this->modelName);\n }", "public function __construct( Model $model ) {\n\t\t$this->model = $model;\n\t}", "public function __construct () {\n\t\tparent::__construct ();\n\t\t\n\t\tif ($this->models)\n\t\tforeach ($this->models as $model) {\n\t\t\tunset ($this->models[$model]);\n\t\t\t$this->models[$model] = $this->session->getModel ($model,$this);\n\t\t\t$this->$model = $this->models[$model];\n\t\t}\n\t}", "public function __construct()\n {\n \t parent::__construct();\n \t $this->load->model('Modelo');\n }", "function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}", "function __construct()\n {\n parent::__construct();\n\n\t\t$this->load->model('floatplan_model');\n\t\t$this->load->model('user_model');\n }", "public function __construct() {\r\n $this->model = new CompanyModel();\r\n }", "public function __construct($model){\r\n\t\t$this->model = $model;\r\n\t}", "public function __construct()\n {\n $this->MemberModel = new MemberModel();\n }", "public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('LeBabeModel');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('LeBabeModel');\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->model = new MembersModel();\n }", "public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }", "public function __construct()\n {\n echo \"constructeur model\";\n }", "function __construct()\n {\n $this->view = new View();\n $this->model = new si_cf_parametroModel();\n }", "public function __construct()\n\t\t{\n\t\t\t/*goi thang den ham _init trong ResourceModel*/\n\t\t\tparent::_init('lienhe', 'id', new ContactModel);\n\t\t}", "public function __construct()\n {\n parent::__construct();\n\n\t\t$this->load->model(\"options_model\");\n\t\t$this->load->model(\"selections_model\");\n\t\t$this->load->model(\"info_model\");\n\t\t$this->load->model(\"dealer_model\");\n\t\t$this->load->library(\"encrypt\");\n\t\t$this->load->model(\"promocode_model\");\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model(['m_voting', 'm_master', 'm_prospects', 'm_factors']);\n }", "public function __construct() {\n parent::__construct();\n $this->load->model('Thematic_model');\n }", "function __construct() {\n $this->model = new HomeModel();\n }", "public function __construct() {\n\n parent::__construct();\n\n // Load models\n $this->load->model(\"attributesModel\", \"attributes\");\n\n }", "public function __construct()\n\t{\n\t\t//MVC: makes CodeIgniter style $this->load->model() available to my controllers\n\t\t$this->load = new modelLoader($this);\n\t}", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "public function __construct($model)\n {\n $this->model = $model;\n }", "function __construct()\n\t{\n\t\tparent :: __construct();\n\t\t$this -> load -> model('getinfo','m');\n\t}", "function __construct() {\n $this->loteModel = new loteModel();\n }", "public function __construct() {\n parent::__construct();\n $this->load->model(array('dt_diag_klsf_model','dt_obat_model','dt_pasien_model','dt_pemeriksaan_model','dt_proses_model','dt_thpan_model'));\n }", "function __construct()\n\t{\n\t\t// this->model = new Producto();\n\t}", "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "public function __construct()\n {\n // Call the CI_Model constructor\n parent::__construct();\n }", "public function __construct() {\n\t\t$this->empleadoModel = $this->model('Empleado');\n\t}", "public function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t\r\n\t\t$this->load->model(array('user_model','program_model'));\r\n\t\t\r\n\t}", "public function __construct(Model $model)\n {\n // $this->$key = $model;\n $this->model = $model;\n }", "function __construct()\n {\n // load model\n Load::loadModel(\"helpDesk\");\n }", "public function __construct()\n\t{\n\t\t$this->model = new Layout_Model();\n\t}", "public function __construct(){\n $this->sliderModel = $this->model('Slider');\n $this->siteInfoModel = $this->model('SiteInfo');\n $this->officeModel = $this->model('Office');\n $this->categoryModel = $this->model('Category');\n $this->brandModel = $this->model('Brands');\n $this->productModel = $this->model('Products');\n $this->imgModel = $this->model('Image');\n }", "function __construct()\n {\n parent::__construct();\n // $this->load->model('');\n }", "public function __construct() {\r\n parent::__construct();\r\n $this->load->model(array(\r\n 'app_model'\r\n ));\r\n }", "function __construct(){\n\t\t\t$this->model = new model(); //variabel model merupakan objek baru yang dibuat dari class model\n\t\t\t$this->model->table=\"tb_dosen\";\n\t\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('TimeTable_model', 'tmtl');\n\t\t$this->load->model('Schools_model', 'schl');\n\t}", "public function __construct() {\n\t\t\t$this->modelName = 'concreeeeeete';\n\t\t}", "public function __construct($model = null)\n {\n $instance = $this->makeModel($model);\n parent::__construct($instance->getConnection()->query());\n $this->setModel($instance);\n }", "function __construct() {\n parent::__construct();\n $this->load->model('Fontend_model');\n $this->load->model('Package_model');\n }" ]
[ "0.8196736", "0.8080118", "0.8054001", "0.7839992", "0.78184336", "0.78158236", "0.7770901", "0.773286", "0.7704549", "0.7701882", "0.7701882", "0.7701882", "0.7701882", "0.76811564", "0.76426494", "0.75779855", "0.75710344", "0.75621206", "0.7518676", "0.75171185", "0.75171185", "0.7511973", "0.7489728", "0.7468261", "0.74572253", "0.7449389", "0.7445181", "0.7444535", "0.7427869", "0.7407304", "0.74014014", "0.73759925", "0.73413444", "0.7335981", "0.73260605", "0.7277932", "0.7272845", "0.72707343", "0.7265125", "0.7254405", "0.7252804", "0.72438663", "0.7242104", "0.7241692", "0.7240256", "0.7231797", "0.7230043", "0.72287345", "0.7228103", "0.722678", "0.72072005", "0.71945196", "0.7175319", "0.716174", "0.71547157", "0.7150238", "0.7140722", "0.71377164", "0.71358", "0.7132933", "0.7132409", "0.7132409", "0.71250975", "0.71239203", "0.71029484", "0.7092826", "0.70837456", "0.7072703", "0.70563996", "0.7049204", "0.70491046", "0.7045107", "0.70382833", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7036996", "0.7033529", "0.7029588", "0.7026682", "0.70233345", "0.70195305", "0.70195305", "0.7018619", "0.7012934", "0.7012402", "0.7007989", "0.70067614", "0.7005785", "0.7004497", "0.6996979", "0.69894654", "0.6989313", "0.6972264", "0.6970196", "0.6969221" ]
0.0
-1
Returns the list of all versions of the specified agent.
public function ListVersions(\Google\Cloud\Dialogflow\V2\ListVersionsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/ListVersions', $argument, ['\Google\Cloud\Dialogflow\V2\ListVersionsResponse', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVersions();", "public function getVersions();", "public function getVersions();", "public function getVersions()\n {\n return $this->getData()->get('versions', array());\n }", "public function getVersions(): array\n {\n return $this->client->getGameVersionsByType($this->gameVersion->getGameId(), $this->gameVersion->getId());\n }", "public function getVersions():array\n {\n return json_decode(\n copy_to_string($this->request('GET', '/unoconv/versions')->getBody()),\n true\n );\n }", "public function getVersions(): Collection;", "public function versions() : array\n {\n return $this->versions;\n }", "public function getVersions()\n { \n return $this->versions;\n }", "public function get_all_versions()\n\t\t{\n\t\t\t$versions = array();\n\t\t\t$dir_path = $this->get_path_hashed_dir();\n\n\t\t\tif (\\System\\Directory::check($dir_path, false)) {\n\t\t\t\t$version_files = \\System\\Directory::find($dir_path);\n\t\t\t\t$model = get_class($this);\n\n\t\t\t\tforeach ($version_files as $fp) {\n\t\t\t\t\t$file = $model::from_path($fp);\n\t\t\t\t\t$file->time = $file->name;\n\t\t\t\t\t$versions[] = $file;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $versions;\n\t\t}", "public function agents()\n\t{\n\t\t// Get all agents\n\t\t$agents = [];\n\t\tforeach (model(AgentModel::class)->findAll() as $agent)\n\t\t{\n\t\t\t$agents[] = [\n\t\t\t\t'name' => $agent->name,\n\t\t\t\t'uid' => $agent->uid,\n\t\t\t\t'class' => $agent->class,\n\t\t\t\t'icon' => $agent->icon,\n\t\t\t\t'summary' => $agent->summary,\n\t\t\t];\n\t\t}\n\n\t\treturn $this->dataHandler($agents);\n\t}", "public function retrieveAll(): array\n {\n return self::flatten($this->versionsDefinition);\n }", "public function getAgentListJson() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = CommonProcess::createConfigJson($agent->id, $agent->name);\n }\n return $retVal;\n }", "public function getVersions()\n {\n $this->createIfNotExists();\n $sql = 'SELECT version FROM schema_migration ORDER BY version DESC';\n $versions = array();\n foreach ($this->connection->query($sql) as $row) {\n $versions[] = $row['version'];\n }\n\n return $versions;\n }", "public function getVersions()\n {\n return json_decode(\n file_get_contents(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'version.json'),\n true\n );\n }", "public function getAgentIds() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = $agent->id;\n }\n return $retVal;\n }", "protected function get_versions()\n\t{\n\t\t// determine the current versions\n\t\t$data = array(0 => '&nbsp;');\n\n\t\tforeach (\\Documentation\\Model_Version::query()->order_by('major', 'ASC')->order_by('minor', 'ASC')->order_by('branch', 'ASC')->get() as $version)\n\t\t{\n\t\t\t$data[$version->id] = $version->major.'.'.$version->minor.'/'.$version->branch;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function actionIndex()\n {\n /**\n * Check if the request has the proper API keys, deny access if not.\n */\n $this->checkIfAuthenticated();\n\n /**\n * Get and return the response of Versions service.\n */\n $versions = new Versions();\n\n return $versions->all();\n }", "function getVersions($manual_set, $document_alias)\n {\n $args = null;\n $args->manual_set = $manual_set;\n $args->alias = $document_alias;\n $output = executeQueryArray('xedocs.getDocumentVersions', $args);\n if(!$output->toBool() || !$output->data) return array();\n return $output->data;\n }", "public function getVersions($manual)\n\t{\n\t\t$manualDir = $this->storagePath.'/'.$manual;\n\n\t\treturn $this->getDirectories($manualDir);\n\t}", "public function index()\n {\n $agents = Agent::latest()->paginate(20);\n return view('Admin.agents.all', compact('agents'));\n }", "public function versions()\n {\n return $this->morphMany(Version::class, 'versionable');\n }", "private function getVersionChoices(): array\n {\n $versions = [];\n foreach (Php::getSupportedVersions() as $version) {\n $versions[$version] = $version;\n }\n\n return $versions;\n }", "protected function extractVersions($oXPath)\n {\n $this->debug('Extracting card version IDs.');\n\n $aVersions = array();\n $aXPathSets = $oXPath->query(\n '//div[@id=\"' . self::DIV_PREFIX . $this->sPrefix . '_otherSetsRow\"]/div[@class=\"value\"]/div[@id=\"' . self::DIV_PREFIX . $this->sPrefix . '_otherSetsValue\"]/a/@href'\n );\n foreach ($aXPathSets as $sTmp) {\n $aVersions[] = (int)trim(str_replace('Details.aspx?multiverseid=', '', $sTmp->nodeValue));\n }\n\n return $aVersions;\n }", "public function getAllVersions(): Collection\n {\n $guzzleClient = new Client(['base_uri' => config('bitbucket.api_base_url')]);\n $response = $guzzleClient\n ->get(\"2.0/repositories/\" . config('bitbucket.vendor') . \"/\" . config('bitbucket.repo') . \"/refs/tags\", [\n 'auth' => [config('bitbucket.username'), config('bitbucket.password')]\n ])->getBody();\n\n return collect(\\GuzzleHttp\\json_decode($response)->values);\n }", "public function getMigratedVersions()\n {\n $this->createMigrationCollection();\n\n $cursor = $this->getCollection()->find();\n $versions = [];\n foreach ($cursor as $record) {\n $versions[] = $record['v'];\n }\n\n return $versions;\n }", "public function index()\n {\n $agents = User::where('role', 'agent')->get();\n\n return view('agent.all_agents', [\n 'agents' => $agents\n ]);\n }", "public function getAvailableVersions()\n\t{\n\t\treturn array('v1', 'v2');\n\t}", "public function getAffectedEntityVersions($entity)\n {\n $ret = [];\n\n if ($this->isManaged(get_class($entity))) {\n foreach ($this->affectedVersions as list($affectedEntity, $version)) {\n if (get_class($entity) === get_class($affectedEntity)) {\n $ret[]= $version;\n }\n }\n }\n\n return $ret;\n }", "public function fetchInstalledPHPVersions() : array {\n $queryBuilder = $this->httpClient->queryStringBuilder();\n $queryBuilder->addParameter(\"program\", \"list-php-versions\");\n $queryBuilder->addParameter(\"name-only\");\n\n $this->httpClient->sendRequest();\n\n return $this->httpClient->getResponseMessage()->data;\n }", "public function getPageVersions(Request $request, string $identifier) {\n $sortOrder = $request->input('sort_order');\n $versionSortOder = 'asc';\n\n if ($sortOrder === 'desc') {\n $versionSortOder = $sortOrder;\n }\n\n $pages = Pages::pageVersions($identifier, $versionSortOder)->paginate(\n Pages::getPageSize()\n );\n\n return response()->json($pages);\n }", "function getActiveWikiVersions() {\n\tglobal $argv;\n\t$options = str_replace( '--home', '--staging', $argv ); // accept '--home' as an alias for '--staging', for back-compat.\n\tarray_shift( $options ); // first item is this file\n\n\tif ( in_array( '--staging', $options ) ) {\n\t\t$jsonPath = getRealmSpecificFilename( MEDIAWIKI_STAGING_DIR . '/wikiversions.json' );\n\t} else {\n\t\t$jsonPath = getRealmSpecificFilename( MEDIAWIKI_DEPLOYMENT_DIR . '/wikiversions.json' );\n\t}\n\n\t# Get all the wikiversion rows in wikiversions.json...\n\ttry {\n\t\t$versionRows = MWWikiversions::readWikiVersionsFile( $jsonPath );\n\t} catch( Exception $e ) {\n\t\tif ( in_array( '--report', $options ) ) {\n\t\t\tthrow $e; // show error\n\t\t} else {\n\t\t\tdie( 1 ); // silent death\n\t\t}\n\t}\n\t$result = $activeVersions = array();\n\tforeach ( $versionRows as $dbName => $version ) {\n\t\tif ( !isset( $activeVersions[$version] ) ) { // already listed?\n\t\t\t$activeVersions[$version] = 1;\n\n\t\t\t$version = substr( $version, 4 ); // remove 'php-'\n\t\t\tif ( in_array( '--withdb', $options ) ) {\n\t\t\t\t$result[] = \"{$version}={$dbName}\";\n\t\t\t} else {\n\t\t\t\t$result[] = \"{$version}\";\n\t\t\t}\n\t\t}\n\n\t}\n\n\treturn $result;\n}", "public function getRevisions(): array\n {\n return $this->revs;\n }", "public function getAvailableVersions()\n {\n $availableVersions = [];\n foreach ($this->migrations as $migration) {\n $availableVersions[] = $migration->getVersion();\n }\n\n return $availableVersions;\n }", "public function getAgentListings($agent_id)\n {\n $numbers= [];\n $numbers['listings_taken'] = $this->checkAgentListings($agent_id, 'listing');\n $numbers['listings_sold'] = $this->checkAgentListings($agent_id, 'closed_listing');\n $numbers['buyer_sides'] = $this->checkAgentListings($agent_id, 'buyer');\n return $numbers;\n\n\n\n\n }", "public function iteratePluginVersions(): Generator;", "public function getAffectedVersions()\n {\n return $this->affectedVersions;\n }", "public static function scanForVersions($dir) {\n $versions = [];\n $iterator = new DirectoryIterator($dir);\n\n foreach ($iterator as $fileinfo) {\n $filename = $fileinfo->getFilename();\n if (\n !$fileinfo->isDir() || $fileinfo->isDot() || !VersionCollection::isCorrectVersion($filename)\n ) {\n continue;\n }\n\n $versions[] = VersionCollection::createItem($filename);\n }\n\n return $versions;\n }", "public static function all($obj) {\n\t\treturn DB::table(Version::getVersionsTable())->where('object_id', '=', $obj->attributes['id'])->where('object_table', '=', strtolower(get_class($obj)))->order_by('updated_at', 'desc')->get();\n\t}", "public function getVersions($flav)\n {\n return new OrderedList($this->get($flav . '_versions', []));\n }", "public function index() {\n $agents = \\App\\Agent::with('region')->get();\n return view('agent.index', array('agent' => $agents));\n }", "private function getPhpVersions()\n {\n\n // Load models\n $this->load->model('Phpversions_model');\n\n return $this->Phpversions_model->getPhpVersions();\n\n }", "public function getRevisions(): array;", "public function getVariantList()\n {\n return $this->loadVariantInformation();\n }", "public function getUpgrades()\n {\n $upgrades = $this->getData('upgrades');\n if (is_array($upgrades)) {\n return $upgrades;\n }\n\n try {\n $dir = $this->getUpgradesPath();\n if (!is_readable($dir)) {\n return array();\n }\n $dir = new DirectoryIterator($dir);\n } catch (Exception $e) {\n // module doesn't has upgrades\n return array();\n }\n\n $upgrades = array();\n foreach ($dir as $file) {\n $file = $file->getFilename();\n if (false === strstr($file, '.php')) {\n continue;\n }\n $upgrades[] = substr($file, 0, -4);\n }\n usort($upgrades, 'version_compare');\n $this->setData('upgrades', $upgrades);\n return $upgrades;\n }", "public function getAllVoters(Request $request) {\n $voter = Voter::get()->toJson(JSON_PRETTY_PRINT);\n return response($voter, 200);\n }", "function getVersionList($limit = null)\n\t{\n\t\treturn $this->store->getVersionList($this->area, $this->page, \n\t\t\t$limit);\n\t}", "public function getMysqlVersions()\n {\n\n // Load models\n $this->load->model('Mysqlversions_model');\n\n return $this->Mysqlversions_model->getMysqlVersions();\n\n }", "public function getTopVoters(): array {\n return $this->plugin->getTopVoters();\n }", "public function getAgents()\n {\n if ($this->request->ajax()) {\n $agents = $this->agent->getAgents();\n $options = '';\n foreach ($agents as $key => $agent) {\n $options .= \"<option value =\" . $key . \">\" . $agent . \"</option>\";\n }\n return $this->success(['options' => $options]);\n } else {\n return $this->fail(['error' => 'The method is not authorized.']);\n }\n }", "public function listVirtualMachines() {\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"listVirtualMachines\",\n\t\t\t\t\"response\" => \"json\"\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "public function index()\n {\n $agents = Agent::with('supplier')->get();\n\n return view('agent.index')->with([\n 'agents' => $agents,\n ]);\n }", "public function getVersions()\n {\n if (array_key_exists(\"versions\", $this->_propDict)) {\n return $this->_propDict[\"versions\"];\n } else {\n return null;\n }\n }", "public function getActivatedVendors();", "public function getVersions()\n\t{\n\t\tforeach( $GLOBALS['TL_JQUERY_VERSIONS'] as $version => $settings)\n\t\t{\n\t\t\tif( $version == 'contao_version' || $version == 'latest_jquery_version' )\n\t\t\t\t$return[$version] = $GLOBALS['TL_LANG']['tl_layout']['jquery_version'][$version]; \n\t\t\telse \n\t\t\t\t$return[$version] = $version;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "public function getUpgradesToRun($from = null)\n {\n if (null === $from) {\n $from = $this->getDataVersion();\n }\n\n $upgrades = array();\n foreach ($this->getUpgrades() as $upgradeVersion) {\n if (version_compare($from, $upgradeVersion) >= 0) {\n continue;\n }\n $upgrades[] = $upgradeVersion;\n }\n\n return $upgrades;\n }", "public function getUnactivatedVersions()\n {\n $versions = $this->storage->findUnactivatedVersions();\n $objects = $this->storage->getObjects($versions);\n return ['versions' => $versions, 'objects' => $objects];\n }", "public function showAllAgent(Request $request)\n {\n $agent_specialists = AgentActivation::get();\n foreach($agent_specialists as $key => $agent){\n $agent_specialists[$key]->fullname = $agent->first_name.' '.$agent->last_name;\n }\n if($request->is('api/*')){\n return Response()->json($agent_specialists);\n }\n return view('home.agent_list');\n }", "public function getPackagesVersions()\n {\n $components = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $components['core']['ZEDx'] = Core::VERSION;\n\n foreach (Themes::all() as $theme) {\n $components['theme'][$theme['manifest']['name']] = $theme['manifest']['version'];\n }\n\n foreach (Widgets::noType()->noFilter()->all(null, true) as $namespace => $widget) {\n $components['widget'][$namespace] = $widget->get('version');\n }\n\n foreach (Modules::all() as $module) {\n $components['module'][$module->name] = $module->version;\n }\n\n return $components;\n }", "public function index()\n {\n $osVersions = OSVersion::all();\n\n return view('admin.os_versions.index', compact('osVersions'));\n }", "public function getVoyagesAction()\n {\n $em = $this->getDoctrine()->getManager();\n $voyages = $em->getRepository('SiteBundle:Voyage')->findAll();\n\n return array('voyages' => $voyages);\n }", "public static function getLibraryVersions(CommandRunner $runner, $library)\n {\n $error = \"Could not parse available versions from command \\\"composer show {$library}\\\"\";\n $result = $runner->runCommand([\"composer\", \"global\", \"show\", $library, \"--all\", \"--no-ansi\"], $error);\n\n if (empty($result) || !preg_match('/^versions\\s*:\\s*(?<versions>(\\S.+\\S))\\s*$/m', $result, $matches)) {\n throw new InvalidArgumentException($error);\n }\n\n return preg_split('/\\s*,\\s*/', $matches['versions']);\n }", "function getAgentsInfo() {\n\t\tglobal $dbh;\n\t\t$agents = array();\n\t\t\n\t\t\n\t\t$sql = \"SELECT A.*, (SELECT B.AgncyCity FROM Agencies AS B WHERE B.AgencyId=A.AgencyId) as AgencyName\n\t\t\t\tFROM agents AS A\";\n\n\t\ttry {\n\t\t\tgetDBConnection();\n\t\t\t\n\t\t\t$result = mysqli_query($dbh, $sql);\n\t\t\t\n\t\t\tif(!$result) {\n\t\t\t\tprint(\"Query failed: \" . mysqli_errno($dbh) . \"--\" . mysqli_error($dbh) . \"<br/>\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\twhile ($values = mysqli_fetch_object($result)) {\n\t\t\t\t$agent = new Agent();\n\t\t\t\t$agent -> setAgent($values);\n\t\t\t\tarray_push($agents, $agent);\n\t\t\t}\n\n\t\t\treturn $agents;\n\t\t\t\n\t\t} catch (Exception $e){\n\t\t\tprint \"<br/> $e\";\n\t\t} finally {\n\t\t\tcloseDBConnection();\n\t\t}\n\t}", "public function getNotifyAgentEvents() {\n\t\t$events = [];\n\t\tforeach ( $this->notifications as $event => $attribs ) {\n\t\t\tif ( $attribs['canNotifyAgent'] ?? false ) {\n\t\t\t\t$events[] = $event;\n\t\t\t}\n\t\t}\n\t\treturn $events;\n\t}", "public function getAllowedVersions()\n {\n return $this->allowedVersions;\n }", "public function getModuleVersions()\n {\n $this->moduleVersions = json_decode($this->cache->load(self::MODULES_CACHE_ID), true);\n\n if ($this->moduleVersions !== null) {\n return $this->moduleVersions;\n }\n\n $packagesToLog = C_RB_LOG_PACKAGES;\n $composer = json_decode(file_get_contents(BP . '/composer.lock'), true);\n\n $this->moduleVersions = [];\n foreach ($composer['packages'] as $package) {\n if (in_array($package['name'], $packagesToLog)) {\n $this->moduleVersions[ str_replace('/', '_', $package['name']) ] = $package['version'];\n }\n elseif ($package['name'] == 'magento/magento2-base') {\n $this->moduleVersions['_magento_version'] = $package['version'];\n }\n }\n\n $this->cache->save(json_encode($this->moduleVersions), self::MODULES_CACHE_ID, [], 86400);\n\n return $this->moduleVersions;\n }", "private function findSiteVersions($url = null)\n {\n if (!$url) {\n $url = 'home/wetter/messwerte/messwerte-an-stationen.html';\n }\n\n $html = $this->makeRequest($url);\n\n $regex = '/product\\/output\\/measured-values\\/([a-z-]*)\\/(version__[0-9]{6,8}_[0-9]{2,4})\\/(de)/';\n $matches = Regex::matchAll($regex, $html);\n\n $versions = collect($matches->results())\n ->map(function (MatchResult $match) {\n return [\n 'parameter-name' => $match->group(1),\n 'version' => $match->group(2),\n 'lang' => $match->group(3)\n ];\n })\n ->unique('parameter-name');\n\n $parameterVersions = $versions;\n\n return collect($parameterVersions);\n }", "function getVersions ($obj) {\n\t\tif (strtolower(get_class($obj)) != 'story')\n\t\t\treturn null;\n\t\t\n\t\t$element = $this->_document->createElement('versions');\n\t\t$versions = get_versions($obj->id);\n\t\tforeach ($versions as $version) {\n\t\t\t$element->appendChild($this->getVersion($version, $obj->getField('type'), $obj->getField('texttype'), $obj));\n\t\t}\n\t\treturn $element;\n\t}", "public static function fetch_wordpress_versions()\n {\n //Cache File name for wordpress version\n $version_list = Package::get_config('package', 'version', 'file');\n\n //Connect To Wordpress API\n $list = \\WP_CLI_Helper::http_request(Package::get_config('wordpress_api', 'version'));\n if ($list != false) {\n //convert list to json file\n $list = json_decode($list, true);\n\n //Create Cache file for wordpress version list\n \\WP_CLI_FileSystem::create_json_file($version_list, $list, false);\n } else {\n //Show Error connect to WP API\n return array('status' => false, 'data' => Package::_e('wordpress_api', 'connect'));\n }\n\n return array('status' => true, 'data' => $list);\n }", "function VM_listDownloadableVBoxAddons()\n{\n\texec(\"\n\tidxTime=`find /m23/tmp/downloadableVBoxAddons.idx -printf %C@ | cut -d'.' -f1`\n\tcurTime=`date +%s`\n\tdifTime=`expr \\$curTime - \\$idxTime`\n\n\tif [ ! -e /m23/tmp/downloadableVBoxAddons.idx ] || [ \\$difTime -gt 300 ]\n\tthen\n\t\twget -q http://download.virtualbox.org/virtualbox/ -O /m23/tmp/downloadableVBoxAddons.idx\n\tfi\n\n\tcat /m23/tmp/downloadableVBoxAddons.idx | cut -d'\\\"' -f2 | egrep '[1-9]+\\.[0-9]+\\.[0-9]+/' | egrep -v '^1\\.' | sed 's#/##g'\",$out);\n\n\treturn(HELPER_array2AssociativeArray($out));\n}", "public function scopeAgentsLists($query)\n {\n if (version_compare(app()->version(), '5.2.0', '>=')) {\n return $query->where('panichd_agent', '1')->pluck('name', 'id')->toArray();\n } else { // if Laravel 5.1\n return $query->where('panichd_agent', '1')->lists('name', 'id')->toArray();\n }\n }", "public function getAllViruses() {\n\t\treturn $this->selectAll('VIRUSES');\n\t}", "public function getApprovers()\n {\n\t $admins = $this->getUserList(array('role='=>'Admin'));\n\t $powers = $this->getUserList(array('role='=>'Power'));\n\t $approvers = array();\n\t foreach ($admins as $admin) {\n\t $approvers[] = $admin->username;\n\t }\n\t foreach ($powers as $power) {\n\t $approvers[] = $power->username;\n\t }\n\t return $approvers;\n }", "public function getVouchers(): Collection\n {\n return $this->vouchers;\n }", "public function ListModelVersions(\\Google\\Cloud\\AIPlatform\\V1\\ListModelVersionsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/ListModelVersions',\n $argument,\n ['\\Google\\Cloud\\AIPlatform\\V1\\ListModelVersionsResponse', 'decode'],\n $metadata, $options);\n }", "public function getAllAgentsWithHttpInfo()\n {\n // parse inputs\n $resourcePath = \"/agent/all\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'GET',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\Agent[]',\n '/agent/all'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\Agent[]', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\Agent[]', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "private function getLatestVersionScripts() {\n $latest_version = $this->getLatestVersion();\n \n if($latest_version) {\n $latest_version_path = ROOT . \"/$latest_version\";\n \n return get_files(\"$latest_version_path/upgrade\", 'php');\n } else {\n return array();\n } // if\n }", "public function gatherExtensionVersions()\n {\n $extensions = array(\n 'Iparcel_All' => 0,\n 'Iparcel_CartHandoff' => 0,\n 'Iparcel_GlobaleCommerce' => 0,\n 'Iparcel_Logistics' => 0\n );\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n\n foreach ($extensions as $key => &$version) {\n if (array_key_exists($key, $allExtensions)) {\n $version = $allExtensions[$key]['version'];\n } else {\n unset($extensions[$key]);\n }\n }\n\n return $extensions;\n }", "public function iterateToolVersions(): Generator;", "public function getAllVoters($idea_id){\r\n $table = Engine_Api::_()->getDbtable('ideavotes', 'ynidea');\r\n\t\t$select = $table->select()->where(\"idea_id = ?\",$idea_id);\r\n\t\t$rows = $table->fetchAll($select);\r\n\t \treturn $rows;\r\n }", "public function getBucketVersions($bucket)\n\t{\n\t\t$url = 'https://' . $bucket . '.' . $this->options->get('api.url') . '/?versions';\n\n\t\t// Send the request and process the response\n\t\treturn $this->commonGetOperations($url);\n\t}", "function getAllVirtualAccounts()\n\t{\n\n\t\t$rel_url = \"virtual_accounts\";\n\n\t\t$virtualAccounts = $this->getDatafromServerUsingCurl( $rel_url );\n\n\t\treturn $virtualAccounts;\n\t}", "public function agents()\n {\n $range = explode('-', $this->request->range);\n $start_date = date('Y-m-d', strtotime($range[0]));\n $end_date = date('Y-m-d', strtotime($range[1]));\n $this->request->request->add(['date_range' => [$start_date, $end_date]]);\n $data['range'] = $this->request->date_range;\n $agents = User::permission('tickets_update')->get();\n $html = view('analytics::_ajax._agents', compact('agents'))->with($data)->render();\n\n return response()->json(['status' => 'success', 'html' => $html, 'message' => 'Processed successfully'], 200);\n }", "public function selectVersionHistory($vhInfo,$listAll = false) {\n $limitHistory = 'and (v.status=\\'published\\' or v.status=\\'ingest cpf\\' or v.status=\\'deleted\\' or v.status=\\'tombstone\\' or v.status=\\'ingest cpf\\' or v.status=\\'merge split\\')';\n if ($listAll === true)\n $limitHistory = \"\";\n $result = $this->sdb->query(\n 'select v.*, to_char(v.timestamp, \\'YYYY-MM-DD\"T\"HH24:MI:SS\\') as update_date, a.username, a.fullname\n from version_history v, appuser a\n where v.user_id = a.id and v.id=$1 and v.version<=$2\n '.$limitHistory.'\n order by v.timestamp asc',\n array($vhInfo[\"ic_id\"], $vhInfo[\"version\"]));\n\n $all = array();\n while ($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row);\n }\n return $all;\n }", "public function index(Request $request) {\n\n $agents = Agent::query();\n $name = $request->input('name');\n\n if ($name) {\n $agents->where('first_name', 'like', $name . '%')->orWhere('last_name', 'like', $name . '%');\n }\n\n $user = Auth::user();\n\n if($user->email !== '[email protected]' AND $user->email !== '[email protected]') {\n $agents->whereIn('email', ['[email protected]', '[email protected]', $user->email]);\n }\n\n return [\n 'data' => $agents->get()\n ];\n }", "public function index()\n {\n //\n $agents = User::where('type','=','agent')->orderBy('id', 'desc')->get();\n return view('agent',compact('agents'));\n }", "public function getApiVersions()\n {\n $version = array(\n \"2006-03-01\" => \"2006-03-01 (default)\",\n \"latest\" => \"latest\",\n );\n return $version;\n }", "function getMasterservers() {\n\t\treturn $this->masterservers;\n\t}", "public function all(): array\n {\n $html = file_get_contents(static::RELEASES_URL);\n if (false === $html) {\n throw new RuntimeException('Failed to download ' . static::RELEASES_URL);\n }\n\n preg_match_all(\n '/<a[^>]*href=\"(?<releaseUrl>https:\\/\\/[\\S]+\\/wordpress-[4-9]\\S+[^IIS]\\.zip)\\.sha1\"[^>]*>/',\n $html,\n $matches\n );\n $releaseUrls = $matches['releaseUrl'] ?? [];\n\n static::failIfReleaseUrlsNotFound($releaseUrls);\n\n $releases = array_map(function (string $releaseUrl): ?Release {\n return Release::parse($releaseUrl);\n }, $releaseUrls);\n $releases = array_filter($releases);\n\n $this->failIfReleaseCannotBeParsed($releases);\n\n return $releases;\n }", "public function getVerzendlijst()\n {\n return $this->soapClient->__soapCall('getVerzendlijst', [\n 'getVerzendlijst' => $this->oLogin,\n ]);\n }", "public function index()\n {\n $versions = Version::all();\n\n return view('versions.index', compact('versions'));\n }", "public function index()\n {\n $peer = new VetrinaPeer();\n ActiveRecordUtils::updateFilters($peer);\n return ActiveRecordUtils::toArray($peer->find());\n }", "public function index(Request $request)\n {\n $versions = DB::table('versions');\n if ($request->version) {\n $versions = $versions\n ->where('version', $request->version)\n ->orWhere('version', 'like', $request->version . '.%');\n }\n if ($request->mode) {\n $versions = $versions->where('mode', $request->mode);\n }\n if ($request->deprecated) {\n $versions = $versions->where('deprecated', strtolower($request->deprecated) === 'true');\n }\n return response()->json([\n 'data' => $this->versionTransformer->transformCollection($versions->get()),\n ]);\n }", "public function history( Agent $agent){\n //agents revenue\n //$pending = $agent->revenue()\n //not in remittance\n // ->sum('amount');\n\n $history = Remittance::where('agent_id',$agent->id)->get();\n\n return response()->json([\n 'status' => 'success',\n 'data' => [\n 'amount' => $history\n ]\n ]);\n }", "public function agent()\n {\n return $this->hasMany('App\\Masterdata\\Agent');\n }", "public function list()\n {\n $plugins = Plugin::orderBy('name', 'asc')->where('vsrepo', 0)->where('vs_included', 0)->with('categories')->get();\n\t\treturn view('vsrepo.list', compact('plugins'));\n }", "public function getPatchversionList(){\n return $this->_get(40);\n }", "public function PHP_getVirtualHosts()\n\t{\n\t\t$docRoot\t= $this->_doc_root;\n\t\t$vhosts\t\t= array();\n\n\t\tif ($handle = opendir($docRoot)) {\n\t\t\twhile (false !== ($directory = readdir($handle))) {\n\t\t\t\tif ($this->_is_valid_dir($docRoot . DIRECTORY_SEPARATOR . $directory) && $directory != '.' && $directory != '..') {\n\n\t\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t\t'name'\t\t=> $directory,\n\t\t\t\t\t\t'domain'\t=> $directory .'.' . $this->_tld,\n\t\t\t\t\t\t'href'\t\t=> 'http://' . $directory . '.' . $this->_tld\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $vhosts;\n\t}", "public static function allBundles(): Collection;", "public function getVersesFromSearch($pattern, $version = '', $book = '', $chapter = '') {\n return [];\n }" ]
[ "0.64000916", "0.64000916", "0.64000916", "0.61150116", "0.59911734", "0.5981857", "0.5939583", "0.59027815", "0.5799637", "0.57953405", "0.5757459", "0.55908674", "0.5565991", "0.55166775", "0.5504368", "0.5487049", "0.54512596", "0.5415199", "0.5410186", "0.5383744", "0.53786707", "0.5363353", "0.5362943", "0.5359861", "0.5356991", "0.5326264", "0.5324355", "0.5298455", "0.52899444", "0.52562946", "0.5218559", "0.5213422", "0.519634", "0.5195397", "0.5178631", "0.5157646", "0.51495194", "0.51372564", "0.5094151", "0.50829524", "0.5075369", "0.50344044", "0.50335586", "0.5023625", "0.50228757", "0.5010095", "0.49927133", "0.4969436", "0.49664453", "0.49612862", "0.49512827", "0.49372253", "0.4930668", "0.4913647", "0.4897855", "0.48695394", "0.4866258", "0.48467693", "0.48355475", "0.48251075", "0.48174277", "0.4785969", "0.4773185", "0.4772638", "0.47574967", "0.4743048", "0.47132823", "0.47016904", "0.4699901", "0.46863163", "0.46824652", "0.46817008", "0.46669355", "0.46604535", "0.46583238", "0.46574318", "0.46559462", "0.4644406", "0.46438584", "0.46353173", "0.4634945", "0.462908", "0.46173507", "0.4612662", "0.46076998", "0.45855388", "0.45844287", "0.4581571", "0.45813397", "0.4578224", "0.4573611", "0.45682472", "0.4566606", "0.4566485", "0.45624605", "0.45614803", "0.45500717", "0.45498717", "0.45445552", "0.45358747" ]
0.5046688
41
Retrieves the specified agent version.
public function GetVersion(\Google\Cloud\Dialogflow\V2\GetVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/GetVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAgentVersion()\n {\n if (array_key_exists('ai.internal.agentVersion', $this->_data)) { return $this->_data['ai.internal.agentVersion']; }\n return NULL;\n }", "public function retrieveVersion()\n {\n return $this->start()->uri(\"/api/system/version\")\n ->get()\n ->go();\n }", "public function getAgentVersion(): ?Provenance\n {\n $url = $this->getUrlQuery($this->getDataUrl(), false, false, false, true);\n $result = $this->executeGet($url);\n return $result->getVersion();\n }", "public function getVersion() {\r\n\t\t$response = $this->Client->execute('show version');\r\n\t\tpreg_match('/Version:\\s+VyOS\\s([0-9\\.]+)/', $response, $matches );\r\n\t\t$version = $matches[1];\r\n\t\treturn $version;\r\n\t}", "public function getVersion()\n {\n return $this->sendrequest('version', null);\n }", "public function getVersion() \n\t{\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=version\";\n\t\treturn $this->curlObj->fetch_url($url);\n\t}", "public function getVersion()\n {\n return $this->get(self::VERSION);\n }", "public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }", "public function getSpecifiedVersion();", "public function getVersion()\n {\n return $this->get(self::_VERSION);\n }", "function version(){\n\n\t\treturn (new user_agent)->version();\n\n\t}", "public function get_version();", "public function getVersion()\n {\n return $this->values[\"version\"];\n }", "public function version()\n {\n return $this->browser->get('version')->then(array($this->parser, 'expectJson'));\n }", "public function version()\n {\n $sPARAMS = array( );\n $result = $this->_api(\"Version\", array($sPARAMS) );\n return($result->VersionResult);\n }", "protected function getFromVersion()\n {\n $version = $this->loadFromVersion();\n $this->log('The from version is detected as ' . implode(' ', $version));\n return $version;\n }", "public function getVersion() {\r\n $version = $this->QuerySysStatus(1);\r\n return $version['ver-key'];\r\n }", "public function get_version(){\n\n\t\t\tswitch( $this->method ){\n\n\t\t\t\tcase 'commit-message':\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->get_version_from_commit_message();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn $this->get_version_from_file();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t\treturn $this->get_version_from_tag();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "public function getUserAgentVersion()\n {\n return UTIL_Browser::getVersion($_SERVER['HTTP_USER_AGENT']);\n }", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion() {\r\n return $this->versione;\r\n }", "public function getVersion() {\n return isset($this->data['version']) ? $this->data['version'] : null;\n }", "public function getRequestedVersion()\n {\n return $this->_options['requested_version'];\n }", "public function getVersion()\n {\n return $version;\n }", "static function getVersion(){\n\t\t$uagent = \"\";\n\t\tif (array_key_exists(\"HTTP_USER_AGENT\", $_SERVER)){\n\t\t\t$uagent = $_SERVER[\"HTTP_USER_AGENT\"];\n\t\t}\n\t\t\n\t\tif (knj_browser::getBrowser() == \"ie\"){\n\t\t\tif (preg_match(\"/MSIE (\\d+)/\", $uagent, $match)){\n\t\t\t\treturn $match[1];\n\t\t\t}elseif(strpos($uagent, \"7.0\") !== false){\n\t\t\t\treturn 7;\n\t\t\t}else{\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"safari\"){\n\t\t\tif (strpos($uagent, \"Version/4.0\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"konqueror\"){\n\t\t\tif (strpos($uagent, \"Konqueror/3\") !== false){\n\t\t\t\treturn 3;\n\t\t\t}elseif (strpos($uagent, \"Konqueror/4\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"mozilla\" or knj_browser::getBrowser() == \"firefox\"){\n\t\t\tif (strpos($uagent, \"Firefox/3\") !== false){\n\t\t\t\treturn 3;\n\t\t\t}elseif(strpos($uagent, \"Firefox/2\") !== false){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}elseif(knj_browser::getBrowser() == \"chrome\"){\n\t\t\tif (strpos($uagent, \"Chrome/4\") !== false){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "function get_version() {\n\n\t\treturn $this->version;\n\n\t}", "public function getVersion() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function get_version() {\n\t\treturn $this->version;\n\t}", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function getVersion()\n {\n $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true);\n\n if ($info) {\n return $info['currentVersion'];\n } else {\n throw new Exception('The plugin has an invalid version file.');\n }\n }", "public function getVersion()\r\n {\r\n return $this->version;\r\n }", "public function getVersion()\n {\n $value = $this->get(self::version);\n return $value === null ? (string)$value : $value;\n }", "public static function getDefaultAgentVersion()\n {\n return 'google.com/gcp-php/' . self::VERSION;\n }", "public function getVersion() {\r\n return $this->version;\r\n }", "public function getVersion(): string\n {\n return $this->version;\n }", "public function getVersion(): string\n {\n return $this->version;\n }", "public function getVersion()\n\t{\n\t\treturn $this->version;\n\t}", "public function EngineVersion() {\n if ($cache = fastcache::cache_get('EngineVersion', 'schema')) {\n return $cache->data;\n }\n\n $version = $this->connection\n ->query_direct(<<< EOF\n SELECT CONVERT (varchar,SERVERPROPERTY('productversion')) AS VERSION, \n CONVERT (varchar,SERVERPROPERTY('productlevel')) AS LEVEL, \n CONVERT (varchar,SERVERPROPERTY('edition')) AS EDITION\nEOF\n )->fetchAssoc();\n\n fastcache::cache_set('EngineVersion', $version, 'schema');\n return $version;\n }", "public function get_version() { \n\n\t\treturn $this->version; \n\n\t}", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getVersion()\n {\n return $this->version;\n }", "public function getApiVersion()\n {\n return SiteVersion::get();\n }" ]
[ "0.7479249", "0.68799955", "0.66829276", "0.6626546", "0.65743554", "0.65036577", "0.62579453", "0.62511075", "0.61790526", "0.61566794", "0.61554545", "0.61417115", "0.613188", "0.606005", "0.59780693", "0.595682", "0.5954178", "0.5929921", "0.59250396", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5923857", "0.5918874", "0.58788407", "0.5866897", "0.5859271", "0.58501804", "0.5835379", "0.58253294", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.5812237", "0.58049166", "0.58049166", "0.5795799", "0.5793836", "0.5789944", "0.57743883", "0.57656616", "0.57656616", "0.5759958", "0.5759574", "0.575547", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.57546407", "0.5753965" ]
0.5902098
42
Creates an agent version. The new version points to the agent instance in the "default" environment.
public function CreateVersion(\Google\Cloud\Dialogflow\V2\CreateVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/CreateVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function makeNewVersion(): Versionable;", "public static function getDefaultAgentVersion()\n {\n return 'google.com/gcp-php/' . self::VERSION;\n }", "public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(), 12);\n $version = bcmul($difference, $rand_percent, 0);\n $this->owner->setAttribute($this->versionField, $version);\n }", "protected function thenNewVersionWasCreated()\n {\n }", "protected function assignVersion()\n {\n\n }", "public function fakeVersion();", "public static function defaultVersion()\n {\n return static::where('default', true)->first();\n }", "protected function whenNewVersionWasRequested()\n {\n }", "public function created()\n\t{\n\t\tif (!$this->ismilestone) {\n\t\t\t$this->createDefaultMilestone();\n\t\t}\n\n\t\t$this->versioningService->createVersion($this);\n\t}", "public function createNewVersion()\n {\n if ( !$this->Node )\n {\n return false;\n }\n\n $object = $this->Node->object();\n\n $contentObjectVersion = $object->createNewVersion();\n\n return $contentObjectVersion ? $contentObjectVersion->attribute( 'version' ) : false;\n }", "public function version();", "public function version();", "public function version();", "public function version();", "public function version();", "public function getAgentVersion()\n {\n if (array_key_exists('ai.internal.agentVersion', $this->_data)) { return $this->_data['ai.internal.agentVersion']; }\n return NULL;\n }", "public function version() {\n $versionsTable = TableRegistry::get('Versions');\n $data = $versionsTable->findAllVersion();\n $this->set('web', $data[0]);\n $this->set('iOS', $data[1]);\n $this->set('android', $data[2]);\n }", "public function getCurrentVersion();", "public function create()\n {\n $agent = new Agent;\n \n return view('agent.createModify')->with([\n 'agent' => $agent,\n 'action' => 'create',\n ]);\n }", "function &getNewVersion() {\n\t\treturn $this->newVersion;\n\t}", "public function init(): AgentInterface;", "abstract public function version();", "abstract public function version();", "function getNewVersion($meta, $object);", "public function created()\n\t{\n\t\t$parent = $this->projectService->getProject($this->projectid);\n\t\tif ($parent) {\n\t\t\t$this->versioningService->createVersion($parent, 'featureupdate');\n\t\t}\n\t\t$this->versioningService->createVersion($this);\n\t}", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "abstract public function getVersion();", "public static final function getCurrentVersion() : Version\n {\n return new Version(self::VERSION);\n }", "public static function activate() {\n self::version_compare();\n update_option(self::version_option_name, self::version);\n }", "public function deploy($version, $name){\n \n }", "public static function getCurrent() {\n return new amvonetroom_Version(AMVONETROOM_PROTOCOL_VERSION);\n }", "protected function generateSemVer()\n {\n $this->semver = $this->version;\n\n if ($this->pre_release) {\n $this->semver .= '-'.$this->pre_release;\n }\n\n if ($this->meta) {\n $this->semver .= '+'.$this->meta;\n }\n }", "public function findOrCreateNotDetected(): Agent\n {\n return Agent::firstOrCreate([\n 'name' => 'unknown',\n 'browser' => NULL,\n 'browser_version' => NULL\n ]);\n }", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function getVersion();", "public function setAgentVersion($agentVersion)\n {\n $this->_data['ai.internal.agentVersion'] = $agentVersion;\n }", "protected function assignVersion()\n {\n $this->version = '';\n }", "abstract public function get_version();", "public function create()\n {\n return view('versions.create');\n }", "public function setDefaultVersion(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Ml\\V1\\Version::class);\n $this->default_version = $var;\n }", "public function create($version)\n {\n if ($version->releaseDate instanceof \\DateTimeInterface) {\n $version->releaseDate = $version->releaseDate->format('Y-m-d');\n }\n $data = json_encode($version);\n\n $this->log->info(\"Create Version=\\n\".$data);\n\n $ret = $this->exec($this->uri, $data, 'POST');\n\n return $this->json_mapper->map(\n json_decode($ret),\n new Version()\n );\n }", "public function getDefaultVersion()\n {\n return $this->default_version;\n }", "public function getVersion() {}", "public function getVersion() {}", "public function getVersion() {}", "public function getVersion() {}", "public function getVersion() {}", "public static function create(ReflectedVersion $version, string $name): self\n {\n return parent::createBase($name)->setVersion($version);\n }", "public function create()\n\t{\n\t\treturn $this->createResource(sprintf('/%s/%s/', ZoopResource::VERSION, sprintf(self::PATH, $this->zoop->getMarketplaceId())));\n\t}", "public function getVersion()\n {\n return new Types\\Version($this->request('GET', 'version'));\n }", "function &factory($version)\n {\n if (!in_array($version[0], array('1', '2'))) {\n $a = false;\n return $a;\n }\n\n include_once 'PEAR/PackageFile/v' . $version[0] . '.php';\n $version = $version[0];\n $class = $this->getClassPrefix() . $version;\n $a = new $class;\n return $a;\n }", "function switchToBeta(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_BETA; }", "function CreateDefaultSaleStageEntity()\n {\n\t\t$result = $this->sendRequest(\"CreateDefaultSaleStageEntity\", array());\n\t\treturn $this->getResultFromResponse($result);\n }", "function VM_setVBoxAddonAsDefault($version)\n{\n\t//Delete old default addons\n\t@unlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64.run\");\n\t@unlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86.run\");\n\t\n\tsymlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64-$version.run\",VBOX_addonStoreDir.\"VBoxLinuxAdditions-amd64.run\");\n\tsymlink(VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86-$version.run\",VBOX_addonStoreDir.\"VBoxLinuxAdditions-x86.run\");\n}", "public function newLinkVersionAction()\n {\n $user = $this->getConnectedUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n if ($request->getMethod() == 'POST') {\n $versionId = $request->request->get('versionId');\n $versionId = json_decode($versionId);\n\n $version = $em->getRepository('TimeBoxMainBundle:Version')->findBy(array(\n 'id' => $versionId\n ));\n\n if (!is_null($version)) {\n $existingLinks = $em->getRepository('TimeBoxMainBundle:Link')->findBy(array(\n 'user' => $user,\n 'version' => $version\n ));\n\n if(sizeof($existingLinks) == 0){\n $link = new Link();\n $link->setUser($user);\n $link->setVersion($version[0]);\n $link->setDate(new \\DateTime);\n $time = time();\n $hash = md5($time + $user->getId()) . sha1($time + $user->getUsername());\n $link->setDownloadHash($hash);\n\n $em->persist($link);\n }\n $em->flush();\n }\n }\n return $this->redirect($this->generateUrl('time_box_main_share'));\n }", "public static function getCurrent() {\n global $CFG;\n\n if ($data = file_get_contents(\"$CFG->dirroot/mod/amvonetroom/revision\"))\n return new amvonetroom_Version($data);\n else\n return new amvonetroom_Version(0);\n }", "public function get_version();", "public static function createAgent(\n array $config = [],\n ?ClientInterface $client = null,\n ?LoggerInterface $logger = null\n ) {\n // Check php sapi is cli disable apm agent\n if (PHP_SAPI === 'cli') {\n $config['enabled'] = false;\n }\n\n $agentBuilder = new AgentBuilder();\n\n if (array_key_exists('env', $config) && !empty($config['env'])) {\n $agentBuilder->withEnvData($config['env']);\n }\n if (array_key_exists('cookies', $config) && !empty($config['cookies'])) {\n $agentBuilder->withCookieData($config['cookies']);\n }\n if ($client instanceof ClientInterface) {\n $agentBuilder->withHttpClient($client);\n }\n if ($logger instanceof LoggerInterface) {\n $config['logger'] = $logger;\n }\n\n unset($config['env'], $config['cookies'], $config['httpClient']);\n $config = new Config($config);\n\n return $agentBuilder->withConfig($config)->build();\n }", "public function setVersion($version) {}", "public function setVersion($version) {}", "private function createEnvironment() {\n\t\t$this->cache_folder = dirname(__FILE__) . \"/\" . $this->cache_folder;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($this->cache_folder))\n\t\t\tmkdir($this->cache_folder);\n\n\t\t// Get the index file path\n\t\t$indexFilepath = $this->cache_folder . \"/\" . $this->cache_index;\n\n\t\t// Create one if it doesn't exist\n\t\tif(!file_exists($indexFilepath))\n\t\t\ttouch($indexFilepath);\n\t}", "public function execute()\n {\n $version = $this->context->getParameter('new-version');\n if ($version == null) {\n throw new \\RuntimeException('Could not determine the new version.');\n }\n \n $const = $this->options['const'];\n $template = \"<?php\\ndefine('$const', '%s');\\n\";\n\n file_put_contents($this->options['file'], sprintf($template, $version));\n $this->confirmSuccess();\n }", "public function create(Environment $environment);", "public function registerVersion() {\n $this->loadModel('Versions');\n $result = $this->Versions->newEntity();\n if ($this->request->is('post') || $this->request->is('put')) {\n $this->Versions->patchEntity($result, $this->request->data(), [\n 'validate' => 'adminAdd'\n ]);\n if ($this->Versions->save($result)) {\n $this->redirect(array('controller' => 'users', 'action' => 'version'));\n }\n }\n $this->set(compact('result'));\n }", "public function create()\n {\n return view('Admin.agents.create');\n }", "static function generate($version) {\n if (is_int($version)) {\n $st = new static;\n\n switch ($version) {\n case '4':\n return $st->genV4();\n default:\n throw new Exception('Invalid version');\n }\n }\n }", "public function getVersion()\n\t{\n\t}", "public function create()\n {\n return view('Tenant::Agent/add');\n }", "protected function loadToVersion()\n {\n return $this->loadVersion($this->context['new_source_dir']);\n }", "private static function createVersionRoute()\n {\n self::$Router->map('GET|POST', '/[a:version]', function(string $version){\n if(isset(Handler::$MainConfiguration->VersionConfigurations[$version]) == false)\n {\n UnsupportedVersion::executeResponse();\n exit();\n }\n else\n {\n /** @var VersionConfiguration $VersionConfiguration */\n $VersionConfiguration = Handler::$MainConfiguration->VersionConfigurations[$version];\n\n $Modules = array();\n\n /** @var ModuleConfiguration $module */\n foreach($VersionConfiguration->Modules as $module)\n {\n $ModuleObject = self::getModuleObject($version, $module);\n\n $Modules['/' . $module->Path] = array(\n 'name' => $ModuleObject->name,\n 'version' => $ModuleObject->version,\n 'description' => $ModuleObject->description\n );\n }\n\n ModuleListingResponse::executeResponse($Modules);\n exit();\n }\n });\n }", "function GetVersion()\n {\n return '1.0';\n }", "public function version( $args = array(), $assoc_args = array() ) {\n\t\tself::run( 'core version', $args, $assoc_args );\n\t}", "function getVersion() {\r\n\t\treturn '1.1';\r\n\t}", "public static function factory(&$object, &$version)\n {\n $class = $object->package() . '\\\\Common\\\\' .\n ClassnameUtilities::getInstance()->getPackageNameFromNamespace($object->package()) . 'Difference';\n return new $class($object, $version);\n }", "public function create()\n {\n return $this->createResource(sprintf('/%s/%s', MoipResource::VERSION, self::PATH));\n }", "public static function createNew();", "public static function getVersion()\n {\n return '1.0.1';\n }", "public function latest_version();" ]
[ "0.6062278", "0.5824177", "0.55727667", "0.5546499", "0.53755563", "0.51298493", "0.5073875", "0.5063272", "0.5002378", "0.49918213", "0.4927859", "0.4927859", "0.4927859", "0.4927859", "0.4927859", "0.48472664", "0.4831095", "0.48309276", "0.4825261", "0.48146376", "0.48111948", "0.4807282", "0.4807282", "0.47920358", "0.4784614", "0.47672978", "0.47672978", "0.47672978", "0.47672978", "0.4766372", "0.47578484", "0.47312608", "0.47082132", "0.46990806", "0.46979243", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46834213", "0.46682405", "0.46580303", "0.4655907", "0.46496066", "0.46393257", "0.463178", "0.46113044", "0.46015316", "0.46015316", "0.46015316", "0.46015316", "0.4601031", "0.4576114", "0.457348", "0.45616326", "0.45522365", "0.44991523", "0.44902465", "0.44897753", "0.44833237", "0.4480708", "0.4475456", "0.44728535", "0.44609156", "0.44609156", "0.44473645", "0.4446361", "0.44364786", "0.442317", "0.4418524", "0.4417652", "0.44035676", "0.44032863", "0.440004", "0.43861213", "0.43780956", "0.43754667", "0.43752244", "0.4373404", "0.43701637", "0.4367316", "0.43667188", "0.4359346" ]
0.5107025
6
Updates the specified agent version. Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource.
public function UpdateVersion(\Google\Cloud\Dialogflow\V2\UpdateVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/UpdateVersion', $argument, ['\Google\Cloud\Dialogflow\V2\Version', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUpdateVersion($val)\n {\n $this->_propDict[\"updateVersion\"] = $val;\n return $this;\n }", "public function setAgentVersion($agentVersion)\n {\n $this->_data['ai.internal.agentVersion'] = $agentVersion;\n }", "public function updateVersion($version)\n {\n $config_file = new File(MAIN_PATH . '/config/build.ini');\n $lines = $config_file->readLines();\n foreach ($lines as &$line) {\n // We update the line with the \"current_version\" parameter\n if (strpos($line, 'current_version') === 0) {\n $line = 'current_version = ' . $version;\n break;\n }\n }\n // We rewrite the file with the updated parameter\n $config_file->writeLines($lines, true, false);\n }", "public function update(Request $request, Version $version)\n {\n //\n }", "public function updateVersion(string $extension, ?string $version): void\n {\n $this->set(\"{$extension}/version\", $version);\n $this->updateHistory($extension, $version);\n }", "public function setVersion($version)\n {\n $this->version = $version;\n }", "public function setVersion(Version $version): void\n {\n $this->version = $version;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n }", "public function setVersion($value){\n $this->version = $value;\n }", "public function setApiVersion($version)\n {\n if (ctype_digit(strval($version))) {\n $this->apiVersion = (int)$version;\n }\n }", "public function setVersion($version) {}", "public function setVersion($version) {}", "public function setVersion($version) {\n\t\t$this->version = $version;\n\t}", "public function setVersion($version)\n\t{\n\t\t$this->version = (int) $version;\n\t}", "public function update_version_number(){\n $plugin_settings = nf_get_settings();\n\n if ( !isset ( $plugin_settings['version'] ) OR ( NF_PLUGIN_VERSION != $plugin_settings['version'] ) ) {\n $plugin_settings['version'] = NF_PLUGIN_VERSION;\n update_option( 'ninja_forms_settings', $plugin_settings );\n }\n }", "public function setApiVersion($version)\n {\n $this->_apiVersion = (int)$version;\n }", "public function update(Request $request, OSVersion $osVersion)\n {\n $data = $request->validate([\n 'name' => ['required']\n ]);\n\n $osVersion->update($data);\n\n return redirect('/admin/os-versions');\n }", "final public function setApiVersion($version)\n {\n $this->_apiVersion = $version;\n }", "public function setVersion(string $version): void\n {\n $this->version = $version;\n }", "public function setVersion($var)\n {\n GPBUtil::checkInt32($var);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkInt32($var);\n $this->version = $var;\n\n return $this;\n }", "public function SetVersion($version)\n {\n $this->messageBuilder->SetVersion($version);\n }", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion(string $version);", "public function setVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->version = $var;\n\n return $this;\n }", "public function setVersion($var)\n {\n GPBUtil::checkInt32($var);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "public function doUpdate($version)\n {\n $this->registerMyLibrary();\n\n $update = new Update(\n $this,\n Shopware()->Models(),\n Shopware()->Db(),\n new Logger(Shopware()->Db()),\n $version\n );\n\n return $update->run();\n }", "protected function bumperUpdate($version)\n {\n $filename = 'version';\n foreach (['', '.txt'] as $extension) {\n $filepath = $filename . $extension;\n foreach ([strtoupper($filename) . $extension, ucfirst($filepath), $filepath] as $path) {\n if (file_exists($path)) {\n $file = $path;\n break;\n }\n }\n\n if (!isset($file)) {\n continue;\n }\n\n $this->taskWriteToFile($file)->line($version)->run();\n unset($file);\n }\n\n if (file_exists('composer.json')) {\n $this->taskReplaceInFile('composer.json')\n ->regex('/\"version\": \"[^\\\"]*\"/')\n ->to('\"version\": \"' . ltrim($version, 'v') . '\"')\n ->run();\n }\n }", "abstract protected function doUpdate($oldVersion);", "private function setVersion($v){\n\t\t$this->version = $v;\n\t}", "function setVersion($inVersion) {\n\t\tif ( $inVersion !== $this->_Version ) {\n\t\t\t$this->_Version = $inVersion;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setVersion(Version $version)\n {\n if (! $version->isSpecified()) {\n throw new \\InvalidArgumentException(\"version for $this must be specified\");\n }\n $this->version = (string) $version;\n }", "function updateVersion() {\n\t\tif ($this->newVersion->compare($this->currentVersion) > 0) {\n\t\t\t$versionDao =& DAORegistry::getDAO('VersionDAO');\n\t\t\tif (!$versionDao->insertVersion($this->newVersion)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$result = true;\n\t\tHookRegistry::call('Installer::updateVersion', array(&$this, &$result));\n\n\t\treturn $result;\n\t}", "public function setVersion(VersionId $version)\n {\n $this->values['Version'] = $version;\n return $this;\n }", "public function setVersion(VersionId $version)\n {\n $this->values['Version'] = $version;\n return $this;\n }", "function setCurrentVersion(&$version) {\n\t\t$this->currentVersion = $version;\n\t}", "public function setSchemaVersion($version)\n {\n $rq = $this->adodb->prepare('UPDATE ['.$this->schemaTable.'] SET [version]=?');\n $rq->execute(array($version));\n }", "public function setVersion($version)\n {\n $this->version = $version;\n\n // We need to re-build the SOAP headers.\n $this->headers = array();\n }", "public function setVersionReference($version)\n {\n assertion(! $this->isStockItem());\n $this->version = trim($version);\n }", "public function setVersion($rel_version = null, $api_version = null)\n {\n $release = $this->findNodeRelativeTo(\n './p:version',\n $this->_requireCurrentRelease()\n );\n $version = $this->findNode('/p:package/p:version');\n if ($rel_version !== null) {\n $this->replaceTextNodeRelativeTo(\n './p:release', $version, $rel_version\n );\n $this->replaceTextNodeRelativeTo(\n './p:release', $release, $rel_version\n );\n }\n if ($api_version !== null) {\n $this->replaceTextNodeRelativeTo(\n './p:api', $version, $api_version\n );\n $this->replaceTextNodeRelativeTo(\n './p:api', $release, $api_version\n );\n }\n }", "public function setVersion(VersionId $version)\n {\n $this->Version = $version;\n return $this;\n }", "private function setNewModuleVersionNumber( $version )\n {\n $sql = \"UPDATE {$this->config->dbTablePrefix}common_module\n SET\n `version`='{$version}'\n WHERE\n `name`='keyword'\";\n\n $this->model->dba->query($sql);\n }", "public function setVersion($path, $version, View $view) {\n\t\t$fileInfo= $view->getFileInfo($path);\n\n\t\tif($fileInfo !== false) {\n\t\t\t$cache = $fileInfo->getStorage()->getCache();\n\t\t\t$cache->update($fileInfo->getId(), ['encrypted' => $version, 'encryptedVersion' => $version]);\n\t\t}\n\t}", "public function setRequestedVersion($version)\n {\n $this->_options['requested_version'] = $version;\n }", "public function setVersion($version) {\n throw new \\BadFunctionCallException('Cannot set version number of graded version');\n }", "public function setVersion($version)\n {\n return $this->setParam(self::SOFTWARE_VER_PARAM_NAME, $version);\n }", "public function setHttpVersion($version) {}", "public function setVersion($value)\n {\n return $this->set(self::version, $value);\n }", "public function setVersion($value)\n {\n return $this->set(self::_VERSION, $value);\n }", "public function setVersion($value)\n {\n return $this->set(self::VERSION, $value);\n }", "public function setVersion($version) {\n $this->properties['version'] = $version;\n\n return $this;\n }", "public function setOptimizerVersion($var)\n {\n GPBUtil::checkString($var, True);\n $this->optimizer_version = $var;\n\n return $this;\n }", "private function setNewModuleVersionNumber( $version )\n {\n $sql = \"UPDATE {$this->config->dbTablePrefix}common_module\n SET\n `version`='{$version}'\n WHERE\n `name`='modcreator'\";\n\n $this->model->dba->query($sql); \n }", "private function _log_version_number () {\n update_option( $this->_token . '_version', $this->_version );\n }", "function updateVersion() {\n // Query to Update Build Version\n $query5 = \"UPDATE \" . $this->tableName . \" SET appLatestBuild=:appLatestBuild, appUpdatedAt=:appUpdatedAt WHERE appID=:appID\";\n // Prepare query\n $stmt5 = $this->conn->prepare($query5);\n // Sanitize\n $this->appID = htmlspecialchars(strip_tags($this->appID));\n $this->appLatestBuild = htmlspecialchars(strip_tags($this->appLatestBuild));\n $this->appUpdatedAt = htmlspecialchars(strip_tags($this->appUpdatedAt));\n // Bind values\n $stmt5->bindParam(':appID', $this->appID);\n $stmt5->bindParam(':appLatestBuild', $this->appLatestBuild);\n $stmt5->bindParam(':appUpdatedAt', $this->appUpdatedAt);\n // Execute query\n if ($stmt5->execute()) {\n return true;\n }\n return false;\n }", "public function setVersion($version)\n {\n if (empty($version)) {\n throw new Exception (\"version is empty!\");\n } \n $this->version = $version;\n }", "public function set_version( $ver ) {\n\t\t$this->items[ $this->id ]['ver'] = $ver;\n\t\treturn $this;\n\t}", "protected function incrementVersion(): void\n {\n $version = $this->getVersion() + 1;\n\n $this->store->forever($this->getCacheVersionKey(), $version);\n\n static::$versions[$this->prefix] = $version;\n }", "public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "public function setVersion(\\App\\Entity\\Product\\Details\\Version $version = null) \n { \n $this->version = $version;\n \n return $this;\n }", "public function setVersion($version)\n {\n if (!preg_match(\"/\\\\d+\\\\.\\\\d+\\\\.\\\\d+/i\", $version)) {\n throw new \\RuntimeException(sprintf('Invalid version string, expected VERSION=major.minor.patch'));\n }\n\n $string = \"VERSION=\" . $version;\n\n return file_put_contents($this->filepath, $string);\n }", "public function set_version( $version ) {\n\t\t$this->version = $version;\n\n\t\treturn $this;\n\t}", "public function changeVersion($num)\n {\n $versions = $this->versions()->with(['version' => (string) $num])->fetch();\n if ($versions) {\n $version = $versions[0];\n $attrs = $version->getAttributes();\n $idKey = $this->meta()->get('table') . '_id';\n\n foreach ($attrs as $field => $value) {\n if ($field !== $idKey && $field !== 'version') {\n $this->$field = $value;\n }\n }\n }\n }", "public function setVersion($val)\n {\n $this->_propDict[\"version\"] = $val;\n return $this;\n }", "public function actionVersion($argv)\n {\n $info = \\Gini\\Core::moduleInfo(APP_ID);\n $opt = \\Gini\\Util::getOpt($argv, 'f', ['force']);\n\n if (isset($opt['f']) || isset($opt['force'])) {\n $force = true;\n } else {\n $force = false;\n }\n\n $version = $opt['_'][0] ?? null;\n if ($version) {\n $WORK_TREE = escapeshellarg(APP_PATH);\n $GIT_DIR = escapeshellarg(APP_PATH . '/.git');\n if (is_dir(APP_PATH . '/.git') && !$force) {\n $content = `git --git-dir=$GIT_DIR --work-tree=$WORK_TREE status --short --untracked-files=no`;\n if ($content) {\n echo \"$content\\n\";\n die(\"Please commit uncommited changes before bump the version! Or you have to specify -f parameter.\\n\");\n }\n }\n // major.minor.patch\n // e.g. gini version minor+1\n // set current version\n if (preg_match('/^(major|minor|patch)?\\+(\\d+)$/', $version, $matches)) {\n $v = new \\Gini\\Version($info->version);\n $v->bump($matches[1] ?? 'patch', (int) $matches[2]);\n } else {\n $v = new \\Gini\\Version($version);\n if ($v->isValid()) {\n $v->compare($info->version) > 0 or die(\"A newer version (>{$info->version}) is required! But we only got {$version}.\\n\");\n } else {\n die(\"Invalid version {$version} was specified.\\n\");\n }\n }\n\n $info->version = $v->fullVersion;\n \\Gini\\Core::saveModuleInfo($info);\n\n // commit it if it is a git repo\n if (is_dir(APP_PATH . '/.git')) {\n $GIT_MSG = escapeshellarg(\"Bumped version to {$info->version}\");\n $command = \"git --git-dir=$GIT_DIR --work-tree=$WORK_TREE commit -m $GIT_MSG gini.json && git --git-dir=$GIT_DIR tag {$info->version}\";\n passthru($command);\n\n return;\n }\n }\n\n echo \"$info->name ($info->id/$info->version)\\n\";\n }", "public function setVersionId($var)\n {\n GPBUtil::checkString($var, True);\n $this->version_id = $var;\n\n return $this;\n }", "public function setVersionId($var)\n {\n GPBUtil::checkString($var, True);\n $this->version_id = $var;\n\n return $this;\n }", "private function _log_version_number () {\n\t\tupdate_option( $this->_token . '_version', $this->_version );\n\t}", "public function update()\n\t{\n\t\t$parent = $this->projectService->getProject($this->projectid);\n\t\t$otherParent = null;\n\t\t// load the current state\n\t\t$current = $this->dbService->getById($this->id, 'Feature');\n\t\tif ($current->projectid != $this->projectid) {\n\t\t\t$otherParent = $this->projectService->getProject($current->projectid);\n\t\t}\n\t\t// $mostRecent = $this->versioningService->getMostRecentVersion($this);\n\t\tif ($this->isChanged(array('estimated', 'title', 'description', 'milestone', 'projectid'), $current)) {\n\t\t\tif ($otherParent) {\n\t\t\t\t$this->versioningService->createVersion($otherParent, 'featureupdate');\n\t\t\t}\n\n\t\t\tif ($parent) {\n\t\t\t\t$this->versioningService->createVersion($parent, 'featureupdate');\n\t\t\t}\n\n\t\t\t$this->versioningService->createVersion($current);\n\t\t}\n\t}", "public function setVersion($name) {\n\n // Take what is the $current variable and copy it into an entry in\n // the versions variable.\n $this->versions[$name] = $this->current;\n }", "public function setVersionId($versionId);", "public function setVersion(string $version)\n {\n $this->version = $version;\n\n return $this;\n }", "public function setVersion(string $version)\n {\n $this->version = $version;\n\n return $this;\n }", "public function upgrade($version)\n {\n if (version_compare($version, '1.1.0', '<')) {\n $updator = new Updator110($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.2.2', '<')) {\n $updator = new Updator122($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.3.0', '<')) {\n $updator = new Updator130($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n if (version_compare($version, '1.3.1', '<')) {\n $updator = new Updator131($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n \n if (version_compare($version, '1.3.2', '<')) {\n $updator = new Updator132($this->handler);\n $result = $updator->upgrade($version);\n if (false === $result) {\n return $result;\n }\n }\n $result = $this->from133($version);\n\n return $result;\n }", "private function setVersionInternal($version) {\n if ((is_int($version) || ctype_digit($version)) && intval($version) >= 0) {\n $this->version = intval($version);\n }\n else {\n throw new \\InvalidArgumentException('Version number must be a non-negative integer');\n }\n }", "public function setVersion($version)\n {\n $this->version = $version;\n return $this;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n return $this;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n return $this;\n }", "public function setVersion($version)\n {\n $this->version = $version;\n return $this;\n }", "public function setVersion(?int $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "public function setAppVersion($appVersion) {\n $this->appVersion = $appVersion;\n }", "public function updateEntityVersion(VersionableInterface $entity, $changeset, $versionNumber, $metadata = null)\n {\n $version = $this->findVersion($entity, $versionNumber);\n if (!$version) {\n throw new VersionNotFoundException(\"Version not found: {$versionNumber}\");\n }\n $version->setData($this->serializer->serialize($entity));\n $version->setChangeSet(json_encode($changeset));\n if (null !== $metadata) {\n if (isset($metadata['dateActiveFrom'])) {\n $version->setDateActiveFrom($metadata['dateActiveFrom']);\n }\n if (isset($metadata['notes'])) {\n $version->setNotes($metadata['notes']);\n }\n }\n\n $this->affectedVersions[] = [$entity, $version];\n return $version;\n }", "public function setOrderVersion(?int $orderVersion): void\n {\n $this->orderVersion['value'] = $orderVersion;\n }", "public function changeVersion($idlist, $version)\n {\n $idArray = explode(',', $idlist);\n foreach($idArray as $id) {\n $issue = $this->find($id);\n $issue->version = $version;\n $issue->save();\n }\n\n return true;\n }", "public function setClientVersion($clientVersion) {\n $this->clientVersion = $clientVersion;\n }", "public function getAgentVersion()\n {\n if (array_key_exists('ai.internal.agentVersion', $this->_data)) { return $this->_data['ai.internal.agentVersion']; }\n return NULL;\n }", "public function setServiceVersion($value)\n {\n $this->_headers[ODataConstants::ODATAVERSIONHEADER] \n = $value;\n }", "public function setVersion($version) {\n\t\t$this->version = $version;\n\n\t\treturn $this;\n\t}", "public function setVersion($version = null): object\n\t{\n\t\tif (null !== $version && !($version instanceof FHIRString)) {\n\t\t\t$version = new FHIRString($version);\n\t\t}\n\t\t$this->_trackValueSet($this->version, $version);\n\t\t$this->version = $version;\n\t\treturn $this;\n\t}" ]
[ "0.58730173", "0.58695847", "0.58048266", "0.5606574", "0.55426466", "0.54943204", "0.54700434", "0.54400736", "0.54400736", "0.54400736", "0.54358196", "0.5432168", "0.5421149", "0.5421149", "0.54122525", "0.5388079", "0.53782827", "0.53386074", "0.5330476", "0.5304612", "0.5282869", "0.52772796", "0.52772796", "0.52651674", "0.5261862", "0.5261862", "0.5261862", "0.5261862", "0.5261862", "0.52597344", "0.5253007", "0.5253007", "0.5253007", "0.5253007", "0.5253007", "0.5236247", "0.52207226", "0.5210113", "0.52090776", "0.5205002", "0.51446736", "0.51072824", "0.5087235", "0.50673485", "0.50673485", "0.50565135", "0.4982764", "0.49826476", "0.49774703", "0.49543294", "0.4926751", "0.48954415", "0.48879138", "0.484923", "0.48258346", "0.4821186", "0.48118383", "0.48071796", "0.47904152", "0.47894084", "0.47791404", "0.47693944", "0.4768221", "0.47356915", "0.4705812", "0.46915928", "0.46912375", "0.4685918", "0.46736538", "0.46736538", "0.46706372", "0.46692336", "0.46393412", "0.4636352", "0.46322146", "0.46025884", "0.4594934", "0.4594934", "0.45871872", "0.45835507", "0.45696118", "0.45672792", "0.45594367", "0.45594367", "0.4553882", "0.45497447", "0.45475352", "0.45475352", "0.45475352", "0.45475352", "0.45367533", "0.45277193", "0.45161936", "0.44937515", "0.4483908", "0.4473356", "0.44717833", "0.44546193", "0.44531783", "0.44520032" ]
0.7078659
0
Delete the specified agent version.
public function DeleteVersion(\Google\Cloud\Dialogflow\V2\DeleteVersionRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/DeleteVersion', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n foreach ($this->versions as $version)\n {\n $version->delete();\n }\n\n parent::delete();\n }", "public function delete(Request $request)\n {\n \t$version = AppVersion::where('id',$request->id);\n $version->delete();\n $this->helper->flash_message('success', 'Mobile App Version successfully deleted');\n return redirect('admin/mobile_app_version');\n }", "public function destroy(Agent $agent)\n {\n $agent->delete();\n\n return redirect()\n ->route('agents.index')\n ->with('success','Agente eliminato.');\n }", "public function destroy(Version $version)\n {\n //\n }", "public function delete(Vote $vote);", "public function delete($episode);", "public function remove(string $version);", "public function destroy(Agent $agent)\n {\n $agent->delete();\n User::where('username', $agent->phonenumber)->delete();\n return back();\n }", "public static function delete($version_id) {\n\t\treturn DB::table(Version::getVersionsTable())->delete($version_id);\n\t}", "public function DeleteModelVersion(\\Google\\Cloud\\AIPlatform\\V1\\DeleteModelVersionRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.aiplatform.v1.ModelService/DeleteModelVersion',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }", "public function delete(Environment $environment);", "public function deleteAgent( $remove = true )\n\t{\n\t\tglobal $db;\n\t\tif ( empty( $this->id ) ) return false;\n\t\t\n\t\t// check certain tables and force $remove = true if matches found\n\t\tif ( ! $remove ) {\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_AGENT_TRACKING.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}\n\t\tif ( ! $remove ) {\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_EVENT_OVERVIEWS.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\tOR instructor_id = '{$this->id}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}\n\t\t/*if ( ! $remove ) {\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_PDF_QUEUE_PROCESS.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}*/\n\t\tif ( ! $remove ) {\n\t\t\t$agent_code = $db->escape( $this->data['agent_code'] );\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_WEALTH_INDEX_USERS.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\tOR agent_code = '{$agent_code}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}\n\t\tif ( ! $remove ) {\n\t\t\t$agent_code = $db->escape( $this->data['agent_code'] );\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_SITE_SUBSCRIPTION_PAYMENTS.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}\n\t\tif ( ! $remove ) {\n\t\t\t$agent_code = $db->escape( $this->data['agent_code'] );\n\t\t\t$query = \"SELECT COUNT(*)\n\t\t\t\tFROM \".TABLE_ORDERS.\"\n\t\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\";\n\t\t\t$check = $db->getValue( $query );\n\t\t\tif ( $check ) $remove = true;\n\t\t}\n\t\t\n\t\t// PDF Creator\n\t\t$this->removeAgentFromQueues();\n\t\t\n\t\t// delete image(s)\n\t\t$this->deleteImage();\n\t\t$this->deleteLogo();\n\t\t\n\t\t// delete CIM profiles\n\t\t$query = \"SELECT site_id\n\t\t\tFROM \".TABLE_AGENTS_TO_SITES.\"\n\t\t\tWHERE agent_id = '{$this->id}'\n\t\t\t\tAND customer_profile_id IS NOT NULL\n\t\t\";\n\t\t$site_ids = $db->getColumn( $query );\n\t\tif ( ! empty( $site_ids ) && is_array( $site_ids ) ) {\n\t\t\tforeach ( $site_ids as $sid ) {\n\t\t\t\t$this->deleteCustomerProfile( $sid );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $remove ) {\n\t\t\t// set database record to removed\n\t\t\t$query = \"UPDATE \" . TABLE_AGENTS . \" \n\t\t\t\tSET `agent_removed` = 1\n\t\t\t\tWHERE `agent_id` = '{$this->id}'\n\t\t\t\";\n\t\t} else {\n\t\t\t// delete from database\n\t\t\t$query = \"DELETE a, s, c, al, i, l, f, ci, cic, ciso, pp, fl, qp\n\t\t\t\tFROM \" . TABLE_AGENTS . \" AS a\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENTS_TO_SITES.\" AS s\n\t\t\t\t\t\tON a.agent_id = s.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENTS_TO_COMPANIES.\" AS c\n\t\t\t\t\t\tON a.agent_id = c.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_ADD_LOGINS.\" AS al\n\t\t\t\t\t\tON a.agent_id = al.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_ADD_LOGINS_TO_SITES.\" AS als\n\t\t\t\t\t\tON al.add_id = als.add_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_IMAGES.\" AS i\n\t\t\t\t\t\tON a.agent_id = i.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_LOGOS.\" AS l\n\t\t\t\t\t\tON a.agent_id = l.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_PRODUCT_FAVORITES.\" AS f\n\t\t\t\t\t\tON a.agent_id = f.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_CART_ITEMS.\" AS ci\n\t\t\t\t\t\tON a.agent_id = ci.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_CART_ITEM_CUSTOMIZATION.\" AS cic\n\t\t\t\t\t\tON ci.cart_item_id = cic.cart_item_id\n\t\t\t\t\tLEFT JOIN \".TABLE_CART_ITEM_SELECTED_OPTIONS.\" AS ciso\n\t\t\t\t\t\tON ci.cart_item_id = ciso.cart_item_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_PAYMENT_PROFILES.\" AS pp\n\t\t\t\t\t\tON a.agent_id = pp.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_AGENT_FINRA_LINKS.\" AS fl\n\t\t\t\t\t\tON a.agent_id = fl.agent_id\n\t\t\t\t\tLEFT JOIN \".TABLE_PDF_QUEUE_PROCESS.\" AS qp\n\t\t\t\t\t\tON a.agent_id = qp.agent_id\n\t\t\t\tWHERE a.`agent_id` = '{$this->id}'\n\t\t\t\";\n\t\t}\n\t\t$db->update( $query );\n\t}", "public function deleteLeague($league);", "public function delete( $args, $assoc_args ) {\n\n\t\t$site_id = $assoc_args['site-id'];\n\t\t$backup_id = $args[0];\n\n\t\t$this->set_account();\n\n\t\t$args = array(\n\t\t\t'endpoint' => '/site/' . $site_id . '/backup/' . $backup_id,\n\t\t\t'method' => 'DELETE',\n\t\t\t);\n\n\t\t$response = $this->api_request( $args );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\tWP_CLI::error( $response->get_error_message() );\n\n\t\tWP_CLI::success( 'Deleted backup ' . $backup_id );\n\t}", "public function delete(Request $request)\n {\n $vote=UserParticipatesParty::find($request->id);\n if($vote == null) { return redirect()->back();}\n $track=Track::find($vote->vote);\n $track->votes -= 1;\n $track->save();\n $vote->vote=null;\n $vote->save();\n return redirect()->back()->with('success','vote deleted!');\n }", "public function deleteDocument(AgentProfileInterface $profile);", "public function actionDelete( $subject_id,$subject_version,$term_id, $year)\n {\n $this->findModel( $subject_id,$subject_version,$term_id, $year)->delete();\n\n $this->layout = \"main_modules\";\n return $this->redirect(['index']);\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete($Enterprise) { ; }", "public function delete($vendor_id);", "function delete()\n {\n jimport('joomla.installer.installer');\n $installer =& JInstaller::getInstance();\n\n require_once(JPATH_COMPONENT.DS.'adapters'.DS.'sef_ext.php');\n $adapter = new JInstallerSef_Ext($installer);\n $installer->setAdapter('sef_ext', $adapter);\n\n $result = $installer->uninstall('sef_ext', $this->_id, 0);\n\n return $result;\n }", "protected function deleteVersion($image, $version)\n\t{\n\t\tif (isset($this->versions[$version]))\n\t\t{\n\t\t\t$path = $this->resolveImageVersionPath($image, $version).$this->resolveFileName($image);\n\n\t\t\tif (file_exists($path) !== false && unlink($path) === false)\n\t\t\t\tthrow new CException(__CLASS__.': Failed to delete the image version! File could not be deleted.');\n\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\tthrow new CException(__CLASS__.': Failed to delete image version! Version is unknown.');\n\t}", "public function delete() {\n if (isset($this->path[0]))\n models\\Locker::new(['id' => $this->path[0], 'accountId' => models\\Account::current()->id])->delete();\n\n $this->send('Successfully deleted Locker.');\n }", "public final function delete() {\n }", "public function deleted(Vehicle $vehicle)\n {\n //\n }", "public function destroy(OSVersion $osVersion)\n {\n $osVersion->delete();\n\n return back();\n }", "public function delete( $option );", "public function delete()\n {\n delete_option($this->optionName);\n }", "public function delete( $args ) {\n\t\t\\EE\\Utils\\delem_log( 'site delete start' );\n\t\t$this->populate_site_info( $args );\n\t\t$this->level = 5;\n\t\t$this->delete_site();\n\t\t\\EE\\Utils\\delem_log( 'site delete end' );\n\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function deleteAgentWithHttpInfo($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling deleteAgent');\n }\n // parse inputs\n $resourcePath = \"/agent/delete\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json'));\n\n // query params\n if ($id !== null) {\n $queryParams['id'] = $this->apiClient->getSerializer()->toQueryValue($id);\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\Swagger\\Client\\Model\\InlineResponse2003',\n '/agent/delete'\n );\n\n return array($this->apiClient->getSerializer()->deserialize($response, '\\Swagger\\Client\\Model\\InlineResponse2003', $httpHeader), $statusCode, $httpHeader);\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\InlineResponse2003', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n case 404:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Swagger\\Client\\Model\\ErrorModel', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }", "public function destroy(Drivervehicle $drivervehicle)\n {\n $drivervehicle->delete();\n \n return redirect()->route('drivervehicle.index')\n ->with('success','Vehicle removed successfully');\n }", "public function destroy(driver $driver)\n {\n //\n $driver = driver::find($driver->id); // can also skip this line //\n\n $driver->delete();\n\n return response()->json(array('success' => 1, 'msg' => 'deleted successfully'), 200);\n // return redirect('admin/vehicletype/')->with('success', 'deleted successfully');\n }", "public function delete( $args ) {\n\t\tforeach ( $args as $arg ) {\n\t\t\tif ( ! delete_option( $arg ) ) {\n\t\t\t\tWP_CLI::warning( \"Could not delete '{$arg}' option. Does it exist?\" );\n\t\t\t} else {\n\t\t\t\tWP_CLI::success( \"Deleted '{$arg}' option.\" );\n\t\t\t}\n\t\t}\n\t}", "public function destroy(Vehicle $vehicle)\n {\n return (int)$vehicle->delete();\n }", "public function delete()\n {\n $this->job->delete();\n }", "public function destroy(vote $vote)\n {\n //\n }", "public function delete($metricaevotranspiracion);", "public function destroy(Vote $vote)\n {\n //\n }", "public function destroy(Vote $vote)\n {\n //\n }", "public function delete() {\r\n\r\n if ( ! current_user_can( 'activate_plugins' ) ) {\r\n return;\r\n }\r\n\r\n $this->deleteOrdersTable();\r\n delete_option( 'ce_option' );\r\n delete_option( 'ce_coins_alerts' );\r\n delete_transient( 'ce_flush_rules' );\r\n flush_rewrite_rules();\r\n\r\n }", "public function delete()\n {\n return delete_option($this->hash);\n }", "public function delete($job);", "public function deleteQuotasByVersion($param)\n {\n $version = $param['version'];\n\n switch ($_SESSION['role']) {\n case 0:\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $result = QuotaTable::deleteByVersion($version);\n\n if ($result['rowCount']) {\n http_response_code(204);\n } else {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Không thể xóa hoặc phiên bản định mức đang có hiệu lực\"\n ));\n }\n }", "public function destroy(Download $download)\n {\n $download->delete();\n redirect('/download');\n }", "public function deleteAdvertiser(Request $request){\n return $this->repository->delete((int) $request->route()->parameter('id'));\n }", "public function destroy(driver $driver)\n {\n //\n }", "public static function delete() {\n\n\n\t\t}", "public function testComDayCqWcmCoreImplVersionPurgeTask()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.core.impl.VersionPurgeTask';\n\n $crawler = $client->request('POST', $path);\n }", "public function deleteattachmentAction()\r\n {\r\n try {\r\n if ( ($id = $this->getRequest()->getParam('id')) ) {\r\n $attachment = Mage::getModel('link/node_attachment')->load($id);\r\n\r\n $attachment->delete();\r\n }\r\n } catch (Exception $error) { }\r\n }", "public function delete($filepath);", "public function sitePageDeleteAction ()\n {\n\t\t$Page = Tg_Site::getInstance ()->getPageById($this->_getParam ('id'));\n\t\tif (!$Page)\n\t\t\tthrow new Exception (\"Page not found\");\n\t\t\t\n\t\tif ($Page->locked)\n\t\t\tthrow new Exception (\"Page is locked\");\n\t\t\n \t$Page->delete();\n \t\n\t\techo '{\"success\":true,\"msg\":\"Delete successful\"}';\n\t\tdie;\n }", "public function delete($location);", "public function delete()\r\n {\r\n // Remove Roles\r\n $objPartnerRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objPartnerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objAssistantRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objAssistantRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objManagerRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objManagerRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n // Remove all plugin capabilities from WordPress admin role\r\n $objWPAdminRole = get_role('administrator');\r\n $capabilitiesToRemove = $objManagerRole->getCapabilities();\r\n foreach($capabilitiesToRemove AS $capability => $grant)\r\n {\r\n $objWPAdminRole->remove_cap($capability);\r\n }\r\n\r\n // Create mandatory instances\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n $objSingleSiteInstall->deleteContent();\r\n\r\n flush_rewrite_rules();\r\n }", "public function delete($variable);", "public function removeUpdateVersion($action, $type){\n if($action == 'update' && $type == 'core'){\n delete_option('svc_upgrade_version');\n }\n }", "function removeSuperAgent($tenant_id, $institute_id, $agent_id)\n {\n $agent = SuperAgentInstitute::where('institute_id', $institute_id)->where('agents_id', $agent_id)->first();\n if ($agent) {\n $agent->delete();\n \\Flash::success('Super agent added successfully!');\n return redirect()->route('tenant.institute.show', [$tenant_id, $institute_id]);\n }\n }", "public function delete()\n {\n $this->deleteOnExit = true;\n }", "public function delete($path);", "public function delete($path);", "public function action_delete() {\n $elect_id = $this->request->query('elect_id');\n $res = Model::factory('Elect')->delete($elect_id);\n if(!$res) exit('error action_delete');\n $this->redirect('/'); \n }", "public function destroy(Voter $voter)\n {\n \n }", "public function destroy(Driver $driver)\n {\n $driver->delete();\n\n return redirect()->route('drivers.index')->with('success','Driver deleted successfully');\n }", "public function delete($model);", "public function deletepurgeAction($days)\n {\n $purge = $this->get('oc_platform.advert_purger');\n /* $old_adverts = $purge->purge($days, $advertswithapplication);*/\n $purge->purge($days);\n /* foreach($old_adverts as $old_advert)\n {\n $em = $this->getdoctrine()->getManager();\n $em->remove($old_advert);\n $em->flush();\n }*/\n return $this->redirect($this->generateUrl('oc_platform_home'));\n }", "public function deleted(Candidate $candidate)\n {\n //\n }", "public function destroy( $request )\n {\n $hotel = Hotel::findOrFail($request);\n $hotel->delete();\n \n \n Flash::success('Hotel Delete successfully!');\n return redirect('admin/hotels/manage');\n }", "public function destroy(Request $request)\n {\n $tense = Tense::find($request->tense);\n $tense->delete();\n \n return redirect(\"admin/verbs/$request->verb\");\n }", "public function delete($extension)\n {\n }", "public function destroy(DeleteRequest $request)\n {\n $agency = Agency::findOrFail($request->input('id'));\n\n if ($agency->delete()) {\n return response()->json([\n \"success\" => 1,\n \"message\" => \"deleted successfully\",\n \"agency\" => $agency\n ]);\n } else {\n return response()->json([\n \"success\" => 0,\n \"message\" => \"something went wrong\"\n ]);\n }\n }", "public function destroy($id)\n {\n $agent = $this->agentRepository->find($id);\n\n if (empty($agent)) {\n Flash::error('Agent not found');\n\n return redirect(route('agents.index'));\n }\n\n $this->agentRepository->delete($id);\n $agent->biodata()->delete();\n $agent->user()->delete();\n Flash::success('Agent deleted successfully.');\n\n return redirect(route('agents.index'));\n }", "public function deleteArchive() {\n\t\tif ($this->tar instanceof Tar) {\n\t\t\t$this->tar->close();\n\t\t}\n\t\t\n\t\t@unlink($this->archive);\n\t}", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "public function deleteIntent(Intent $model, $workspace_id, $version = self::VERSION)\n {\n $config = $this->initConfig();\n $config->addHeaders($model->getData('@header'));\n\n $config->setQuery( [ 'version' => $version ] );\n $config->setMethod(HttpClientConfiguration::METHOD_DELETE);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n\n $url = self::BASE_URL.\"/workspaces/{$workspace_id}/intents/{$model->getIntent()}/\";\n $config->setURL($url);\n $response = $this->sendRequest($config);\n\n return $response;\n }", "public function delete($sessionID, $audience);", "public function deleteVersioningConfig(RestServiceEntity $entity)\n {\n $serviceName = $entity->controllerServiceName;\n if (false === strstr($serviceName, '\\\\V1\\\\')) {\n // service > v1; do not delete route\n return;\n }\n\n $config = $this->configResource->fetch(true);\n if (! isset($config['api-tools-versioning']['uri'])) {\n return;\n }\n\n $route = $entity->routeName;\n if (! in_array($route, $config['api-tools-versioning']['uri'], true)) {\n return;\n }\n\n $versioning = array_filter($config['api-tools-versioning']['uri'], function ($value) use ($route) {\n if ($route === $value) {\n return false;\n }\n return true;\n });\n\n $key = ['api-tools-versioning', 'uri'];\n $this->configResource->patchKey($key, $versioning);\n }", "public function delete()\n\t{\n\t\t$this->plugin->setResponse('in delete');\n\t}", "public function delete($otros_votos);", "public function delete($entity);", "static function delete($id) {\n $extension = new self($id);\n\n foreach ($extension->versions as $version)\n Version::delete($version->id);\n\n parent::destroy(get_class(), $id);\n\n\t\t\tif (module_enabled(\"cacher\"))\n\t\t\t Modules::$instances[\"cacher\"]->regenerate();\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function destroy(Request $request)\n {\n Vendas::where('id', $request->id)->delete();\n\n return redirect()->route('vendasget');\n }" ]
[ "0.6164806", "0.6152087", "0.60773957", "0.6000222", "0.5940691", "0.5830846", "0.57951206", "0.5758511", "0.55752754", "0.55115676", "0.54422754", "0.52564156", "0.52361554", "0.5226956", "0.5223968", "0.518456", "0.5177373", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5164622", "0.5159836", "0.5148114", "0.5144053", "0.5120606", "0.51090795", "0.50984967", "0.5091925", "0.50729126", "0.5063298", "0.5063144", "0.50552887", "0.50511485", "0.50511485", "0.5051144", "0.504815", "0.5046927", "0.5027428", "0.4987722", "0.49804708", "0.4980186", "0.49791005", "0.49536085", "0.494866", "0.49451602", "0.49451602", "0.49404728", "0.49387294", "0.49344915", "0.4926468", "0.49242708", "0.49240762", "0.49028942", "0.49027392", "0.49026474", "0.48872656", "0.4870834", "0.48697242", "0.48684913", "0.48663533", "0.48662037", "0.48610386", "0.48559758", "0.4853831", "0.48509622", "0.48509622", "0.4850519", "0.48485124", "0.48455024", "0.48445275", "0.48444927", "0.4844461", "0.48426777", "0.4839511", "0.4833442", "0.48297998", "0.4824798", "0.48193955", "0.48188984", "0.48167688", "0.4812645", "0.48121047", "0.48115748", "0.4803182", "0.4798145", "0.47941452", "0.47834307", "0.47834307", "0.47831818" ]
0.59284556
5
Calculate colors for smooth fading (green > red)
function calculate_hsl ( $percent_ath ) { $hue = (1 - $percent_ath) * 120; $saturation = 70; $lightness = 50; $color = 'hsl(' . $hue . ', ' . $saturation . '%, ' . $lightness . '% )'; return $color; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function percent2Color($value, $brightness = 255, $max = 100, $min = 0, $thirdColorHex = '00') {\n\t$first = (1-($value/$max))*$brightness;\n\t$second = ($value/$max)*$brightness;\n\n\t// Find the influence of the middle color (yellow if 1st and 2nd are red and green)\n\t$diff = abs($first-$second);\n\t$influence = ($brightness-$diff)/2; \n\t$first = intval($first + $influence);\n\t$second = intval($second + $influence);\n\n\t// Convert to HEX, format and return\n\t$firstHex = str_pad(dechex($first),2,0,STR_PAD_LEFT);\n\t$secondHex = str_pad(dechex($second),2,0,STR_PAD_LEFT);\n\t$thirdColorHex = str_pad(dechex($thirdColorHex),2,0,STR_PAD_LEFT);\n\t\n\tif (($value % 3) == 0) { // three\n\t\treturn '#' . $firstHex . $secondHex . $thirdColorHex;\n\t} else if (($value % 3) == 1) { // two\n\t\treturn '#' . $thirdColorHex . $firstHex . $secondHex;\n\t} else if (($value % 3) == 2) { // one\n\t\treturn '#' . $secondHex . $thirdColorHex . $firstHex;\n\t}\n\n// alternatives:\n// return $thirdColorHex . $firstHex . $secondHex;\n// return $firstHex . $thirdColorHex . $secondHex;\n}", "function GetAllColors () {\n $colors = array (\"#00FFFF\",\"#000000\",\"#0000FF\",\"#8A2BE2\",\"#A52A2A\",\"#DEB887\",\"#5F9EA0\",\"#7FFF00\",\"#D2691E\",\"#FF7F50\",\"#6495ED\",\"#00FFFF\",\"#00008B\",\"#008B8B\",\"#B8860B\",\"#A9A9A9\",\"#006400\",\"#BDB76B\",\"#8B008B\",\"#556B2F\",\"#FF8C00\",\"#9932CC\",\"#8B0000\",\"#E9967A\",\"#8FBC8F\",\"#483D8B\",\"#2F4F4F\",\"#2F4F4F\",\"#00CED1\",\"#9400D3\",\"#FF1493\",\"#00BFFF\",\"#696969\",\"#696969\",\"#1E90FF\",\"#B22222\",\"#228B22\",\"#FF00FF\",\"#FFD700\",\"#DAA520\",\"#808080\",\"#808080\",\"#008000\",\"#ADFF2F\",\"#FF69B4\",\"#CD5C5C\",\"#4B0082\",\"#7CFC00\",\"#ADD8E6\",\"#F08080\",\"#E0FFFF\",\"#D3D3D3\",\"#90EE90\",\"#FFB6C1\",\"#FFA07A\",\"#20B2AA\",\"#87CEFA\",\"#778899\",\"#778899\",\"#B0C4DE\",\"#00FF00\",\"#32CD32\",\"#FF00FF\",\"#800000\",\"#66CDAA\",\"#0000CD\",\"#BA55D3\",\"#9370D8\",\"#3CB371\",\"#7B68EE\",\"#00FA9A\",\"#48D1CC\",\"#C71585\",\"#191970\",\"#FFE4E1\",\"#FFE4B5\",\"#000080\",\"#808000\",\"#6B8E23\",\"#FFA500\",\"#FF4500\",\"#DA70D6\",\"#EEE8AA\",\"#98FB98\",\"#AFEEEE\",\"#D87093\",\"#FFDAB9\",\"#CD853F\",\"#FFC0CB\",\"#DDA0DD\",\"#B0E0E6\",\"#800080\",\"#FF0000\",\"#BC8F8F\",\"#4169E1\",\"#8B4513\",\"#FA8072\",\"#F4A460\",\"#2E8B57\",\"#A0522D\",\"#C0C0C0\",\"#87CEEB\",\"#6A5ACD\",\"#708090\",\"#708090\",\"#00FF7F\",\"#4682B4\",\"#D2B48C\",\"#008080\",\"#D8BFD8\",\"#FF6347\",\"#40E0D0\",\"#EE82EE\",\"#F5DEB3\",\"#FFFFFF\",\"#F5F5F5\",\"#FFFF00\",\"#9ACD32\");\n return($colors);\n}", "function the_monday_colour_brightness($hex, $percent) {\n $hash = '';\n if (stristr($hex, '#')) {\n $hex = str_replace('#', '', $hex);\n $hash = '#';\n }\n /// HEX TO RGB\n $rgb = array(hexdec(substr($hex, 0, 2)), hexdec(substr($hex, 2, 2)), hexdec(substr($hex, 4, 2)));\n //// CALCULATE \n for ($i = 0; $i < 3; $i++) {\n // See if brighter or darker\n if ($percent > 0) {\n // Lighter\n $rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1 - $percent));\n } else {\n // Darker\n $positivePercent = $percent - ($percent * 2);\n $rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1 - $positivePercent));\n }\n // In case rounding up causes us to go to 256\n if ($rgb[$i] > 255) {\n $rgb[$i] = 255;\n }\n }\n //// RBG to Hex\n $hex = '';\n for ($i = 0; $i < 3; $i++) {\n // Convert the decimal digit to hex\n $hexDigit = dechex($rgb[$i]);\n // Add a leading zero if necessary\n if (strlen($hexDigit) == 1) {\n $hexDigit = \"0\" . $hexDigit;\n }\n // Append to the hex string\n $hex .= $hexDigit;\n }\n return $hash . $hex;\n}", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "function clrfl_get_stripe_opacity() {\n\t/* The darkness of the stripes is based on\n\t * lightness of the background color.\n\t */\n\t$bg_color = get_background_color();\n\n\t//find lightest hue\n\t$stripe_lightness = 0;\n\t$max_color_component = 0;\n\t//bias towards green, which is a higher energy color\n\t$biases = array(0.8, 1.0, 0.8);\n\tforeach (str_split($bg_color, 2) as $hex) {\n\t\t$bias = array_pop($biases);\n\t\t$hex = hexdec($hex);\n\t\t$lightness = $hex * $bias;\n\t\tif ($max_color_component < $lightness) {\n\t\t\t$max_color_component = $lightness;\n\t\t}\n\t}\n\t$stripe_lightness = $max_color_component;\n\n\t//how close to white are we?\n\t//aka, how black are we?\n\t//full black would be 1.0\n\t//a full hue is 0.0\n\t$factor = (255.0 - $stripe_lightness) / 255.0;\n\n\t//notice how things are looking like a polynomial\n\t$pure_bias = 0.65;\n\n\t//the magic formula, our wizardry is done\n\treturn ($factor) * $pure_bias;\n\n\t/*\n\t * If you ever need a reason why\n\t * high school math is useful...\n\t */\n}", "function mc_shift_color( $color ) {\n\t$color = str_replace( '#', '', $color );\n\t$rgb = '';\n\t$percent = ( mc_inverse_color( $color ) == '#ffffff' ) ? - 20 : 20;\n\t$per = $percent / 100 * 255;\n\t// Percentage to work with. Change middle figure to control color temperature.\n\tif ( $per < 0 ) {\n\t\t// DARKER.\n\t\t$per = abs( $per ); // Turns Neg Number to Pos Number.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) - $per;\n\t\t\t$c = ( $c < 0 ) ? 0 : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t} else {\n\t\t// LIGHTER.\n\t\tfor ( $x = 0; $x < 3; $x ++ ) {\n\t\t\t$c = hexdec( substr( $color, ( 2 * $x ), 2 ) ) + $per;\n\t\t\t$c = ( $c > 255 ) ? 'ff' : dechex( $c );\n\t\t\t$rgb .= ( strlen( $c ) < 2 ) ? '0' . $c : $c;\n\t\t}\n\t}\n\n\treturn '#' . $rgb;\n}", "protected function make_hsl()\n {\n $rgb = $this->_rgb_dec;\n\n $red = max(min(($rgb['red'] / self::RGB_MAX), 1), 0);\n $green = max(min(($rgb['green'] / self::RGB_MAX), 1), 0);\n $blue = max(min(($rgb['blue'] / self::RGB_MAX), 1), 0);\n\n $min = min($red, min($green, $blue));\n $max = max($red, max($green, $blue));\n $delta = $max - $min;\n\n $luminance = ($min + $max) / 2;\n $saturation = 0;\n if ($luminance > 0 && $luminance < 1) {\n $saturation = $delta / ($luminance < 0.5 ? (2 * $luminance) : (2 - 2 * $luminance));\n }\n $hue = 0;\n\n if ($delta > 0) {\n if ($max == $red && $max != $green) {\n $hue += ($green - $blue) / $delta;\n }\n if ($max == $green && $max != $blue) {\n $hue += (2 + ($blue - $red) / $delta);\n }\n if ($max == $blue && $max != $red) {\n $hue += (4 + ($red- $green) / $delta);\n }\n $hue /= 6;\n }\n $this->_hsl = array('hue' => $hue, 'saturation' => $saturation, 'luminance' => $luminance);\n }", "function fastshop_adjust_color_brightness( $hex, $steps ) {\n // Steps should be between -255 and 255. Negative = darker, positive = lighter\n $steps = max( -255, min( 255, $steps ) );\n\n // Format the hex color string\n $hex = str_replace( '#', '', $hex );\n\n if ( 3 == strlen( $hex ) ) {\n $hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );\n }\n\n // Get decimal values\n $r = hexdec( substr( $hex, 0, 2 ) );\n $g = hexdec( substr( $hex, 2, 2 ) );\n $b = hexdec( substr( $hex, 4, 2 ) );\n\n // Adjust number of steps and keep it inside 0 to 255\n $r = max( 0, min( 255, $r + $steps ) );\n $g = max( 0, min( 255, $g + $steps ) );\n $b = max( 0, min( 255, $b + $steps ) );\n\n $r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );\n $g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );\n $b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );\n\n return '#' . $r_hex . $g_hex . $b_hex;\n}", "function generar_color($rgb){\n $vermell= substr($rgb,1,2); \n $verd = substr($rgb,3,2); \n $blau = substr($rgb,5,2); \n \n //Converteixo de hexadecimal a decimal \n $enter_vermell= hexdec($vermell); \n $enter_verd= hexdec($verd); \n $enter_blau= hexdec($blau); \n \n //Valor que li sumarem o restarem a cada component rgb: \n $valor = hexdec(22); \n \n //Calculo l'umbral del color. \n $umbral = 255/2; //7F en hexadecimal. \n \n //Calculo la foscor del color entrat: \n $foscor= ($enter_vermell + $enter_verd + $enter_blau) /3; \n \n //El color és clar. Per tant tenim que enfosquirlo restant-li el $valor en cada component rgb. \n if($foscor >= $umbral){ \n $enter_vermell = ($enter_vermell-$valor<00) ? 00 : $enter_vermell-$valor; \n $enter_verd = ($enter_verd-$valor<00) ? 00 : $enter_verd-$valor; \n $enter_blau = ($enter_blau-$valor<00) ? 00 : $enter_blau-$valor; \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n //if($enter_vermell-$valor<00){ $nou_enter_vermell = 00; } else { $enter_vermell=$enter_vermell-$valor; } \n } \n \n //El color és fosc. Per tant tenim que aclararlo sumant-li el $valor en cada component rgb. \n else{ \n $enter_vermell = ($enter_vermell+$valor>255) ? 255 : $enter_vermell+$valor; \n $enter_verd = ($enter_verd+$valor>255) ? 255 : $enter_verd+$valor; \n $enter_blau = ($enter_blau+$valor>255) ? 255 : $enter_blau+$valor; \n } \n $vermell=dechex($enter_vermell); \n $verd=dechex($enter_verd); \n $blau=dechex($enter_blau); \n \n $rgb=\"#\".$vermell.$verd.$blau; \n return $rgb; \n}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "function color_detect(){\n\t\t\n\t\t$hex = str_replace('#', '', $this->base_color); \n\n\t\t$r = hexdec(substr($hex,0,2));\n\t\t$g = hexdec(substr($hex,2,2));\n\t\t$b = hexdec(substr($hex,4,2));\n\t\t\n\t\tif($r + $g + $b > 750){\n\t\t\t\n\t\t\t// Light\n\t\t return 1;\n\t\t\n\t\t}elseif($r + $g + $b < 120){\n\n\t\t\t// Really Dark\n\t\t\treturn -2;\n\n\t\t}\n\t\telseif($r + $g + $b < 300){\n\t\t\n\t\t\t// Dark\n\t\t\treturn -1;\n\t\t\n\t\t}else{\n\t\t\t\n\t\t\t// Meh\n\t\t return false;\n\t\t\n\t\t}\n\t}", "function setColor($percent, $invert = false)\n{\n //Amount under 100% determines red tint\n $R = min((2.0 * (1.0-$percent)), 1.0) * 255.0;\n //Green by default, 100%\n $G = min((2.0 * $percent), 1.0) * 255.0;\n //No blue here\n $B = 0.0;\n //Return the hexadecimal conversion of the RGB\n return (($invert) ? \nsprintf(\"%02X%02X%02X\",$R,$G,$B) \n: sprintf(\"%02X%02X%02X\",$R,$G,$B)); \n}", "function cjpopups_color_brightness($hex, $steps) {\n $steps = max(-255, min(255, $steps));\n\n // Normalize into a six character long hex string\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) == 3) {\n $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n }\n\n // Split into three parts: R, G and B\n $color_parts = str_split($hex, 2);\n $return = '#';\n\n foreach ($color_parts as $color) {\n $color = hexdec($color); // Convert to decimal\n $color = max(0,min(255,$color + $steps)); // Adjust color\n $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n }\n\n return $return;\n}", "function get_RGB($i,$iMax,$palette){\n $r = 0 ;\n $g = 0 ;\n $b = 0 ;\n $i = $i/$iMax ;\n switch($palette){\n case 2: // Red \n $r = $i*255*1 ; $g = $i*255*0 ; $b = $i*255*0 ;\n break ;\n case 3: // Green \n $r = $i*255*0 ; $g = $i*255*1 ; $b = $i*255*0 ;\n break ;\n case 4: // Blue \n $r = $i*255*0 ; $g = $i*255*0 ; $b = $i*255*1 ;\n break ;\n case 5: // Cyan\n $r = $i*255*0 ; $g = $i*255*1 ; $b = $i*255*1 ;\n break ;\n case 6: // Magenta \n $r = $i*255*1 ; $g = $i*255*0 ; $b = $i*255*1 ;\n break ;\n case 7: // Yellow\n $r = $i*255*1 ; $g = $i*255*1 ; $b = $i*255*0 ;\n break ;\n case 12: // Hot red\n if ($i<1/2) { $r = $i*255*2 ; $g = $i*255*0 ; $b = $i*255*0 ; }\n else if($i<2/2) { $r = 255*1 ; $g = ($i-1/2)*255*2 ; $b = ($i-1/2)*255*2 ; }\n break ;\n case 13: // Hot green\n if ($i<1/2) { $r = $i*255*0 ; $g = $i*255*2 ; $b = $i*255*0 ; }\n else if($i<2/2) { $r = ($i-1/2)*255*2 ; $g = 255*1 ; $b = ($i-1/2)*255*2 ; }\n break ;\n case 14: // Hot blue\n if ($i<1/2) { $r = $i*255*0 ; $g = $i*255*0 ; $b = $i*255*2 ; }\n else if($i<2/2) { $r = ($i-1/2)*255*2 ; $g = ($i-1/2)*255*2 ; $b = 255*1 ; }\n break ;\n case 15: // Hot cyan\n if ($i<1/2) { $r = $i*255*0 ; $g = $i*255*2 ; $b = $i*255*2 ; }\n else if($i<2/2) { $r = ($i-1/2)*255*2 ; $g = 255*1 ; $b = 255*1 ; }\n break ;\n case 16: // Hot magenta\n if ($i<1/2) { $r = $i*255*2 ; $g = $i*255*0 ; $b = $i*255*2 ; }\n else if($i<2/2) { $r = 255*1 ; $g = ($i-1/2)*255*2 ; $b = 255*1 ; }\n break ;\n case 17: // Hot yellow\n if ($i<1/2) { $r = $i*255*2 ; $g = $i*255*2 ; $b = $i*255*0 ; }\n else if($i<2/2) { $r = 255*1 ; $g = 255*1 ; $b = ($i-1/2)*255*2 ; }\n break ;\n case 22: // Very hot red\n $r = 255*1 ; $g = $i*255*1 ; $b = $i*255*1 ;\n break ;\n case 23: // Very hot green\n $r = $i*255*1 ; $g = 255*1 ; $b = $i*255*1 ;\n break ;\n case 24: // Very hot blue\n $r = $i*255*1 ; $g = $i*255*1 ; $b = 255*1 ;\n break ;\n case 25: // Very hot cyan\n $r = $i*255*1 ; $g = 255*1 ; $b = 255*1 ;\n break ;\n case 26: // Very hot magenta\n $r = 255*1 ; $g = $i*255*1 ; $b = 255*1 ;\n break ;\n case 27: // Very hot yellow\n $r = 255*1 ; $g = 255*1 ; $b = $i*255*1 ;\n break ;\n case 8: // Grey\n $r = $i*255*1 ; $g = $i*255*1 ; $b = $i*255*1 ;\n break ;\n case 9: $r = $i*255*0 ; $g = 255*abs(sin($i*pi()*8)) ; $b = 255*abs(sin($i*pi()*8)) ; break ; // Wave\n case 10: $r = 255*abs(sin($i*pi()*3)) ; $g = $i*255*0 ; $b = $i*255*0 ; break ; // Pulse\n case 11: // Flame\n if ($i>=0/3 AND $i<1/3) { $r=(3*$i-0)*255 ; $g=(3*$i-0)*255 ; $b=(3*$i-0)*255 ; } // Black to white 0/0-1/3\n else if($i>=1/3 AND $i<2/3) { $r=255 ; $g=255 ; $b=(1-(3*$i-1))*255 ; } // White to Yellow 1/3-2/3\n else if($i>=2/3 AND $i<3/3) { $r=255 ; $g=(1-(3*$i-2))*255 ; $b=0 ; } // Yellow to red 2/3-3/3\n else { $r=0 ; $g=0 ; $b=0 ; } // Black\n break ;\n case 12: // Log\n $i = log(1+$i) ;\n $r = $i*255*0 ; $g = $i*255*1 ; $b = $i*255*0 ;\n break ;\n case 20: // Aqua\n $r = $i*255*0 ; $g = 255*1 ; $b = (1-$i)*255*1 ;\n break ;\n case 21: // Cheese and onion\n $r = $i*255*1 ; $g = 255*1 ; $b = 255*0 ;\n break ;\n case 102: // Red to blue\n if ($i>=0/2 AND $i<1/2) { $r=255 ; $g=(2*$i-0)*255 ; $b=(2*$i-0)*255 ; } // Red to white 0/0-1/2\n else { $r=(1-(2*$i-1))*255 ; $g=(1-(2*$i-1))*255 ; $b=255 ; } // White to Blue 1/2-2/2\n break ;\n case 103: // Fireworks\n $r=0 ; $g=0 ; $b=0 ;\n if($i>0.12 AND $i<0.13 ) { $r=205+10*abs($i-0.125) ; $g=0 ; $b=0 ; }\n if($i>0.245 AND $i<0.255) { $r=0 ; $g=205+10*abs($i-0.25) ; $b=0 ; }\n if($i>0.37 AND $i<0.38 ) { $r=0 ; $g=0 ; $b=205+10*abs($i-0.375) ; }\n if($i>0.495 AND $i<0.505) { $r=205+10*abs($i-0.5) ; $g=205+10*abs($i-0.5) ; $b=0 ; }\n if($i>0.62 AND $i<0.63 ) { $r=205+10*abs($i-0.625) ; $g=0 ; $b=205+10*abs($i-0.625) ; }\n if($i>0.745 AND $i<0.755) { $r=0 ; $g=205+10*abs($i-0.75) ; $b=205+10*abs($i-0.75) ; }\n if($i>0.87 AND $i<0.88 ) { $r=205+10*abs($i-0.875) ; $g=205+10*abs($i-0.875) ; $b=205+10*abs($i-0.875) ; }\n break ;\n case 104: // Roulette\n if ($i>=0/10 AND $i<1/10) { $r=0 ; $g=0 ; $b=0 ; }\n\telse if($i>=1/10 AND $i<2/10) { $r=255 ; $g=0 ; $b=0 ; }\n\telse if($i>=2/10 AND $i<3/10) { $r=0 ; $g=0 ; $b=0 ; }\n\telse if($i>=3/10 AND $i<4/10) { $r=255 ; $g=0 ; $b=0 ; }\n\telse if($i>=4/10 AND $i<5/10) { $r=0 ; $g=0 ; $b=0 ; }\n\telse if($i>=5/10 AND $i<6/10) { $r=255 ; $g=0 ; $b=0 ; }\n\telse if($i>=6/10 AND $i<7/10) { $r=0 ; $g=0 ; $b=0 ; }\n\telse if($i>=7/10 AND $i<8/10) { $r=255 ; $g=0 ; $b=0 ; }\n\telse if($i>=8/10 AND $i<9/10) { $r=0 ; $g=0 ; $b=0 ; }\n\telse if($i>=9/10 AND $i<10/10) { $r=255 ; $g=0 ; $b=0 ; }\n\telse { $r=0 ; $g=0 ; $b=0 ; }\n\tbreak ;\n case 105: // Contours\n $r=255 ; $g=255 ; $b=255 ;\n if($i>0.095 AND $i<0.105) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.195 AND $i<0.205) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.295 AND $i<0.305) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.395 AND $i<0.405) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.495 AND $i<0.505) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.595 AND $i<0.605) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.695 AND $i<0.705) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.795 AND $i<0.805) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.895 AND $i<0.905) { $r=0 ; $g=0 ; $b=0 ;}\n if($i>0.995 AND $i<1.005) { $r=0 ; $g=0 ; $b=0 ;}\n break ;\n default:\n if($palette>=1000){\n $r=0 ; $g=0 ; $b=0 ;\n if($iIn==$palette-1000) $r=255 ;\n break ;\n }\n if($palette==100){ // Low\n $i = pow($i,1/5) ;\n }\n if($palette==101){ // High\n $i = pow($i,5) ;\n }\n if ($i>=0/7 AND $i<1/7) { $r= (7*$i-0)*255 ; $g=0 ; $b=(7*$i-0)*255 ; } // Black to magenta 0/0-1/7\n else if($i>=1/7 AND $i<2/7) { $r=(1-(7*$i-1))*255 ; $g=0 ; $b=255 ; } // Magenta to blue 1/7-2/7\n else if($i>=2/7 AND $i<3/7) { $r=0 ; $g=(7*$i-2)*255 ; $b=255 ; } // Blue to cyan 2/7-3/7\n else if($i>=3/7 AND $i<4/7) { $r=0 ; $g=255 ; $b=(1-(7*$i-3))*255 ; } // Cyan to green 3/7-4/7\n else if($i>=4/7 AND $i<5/7) { $r=(7*$i-4)*255 ; $g=255 ; $b=0 ; } // Green to yellow 4/7-5/7\n else if($i>=5/7 AND $i<6/7) { $r=255 ; $g=(1-(7*$i-5))*255 ; $b=0 ; } // Yellow to red 5/7-6/7\n else if($i>=6/7 AND $i<7/7) { $r=255 ; $g=(7*$i-6)*255 ; $b=(7*$i-6)*255 ; } // Red to white 6/7-7/7\n else{\n if($palette==1){ $r=255 ; $g=255 ; $b=255 ; } // Pure as driven snow\n else { $r=0 ; $g=0 ; $b=0 ; } // Black, like my soul\n }\n }\n $rgb[0] = floor($r) ;\n $rgb[1] = floor($g) ;\n $rgb[2] = floor($b) ;\n return $rgb ;\n}", "function andersen_color_sync($key = '', $lum = 2){\n\t\t$r = hexdec(substr($key,0,2));\n\t\t$g = hexdec(substr($key,2,2));\n\t\t$b = hexdec(substr($key,4,2));\n\n\t\t$yiq = (($r*299)+($g*587)+($b*114))/1000;\n\n\t\tif ($yiq >= 128){\n\t\t $out = andersen_darken($key, $lum);\n\t\t}else{\n\t\t //dark color, use bright font\n\t\t $out = andersen_lighten($key, $lum);\n\t\t}\n\n\t\treturn $out;\n\t}", "function getColor($color_count){\n //again\n $color_array = array(\"#4B0082\", \"#3F6826\", \"#38B0DE\", \"#330000\", \"#55141C\", \"#5EDA9E\", \"#660000\", \"#6959CD\", \"#7B3F00\", \"#800000\");\n $new_count = $color_count % 10 ;\n return $color_array[$new_count];\n}", "public function colour();", "function carton_hex_lighter( $color, $factor = 30 ) {\n\t\t$base = carton_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t foreach ($base as $k => $v) :\n\t $amount = 255 - $v;\n\t $amount = $amount / 100;\n\t $amount = round($amount * $factor);\n\t $new_decimal = $v + $amount;\n\n\t $new_hex_component = dechex($new_decimal);\n\t if(strlen($new_hex_component) < 2) :\n\t \t$new_hex_component = \"0\".$new_hex_component;\n\t endif;\n\t $color .= $new_hex_component;\n\t \tendforeach;\n\n\t \treturn $color;\n\t}", "function rgb_hsl($r,$g,$b) {\n\t$var_R=($r/255);\n\t$var_G=($g/255);\n\t$var_B=($b/255);\n\t$var_Min=min($var_R,$var_G,$var_B);\n\t$var_Max=max($var_R,$var_G,$var_B);\n\t$del_Max=$var_Max-$var_Min;\n\n\t$l=($var_Max+$var_Min)/2;\n\n\tif ($del_Max==0) {\n\t\t$h=0;\n\t\t$s=0;\n\t}\n\telse {\n\t\tif ($l<0.5)\n\t\t\t$s=$del_Max/($var_Max+$var_Min);\n\t\telse\n\t\t\t$s=$del_Max/(2-$var_Max-$var_Min);\n\n\t\t$del_R=((($var_Max-$var_R)/6)+($del_Max/2))/$del_Max;\n\t\t$del_G=((($var_Max-$var_G)/6)+($del_Max/2))/$del_Max;\n\t\t$del_B=((($var_Max-$var_B)/6)+($del_Max/2))/$del_Max;\n\n\t\tif ($var_R==$var_Max)\n\t\t\t$h=$del_B-$del_G;\n\t\telseif ($var_G==$var_Max)\n\t\t\t$h=(1/3)+$del_R-$del_B;\n\t\telseif ($var_B==$var_Max)\n\t\t\t$h=(2/3)+$del_G-$del_R;\n\t\tif ($h<0)\t\t$h+=1;\n\t\tif ($h>1)\t\t$h-=1;\n\t}\n\treturn array($h,$s,$l); // $h,$s,$l entre 0 et 1\n}", "function color_picker($p,$maxPixel,$numberSpirals,$start_color,$end_color){\n\t\t$start_dec = hexdec($start_color);\n\t\t$end_dec = hexdec($end_color);\n\t\t$rgb = $start_dec;\n\t\t$r = ($rgb >> 16) & 0xFF;\n\t\t$g = ($rgb >> 8) & 0xFF;\n\t\t$b = $rgb & 0xFF;\n\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t$start_H=$HSL['H']; \n\t\t$start_S=$HSL['S']; \n\t\t$start_V=$HSL['V']; \n\t\t$rgb = $end_dec;\n\t\t$r = ($rgb >> 16) & 0xFF;\n\t\t$g = ($rgb >> 8) & 0xFF;\n\t\t$b = $rgb & 0xFF;\n\t\t$HSL=RGB_TO_HSV ($r, $g, $b);\n\t\t$end_H=$HSL['H']; \n\t\t$end_S=$HSL['S']; \n\t\t$end_V=$HSL['V']; \n\t\t$range=$start_H-$end_H;\n\t\tif($start_H<$end_H)\t\t$range=$end_H-$start_H;\n\t\t//if($range<0) $range+=1.0;\n\t\t$percentage = $p/$maxPixel; // 0 to 1.0\n\t\tif($start_H>$end_H)\t\t$H = $start_H - $percentage*$range;\n\t\telse\t$H = $start_H + $percentage*$range;\n\t\tif($H<0) $H+=1.0;\n\t\t$range=$start_S-$end_S;\n\t\tif($start_S<$end_S)\t\t$range=$end_S-$start_S;\n\t\t//if($range<0) $range+=1.0;\n\t\tif($start_S>$end_S)\t\t$S = $start_S - $percentage*$range;\n\t\telse\t$S = $start_S + $percentage*$range;\n\t\tif($S<0) $S+=1.0;\n\t\t$range=$start_V-$end_V;\n\t\tif($start_V<$end_V)\t\t$range=$end_V-$start_V;\n\t\t//if($range<0) $range+=1.0;\n\t\tif($start_V>$end_V)\t\t$V = $start_V - $percentage*$range;\n\t\telse\t$V = $start_V + $percentage*$range;\n\t\tif($V<0) $V+=1.0;\n\t\t$color_HSV=array('H'=>$H,'S'=>$S,'V'=>$V);\n\t\treturn $color_HSV;\n\t}", "function getColor(): string\n{\n $arrColors = [\n 'AliceBlue',\n 'AntiqueWhite',\n 'Aqua',\n 'Aquamarine',\n 'Azure',\n 'Beige',\n 'Bisque',\n 'Black',\n 'BlanchedAlmond',\n 'Blue',\n 'BlueViolet',\n 'Brown',\n 'BurlyWood',\n 'CadetBlue',\n 'Chartreuse',\n 'Chocolate',\n 'Coral',\n 'CornflowerBlue',\n 'Cornsilk',\n 'Crimson',\n 'Cyan',\n 'DarkBlue',\n 'DarkCyan',\n 'DarkGoldenRod',\n 'DarkGray',\n 'DarkGrey',\n 'DarkGreen',\n 'DarkKhaki',\n 'DarkMagenta',\n 'DarkOliveGreen',\n 'Darkorange',\n 'DarkOrchid',\n 'DarkRed',\n 'DarkSalmon',\n 'DarkSeaGreen',\n 'DarkSlateBlue',\n 'DarkSlateGray',\n 'DarkSlateGrey',\n 'DarkTurquoise',\n 'DarkViolet',\n 'DeepPink',\n 'DeepSkyBlue',\n 'DimGray',\n 'DimGrey',\n 'DodgerBlue',\n 'FireBrick',\n 'FloralWhite',\n 'ForestGreen',\n 'Fuchsia',\n 'Gainsboro',\n 'GhostWhite',\n 'Gold',\n 'GoldenRod',\n 'Gray',\n 'Grey',\n 'Green',\n 'GreenYellow',\n 'HoneyDew',\n 'HotPink',\n 'IndianRed',\n 'Indigo',\n 'Ivory',\n 'Khaki',\n 'Lavender',\n 'LavenderBlush',\n 'LawnGreen',\n 'LemonChiffon',\n 'LightBlue',\n 'LightCoral',\n 'LightCyan',\n 'LightGoldenRodYellow',\n 'LightGray',\n 'LightGrey',\n 'LightGreen',\n 'LightPink',\n 'LightSalmon',\n 'LightSeaGreen',\n 'LightSkyBlue',\n 'LightSlateGray',\n 'LightSlateGrey',\n 'LightSteelBlue',\n 'LightYellow',\n 'Lime',\n 'LimeGreen',\n 'Linen',\n 'Magenta',\n 'Maroon',\n 'MediumAquaMarine',\n 'MediumBlue',\n 'MediumOrchid',\n 'MediumPurple',\n 'MediumSeaGreen',\n 'MediumSlateBlue',\n 'MediumSpringGreen',\n 'MediumTurquoise',\n 'MediumVioletRed',\n 'MidnightBlue',\n 'MintCream',\n 'MistyRose',\n 'Moccasin',\n 'NavajoWhite',\n 'Navy',\n 'OldLace',\n 'Olive',\n 'OliveDrab',\n 'Orange',\n 'OrangeRed',\n 'Orchid',\n 'PaleGoldenRod',\n 'PaleGreen',\n 'PaleTurquoise',\n 'PaleVioletRed',\n 'PapayaWhip',\n 'PeachPuff',\n 'Peru',\n 'Pink',\n 'Plum',\n 'PowderBlue',\n 'Purple',\n 'Red',\n 'RosyBrown',\n 'RoyalBlue',\n 'SaddleBrown',\n 'Salmon',\n 'SandyBrown',\n 'SeaGreen',\n 'SeaShell',\n 'Sienna',\n 'Silver',\n 'SkyBlue',\n 'SlateBlue',\n 'SlateGray',\n 'SlateGrey',\n 'Snow',\n 'SpringGreen',\n 'SteelBlue',\n 'Tan',\n 'Teal',\n 'Thistle',\n 'Tomato',\n 'Turquoise',\n 'Violet',\n 'Wheat',\n 'White',\n 'WhiteSmoke',\n 'Yellow',\n 'YellowGreen'\n ];\n\n return array_rand(array_flip($arrColors));\n}", "public function getColor() {}", "public function getColor() {}", "public static function getHue($array){\n\n $RGB['R'] = $array['r'] / 255;\n $RGB['G'] = $array['g'] / 255;\n $RGB['B'] = $array['b'] /255;\n // calculate maximum and minimum values;\n $maxValue = 0;\n $maxKey ='';\n $minValue = 1;\n $minKey ='';\n foreach ($RGB as $key => $value) {\n if ($value > $maxValue) {\n $maxValue = $value;\n $maxKey = $key;\n }\n if ($value < $minValue) {\n $minValue = $value;\n $minKey = $key;\n }\n }\n $delta = $maxValue - $minValue;\n if ($delta == 0) {\n $delta = 0.01;\n }\n if ($maxKey == 'R') {\n $hue = ($RGB['G'] - $RGB['B']) / $delta;\n }elseif ($maxKey == 'G'){\n $hue = 2.0 + (($RGB['B']-$RGB['R']) / $delta );\n }elseif ($maxKey == 'B'){\n $hue = 4.0 + (($RGB['R']-$RGB['G']) / $delta );\n }\n return round($hue*60);\n }", "function produce_colorpicker() {\n\n $width = 384;\n $height = 128;\n $factor = 4;\n $colour = array(255, 0, 0);\n\n $matrices = array();//R, G, B\n $matrices[] = array( 0, 1, 0);\n $matrices[] = array( -1, 0, 0);\n $matrices[] = array( 0, 0, 1);\n $matrices[] = array( 0, -1, 0);\n $matrices[] = array( 1, 0, 0);\n $matrices[] = array( 0, 0, -1);\n \n $matrixcount = count($matrices);\n $limit = ceil($width/$matrixcount);\n $heightbreak = floor($height/2);\n\n header(\"Content-type: image/png\");\n $image = imagecreatetruecolor($width, $height);\n imagecolorallocate($image, 0, 0, 0);\n\n for ($x = 0; $x < $width; $x++) {\n\n $divisor = floor($x / $limit);\n $matrix = $matrices[$divisor];\n\n \n $colour[0] += $matrix[0]*$factor;\n $colour[1] += $matrix[1]*$factor;\n $colour[2] += $matrix[2]*$factor;\n\n for ($y=0;$y<$height;$y++) {\n $pixel = $colour;\n\n if ($y < $heightbreak) {\n $pixel[0] += ((255-$pixel[0])/$heightbreak)*($heightbreak-$y);\n $pixel[1] += ((255-$pixel[1])/$heightbreak)*($heightbreak-$y);\n $pixel[2] += ((255-$pixel[2])/$heightbreak)*($heightbreak-$y);\n } else if ($y > $heightbreak) {\n $pixel[0] = ($height-$y)*($pixel[0]/$heightbreak);\n $pixel[1] = ($height-$y)*($pixel[1]/$heightbreak);\n $pixel[2] = ($height-$y)*($pixel[2]/$heightbreak);\n }\n\n if ($pixel[0] < 0) $pixel[0] = 0;\n else if ($pixel[0] > 255) $pixel[0] = 255;\n if ($pixel[1] < 0) $pixel[1] = 0;\n else if ($pixel[1] > 255) $pixel[1] = 255;\n if ($pixel[2] < 0) $pixel[2] = 0;\n else if ($pixel[2] > 255) $pixel[2] = 255;\n\n imagesetpixel($image, $x, $y, imagecolorallocate($image, $pixel[0], $pixel[1], $pixel[2]));\n }\n\n }\n\n imagepng($image);\n imagedestroy($image);\n}", "function colorFormat($v) {\r\n //$o = round(sqrt(abs($v)),1);\r\n if ($v <= 0) $maxColor = [0,0,255,1];\r\n else $maxColor = [255,0,0,1];\r\n $minColor = [251,250,182,0];\r\n\r\n for($i=0;$i<=3;$i++) {\r\n $rgba[$i] = round(($maxColor[$i] - $minColor[$i]) * abs($v),2) + $minColor[$i];\r\n }\r\n\r\n \r\n return 'rgba('.implode(',',$rgba).')';\r\n}", "function waves_ColorLuminance($color, $percent) {\n $color = str_replace(\"#\", \"\", $color);\n if (strlen($color) == 3) {\n $R = hexdec(substr($color, 0, 1) . substr($color, 0, 1));\n $G = hexdec(substr($color, 1, 1) . substr($color, 1, 1));\n $B = hexdec(substr($color, 2, 1) . substr($color, 2, 1));\n } else {\n $R = hexdec(substr($color, 0, 2));\n $G = hexdec(substr($color, 2, 2));\n $B = hexdec(substr($color, 4, 2));\n }\n\n $R = intval($R);\n $G = intval($G);\n $B = intval($B);\n\n $R = round($R * (100 + $percent) / 100);\n $G = round($G * (100 + $percent) / 100);\n $B = round($B * (100 + $percent) / 100);\n\n $R = (string) dechex(($R < 255) ? $R : 255);\n $G = (string) dechex(($G < 255) ? $G : 255);\n $B = (string) dechex(($B < 255) ? $B : 255);\n\n $RR = (strlen($R) == 1) ? (\"0\" . $R) : $R;\n $GG = (strlen($G) == 1) ? (\"0\" . $G) : $G;\n $BB = (strlen($B) == 1) ? (\"0\" . $B) : $B;\n\n return \"#\" . $RR . $GG . $BB;\n}", "function fetch_colors($filename = '')\n\t{\n\t\tif (!empty($filename))\n\t\t{\n\t\t\t// resize to obtain most significant colors\n\t\t\t$preview_width = 150;\n\t\t\t$preview_height = 150;\n\t\t\t$size = GetImageSize($filename);\n\t\t\t$scale = 1;\n\t\t\tif ($size[0] > 0)\n\t\t\t{\n\t\t\t\t$scale = min($preview_width / $size[0], $preview_height / $size[1]);\n\t\t\t}\n\t\t\tif ($scale < 1)\n\t\t\t{\n\t\t\t\t$width = floor($scale*$size[0]);\n\t\t\t\t$height = floor($scale*$size[1]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$width = $size[0];\n\t\t\t\t$height = $size[1];\n\t\t\t}\n\t\t\t$image_resized = imagecreatetruecolor($width, $height);\n\t\t\tif ($size[2] == 1)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromgif($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 2)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefromjpeg($filename);\n\t\t\t}\n\t\t\tif ($size[2] == 3)\n\t\t\t{\n\t\t\t\t$image_orig = imagecreatefrompng($filename);\n\t\t\t}\n\t\t\t// we need the nearest neihbor resizing because it doesn't alter the colors\n\t\t\timagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t\t\t$im = $image_resized;\n\t\t\t$imgWidth = imagesx($im);\n\t\t\t$imgHeight = imagesy($im);\n\t\t\tfor ($y = 0; $y < $imgHeight; $y++)\n\t\t\t{\n\t\t\t\tfor ($x = 0; $x < $imgWidth; $x++)\n\t\t\t\t{\n\t\t\t\t\t$index = imagecolorat($im, $x, $y);\n\t\t\t\t\t$Colors = imagecolorsforindex($im, $index);\n\t\t\t\t\t// round off the colors to reduce the number of colors to prevent duplicates\n\t\t\t\t\t$Colors['red'] = intval((($Colors['red']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['green'] = intval((($Colors['green']) + 15) / 32) * 32;\n\t\t\t\t\t$Colors['blue'] = intval((($Colors['blue']) + 15) / 32) * 32;\n\t\t\t\t\tif ($Colors['red'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['red'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['green'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['green'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\tif ($Colors['blue'] >= 256)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Colors['blue'] = 240;\n\t\t\t\t\t}\n\t\t\t\t\t$hexarray[] = substr(\"0\" . dechex($Colors['red']), -2) . substr(\"0\" . dechex($Colors['green']), -2) . substr(\"0\" . dechex($Colors['blue']), -2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$hexarray = array_count_values($hexarray);\n\t\t\tnatsort($hexarray);\n\t\t\t$hexarray = array_reverse($hexarray, true);\n\t\t\treturn $hexarray;\n\t\t}\n\t}", "function hsl_rgb($h,$s,$l) {\n\t$h=$h-floor($h); // h est entre 0 et 1\n\t$s=$s-floor($s); // s est entre 0 et 1\n\t$l=$l-floor($l); // l est entre 0 et 1\n\t//echo $h.\" \".$s.\" \".$l.\"<br>\\n\";\n\tif ($s==0) {\n\t\t$r=$l*255;\n\t\t$g=$l*255;\n\t\t$b=$l*255;\n\t}\n\telse {\n\t\tif ($l<0.5)\n\t\t\t$var_2=$l*($l+$s);\n\t\telse\n\t\t\t$var_2=($l+$s)-($s*$l);\n\t\t$var_1=2*$l-$var_2;\n\t\t$r=255*_hue_rgb($var_1,$var_2,$h+(1/3));\n\t\t$g=255*_hue_rgb($var_1,$var_2,$h);\n\t\t$b=255*_hue_rgb($var_1,$var_2,$h-(1/3));\n\t}\n\treturn array($r,$g,$b); // $r,$g,$b entre 0 et 255\n}", "function _hue_rgb($v1,$v2,$vH) {\n\tif ($vH<0)\t$vH+=1;\n\tif ($vH>1)\t$vH-=1;\n\tif (($vH*6)<1)\n\t\treturn ($v1+($v2-$v1)*6*$vH);\n\tif (($vH*2)<1)\n\t\treturn $v2;\n\tif (($vH*3)<2)\n\t\treturn ($v1+($v2-$v1)*((2/3)-$vH)*6);\n\treturn $v1;\n}", "protected function make_rgb()\n {\n $hsl = $this->_hsl;\n $hue = $hsl['hue'];\n $saturation = max(min($hsl['saturation'], 1), 0);\n $luminance = max(min($hsl['luminance'], 1), 0);\n\n $max = ($luminance <= 0.5) ? $luminance * ($saturation + 1) : $luminance + $saturation - $luminance * $saturation;\n $min = $luminance * 2 - $max;\n\n $this->_rgb_dec = array(\n 'red' => (int) ($this->_hue_to_rgb($min, $max, $hue + 0.33333) * self::RGB_MAX),\n 'green' => (int) ($this->_hue_to_rgb($min, $max, $hue) * self::RGB_MAX),\n 'blue' => (int) ($this->_hue_to_rgb($min, $max, $hue - 0.33333) * self::RGB_MAX),\n );\n $this->_rgb_hex = $this->rgb_dec_to_hex($this->_rgb_dec);\n }", "function getColors($imageURL){\n\n //create image in RAM from any uploaded picture ['jpg', 'jpeg', 'png', 'gif', 'bpm'];\n $img = imagecreatefromstring(file_get_contents($imageURL));\n\n //get original size from uploaded picture\n $size = getimagesize($imageURL);\n $size_x = $size[0];\n $size_y = $size[1];\n\n //set new with and height size\n $new_size_x = round($size_x/2);\n $new_size_y = round($size_y/2);\n\n //create empty picture with new size\n $new_size_img = imagecreatetruecolor($new_size_x,$new_size_y);\n\n //copy original picture to created picture wiz new size\n imagecopyresized($new_size_img, $img , 0, 0 , 0, 0, $new_size_x, $new_size_y, $size_x, $size_y);\n\n //delete original picture from RAM\n imagedestroy($img);\n\n //get color from every second pixel in picture and \n $colors = [];\n for ($x = 0; $x < $new_size_x; $x+=2) {\n for ($y = $x; $y < $new_size_y; $y+=2) {\n $colors[]=dechex(imagecolorat($new_size_img,$x,$y));\n }\n } \n\n //delete copied picture from RAM\n imagedestroy($new_size_img);\n\n //add '0`s' to colors which have less than 6 symbols\n $colors = array_map(function($colors){\n $color = $colors;\n $zeros = '';\n $max_len = 6;\n $len = strlen($color) ?? '0';\n if($len < $max_len){\n $count = $max_len - $len;\n for($x = 0; $x < $count; $x++){\n $zeros .= \"0\";\n }\n }\n return $zeros.$color;\n },$colors);\n\n return $colors;\n}", "public function parse_colors($text) {\r\n\t\r\n\t\t# Clear garbage\r\n\t\t$text = preg_replace('/[^\\r\\n\\t\\x20-\\x7E\\xA0-\\xFF]/', '', trim($text));\r\n\t\t\r\n\t\t# load first set..\r\n\t\t$switch = 1;\r\n\t\r\n\t\t# Check if there's a color..\r\n\t\tif (substr_count($text, '^')>0) {\r\n\t\t\r\n\t\t $clr = array ( // colors\r\n\t \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", \"\\\"#E8FF19\\\"\", // 1\r\n\t \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", \"\\\"#FFFFFF\\\"\", // 2\r\n\t \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#EB9F53\\\"\", \"\\\"#106F59\\\"\", // 3\r\n\t \"\\\"#5A134F\\\"\", \"\\\"#035AFF\\\"\", \"\\\"#681EA7\\\"\", \"\\\"#5097C1\\\"\", // 4\r\n\t \"\\\"#BEDAC4\\\"\", \"\\\"#024D2C\\\"\", \"\\\"#7D081B\\\"\", \"\\\"#90243E\\\"\", // 5\r\n\t \"\\\"#743313\\\"\", \"\\\"#A7905E\\\"\", \"\\\"#555C26\\\"\", \"\\\"#AEAC97\\\"\", // 6\r\n\t \"\\\"#C0BF7F\\\"\", \"\\\"#000000\\\"\", \"\\\"#DA0120\\\"\", \"\\\"#00B906\\\"\", // 7\r\n\t \"\\\"#E8FF19\\\"\", \"\\\"#170BDB\\\"\", \"\\\"#23C2C6\\\"\", \"\\\"#E201DB\\\"\", // 8\r\n\t \"\\\"#FFFFFF\\\"\", \"\\\"#CA7C27\\\"\", \"\\\"#757575\\\"\", \"\\\"#CC8034\\\"\", // 9\r\n\t \"\\\"#DBDF70\\\"\", \"\\\"#BBBBBB\\\"\", \"\\\"#747228\\\"\", \"\\\"#993400\\\"\", // 10\r\n\t \"\\\"#670504\\\"\", \"\\\"#623307\\\"\" // 11\r\n );\r\n\r\n\t if ($switch == 1)\r\n\t { // colored string\r\n\t $search = array (\r\n\t \"/\\^0/\", \"/\\^1/\", \"/\\^2/\", \"/\\^3/\", // 1\r\n\t \"/\\^4/\", \"/\\^5/\", \"/\\^6/\", \"/\\^7/\", // 2\r\n\t \"/\\^8/\", \"/\\^9/\", \"/\\^a/\", \"/\\^b/\", // 3\r\n\t \"/\\^c/\", \"/\\^d/\", \"/\\^e/\", \"/\\^f/\", // 4\r\n\t \"/\\^g/\", \"/\\^h/\", \"/\\^i/\", \"/\\^j/\", // 5\r\n\t \"/\\^k/\", \"/\\^l/\", \"/\\^m/\", \"/\\^n/\", // 6\r\n\t \"/\\^o/\", \"/\\^p/\", \"/\\^q/\", \"/\\^r/\", // 7\r\n\t \"/\\^s/\", \"/\\^t/\", \"/\\^u/\", \"/\\^v/\", // 8\r\n\t \"/\\^w/\", \"/\\^x/\", \"/\\^y/\", \"/\\^z/\", // 9\r\n\t \"/\\^\\//\", \"/\\^\\*/\", \"/\\^\\-/\", \"/\\^\\+/\", // 10\r\n\t \"/\\^\\?/\", \"/\\^\\@/\", \"/\\^</\", \"/\\^>/\", // 11\r\n\t \"/\\^\\&/\", \"/\\^\\)/\", \"/\\^\\(/\", \"/\\^[A-Z]/\", // 12\r\n\t \"/\\^\\_/\", // 14\r\n\t \"/&</\", \"/^(.*?)<\\/font>/\" // 15\r\n\t );\r\n\t\r\n\t $replace = array (\r\n\t \"&<font color=$clr[0]>\", \"&<font color=$clr[1]>\", // 1\r\n\t \"&<font color=$clr[2]>\", \"&<font color=$clr[3]>\", // 2\r\n\t \"&<font color=$clr[4]>\", \"&<font color=$clr[5]>\", // 3\r\n\t \"&<font color=$clr[6]>\", \"&<font color=$clr[7]>\", // 4\r\n\t \"&<font color=$clr[8]>\", \"&<font color=$clr[9]>\", // 5\r\n\t \"&<font color=$clr[10]>\", \"&<font color=$clr[11]>\", // 6\r\n\t \"&<font color=$clr[12]>\", \"&<font color=$clr[13]>\", // 7\r\n\t \"&<font color=$clr[14]>\", \"&<font color=$clr[15]>\", // 8\r\n\t \"&<font color=$clr[16]>\", \"&<font color=$clr[17]>\", // 9\r\n\t \"&<font color=$clr[18]>\", \"&<font color=$clr[19]>\", // 10\r\n\t \"&<font color=$clr[20]>\", \"&<font color=$clr[21]>\", // 11\r\n\t \"&<font color=$clr[22]>\", \"&<font color=$clr[23]>\", // 12\r\n\t \"&<font color=$clr[24]>\", \"&<font color=$clr[25]>\", // 13\r\n\t \"&<font color=$clr[26]>\", \"&<font color=$clr[27]>\", // 14\r\n\t \"&<font color=$clr[28]>\", \"&<font color=$clr[29]>\", // 15\r\n\t \"&<font color=$clr[30]>\", \"&<font color=$clr[31]>\", // 16\r\n\t \"&<font color=$clr[32]>\", \"&<font color=$clr[33]>\", // 17\r\n\t \"&<font color=$clr[34]>\", \"&<font color=$clr[35]>\", // 18\r\n\t \"&<font color=$clr[36]>\", \"&<font color=$clr[37]>\", // 19\r\n\t \"&<font color=$clr[38]>\", \"&<font color=$clr[39]>\", // 20\r\n\t \"&<font color=$clr[40]>\", \"&<font color=$clr[41]>\", // 21\r\n\t \"\", \"\", \"\", \"\", \"\", \"\", // 22\r\n\t \"\", \"</font><\", \"\\$1\" // 23\r\n\t );\r\n\t\r\n\t $ctext = preg_replace($search, $replace, $text);\r\n\t\r\n\t if ($ctext != $text)\r\n\t {\r\n\t $ctext = preg_replace(\"/$/\", \"</font>\", $ctext);\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t elseif ($switch == 2)\r\n\t { // colored numbers\r\n\t if ($text <= 39)\r\n\t {\r\n\t $ctext = \"<font color=$clr[7]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 69)\r\n\t {\r\n\t $ctext = \"<font color=$clr[5]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 129)\r\n\t {\r\n\t $ctext = \"<font color=$clr[8]>$text</font>\";\r\n\t }\r\n\t elseif ($text <= 399)\r\n\t {\r\n\t $ctext = \"<font color=$clr[9]>$text</font>\";\r\n\t }\r\n\t else\r\n\t {\r\n\t $ctext = \"<font color=$clr[1]>$text</font>\";\r\n\t }\r\n\t\r\n\t return trim($ctext);\r\n\t }\r\n\t\t}\r\n\t\t# no color so just return ..\r\n\t\telse {\r\n\t\t\treturn trim($text);\r\n\t\t} \r\n\t}", "function hex_color_mod($hex, $diff) {\n\t$rgb = str_split(trim($hex, '# '), 2);\n \n\tforeach ($rgb as &$hex) {\n\t\t$dec = hexdec($hex);\n\t\tif ($diff >= 0) {\n\t\t\t$dec += $diff;\n\t\t}\n\t\telse {\n\t\t\t$dec -= abs($diff);\t\t\t\n\t\t}\n\t\t$dec = max(0, min(255, $dec));\n\t\t$hex = str_pad(dechex($dec), 2, '0', STR_PAD_LEFT);\n\t}\n \n\treturn '#'.implode($rgb);\n}", "function colorFormat($v) {\r\n //$o = round(sqrt(abs($v)),1);\r\n if ($v <= 0) $maxColor = [0,0,255,1];\r\n else $maxColor = [255,0,0,1];\r\n $minColor = [251,250,182,0];\r\n\r\n for($i=0;$i<=2;$i++) {\r\n $rgba[$i] = round(($maxColor[$i] - $minColor[$i]) * abs($v),0) + $minColor[$i];\r\n }\r\n $rgba[3] = round(($maxColor[3] - $minColor[3]) * abs($v),2) + $minColor[3];\r\n\r\n \r\n return 'rgba('.implode(',',$rgba).')';\r\n}", "function make_color_array($n)\n{\n //you might set this to 16 and change sprintf accordingly.\n $pow = 256;\n $n = (int)$n;\n\n $color_space = array();\n\n $d = (int)(pow($n, (1/3)));\n $red = $green = $blue = $d;\n $r = $n - pow($d, 3);\n\n if($r != 0)\n {\n ++$blue;\n if($green*$red*$blue < $n)\n {\n ++$red;\n }\n if($green*$red*$blue < $n)\n {\n ++$green;\n }\n }\n\n $red = (($red > 1) ? (int)(($pow - 1)/($red - 1)) : ($pow - 1));\n $green = (($green > 1) ? (int)(($pow - 1)/($green - 1)) : ($pow - 1));\n $blue = (($blue > 1) ? (int)(($pow - 1)/($blue - 1)) : ($pow - 1));\n\n $h = 0;\n for($i = 0; $i < $pow; $i += $red)\n {\n for($j = 0; $j < $pow; $j += $green)\n {\n for($k = 0; $k < $pow; $k += $blue)\n {\n $color = sprintf(\"%02X%02X%02X\", $i, $j, $k);\n array_push($color_space, $color);\n if(++$h >= $n)\n {\n return $color_space;\n }\n }\n }\n }\n}", "function colourBrightness($hex, $percent) {\n $hash = '';\n if (stristr($hex,'#')) {\n $hex = str_replace('#','',$hex);\n $hash = '#';\n }\n /// HEX TO RGB\n $rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\n //// CALCULATE \n for ($i=0; $i<3; $i++) {\n // See if brighter or darker\n if ($percent > 0) {\n // Lighter\n $rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\n } else {\n // Darker\n $positivePercent = $percent - ($percent*2);\n $rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\n }\n // In case rounding up causes us to go to 256\n if ($rgb[$i] > 255) {\n $rgb[$i] = 255;\n }\n }\n //// RBG to Hex\n $hex = '';\n for($i=0; $i < 3; $i++) {\n // Convert the decimal digit to hex\n $hexDigit = dechex($rgb[$i]);\n // Add a leading zero if necessary\n if(strlen($hexDigit) == 1) {\n $hexDigit = \"0\" . $hexDigit;\n }\n // Append to the hex string\n $hex .= $hexDigit;\n }\n return $hash.$hex;\n}", "function callback_color($args)\n {\n }", "public function getRed()\n {\n return (0.5 + $this->red) | 0;\n }", "function carton_hex_darker( $color, $factor = 30 ) {\n\t\t$base = carton_rgb_from_hex( $color );\n\t\t$color = '#';\n\n\t\tforeach ($base as $k => $v) :\n\t $amount = $v / 100;\n\t $amount = round($amount * $factor);\n\t $new_decimal = $v - $amount;\n\n\t $new_hex_component = dechex($new_decimal);\n\t if(strlen($new_hex_component) < 2) :\n\t \t$new_hex_component = \"0\".$new_hex_component;\n\t endif;\n\t $color .= $new_hex_component;\n\t\tendforeach;\n\n\t\treturn $color;\n\t}", "public function getColor() {\n\t}", "public function getGreen()\n {\n return (0.5 + $this->green) | 0;\n }", "function hsl($color) \n\t{\n\t\t$r = hexdec(substr($color, 0, 2)) / 255;\n\t\t$g = hexdec(substr($color, 2, 2)) / 255;\n\t\t$b = hexdec(substr($color, 4, 2)) / 255;\n\t\t$min = min($r, min($g, $b));\n\t\t$max = max($r, max($g, $b));\n\t\t$delta = $max - $min;\n\t\t$l = ($min + $max) / 2;\n\t\t$s = 0;\n\t\tif ($l > 0 && $l < 1)\n\t\t{\n\t\t\t$s = $delta / ($l < 0.5 ? (2 * $l) : (2 - 2 * $l));\n\t\t}\n\t\t$h = 0;\n\t\tif ($delta > 0)\n\t\t{\n\t\t\tif ($max == $r && $max != $g) $h += ($g - $b) / $delta;\n\t\t\tif ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta);\n\t\t\tif ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta);\n\t\t\t$h = $h/6;\n\t\t}\n\t\treturn array(($h * 255), ($s * 255), ($l * 255));\n\t}", "private function getColor() {\n $randomNumber = rand(0, 7);\n $colors = array(0 => 'green',\n 1 => 'orange',\n 2 => 'blue', \n 3 => 'orange',\n 4 => 'yellow',\n 5 => 'purple',\n 6 => 'red',\n 7 => 'cyan');\n //$this->changeColor($colors[$randomNumber]);\n return $colors[$randomNumber]; \n \n }", "public static function merge_colors_for_dots($colors)\n\t{\n\t\t//check if we're dealing with just one color\n\t\tif(count($colors)==1)\n\t\t{\n\t\t\tforeach($colors as $color)\n\t\t\t{\n\t\t\t\treturn $color;\n\t\t\t}\n\t\t}\n\t\t//now for each color break it into RGB, add them up, then normalize\n\t\t$red = 0;\n\t\t$green = 0;\n\t\t$blue = 0;\n\t\tforeach($colors as $color)\n\t\t{\n\t\t\t$numeric_colors = self::_hex2RGB($color);\n\t\t\t$red = $red + $numeric_colors['red'];\n\t\t\t$green = $green + $numeric_colors['green'];\n\t\t\t$blue = $blue + $numeric_colors['blue'];\n\t\t}\n\t\t//now normalize\n\t\t$color_length = sqrt( ($red*$red) + ($green*$green) + ($blue*$blue));\n\t\n\t\t//make sure there's no divide by zero\n\t\tif($color_length == 0)\n\t\t{\n\t\t\t$color_length = 255;\n\t\t}\n\t\t$red = ($red / $color_length) * 255;\n\t\t$green = ($green / $color_length) * 255;\n\t\t$blue = ($blue / $color_length) * 255;\n\t\n\t\t\n\t\t//pad with zeros if there's too much space\n\t\t$red = dechex($red);\n\t\tif(strlen($red) < 2)\n\t\t{\n\t\t\t$red = \"0\".$red;\n\t\t}\n\t\t$green = dechex($green);\n\t\tif(strlen($green) < 2)\n\t\t{\n\t\t\t$green = \"0\".$green;\n\t\t}\n\t\t$blue = dechex($blue);\n\t\tif(strlen($blue) < 2)\n\t\t{\n\t\t\t$blue = \"0\".$blue;\n\t\t}\n\t\t//now put the color back together and return it\n\t\treturn $red.$green.$blue;\n\t\t\n\t}", "function random_color() {\n\t\treturn random_color_part() . random_color_part() . random_color_part();\n\t}", "function thelandscaper_adjust_color( $hex, $steps ) {\n\t $steps = max(-255, min(255, $steps));\n\n\t // Normalize into a six character long hex string\n\t $hex = str_replace('#', '', $hex);\n\t if (strlen($hex) == 3) {\n\t $hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);\n\t }\n\n\t // Split into three parts: R, G and B\n\t $color_parts = str_split($hex, 2);\n\t $return = '#';\n\n\t foreach ($color_parts as $color) {\n\t $color = hexdec($color); // Convert to decimal\n\t $color = max(0,min(255,$color + $steps)); // Adjust color\n\t $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n\t }\n\n\t return $return;\n\t}", "function colourBrightness($hex, $percent) {\n \t$hash = '';\n \tif (stristr($hex,'#')) {\n \t\t$hex = str_replace('#','',$hex);\n \t\t$hash = '#';\n \t}\n \t/// HEX TO RGB\n \t$rgb = array(hexdec(substr($hex,0,2)), hexdec(substr($hex,2,2)), hexdec(substr($hex,4,2)));\n \t//// CALCULATE\n \tfor ($i=0; $i<3; $i++) {\n \t\t// See if brighter or darker\n \t\tif ($percent > 0) {\n \t\t\t// Lighter\n \t\t\t$rgb[$i] = round($rgb[$i] * $percent) + round(255 * (1-$percent));\n \t\t} else {\n \t\t\t// Darker\n \t\t\t$positivePercent = $percent - ($percent*2);\n \t\t\t$rgb[$i] = round($rgb[$i] * $positivePercent) + round(0 * (1-$positivePercent));\n \t\t}\n \t\t// In case rounding up causes us to go to 256\n \t\tif ($rgb[$i] > 255) {\n \t\t\t$rgb[$i] = 255;\n \t\t}\n \t}\n \t//// RBG to Hex\n \t$hex = '';\n \tfor($i=0; $i < 3; $i++) {\n \t\t// Convert the decimal digit to hex\n \t\t$hexDigit = dechex($rgb[$i]);\n \t\t// Add a leading zero if necessary\n \t\tif(strlen($hexDigit) == 1) {\n \t\t$hexDigit = \"0\" . $hexDigit;\n \t\t}\n \t\t// Append to the hex string\n \t\t$hex .= $hexDigit;\n \t}\n \treturn $hash.$hex;\n }", "function adjust_brightness($hex, $steps)\n{\n $steps = max(-255, min(255, $steps));\n // Normalize into a six character long hex string\n $hex = str_replace('#', '', $hex);\n if (strlen($hex) == 3) {\n $hex = str_repeat(substr($hex, 0, 1), 2) . str_repeat(substr($hex, 1, 1), 2) . str_repeat(substr($hex, 2, 1), 2);\n }\n // Split into three parts: R, G and B\n $color_parts = str_split($hex, 2);\n $return = '#';\n foreach ($color_parts as $color) {\n $color = hexdec($color); // Convert to decimal\n $color = max(0, min(255, $color + $steps)); // Adjust color\n $return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code\n }\n return $return;\n}", "function rgb_to_hsv($R, $G, $B) // RGB Values:Number 0-255 \n{ // HSV Results:Number 0-1 \n $max = '';\n $H = '';\n $HSL = array(); \n\n $var_R = ($R / 255); \n $var_G = ($G / 255); \n $var_B = ($B / 255); \n\n $var_Min = min($var_R, $var_G, $var_B); \n $var_Max = max($var_R, $var_G, $var_B); \n $del_Max = $var_Max - $var_Min; \n\n $V = $var_Max; \n\n if ($del_Max == 0) \n { \n $H = 0; \n $S = 0; \n } \n else \n { \n $S = $del_Max / $var_Max; \n\n $del_R = ( ( ( $max - $var_R ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max; \n $del_G = ( ( ( $max - $var_G ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max; \n $del_B = ( ( ( $max - $var_B ) / 6 ) + ( $del_Max / 2 ) ) / $del_Max; \n\n if ($var_R == $var_Max) $H = $del_B - $del_G; \n else if ($var_G == $var_Max) $H = ( 1 / 3 ) + $del_R - $del_B; \n else if ($var_B == $var_Max) $H = ( 2 / 3 ) + $del_G - $del_R; \n\n if ($H < 0) $H++; \n if ($H > 1) $H--; \n }\n\n $HSL['H'] = $H; \n $HSL['S'] = $S; \n $HSL['V'] = $V; \n\n return $HSL; \n}", "function getColorMatrix($hslbc){\n\t\t//colors from the response .json -> material\n\t\t$h = ($hslbc['hue']*pi())/180;\n\t\t$s = $hslbc['saturation'];\n\t\t$l = $hslbc['lightness'];\n\t\t$b = $hslbc['brightness']/128;\n\t\t$c = $hslbc['contrast'];\n\t \n\t\t// 4x4 identity matrix\n\t\t$matrix = array(\n\t\t\tarray(1, 0, 0, 0),\n\t\t\tarray(0, 1, 0, 0),\n\t\t\tarray(0, 0, 1, 0),\n\t\t\tarray(0, 0, 0, 1)\n\t\t);\n\t \n\t\tif($b != 0 || $c != 1){\n\t\t\t// process brightness and contrast\n\t\t\t$t = 128*(2*$b+1-$c);\n\t\t\t$mult = array(\n\t\t\t\tarray($c, 0, 0, $t),\n\t\t\t\tarray( 0, $c, 0, $t),\n\t\t\t\tarray( 0, 0, $c, $t),\n\t\t\t\tarray( 0, 0, 0, 1)\n\t\t\t);\n\t\t\t$matrix = matrix_multiply($mult, $matrix);\n\t\t}\n\t \n\t\tif($h != 0 || $s != 1 || $l != 1){\n\t\t\t// transform to HSL\n\t\t\t$multRgbToHsl = array(\n\t\t\t\tarray( 0.707107, 0, -0.707107, 0),\n\t\t\t\tarray(-0.408248, 0.816497, -0.408248, 0),\n\t\t\t\tarray( 0.577350, 0.577350, 0.577350, 0),\n\t\t\t\tarray( 0, 0, 0, 1)\n\t\t\t);\n\t\t\t$matrix = matrix_multiply($multRgbToHsl, $matrix);\n\t \n\t\t\t// process adjustments\n\t\t\t$cosHue = cos($h);\n\t\t\t$sinHue = sin($h);\n\t\t\t$mult = array(\n\t\t\t\tarray( $cosHue * $s, $sinHue * $s, 0, 0),\n\t\t\t\tarray(-$sinHue * $s, $cosHue * $s, 0, 0),\n\t\t\t\tarray( 0, 0, $l, 0),\n\t\t\t\tarray( 0, 0, 0, 1)\n\t\t\t);\n\t\t\t$matrix = matrix_multiply($mult, $matrix);\n\t \n\t\t\t// transform back to RGB\n\t\t\t$multHslToRgb = array(\n\t\t\t\tarray( 0.707107, -0.408248, 0.577350, 0),\n\t\t\t\tarray( 0, 0.816497, 0.577350, 0),\n\t\t\t\tarray(-0.707107, -0.408248, 0.577350, 0),\n\t\t\t\tarray( 0, 0, 0, 1)\n\t\t\t);\n\t\t\t$matrix = matrix_multiply($multHslToRgb, $matrix);\n\t\t}\n\t\treturn $matrix;\n\t}", "public function colors()\n {\n $color = $this->backgroundColor();\n return array($color, Kronolith::foregroundColor($color));\n }", "public function toHSV()\n {\n $red = $this->red / 255;\n $green = $this->green / 255;\n $blue = $this->blue / 255;\n\n\n $min = min($red, $green, $blue);\n $max = max($red, $green, $blue);\n\n $value = $max;\n $delta = $max - $min;\n\n if ($delta == 0) {\n return new HSV(0, 0, $value * 100);\n }\n\n $saturation = 0;\n\n if ($max != 0) {\n $saturation = $delta / $max;\n } else {\n $saturation = 0;\n $hue = -1;\n return new HSV($hue, $saturation, $value);\n }\n if ($red == $max) {\n $hue = ($green - $blue) / $delta;\n } else {\n if ($green == $max) {\n $hue = 2 + ($blue - $red) / $delta;\n } else {\n $hue = 4 + ($red - $green) / $delta;\n }\n }\n $hue *= 60;\n if ($hue < 0) {\n $hue += 360;\n }\n\n return new HSV($hue, $saturation * 100, $value * 100);\n }", "function getColor(){\n\t\t# Like this: Array ( [red] => 255 [green] => 255 [blue] => 255 )\n\t\t# You could then use it with the setRGB function (See class.rgbcontrol.php for that.)\n\t\t# Simple usage is $led->setRBG($dbh->getColor());\n\n\t\t$pdo = $this->db->prepare(\"SELECT red,green,blue FROM colors ORDER BY cID DESC LIMIT 1\");\n\t\t$pdo->execute();\n\n\t\treturn $pdo->fetch();\n\t}", "public function getColor() {\n\n\t\t//return $query->rows;\n\t}", "function statusColors($statusC)\n{\n\tif ($statusC == 0) return \"#CCC\"; //inactiv\n\tif ($statusC == 1) return \"green\"; //activ\n\tif ($statusC == 2) return \"rgb(245, 160, 3)\"; //waiting\n\tif ($statusC == 3) return \"rgb(221, 36, 3);\"; //not paid\n\t//else return \"\";\n}", "function rgb_cmy($r,$g,$b) {\n\treturn array(1 - ( $r / 255 ),1 - ( $g / 255 ),1 - ( $b / 255 )); // c,m,y entre 0 et 1\n}", "public function get_hslColor(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::HSLCOLOR_INVALID;\n }\n }\n $res = $this->_hslColor;\n return $res;\n }", "function adjust_brightness( $hex, $steps ) {\n\n\t// Steps should be between -255 and 255. Negative = darker, positive = lighter\n\t$steps = max( -255, min( 255, $steps ) );\n\n\t// Normalize into a six character long hex string\n\t$hex = str_replace( '#', '', $hex );\n\tif ( 3 === strlen( $hex ) ) {\n\t\t$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );\n\t}\n\n\t// Split into three parts: R, G and B\n\t$color_parts = str_split( $hex, 2 );\n\t$return = '#';\n\n\tforeach ( $color_parts as $color ) {\n\t\t$color = hexdec( $color ); // Convert to decimal\n\t\t$color = max( 0, min( 255, $color + $steps ) ); // Adjust color\n\t\t$return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code\n\t}\n\n\treturn $return;\n\n}", "public function getColor()\n {\n $La_Color = null;\n\n switch($this->i_Colormode)\n {\n case self::SVNHUE_COLORMODE_HUE:\n $La_Color['hue'] = $this->a_State['hue'];\n $La_Color['sat'] = $this->a_State['sat'];\n break;\n\n case self::SVNHUE_COLORMODE_CT:\n $La_Color['ct'] = $this->a_State['ct'];\n break;\n\n case self::SVNHUE_COLORMODE_XY:\n $La_Color['xy'] = $this->a_State['xy'];\n break;\n } /* switch */\n\n return($La_Color);\n\n }", "public function getColor()\n {\n }", "function getColorRow($index){\n\tif($index%2==0){\t\t\n\t\t$color=array(255,255,208);\n\t\t/*$color=array(224,235,255);*/\n\t}\n\telse{\n\t\t $color=array(249,249,249);\n\t\t /*$color=array(255,255,204);*/\n\t}\n\treturn $color;\n}", "function FCallback($aVal) {\n // the datapoint according to the data value according to\n if( $aVal < 30 ) $c = \"blue\";\n elseif( $aVal < 70 ) $c = \"green\";\n else $c=\"red\";\n return array(floor($aVal/3),\"\",$c);\n}", "protected function calculateColors()\n {\n // initial structure of our return array\n $return = ['time' => [], 'memory' => []];\n\n // short-circuit if we only have one thing to benchmark\n if (count($this->benchmarks) == 1) {\n $name = $this->benchmarks[0]->getName();\n $return['time'][$name] = self::COLOR_GREEN;\n $return['memory'][$name] = self::COLOR_GREEN;\n\n return $return;\n }\n\n // we make separate arrays since we don't want to re-order the list as it was passed in. usort would do that\n $times = [];\n $memories = [];\n\n // split them all out\n /** @var Benchmark $benchmark */\n foreach ($this->benchmarks as $benchmark) {\n $times[$benchmark->getName()] = $benchmark->getTime();\n $memories[$benchmark->getName()] = $benchmark->getMemory();\n }\n\n // sort them by value\n asort($times);\n asort($memories);\n\n // go through the times--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($times as $productName => $time) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['time'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['time'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['time'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n // go through the memory--anything < 34% is green, between 34 and 66 is yellow, higher is red\n $i = 1;\n foreach ($memories as $productName => $memory) {\n $rank = $i / (count($this->benchmarks) + 1);\n if ($rank <= .34) {\n $return['memory'][$productName] = self::COLOR_GREEN;\n } else if ($rank > .34 && $rank <= .66) {\n $return['memory'][$productName] = self::COLOR_YELLOW;\n } else {\n $return['memory'][$productName] = self::COLOR_RED;\n }\n $i++;\n }\n\n return $return;\n }", "private function colorMeanValue($i)\n\t{\n\t\t$colorList = array();\n\t\t$colorSum = 0;\n\t\tfor($a = 0;$a<8;$a++)\n\t\t{\n\t\t\n\t\t\tfor($b = 0;$b<8;$b++)\n\t\t\t{\n\t\t\t\n\t\t\t\t$rgb = imagecolorat($i, $a, $b);\n\t\t\t\t$colorList[] = $rgb & 0xFF;\n\t\t\t\t$colorSum += $rgb & 0xFF;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn array($colorSum/64,$colorList);\n\t}", "public static function nextColor($tagArr) {\n $colors = array('red-gradient', 'blue-gradient', 'purple-gradient', 'green-gradient', 'orange-gradient', 'anthracite-gradient', 'silver-gradient', 'black-gradient');\n\n foreach ($colors as $color) {\n if (!in_array($color, $tagArr)) {\n return $color;\n break;\n }\n }\n // all colors taken, choose random\n return array_rand(shuffle($colors), 1);\n }", "public static function summaryChartColouring()\n {\n return [ '#f1592c', '#f3724c', '#f58b6c', '#f7a48c' ];\n }", "protected function _getGradientEndColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val - (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }", "public function getColor(): string;", "function RBsortColors($unsortedArray, $class) {\n\tfunction RGBtoHSV($r, $g, $b) {\n\t\t$r = ($r / 255);\n\t\t$g = ($g / 255);\n\t\t$b = ($b / 255);\n\n\t\t$maxRGB = max($r, $g, $b);\n\t\t$minRGB = min($r, $g, $b);\n\t\t$chroma = $maxRGB - $minRGB;\n\n\t\t$computedV = 100 * $maxRGB;\n\n\t\tif ($chroma == 0) {\n\t\t\t$computedH = 0;\n\t\t\t$computedS = 0;\n\t\t} else {\n\t\t\t$computedS = 100 * ($chroma / $maxRGB);\n\n\t\t\tif ($r == $minRGB) {\n\t\t\t\t$h = 3 - (($g - $b) / $chroma);\n\t\t\t}\n\t\t\telseif ($b == $minRGB) {\n\t\t\t\t$h = 1 - (($r - $g) / $chroma);\n\t\t\t} else {\n\t\t\t\t$h = 5 - (($b - $r) / $chroma);\n\t\t\t}\n\n\t\t\t$computedH = 60 * $h;\n\t\t}\n\t\treturn array('h' => $computedH, 's' => $computedS, 'v' => $computedV);\n\t}\n\n\tfunction perLightness($r, $g, $b) {\n\t\treturn ($r*0.21)+($g*0.72)+($b*0.07);\n\t}\n\n\n\tusort($unsortedArray, function($a, $b) {\n\t\t$aLig = perLightness($a['r'], $a['g'], $a['b']);\n\t\t$bLig = perLightness($b['r'], $b['g'], $b['b']);\n\n\t\treturn $aLig < $bLig ? 1 : -1 ;\n\t});\n\n\t$sorted = array();\n\tforeach($unsortedArray as $color) {\n\t\t$hsv = RGBtoHSV($color['r'], $color['g'], $color['b']);\n\t\t$hue = round($hsv['h'], 2);\n\t\t$sat = round($hsv['s'], 2);\n\t\t$val = round($hsv['v'], 2);\n\n\t\tif($sat < 10) { //grays\n\t\t\t$sorted['grays'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t}\n\t\telseif(($hue < 20) || (($hue >= 345) && ($hue <= 360))) { //reds\n\t\t\t$sorted['reds'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t} \n\t\telseif(($hue >= 20) && ($hue < 60)) { //oranges n yellows\n\t\t\t$sorted['yellows'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t}\n\t\telseif(($hue >= 60) && ($hue < 175)) { //greens\n\t\t\t$sorted['greens'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t}\n\t\telseif(($hue >= 175) && ($hue < 250)) { //blues\n\t\t\t$sorted['blues'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t}\n\t\telseif(($hue >= 250) && ($hue < 345)) { //purples\n\t\t\t$sorted['purples'][] = array('r'=>$color['r'], 'g'=>$color['g'], 'b'=>$color['b']);\n\t\t}\n\t}\n\n\t$sorted = array_merge($sorted['grays'], $sorted['reds'], $sorted['yellows'], $sorted['greens'], $sorted['blues'], $sorted['purples']);\n\n\n\tforeach($sorted as $color) {\n\t\techo '<div class=\"'.$class.'\" style=\"background-color: rgb('.$color['r'].', '.$color['g'].', '.$color['b'].');\"></div>';\n\t}\n\n}", "public function black_or_white()\n {\n return ($this->_hsl['luminance'] > 0.5) ? '#000' : '#FFF';\n }", "function rgbaColor($colorArray, $mult=1) {\n if ($mult !== 1) {\n foreach ($colorArray as $i => &$color) {\n if ($i < 3) { // alpha stays the same\n $color *= $mult;\n $color &= (int)(round($color));\n }\n }\n }\n $colorStr = implode(\",\", $colorArray);\n return \"rgba($colorStr)\";\n }", "function wp_tinycolor_hue_to_rgb($p, $q, $t)\n {\n }", "function NO2Color($val) {\n\n /**\n * a short function used to tell if an integer is in range\n * @param int $val value to check against\n * @param int $min minimum value boundary\n * @param int $max maximum value boundary\n * @return boolean true if the value was in range, false if not\n */\n $inRange = function ($val, $min, $max) { return $min <= $val && $val <= $max;};\n\n //wish there was a shorthand if statement...\n if($inRange($val, 0, 67)): return \"#9FFF8E\"; endif;\n if($inRange($val, 68, 134)): return \"#55FF00\"; endif;\n if($inRange($val, 135, 200)): return \"#48C900\"; endif;\n if($inRange($val, 201, 267)): return \"#FEFE00\"; endif;\n if($inRange($val, 268, 334)): return \"#FAC900\"; endif;\n if($inRange($val, 335, 400)): return \"#F45958\"; endif;\n if($inRange($val, 401, 467)): return \"#F30000\"; endif;\n if($inRange($val, 468, 534)): return \"#890000\"; endif;\n if($inRange($val, 535, 600)): return \"#C12EFF\"; endif;\n if($val >= 601): return \"#55FF00\"; endif;\n}", "public function getColors()\n\t{\n\t\treturn [\n\t\t\t'AliceBlue',\n\t\t\t'AntiqueWhite',\n\t\t\t'Aqua',\n\t\t\t'Aquamarine',\n\t\t\t'Azure',\n\t\t\t'Beige',\n\t\t\t'Bisque',\n\t\t\t'Black',\n\t\t\t'BlanchedAlmond',\n\t\t\t'Blue',\n\t\t\t'BlueViolet',\n\t\t\t'Brown',\n\t\t\t'BurlyWood',\n\t\t\t'CadetBlue',\n\t\t\t'Chartreuse',\n\t\t\t'Chocolate',\n\t\t\t'Coral',\n\t\t\t'CornflowerBlue',\n\t\t\t'Cornsilk',\n\t\t\t'Crimson',\n\t\t\t'Cyan',\n\t\t\t'DarkBlue',\n\t\t\t'DarkCyan',\n\t\t\t'DarkGoldenRod',\n\t\t\t'DarkGray',\n\t\t\t'DarkGreen',\n\t\t\t'DarkKhaki',\n\t\t\t'DarkMagenta',\n\t\t\t'DarkOliveGreen',\n\t\t\t'Darkorange',\n\t\t\t'DarkOrchid',\n\t\t\t'DarkRed',\n\t\t\t'DarkSalmon',\n\t\t\t'DarkSeaGreen',\n\t\t\t'DarkSlateBlue',\n\t\t\t'DarkSlateGray',\n\t\t\t'DarkTurquoise',\n\t\t\t'DarkViolet',\n\t\t\t'DeepPink',\n\t\t\t'DeepSkyBlue',\n\t\t\t'DimGray',\n\t\t\t'DodgerBlue',\n\t\t\t'FireBrick',\n\t\t\t'FloralWhite',\n\t\t\t'ForestGreen',\n\t\t\t'Fuchsia',\n\t\t\t'Gainsboro',\n\t\t\t'GhostWhite',\n\t\t\t'Gold',\n\t\t\t'GoldenRod',\n\t\t\t'Gray',\n\t\t\t'Green',\n\t\t\t'GreenYellow',\n\t\t\t'HoneyDew',\n\t\t\t'HotPink',\n\t\t\t'IndianRed',\n\t\t\t'Indigo',\n\t\t\t'Ivory',\n\t\t\t'Khaki',\n\t\t\t'Lavender',\n\t\t\t'LavenderBlush',\n\t\t\t'LawnGreen',\n\t\t\t'LemonChiffon',\n\t\t\t'LightBlue',\n\t\t\t'LightCoral',\n\t\t\t'LightCyan',\n\t\t\t'LightGoldenRodYellow',\n\t\t\t'LightGreen',\n\t\t\t'LightGrey',\n\t\t\t'LightPink',\n\t\t\t'LightSalmon',\n\t\t\t'LightSeaGreen',\n\t\t\t'LightSkyBlue',\n\t\t\t'LightSlateGray',\n\t\t\t'LightSteelBlue',\n\t\t\t'LightYellow',\n\t\t\t'Lime',\n\t\t\t'LimeGreen',\n\t\t\t'Linen',\n\t\t\t'Magenta',\n\t\t\t'Maroon',\n\t\t\t'MediumAquaMarine',\n\t\t\t'MediumBlue',\n\t\t\t'MediumOrchid',\n\t\t\t'MediumPurple',\n\t\t\t'MediumSeaGreen',\n\t\t\t'MediumSlateBlue',\n\t\t\t'MediumSpringGreen',\n\t\t\t'MediumTurquoise',\n\t\t\t'MediumVioletRed',\n\t\t\t'MidnightBlue',\n\t\t\t'MintCream',\n\t\t\t'MistyRose',\n\t\t\t'Moccasin',\n\t\t\t'NavajoWhite',\n\t\t\t'Navy',\n\t\t\t'OldLace',\n\t\t\t'Olive',\n\t\t\t'OliveDrab',\n\t\t\t'Orange',\n\t\t\t'OrangeRed',\n\t\t\t'Orchid',\n\t\t\t'PaleGoldenRod',\n\t\t\t'PaleGreen',\n\t\t\t'PaleTurquoise',\n\t\t\t'PaleVioletRed',\n\t\t\t'PapayaWhip',\n\t\t\t'PeachPuff',\n\t\t\t'Peru',\n\t\t\t'Pink',\n\t\t\t'Plum',\n\t\t\t'PowderBlue',\n\t\t\t'Purple',\n\t\t\t'Red',\n\t\t\t'RosyBrown',\n\t\t\t'RoyalBlue',\n\t\t\t'SaddleBrown',\n\t\t\t'Salmon',\n\t\t\t'SandyBrown',\n\t\t\t'SeaGreen',\n\t\t\t'SeaShell',\n\t\t\t'Sienna',\n\t\t\t'Silver',\n\t\t\t'SkyBlue',\n\t\t\t'SlateBlue',\n\t\t\t'SlateGray',\n\t\t\t'Snow',\n\t\t\t'SpringGreen',\n\t\t\t'SteelBlue',\n\t\t\t'Tan',\n\t\t\t'Teal',\n\t\t\t'Thistle',\n\t\t\t'Tomato',\n\t\t\t'Turquoise',\n\t\t\t'Violet',\n\t\t\t'Wheat',\n\t\t\t'White',\n\t\t\t'WhiteSmoke',\n\t\t\t'Yellow',\n\t\t\t'YellowGreen',\n\t\t];\n\t}", "function FCallback($aVal) {\n // This callback will adjust the fill color and size of\n // the datapoint according to the data value according to\n if( $aVal < 30 ) $c = \"blue\";\n elseif( $aVal < 70 ) $c = \"green\";\n else $c=\"red\";\n return array(floor($aVal/3),\"\",$c);\n}", "function get_brightness($hex) {\n\t// strip off any leading #\n\t$hex = str_replace('#', '', $hex);\n\t$c_r = hexdec(substr($hex, 0, 2));\n\t$c_g = hexdec(substr($hex, 2, 2));\n\t$c_b = hexdec(substr($hex, 4, 2));\n\t$result_color_value = (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000;\n\tif ($result_color_value > 130){\n\t $return_color = \"black\";\n\t}else{\n\t $return_color = \"white\";\n\t}\n\treturn $return_color;\n}", "function set_color_low($value, $yellow_limit, $red_limit)\n{\n settype ($value , \"float\");\n settype ($yellow_limit , \"float\");\n settype ($red_limit , \"float\");\n\n\tif ($value == -1)\n\t return null;\n\tif ($value <= $red_limit)\n\t\treturn \"class=red\";\n\tif ($value <= $yellow_limit)\n\t\treturn \"class=yellow\";\n\telse\n\t\treturn \"class=green\";\n}", "function cmy_rgb($c,$m,$y) {\n\treturn array(( 1 - $c ) * 255,( 1 - $m ) * 255,( 1 - $y ) * 255); // r,g,b entre 0 et 255\n}", "function wp_tinycolor_hsl_to_rgb($hsl_color)\n {\n }", "function usecolorPlus( $pDate )\n{\n\tglobal $debug;\n\t$debug=false;\n\tpCOM_DebugInit($debug);\n\tpCOM_DebugAdd($debug, \"Common:usecolorPlus - pDate=\".$pDate);\n\tif (! empty($pDate)) {\n\t\t$dateNow=strtotime(now);\n\t\t$dateTest=strtotime($pDate);\n\t\tif ($dateNow > $dateTest) {\n\t\t\t$trcolor1 = \"#CCEECC\";\n\t\t\t$trcolor2 = \"#CCE4CC\";\n\t\t} else {\n\t\t\t$trcolor1 = \"#EEEEEE\";\n\t\t\t$trcolor2 = \"#E1E1E1\";\n\t\t}\n\t} else {\n\t\t$trcolor1 = \"#EEEEEE\";\n\t\t$trcolor2 = \"#E1E1E1\";\n\t}\n\tstatic $colorvalue;\n\tif($colorvalue == $trcolor1)\n\t\t$colorvalue = $trcolor2;\n\telse\n\t\t$colorvalue = $trcolor1;\n\treturn($colorvalue);\n}", "public function colorList() {}", "function getColor() {return $this->readColor();}", "public function actionColors()\n {\n \t$this->stdout(\"Waiting on important things to happen...\\n\", Console::BOLD);\n \t$yay = $this->ansiFormat('Yay!', Console::FG_CYAN);\n \techo \"$yay! We're done!\\n\";\n \treturn 0;\n }", "private function rgb2hsv($rgb) {\n\t\t$r = $rgb[0];\n\t\t$g = $rgb[1];\n\t\t$b = $rgb[2];\n\t\t$minVal = min($r, $g, $b);\n\t\t$maxVal = max($r, $g, $b);\n\t\t$delta = $maxVal - $minVal;\n\t\t$v = $maxVal / 255;\n\n\t\tif ($delta == 0) {\n\t\t\t$h = 0;\n\t\t\t$s = 0;\n\t\t} else {\n\t\t\t$h = 0;\n\t\t\t$s = $delta / $maxVal;\n\t\t\t$delR = ((($maxVal - $r) / 6) + ($delta / 2)) / $delta;\n\t\t\t$delG = ((($maxVal - $g) / 6) + ($delta / 2)) / $delta;\n\t\t\t$delB = ((($maxVal - $b) / 6) + ($delta / 2)) / $delta;\n\t\t\tif ($r == $maxVal) {\n\t\t\t\t$h = $delB - $delG;\n\t\t\t} else if ($g == $maxVal) {\n\t\t\t\t$h = (1 / 3) + $delR - $delB;\n\t\t\t} else if ($b == $maxVal) {\n\t\t\t\t$h = (2 / 3) + $delG - $delR;\n\t\t\t}\n\t\t\tif ($h < 0) {\n\t\t\t\t$h++;\n\t\t\t}\n\t\t\tif ($h > 1) {\n\t\t\t\t$h--;\n\t\t\t}\n\t\t}\n\n\t\t$h = round($h * 360);\n\t\t$s = round($s * 100);\n\t\t$v = round($v * 100);\n\n\t\treturn array($h, $s, $v);\n\t}", "public static function rgb2hsv($r, $g = NULL, $b = NULL)\n\t{\n\t\t$hsv = array();\n\t\t$rgb = array();\n\t\t$delta_rgb = array();\n\t\t\n\t\tif (! is_array($r)) {\n\t\t\t$rgb['r'] = (int) $r;\n\t\t\t$rgb['g'] = (int) $g;\n\t\t\t$rgb['b'] = (int) $b;\n\t\t} else {\n\t\t\t$rgb = $r;\n\t\t}\n\t\t\n\t\t$rgb['r'] = $rgb['r'] / 255;\n\t\t$rgb['g'] = $rgb['g'] / 255;\n\t\t$rgb['b'] = $rgb['b'] / 255;\n\t\t\n\t\t$min = min($rgb);\n\t\t$max = max($rgb);\n\t\t$delta = $max - $min;\n\t\t\n\t\t$v = $delta;\n\t\t\n\t\tif ($delta == 0) {\n\t\t\t$h = 0;\n\t\t\t$s = 0;\n\t\t} else {\n\t\t\t$s = $delta / $max;\n\t\t}\n\t\t\n\t\tif ($max == 0) {\n\t\t\t$max = 1;\n\t\t}\n\t\t\n\t\t$delta_rgb['r'] = ((($max - $rgb['r']) / 6) + ($delta / 2)) / $max;\n\t\t$delta_rgb['g'] = ((($max - $rgb['g']) / 6) + ($delta / 2)) / $max;\n\t\t$delta_rgb['b'] = ((($max - $rgb['b']) / 6) + ($delta / 2)) / $max;\n\t\t\n\t\tswitch ($max) {\n\t\t\tcase $rgb['r']:\n\t\t\t\t$h = $rgb['b'] - $rgb['g'];\n\t\t\t\tbreak;\n\t\t\tcase $rgb['g']:\n\t\t\t\t$h = (1 / 3) + $delta_rgb['r'] - $delta_rgb['b'];\n\t\t\t\tbreak;\n\t\t\tcase $rgb['b']:\n\t\t\t\t$h = (1 / 3) + $delta_rgb['g'] - $delta_rgb['r'];\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif ($h < 0) {\n\t\t\t$h++;\n\t\t}\n\t\t\n\t\tif ($h > 1) {\n\t\t\t$h--;\n\t\t}\n\t\t\n\t\t$hsv['h'] = $h;\n\t\t$hsv['s'] = $s;\n\t\t$hsv['v'] = $v;\n\t\t\n\t\treturn $hsv;\n\t}", "function get_color($image,$i,$iMax,$palette){\n $rgb = get_RGB($i,$iMax,$palette) ;\n $color = imagecolorexact($image,$rgb[0],$rgb[1],$rgb[2]) ;\n if($color==-1){\n $color = imagecolorallocate($image,$rgb[0],$rgb[1],$rgb[2]) ;\n if($color == -1){\n $color = imagecolorclosest($image,$rgb[0],$rgb[1],$rgb[2]) ;\n }\n }\n return $color;\n}", "public function backgroundColor(array $color);", "protected function _getGradientStartColour() {\n $base_colour = $this->_getColour();\n $colour = \"\";\n foreach (array(0, 2, 4) as $pos) {\n $rgb_val = hexdec(substr($base_colour, $pos, 2));\n $rgb_val = max(0, min(255, $rgb_val + (self::GRADIENT_COLOUR_STEP / 2)));\n $colour .= str_pad(dechex($rgb_val), 2, \"0\", STR_PAD_LEFT);\n }\n return $colour;\n }", "public function color()\n {\n $color = $this->customer->color;\n\n $r = substr($color, 1, 2);\n $g = substr($color, 3, 2);\n $b = substr($color, 5, 2);\n $luma = (float)0.2126 * hexdec($r)\n + 0.7152 * hexdec($g)\n + 0.0722 * hexdec($b);\n\n return ['color' => $this->customer->color, 'luma' => $luma];\n }", "public function mainColour() {\n\t\t$images = $this->ShopImage->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'ShopImage.colour_1 IS NULL'\n\t\t\t)\n\t\t));\n\n\t\t$count = count($images);\n\t\tforeach ($images as $k => $image) {\n\t\t\t$this->out(sprintf('%s of %d: %s', str_pad($k+1, strlen($count), ' ', STR_PAD_LEFT), $count, $image['ShopImage']['image_full']));\n\t\t\t$colours = $this->_colour(APP . 'webroot/' . $image['ShopImage']['image_full']);\n\t\t\t$image['ShopImage']['colour_1'] = $colours[0];\n\t\t\t$image['ShopImage']['colour_2'] = $colours[1];\n\t\t\t$this->ShopImage->save($image['ShopImage']);\n\t\t}\n\t}" ]
[ "0.61964923", "0.6168567", "0.60873264", "0.60849106", "0.60849106", "0.60849106", "0.60849106", "0.6029798", "0.6028076", "0.60247785", "0.60153407", "0.5970682", "0.5952811", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5952765", "0.5903743", "0.5901074", "0.5872733", "0.5872648", "0.58721644", "0.586841", "0.5861467", "0.5829802", "0.5823847", "0.57439226", "0.5713959", "0.5708947", "0.5708947", "0.5708231", "0.57046306", "0.57024205", "0.56784105", "0.56670165", "0.5642544", "0.5640955", "0.56346595", "0.56170166", "0.5584604", "0.5578787", "0.55278325", "0.55125064", "0.5503806", "0.5498312", "0.54927754", "0.5471951", "0.54589194", "0.5457081", "0.5441484", "0.54388785", "0.5420645", "0.5419847", "0.5407739", "0.5406302", "0.5400143", "0.5386791", "0.538348", "0.5374596", "0.5361377", "0.5360644", "0.5349551", "0.53403336", "0.5332827", "0.53308886", "0.53248316", "0.5298494", "0.52925545", "0.52925223", "0.52892995", "0.5261759", "0.52544475", "0.52418065", "0.5222173", "0.52183837", "0.52073264", "0.52007896", "0.51953983", "0.518975", "0.51866937", "0.51727986", "0.5162876", "0.5155298", "0.5151258", "0.51483154", "0.5141156", "0.51400363", "0.51396036", "0.5138567", "0.5129406", "0.5129077", "0.51225954", "0.5119159", "0.51144654", "0.5103594", "0.5097686", "0.5090167", "0.5085782" ]
0.5690365
35
Check if the called method is allowed
final public function actionIsAllowed($action) { $allowed = $this->checkAction($action); if (!$allowed) throw new ActionNotAllowedException($action, get_called_class()); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function allowsCallOfMethod($methodName) {\n\t\treturn TRUE;\n\t}", "public function allowsCallOfMethod($methodName) {\n\t\treturn TRUE;\n\t}", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function allowsCallOfMethod($methodName)\n {\n return true;\n }", "public function callUserFunctionCanCallFunction() {}", "public function isAllowedMethod($method)\n\t{\n\t\t$kirby = App::instance();\n\t\t$name = strtolower(get_class($this->object) . '::' . $method);\n\n\t\t// get list of blocked methods from config\n\t\t$blocked = $kirby->option('kql.methods.blocked', []);\n\t\t$blocked = array_map('strtolower', $blocked);\n\n\t\t// check in the block list from the config\n\t\tif (in_array($name, $blocked) === true) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// check in class allow list\n\t\tif (in_array($method, $this->allowedMethods()) === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// get list of explicitly allowed methods from config\n\t\t$allowed = $kirby->option('kql.methods.allowed', []);\n\t\t$allowed = array_map('strtolower', $allowed);\n\n\t\t// check in the allow list from the config\n\t\tif (in_array($name, $allowed) === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// support for model methods with docblock comment\n\t\tif ($this->isAllowedCallable($method) === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// support for custom methods with docblock comment\n\t\tif ($this->isAllowedCustomMethod($method) === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract function isAllowed($operation);", "abstract protected function canAccess();", "private function checkIfMethodAllowed(string $methodName)\n {\n if (!in_array($methodName, $this->allowedMethods)) throw new \\Exception('Undefinded method');\n }", "protected function isPermissionCorrect() {}", "protected function validateMethod() {\n\t\t$helperWS = Mage::helper('chronorelais/webservice');\n\n\t\t/* Chronorelais => test Si WS fonctionne */\n\t\tif($this->_checkRelaiWs) {\n\t\t\t$shippingAddress = Mage::getSingleton('adminhtml/session_quote')->getQuote()->getShippingAddress();\n\t $webservice = $helperWS->getPointsRelaisByCp($shippingAddress->getPostcode());\n\t if($webservice === false) {\n\t return false;\n\t }\n\t\t}\n\n if($this->_checkContract) {\n $isAllowed = $helperWS->getMethodIsAllowed($this->_code);\n if($isAllowed === false) {\n return false;\n }\n }\n return true;\n\t}", "protected function isAllowedCallable($method): bool\n\t{\n\t\ttry {\n\t\t\t$ref = match (true) {\n\t\t\t\t$method instanceof Closure\n\t\t\t\t\t=> new ReflectionFunction($method),\n\t\t\t\tis_string($method) === true\n\t\t\t\t\t=> new ReflectionMethod($this->object, $method),\n\t\t\t\tdefault\n\t\t\t\t=> throw new InvalidArgumentException('Invalid method')\n\t\t\t};\n\n\t\t\tif ($comment = $ref->getDocComment()) {\n\t\t\t\tif (Str::contains($comment, '@kql-allowed') === true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Throwable) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function _isAllowed()\n {\n \treturn true;\n }", "public function shouldMethodBeProtected($method) {\n if (in_array($method, $this->getMethods())) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "public function can($method)\n {\n return in_array(strtolower($method), $this->allowedMethods);\n }", "public function isForbidden();", "public function checkAccess()\n {\n // need to be modified for security\n }", "protected function isActionMethodValid($methodName)\n {\n // try {\n if (!$this->selfRefl->hasMethod($methodName)) {\n return false;\n }\n $method = $this->selfRefl->getMethod($methodName);\n \n return\n // $method->getDeclaringClass()->getName() == $this->selfRefl->getName() &&\n $method->isPublic();\n // } catch (\\ReflectionException $e) {\n // return false;\n // }\n }", "static function allowed()\n {\n\n }", "public function avoidMethod(string $method): bool {}", "public function validMethods()\n {\n return $this->valid_method;\n }", "public function hasMethodAccess()\n {\n $roles = $this->map[$this->uri][$this->method];\n\n if ($roles === self::ACCESS_ALL) {\n\n return true;\n }\n\n if ($roles === self::ACCESS_NONE) {\n\n return false;\n }\n\n $this->isArray($roles);\n\n $this->collectMissingRoles($roles);\n\n return count(array_intersect($this->currentUserRoles, $roles)) > 0;\n }", "private function _isAllowed()\r\n {\r\n $req = $this->app->request();\r\n $resource = strtoupper($req->getMethod()) . $req->getResourceUri() ;\r\n return in_array($resource, $this->config['allowed_resources']);\r\n }", "final protected function shouldHaveProtectedMethod ($objectOrClass, $method) {\n\t\t$arguments = func_get_args();\n\t\tarray_shift($arguments);\n\n\t\t// Test all given methods\n\t\tforeach ($arguments as $argument) {\n\t\t\tif (!method_exists($objectOrClass, $argument)) {\n\t\t\t\treturn $this->fail();\n\t\t\t} else if ($this->_methodVisibility($objectOrClass, $argument) !== 'protected') {\n\t\t\t\treturn $this->fail();\n\t\t\t}\n\t\t}\n\n\t\treturn $this->pass();\n\t}", "public function checkSecurity() {\n }", "public function isMethodParameter() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "private static function _verifyMethod()\n {\n if (static::Method() == 'OPTIONS') {\n Response::Error('unsupported method.');\n }\n }", "protected function isAllowedCustomMethod(string $method): bool\n\t{\n\t\tif (property_exists($this->object, 'methods') === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// does not have that method\n\t\tif (!$call = $this->method($method)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// check for a docblock comment\n\t\tif ($this->isAllowedCallable($call) === true) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function isValidMethod($method);", "function isAllowedPermission()\n {\n $retObj = array();\n try {\n\n if (isset($_REQUEST['user_id']) && isset($_REQUEST['is_backend']) && isset($_REQUEST['method']))\n {\n $retObj['allowed'] = false;\n\n $params = array(\n 'user_id' => $_REQUEST['user_id'],\n 'is_backend' => $_REQUEST['is_backend'],\n 'method' => $_REQUEST['method']\n );\n\n $aclObj = new AclManager();\n $permissions = $aclObj->getUserPermissions($params);\n\n //c. check if method valid\n foreach($permissions as $permission)\n {\n if($permission['title'] == $params['method']) {\n $retObj['allowed'] = true;\n }\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }", "protected function allow() {\n\t\t\n\t\treturn true;\n\t}", "private static function is_good_method( $method ) {\n\t\treturn $method->isPublic() && ! $method->isStatic() && 0 !== strpos( $method->getName(), '__' );\n\t}", "function allow($operation,$params=array(),$allowCaching=true)\n{\n\treturn Yii::app()->user->checkAccess($operation,$params,$allowCaching);\n}", "public function hasPerm($handler, $request_method);", "public function hasUsageRights() {}", "private function isMethodValid(string $method)\n {\n return in_array($method, $this->httpMethods, true);\n }", "public function supportMethod($data, $method) {\n return !empty($this->need[$data]['methods'][$method]);\n }", "protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}", "private function _verifyAllowedMethod($method) {\n\t\t$allowedMethods = $this->_getAllowedMethods();\n\t\t\n\t\tif (empty($allowedMethods)) {\n\t\t\tthrow new ResponseException(404, 'invalid route');\n\t\t}\n\t\tif (!in_array($method, $allowedMethods)) {\n\t\t\tthrow new MethodNotAllowedException(\n\t\t\t\t\"method $method not allowed\",\n\t\t\t\t['Allow' => implode(', ', $allowedMethods)]\n\t\t\t);\n\t\t}\n\t}", "function hook_permission_check($data) {\n\t\treturn false;\n\t}", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "protected function _checkRequestMethods() {\n\t\t$action = $this->_action();\n\t\t$apiConfig = $action->config('api');\n\n\t\tif (!isset($apiConfig['methods'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$request = $this->_request();\n\t\tforeach ($apiConfig['methods'] as $method) {\n\t\t\tif ($request->is($method)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tthrow new BadRequestException('Wrong request method');\n\t}", "public function isMethods() {}", "private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }", "function __call($fn, $param){\n //if method exists\n \n $run = apply_filters(\"WXP.{$this->handle}.{$fn}.allow\", true, $this, $param);\n \n if($run !== false){\n \n //give an error if the method does not exist, and \n //method call is allowed\n \n if(!method_exists($this->object, $fn)){\n throw new \\BadMethodCallException(\"Call to undefined method {$this->handle}::{$fn}\");\n }\n \n //if method does exist do .before action\n \n do_action(\"WXP.{$this->handle}.{$fn}.before\", $this, $param);\n \n //now call method and apply filters to the result\n \n $result = call_user_func_array(array($this->object, $fn), $param);\n \n $result = apply_filters(\"WXP.{$this->handle}.{$fn}.result\", $result, $this, $param);\n \n //finally do .after action, (passing the result and object)\n \n do_action(\"WXP.{$this->handle}.{$fn}.after\", $result, $this, $param);\n \n //return result\n \n return $result;\n } else {\n //use filter to determine what is returned when \n //run call for this object is disallowed, by default null is\n //returned; but this might cause an error if a different\n //value (like an object) is expected\n \n return apply_filters(\"WXP.{$this->handle}.{$fn}.disallow.return\", null, $this, $param);\n }\n \n }", "public static function isAllowedRouteRequest() {\n\t\treturn self::$correct_request_method;\n\t}", "protected function check_permission()\n {\n return true;\n }", "public function hasMethod() : bool\n {\n return array_key_exists($this->request->getMethod(), $this->routes);\n }", "public function verifyApiCaller() : bool\n {\n $verified = false;\n\n // check for NOAUTH and no-auth-pages configuration for current page\n // these two settings must be present for the endpoint to be visible outside of REDCap\n if (isset($_GET['NOAUTH']) && in_array($_GET['page'], parent::getConfig()[\"no-auth-pages\"])) \n {\n // MODIFY THIS CHECK for the security needs of your system.\n // This hardcoded token should be changed and pulled from a secure location,\n // if using with a third-party service.\n $rctoken = $_REQUEST['rctoken'];\n if ($rctoken === 'ca5d63d58b507615c328da941270ddf0')//IMPORTANT: modify token and pull from a secure location\n {\n $verified = true;\n }\n }\n // if endpoint is not externally accessible, then this endpoint user has been authenticated by REDCap\n else\n {\n $verified = true;\n }\n\n\n return $verified;\n }", "protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }", "public function supports($method = '');", "public function canProcessRequest()\n\t{\n\t\t// Check the validity of the function name\n\t\tif(($this->sRequestedFunction) && !$this->validateFunction($this->sRequestedFunction))\n\t\t{\n\t\t\t$this->sRequestedFunction = null;\n\t\t}\n\t\treturn ($this->sRequestedFunction != null);\n\t}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "public function canHandleRequest() {}", "abstract function allowAddAction();", "public function doesCheckModifyAccessListThrowExceptionOnWrongHookInterface() {}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function checkPermissions();", "public function getAllowedMethods(): array;", "function check_access() {\n trigger_error('Admin class does not implement method <strong>check_access()</strong>', E_USER_WARNING);\n return;\n }", "public function isAccess();", "public function __call($method, $params) {\n\t\tif (!empty($method) && $method == 'Sitecontentcoverphoto_Form_Admin_Global') {\n\n\t\t}\n\t\treturn true;\n\t}", "public function authorize()\n {\n return Gate::allows('add_to_dos') ? true : false;\n }", "public function hasAccess(): bool;", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function isMethod()\n {\n if (!isset($this->class))\n {\n return false;\n }\n\n return method_exists($this->class, $this->function);\n }", "public function checkOperationality()\n {\n }", "function methodNotAllowed($allowed = 'GET, HEAD') {\n header('HTTP/1.0 405 Method Not Allowed');\n header('Allow: '.$allowed);\n }", "public function checkPermissions() {\n if ($this->checkIp()) {\n \\BDSCore\\Errors\\Errors::returnError(403);\n }\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Rapidmage_Firewall::manage_rules');\n }", "function canHandleRequest() ;", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "public function isMethod($method);", "public function isMethod($method);", "public function testIsAllowed()\n {\n $class = new \\ReflectionClass(get_class($this->mvcKeeper));\n $method = $class->getMethod('isAllowed');\n $method->setAccessible(true);\n\n $authorizeByPermission = new Authorize([\n 'value' => [\n 'permissions' => [\n 'render-default-page'\n ]\n ]\n ]);\n\n $authorizeByRole = new Authorize([\n 'value' => [\n 'roles' => [\n 'Download'\n ]\n ]\n ]);\n\n $this->assertTrue($method->invoke($this->mvcKeeper, $authorizeByPermission));\n $this->assertTrue($method->invoke($this->mvcKeeper, $authorizeByRole));\n }", "public function allowRequest(): bool\n {\n return true;\n }", "public function authorize()\n {\n // TODO : determine of existing registration route protection is sufficient.\n return true;\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'DELETE':\n {\n return true;\n }\n case 'POST':\n {\n return true;\n }\n case 'PUT':\n {\n if (Auth::user()->hasPermissionTo('post_update', 'blog')) {\n return true;\n } else {\n return true;\n }\n }\n default:\n break;\n }\n return true;\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function canHandleRequest();", "public function canHandleRequest();", "public function isProtected() {}", "private static function action_allowed( $action ) {\n\t\tif ( in_array( $action, self::allowed_actions() ) ) {\n\t\t\t$class = route::action_class( $action );\n\t\t\tif ( self::check_interface( $class ) && self::check_parent_class( $class ) ) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function forbiddenAction() {\n }", "public function isValidMethod($method)\r\n {\r\n return in_array(strtoupper($method), $this->validMethods, true);\r\n }" ]
[ "0.74373156", "0.74373156", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.7324832", "0.67696136", "0.6743958", "0.672748", "0.6721432", "0.6686392", "0.66826594", "0.6645087", "0.6582676", "0.6566043", "0.6523777", "0.6512685", "0.64938784", "0.64751923", "0.6446472", "0.6422564", "0.64159846", "0.6407803", "0.63893074", "0.6388545", "0.6372442", "0.63632554", "0.6362877", "0.63409495", "0.63409495", "0.63409495", "0.6339153", "0.6339153", "0.6339063", "0.6339063", "0.6339063", "0.63354516", "0.6308326", "0.62943435", "0.62826496", "0.62747836", "0.6260662", "0.6255338", "0.6251028", "0.6244703", "0.62343603", "0.621501", "0.6211168", "0.6207378", "0.62034726", "0.6164573", "0.61597943", "0.6154722", "0.6103513", "0.609718", "0.60970384", "0.60762405", "0.60714054", "0.60703045", "0.6066172", "0.6058637", "0.6054628", "0.60413164", "0.60413164", "0.60413164", "0.60413164", "0.60394", "0.6021017", "0.6000201", "0.6000201", "0.5993124", "0.59894156", "0.59869117", "0.59863997", "0.5984865", "0.59826946", "0.5981045", "0.5966639", "0.595854", "0.5955008", "0.59410834", "0.59404856", "0.5936691", "0.5935861", "0.5930518", "0.59277165", "0.59277165", "0.59271127", "0.59175164", "0.59142196", "0.5913803", "0.59055066", "0.5903814", "0.5903814", "0.5893129", "0.5891884", "0.58848274", "0.58841676" ]
0.0
-1
Redirect to another URL
public function redirect($url) { header("Location: $url"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function redirect();", "public function redirect();", "public function redirect();", "public function redirect();", "abstract protected function redirectTo();", "public function redirectTo();", "public function redirect(string $url, $status_code = 302);", "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "public function sendRedirect() {}", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "public function redirect($url){\r\n header(\"location:$url\");\r\n }", "public function mustRedirect();", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "public function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect(){\r\n\t}", "public function redirect($url){\n header(\"Location: $url\");\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public static function redirectTo($url) {\n header(\"Location: $url\");\n exit;\n }", "function redirect($url){\r\n\t\theader('Location:'.$url, true, 303);\r\n\t}", "public function redirect($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function setRedirect($url, $code = 302);", "function redirectToUrl($url) {\n redirect_to($url);\n }", "public static function redirect($url){\n\t\theader($url);\n\t\tdie();\n\t}", "function redirectToUrl($url) {\r\n redirect_to($url);\r\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "function redirect($url) {\n\tResponder::redirect($url);\n}", "public static function redirect($url = 'index')\n {\n header(\"location: {$url}\");\n }", "public function redirect($url)\n {\n header('Location: http://' . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}", "public function redirect($url)\n {\n header(\"Location: $url\");\n exit;\n }", "function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}", "protected function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect($url) {\r\n ob_start();\r\n header('Location: '. $url);\r\n ob_end_flush();\r\n die();\r\n }", "public function redirect() {\n\n if (isset($_GET['view'])) {\n $view = \"view=\" . $_GET['view'];\n } else {\n $view = \"view=return\";\n }\n\n $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];\n header(\"Location: \" . $return_url);\n }", "function _redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header('location: ' . $url);\n exit;\n }", "function external_redirect($url){\n header('Location:' . $url);\n //Detiene el flujo\n exit;\n }", "public function redirect($url){\n header(\"Location: /$url\");\n header(\"Connection: close\");\n exit;\n }", "static function goToURL($url) {\n header('Location: ' . $url);\n }", "public static function redirect ($url)\r\n {\r\n header(\"Location: $url\");\r\n exit;\r\n }", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "public function redirect($url)\n {\n ob_get_clean();\n header('Location: '.$url);\n exit();\n }", "protected function redirect($url) {\n header(\"Location: $url\");\n die();\n }", "public function redirect(string $url) {\r\n\t\t\theader(\"location: $url\");\r\n\t\t\tdie();\r\n\t\t}", "static function redirect($url, $arguments = array())\n {\n if (substr($url, 0, 1) == '@')\n {\n global $router;\n $url = $router->generate(substr($url, 1), $arguments);\n }\n\n header(\"location: $url\");\n die();\n }", "public function redirect($path);", "static function redirect($url){\n header( 'Location: '.$url ) ;\n\n }", "public function redirect($url = '', $code = 302)\n {\n $referrer = $this->uri();\n\n if (strpos($referrer, '://') === FALSE)\n {\n $referrer = URL::site($referrer, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (strpos($url, '://') === FALSE)\n {\n // Make the URI into a URL\n $url = URL::site($url, TRUE, ! empty(Kohana::$index_file));\n }\n\n if (($response = $this->response()) === NULL)\n {\n $response = $this->create_response();\n }\n\n echo $response->status($code)\n ->headers('Location', $url)\n ->headers('Referer', $referrer)\n ->send_headers()\n ->body();\n\n // Stop execution\n exit;\n }", "function redirect ($url){\n\t header(\"Location: $url\");\n\t\texit;\n\t}", "public function redirect($url)\n {\n if (strpos($url, '://') === false) //relative URL\n {\n $url = BASE_URL.$url;\n }\n \n header('Location: '.$url); //redirect\n exit;\n }", "public function redirect($url) {\r\n\t\theader('Location: ' . HTMLROOT . $url);\r\n\t\tdie();\r\n\t}", "public static function redirect($url)\n {\n header('Location: ' . Config::PROTOKOL . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "public function redirect($redirectUrl);", "public static function _redirect($url, $code = 303) {\n self::response(false)\n ->status($code)\n ->header('Location', $url)\n ->write($url)\n ->send();\n }", "function redirect($url) {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}", "function _redirect($url) {\n\theader(\"HTTP/1.1 301 Moved Permanently\");\n\tdheader(\"location: \".str_replace('&amp;', '&', $url));\n\tdexit();\n}", "function redirect($arg){\n $url = BASE_URL.'/'.$arg;\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location:'.$url);\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "public static function redirect($url) {\n\n header(\"Location: \" . $url);\n }", "public static function redirect($url)\n {\n header('location: ' . $url);\n }", "function redirect($url)\n\t{\n\t\treturn header(\"Location:\". BASEURL . $url);\n\t}", "protected function redirect($url) {\n\t\theader('Location: ' . str_replace('&amp;', '&', $url));\n\t\tdie();\n\t}", "public function redirect($url)\r\n {\r\n header(\"Location: /$url\"); \r\n header(\"Connection: close\");\r\n exit;\r\n }", "public static function redirect($url){\n header('Location: '.$url);\n die(\"Redirecting to page <a href='\".$url.\"'>\".$url.\"</a>\");\n }", "function redirect($url){\n if (headers_sent()){\n die('<script type=\"text/javascript\">window.location.href=\"' . $url . '\";</script>');\n }else{\n header( \"refresh:3;url=\".$url );\n die();\n } \n }", "public function redirect($url = null)\n {\n if ($url <> null) {\n header(\"Location: {$url}\");\n exit(0);\n }\n }", "public function redirect(string $url)\n {\n return exit(header('Location:'. $url));\n }", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "public static function redirect($url)\n {\n echo '<script type=\"text/javascript\">document.location.href=\"' . $url . '\";</script>';\n exit;\n }", "function http_redirect($url = null, ?array $params = null, $session = null, $status = null) {}", "function url_redirect($to)\n{\n\theader(\"Location: $to\");\n}", "public function handle_redirection()\n {\n }", "function redirect($url=null)\n\t{\n\t\tif (is_null($url))\n\t\t\t$url = $_SERVER['PHP_SELF'];\n\t\theader(\"Location: $url\");\n\t\texit();\n\t}", "public function redirect($url = '', $code = 302)\n\t{\n\t\tif (strpos($url, '://') === FALSE)\n\t\t{\n\t\t\t// Make the URI into a URL\n\t\t\t$url = URL::site($url, TRUE);\n\t\t}\n\n\t\t// Set the response status\n\t\t$this->status = $code;\n\n\t\t// Set the location header\n\t\t$this->headers['Location'] = $url;\n\n\t\t// Send headers\n\t\t$this->send_headers();\n\n\t\t// Stop execution\n\t\texit;\n\t}", "public static function redirect($url, $base = SELF_URL){\r\n header('Location: '.self::getAbsoluteURL($url, $base));\r\n\t\texit;\r\n\t}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "function RedirectToURL($url)\n {\n header(\"Location: $url\");\n exit;\n }", "private static function redirect()\n {\n $files = ['Redirector', 'Redirect'];\n $folder = static::$root.'Http/Redirect'.'/';\n\n self::call($files, $folder);\n }", "function redirectTo($url) {\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: ' . $url);\n}", "public function redirect($url, $code = null)\n\t{\n\t\tUrl::redirect($url, $code);\n\t}", "function redirect($url) {\n $url = get_path($url);\n header(\"location: $url\");\n exit();\n}", "function redirect(string $to)\n{\n URL::go($to);\n}", "protected abstract function redirect(Response $response);", "public function redirecturl()\n\t\t\t{\n\t\t\t\tif($this->fields_arr['pcakey'])\n\t\t\t\t Redirect2URL($_SESSION['pcakey'][$this->fields_arr['pcakey']]);\n\t\t\t}", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "function redirect($url)\r\r\n {\r\r\n global $wp_rewrite, $wpdb, $hyper_cache_stop;\r\r\n //disable Hyper Cache plugin (http://www.satollo.net/plugins/hyper-cache) from caching this page\r\r\n $hyper_cache_stop = true;\r\r\n //disable WP Super Cache caching\r\r\n if (!defined('DONOTCACHEPAGE'))\r\r\n define('DONOTCACHEPAGE', 1);\r\r\n\r\r\n if ($this->options['base64']) {\r\r\n $url = base64_decode($url);\r\r\n } elseif ($this->options['maskurl']) {\r\r\n $sql = 'select url from ' . $wpdb->prefix . 'masklinks where id= %s limit 1';\r\r\n $url = $wpdb->get_var($wpdb->prepare($sql, addslashes($url)));\r\r\n }\r\r\n die('<a href=\"' . $url . '\">just click the link!</a>');\r\r\n }", "protected function do_redirect($url, $code = 302) {\n header(\"Location: $url\", true, $code);\n exit;\n }", "function redirectTo($url = \"\") {\n\tif (empty($url)) $url = $_SERVER['REQUEST_URI'];\n\theader(\"Location: \" . $url);\n\texit();\n}", "public function redirectToExternalUrl() {}", "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "function Redirect($url, $permanent = false)\n {\n header('Location: ' . $url, true, $permanent ? 301 : 302);\n exit();\n }", "public static function redirect($url=\".\", $code = 302) {\r\n\t\tstatic::statusCode($code);\r\n\t\tif ($url=='.') $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\r\n\t\theader(\"Location: {$url}\");\r\n\t\texit;\r\n\t}", "protected function processRedirect() {}", "static public function redirect(string $url)\n {\n header(\"location: $url\");\n exit;\n }", "protected function redirect($params) {\r\n\t\t$url = Router::reverse($this->prepare($params));\r\n\t\tif ($this->options['permanent']) {\r\n\t\t\t$code = 301;\r\n\t\t\t$status = 'Moved Permanently';\r\n\t\t} else {\r\n\t\t\t$code = 302;\r\n\t\t\t$status = 'Found';\r\n\t\t}\r\n\t\t$this->header('HTTP/1.1 ' . $code . ' ' . $status);\r\n\t\t$this->header('Location: ' . $url);\r\n\t\t$this->_stop();\r\n\t}" ]
[ "0.8113676", "0.8060218", "0.8060218", "0.8060218", "0.804037", "0.77344865", "0.76604307", "0.76601577", "0.76575154", "0.7584802", "0.7563687", "0.7501449", "0.74307597", "0.7413396", "0.740733", "0.7400592", "0.739393", "0.7362747", "0.7343829", "0.7339327", "0.7293042", "0.72857493", "0.728072", "0.72774816", "0.7269109", "0.7269109", "0.7269109", "0.72525257", "0.725182", "0.72456574", "0.72362703", "0.72361565", "0.7232043", "0.72012746", "0.7191356", "0.7180827", "0.71749455", "0.71675366", "0.71605676", "0.71489054", "0.7148865", "0.7126833", "0.71249205", "0.7114775", "0.7114055", "0.7098364", "0.70921904", "0.70849466", "0.7084877", "0.70793027", "0.7073546", "0.7070468", "0.7069956", "0.7065346", "0.7064568", "0.70588166", "0.70441705", "0.7043602", "0.7042375", "0.7041924", "0.7041849", "0.70418274", "0.70415026", "0.70386493", "0.70192504", "0.70121473", "0.70094174", "0.7007631", "0.70025086", "0.70012575", "0.70005614", "0.6999166", "0.6998952", "0.699663", "0.69952357", "0.699408", "0.69876814", "0.6979148", "0.6975717", "0.69696075", "0.6968999", "0.6958793", "0.6954528", "0.69539815", "0.6950635", "0.6950253", "0.6944803", "0.6943751", "0.69427097", "0.69394624", "0.6932761", "0.6932476", "0.6921505", "0.69207877", "0.69206595", "0.6919425", "0.6917025", "0.6903069", "0.69027615", "0.68948364" ]
0.7205183
33
Check if the controller ist a global controller
public function isGlobal() { return $this->global; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}", "public function loadBaseController()\n\t{\n\t\t$baseControllerClass = $this->getOption('defaultClassBaseController', null, 'eccBaseController');\n\t\tif (!$this->isBaseController OR !class_exists($baseControllerClass)) {\n\t\t\t$this->isBaseController = $this->modx->loadClass($baseControllerClass, $this->config['controllersPath'], true, true);\n\t\t}\n\n\t\treturn !empty($this->isBaseController) AND class_exists($baseControllerClass);\n\t}", "private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\n\t\t\tif (file_exists($controllerPatch)) {\n\t\t\t\tif (class_exists('App\\\\'.self::$app.'\\controller\\\\'.$controller)) {\n\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\tif ( ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\treturn false ;\n\t\t\t\t\t}\n\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\treturn true ;\n\t\t\t\t} else {\n\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\treturn false ;\n\t\t\t\t}\n\t\t\t} elseif ( is_dir(self::$appPatch.self::$app )) {\n\t\t\t\t$files = file::get_files_by_pattern(self::$appPatch,'*'.DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php');\n\t\t\t\tif ( is_array($files) and count($files) > 0 ){\n\t\t\t\t\t$appProvider = strings::deleteWordFirstString(strings::deleteWordLastString($files[0] ,DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php'),self::$appPatch);\n\t\t\t\t\tif (class_exists('App\\\\'.$appProvider.'\\app_provider\\\\'.self::$app.'\\\\'.$controller)) {\n\t\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\t\tif ( ! self::checkAppIsInstalled($appProvider,true) or ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\t\tself::$appProvider = $appProvider;\n\t\t\t\t\t\treturn true ;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "static function hasCurrent() {\n\t\treturn is_object(self::$_ctrl);\n\t}", "private static function viewRequiresController(): bool\n {\n return true;\n }", "public function hasCustomController()\n {\n $controllerName = ucfirst(str_replace('post_', '', $this->slug));\n if(File::exists(Theme::getPath().'/controllers/'.$controllerName.'Controller.php')) {\n return true;\n }\n return false;\n }", "static function checkInit(\n \\AmidaMVC\\Framework\\Controller $ctrl,\n \\AmidaMVC\\Component\\SiteObj &$_siteObj )\n {\n if( $_siteObj->get( 'siteObj' ) ) {\n return TRUE;\n }\n return FALSE;\n }", "public function say_controller()\n\t{\n return $this->controller ? $this->controller : false;\n }", "private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function controller()\n {\n return isset($this->controller) ? $this->controller : false;\n }", "private function ControllerExist($controller) {\n $ControllerExist = false;\n\n foreach ($this->folders as $folder) {\n\n if (class_exists($folder.'\\\\'.$controller)) {\n\n $ControllerExist = true;\n $this->namespace = $folder;\n $this->controller = $controller;\n\n }\n\n }\n\n return $ControllerExist;\n\n }", "private function hasController($page) {\r\n return file_exists($this->getController($page));\r\n }", "function my_is_current_controller($names)\n {\n $names = array_map('trim', explode(',', $names));\n $current = explode('.', Route::currentRouteName())[0];\n return in_array($current, $names, true);\n }", "public function GetControllerHasAbsoluteNamespace ();", "private function universal_controller($c)\n\t{\n\t\tif ( !isset($this->ucontrollers[$c]) ){\n\t\t\treturn false;\n\t\t}\n\t\tif ( $this->ucontrollers[$c] === 1 ){\n\t\t\t$this->ucontrollers[$c] = is_file(self::cpath.$c.'.php') ? self::cpath.$c.'.php' : false;\n\t\t}\n\t\treturn $this->ucontrollers[$c];\n\t}", "public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function isGlobal()\n {\n return $this->global;\n }", "public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }", "public function isScopeGlobal()\n {\n return true;\n }", "public static function hasController($modname, $type)\n {\n return (bool)self::getClass($modname, $type);\n }", "public function checkControllerExists(string $controller)\n {\n if(!class_exists($this->ctlrStrSrc.$controller))\n {\n die(\"Defined Controller doesn't exists\");\n }\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "function isUserLoggedin() {\n $CI = & get_instance();\n $currentClass = $CI->router->fetch_class();\n if ($currentClass == \"admin\" && $CI->session->userdata(\"adminId\") != \"\")\n redirect(\"admin/index\");\n else if ($currentClass == \"organization\" && $CI->session->userdata(\"orgId\") != \"\")\n redirect(\"organization/index\");\n else if ($currentClass == \"controller\" && $CI->session->userdata(\"controllerId\") != \"\")\n redirect(\"controller/index\");\n else\n return false;\n}", "private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }", "public function isApi()\n {\n return $this->controller() instanceof ApiController;\n }", "private function controllerExist($controller)\r\n {\r\n $controller = ucfirst($controller . self::$postfix);\r\n if (file_exists(\"controllers/{$controller}.php\")) {\r\n $this->controller = new $controller;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public static function checkPreconditions() {\n /**\n * @var $ilCtrl ilCtrl\n * @var $ilPluginAdmin ilPluginAdmin\n */\n global $ilCtrl, $ilPluginAdmin;\n $existCtrlMainMenu = $ilPluginAdmin->exists(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n $isActiveCtrlMainMenu = $ilPluginAdmin->isActive(IL_COMP_SERVICE, 'UIComponent', 'uihk', 'CtrlMainMenu');\n //The ilRouterGUI is used in ILIAS <= 4.4\n $existRouterGUI = self::getBaseClass() != false;\n return ($existCtrlMainMenu && $isActiveCtrlMainMenu && $existRouterGUI);\n }", "static public function controller() {\n\t\treturn self::$controller;\n\t}", "private function _loadExistingController(){\n\t\t$file = $this->_controllerPath . $this->_url[0] . '.php';\n\t\tif (file_exists($file)) {\n\t\t\trequire $file;\n\t\t\t$this->_controller = new $this->_url[0];\n\t\t $this->_controller->loadModel($this->_url[0], $this->_modelPath);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function getNoController()\n {\n return $this->_noController;\n }", "public function IsOnlyGlobal(){\r\n\t\t$res=true;\r\n\t\t$i=-1;\r\n\t\t$len=sizeof($this->Methods);\r\n\t\twhile(++$i<$len)\r\n\t\t\tif(!$this->Methods[$i]->IsGlobal){\r\n\t\t\t\t$res=false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\treturn $res;\r\n\t}", "public function set_controller($value)\n\t{\n\t\tif(empty($this->controller))\n\t\t{\n\t\t\t$this->controller = 'Controller_' . $value;\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isGlobalEnvironment()\n\t{\n\t\treturn $this->globalEnvironment;\n\t}", "protected function _controller() {\n\t\treturn $this->_container->controller;\n\t}", "public function isGlobalFunctionOrClass() : bool\n {\n return count($this->tokens) === 2;\n }", "public function testNoControllerVisible()\n {\n $app = $this->getApp();\n ob_start();\n $app->runControllerFromRawUrl('wrapper/noController');\n $output = ob_get_clean();\n $this->assertEquals('No controller, but should be visible anyway', $output);\n }", "public function isScopeRoot();", "public function isInContext(ControllerResultInterface $controllerResult, Request $request): bool;", "function is_robot()\n {\n return dev::isRobot();\n }", "function hasMockClass($type) {\n\t\t$type = strtolower($type);\n\t\treturn $type == 'controller';\n\t}", "public function testControllerLoad()\n {\n // initialize a module with a controller.\n P4Cms_Module::setCoreModulesPath(TEST_ASSETS_PATH . '/core-modules');\n P4Cms_Module::fetch('Core')->init();\n\n // if registered, de-register it.\n if ($this->_isRegistered()) {\n $this->_disableAutoloader();\n }\n\n $this->assertFalse(\n class_exists('Core_FooController'),\n \"Core_IndexController class should not be registered\"\n );\n\n $this->_enableAutoloader();\n $this->assertTrue(\n class_exists('Core_FooController'),\n \"Core_IndexController class should be registered\"\n );\n }", "function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}", "protected function _getController()\n\t{\n\t\treturn $this->_registry->getController();\n\t}", "private function _actionExists($request) { \n $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); \n \n // Check controller \n if (!$dispatcher->isDispatchable($request)) { \n return false; \n } \n \n // Check action \n $controllerClassName = $dispatcher->formatControllerName( $request->getControllerName() ); \n $controllerClassFile = str_replace('_', '/', $controllerClassName) . '.php'; \n if ($request->getModuleName() != $dispatcher->getDefaultModule()) { \n $controllerClassName = ucfirst($request->getModuleName()) . '_' . $controllerClassName; \n } \n try { \n require_once 'Zend/Loader.php'; \n Zend_Loader::loadFile($controllerClassFile, $dispatcher->getControllerDirectory($request->getModuleName()), true); \n $actionMethodName = $dispatcher->formatActionName($request->getActionName()); \n if (@in_array($actionMethodName, get_class_methods($controllerClassName))) { \n return true; \n } \n return false; \n } catch(Exception $e) { \n return false; \n } \n }", "public function _checkControllerAccess() \n {\n static $_unprotectedControllersHookDone = false;\n static $_hookCalled = false;\n \n if ($_hookCalled || !$controller = Yii::app()->getController()) {\n return;\n }\n \n $_hookCalled = true;\n $unprotectedControllers = (array)Yii::app()->params->itemAt('unprotectedControllers');\n\n if (!$_unprotectedControllersHookDone) {\n Yii::app()->params->add('unprotectedControllers', $unprotectedControllers);\n $_unprotectedControllersHookDone = true;\n }\n\n if (!in_array($controller->id, $unprotectedControllers) && !Yii::app()->user->getId()) {\n // make sure we set a return url to the previous page that required the user to be logged in.\n Yii::app()->user->setReturnUrl(Yii::app()->request->requestUri);\n // and redirect to the login url.\n $controller->redirect(Yii::app()->user->loginUrl);\n }\n \n // since 1.3.5, user permission to controller action, aka route\n if (!in_array($controller->id, $unprotectedControllers) && Yii::app()->user->getId()) {\n $controller->onBeforeAction = array($this, '_checkRouteAccess');\n }\n \n // check version update right before executing the action!\n $controller->onBeforeAction = array($this, '_checkUpdateVersion');\n \n // check app wide messages\n $controller->onBeforeAction = array($this, '_checkAppWideMessages');\n }", "protected function _getController($route)\n {\n $ctrlClass = $this->_getControllerClassName($route);\n $this->_controller = new $ctrlClass;\n \n if (!is_subclass_of($this->_controller, 'Konekt_Framework_Core_Controller_Abstract')) {\n return false;\n }\n \n return $this->_controller;\n }", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "private function _loadExistingController()\r\n {\r\n $file = $this->_controller_path . $this->_url[0] . '.php';\r\n if (file_exists($file)) {\r\n require_once $file;\r\n $this->_controller = new $this->_url[0];\r\n $this->_controller->loadModel($this->_url[0],$this->_model_path);\r\n } else {\r\n $this->_error();\r\n return FALSE;\r\n //throw new Exception(\"The file $file does not exist\"); \r\n }\r\n }", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "public function GetControllerClass ();", "function is_global($global=null)\n {\n if (isset($global)) $this->global = (boolean)$global;\n return $this->global;\n }", "function is_home()\n{\n $CI =& get_instance();\n return (!$CI->uri->segment(1))? TRUE: FALSE;\n}", "public function getNeverController()\n {\n return $this->_neverController;\n }", "public function isCurrent() {\n\n return !empty($this->environment);\n }", "public function includeControllerFile() : bool\n {\n if(file_exists($this->routerEntity->getControllerFile())){\n include_once ($this->routerEntity->getControllerFile());\n return true;\n }\n return false;\n }", "public function getBaseControllerName(): string;", "public function isActive(): bool {\n if (App::getClassStatus() == App::STATUS_INITIALIZING) {\n return true;\n }\n\n $routeUri = Router::getUriObjByURL(Request::getRequestedURI());\n\n if ($routeUri !== null) {\n $routeType = $routeUri->getType();\n } else {\n $routeType = Router::VIEW_ROUTE;\n }\n\n return $routeType == Router::API_ROUTE || (defined('API_CALL') && API_CALL === true);\n }", "public function getDefaultController();", "protected function getIsConsoleApp()\n {\n if (defined($this->constant)) {\n return true;\n }\n\n if (\\Yii::$app instanceof \\yii\\console\\Application) {\n return true;\n }\n\n return false;\n }", "public function initBaseController();", "public function isGlobalAdmin()\n {\n if( $this->isAnonymous ) return false;\n\n \t$admin = explode(\",\", $this->appConf[$this->project]['project.globaladmin']);\n \treturn ( in_array($this->vcsLogin, $admin) ) ? true : false;\n }", "public function isAuthorized($user = null) {\n\t\t// Anyone can access this controller to login and logout\n\t\tif ($this->action == \"logout\" || $this->Action == \"login\")\n\t\t\treturn true;\n\t\t// Only admins can use this controller for manage users\n\t\telse if ($user != null && $user['type'] == User::type_admin)\n\t\t\treturn true;\n\t\telse if ($user != null && $user['type'] == User::type_researcher)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn false;\n\t}", "public function isAdminBackend()\n {\n /* @var $owner Controller */\n $owner = $this->owner;\n $url = $owner->getRequest()->getURL();\n if (strpos($url, 'admin/') === 0) {\n return true;\n }\n if (strpos($url, 'dev/') === 0) {\n return true;\n }\n // Because keep-alive pings done through ajax could trigger requirements loading\n if (strpos($url, 'Security/ping') === 0) {\n return true;\n }\n if (\n $owner instanceof LeftAndMain ||\n $owner instanceof DevelopmentAdmin ||\n $owner instanceof DatabaseAdmin ||\n (class_exists('DevBuildController') && $owner instanceof DevBuildController)\n ) {\n return true;\n }\n\n return false;\n }", "public function getIsBackend()\n {\n if ($this->_isBackend === null) {\n $this->_isBackend = strpos($this->controllerNamespace, 'backend') === false ? false : true;\n }\n\n return $this->_isBackend;\n }", "public function isScopeGlobal()\n {\n return in_array($this->getAttributeCode(), $this->globalAttributes);\n }", "public function testIsActiveReturnsTrueOnIdenticalModuleControllerAction()\n {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo',\n 'action' => 'index',\n 'controller' => 'index'\n ));\n \n $this->_front->getRequest()->setParams(array(\n 'module' => 'default',\n 'controller' => 'index',\n 'action' => 'index'\n ));\n \n $this->assertEquals(true, $page->isActive()); \n }", "protected function initCtrlHasAbsNamespace () {\n\t\tif (mb_strpos($this->controller, '//') === 0)\n\t\t\t$this->flags |= static::FLAG_CONTROLLER_ABSOLUTE_NAMESPACE;\n\t}", "function get_controller() {\n\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n return $parts[2];\n }\n return null;\n }", "private function loadCurrentController() {\r\n\t\t$controller_name = ucfirst($this->url[0]) . CONTROLLER_SUFFIX;\r\n\t\t$controller_path = CONTROLLERS_PATH . $controller_name . '.php';\r\n\t\t\r\n\t\tif (file_exists($controller_path)) {\r\n\t\t\trequire $controller_path;\r\n\t\t} else { //Controller not found.\r\n\t\t\t$this->error(); \r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$this->controller = new $controller_name;\r\n\t\t} catch (Exception $e) { //Any error.\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}", "public function getControllerName()\n\t{\n\t\t$explodedArray = explode('/', $_SERVER['REQUEST_URI']);\n\t\tif (array_key_exists(1, $explodedArray) && !empty($explodedArray[1]) && !strstr($explodedArray[1], '?')) {\n\t\t\t$this->controllerName = $explodedArray[1];\n\t\t}else\n\t\t\t$this->controllerName = 'main';\n\t}", "public function load_controller(){\n\n\t\t// return array\n\t\treturn array(\n\n\t\t\t\t\"default_controller\"\t=> \"index\",\n\n\t\t\t\t\"force_https\"\t\t\t=> false\n\n\t\t\t);\n\t}", "public function get_controller() {\r\n\t\treturn $this->controller;\r\n\t}", "public function get_controller() {\n\t\treturn $this->controller;\n\t}", "function is_admin()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_admin();\n\t}", "function is_admin()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_admin();\n\t}", "public function testGetControllerClassNoControllerName()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin_three/ovens/index',\n 'params' => [\n 'plugin' => 'Company/TestPluginThree',\n 'controller' => 'Ovens',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->getControllerClass($request);\n $this->assertSame('Company\\TestPluginThree\\Controller\\OvensController', $result);\n }", "public function isController($action)\n {\n return (bool) preg_match(\"/^[A-Za-z0-9\\\\\\]+@[A-Za-z0-9_]+$/\", $action);\n }", "public function get_controller()\n {\n return $this->_controller;\n }", "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "protected function isNoLoginController(Controller $controller)\n {\n\n // reserved routes that doesn't need redirect or need permission check\n $no_login_routes = array(\n '\\Project\\Controllers\\Admin\\Auth', // login page\n '\\Project\\Controllers\\Admin\\Logout', // logout page\n '\\Project\\Controllers\\Admin\\Account\\Forgot', // password page\n '\\Project\\Controllers\\Admin\\Account\\ResetPassword', // password reset page\n );\n\n return in_array('\\\\' . get_class($controller), $no_login_routes);\n }", "public function FrontControllerIsVisitedOrDie() {\n\t\t\n\t\tglobal $gPage; // Always defined in frontcontroller\n\t\t\n\t\tif(!isset($gPage)) {\n\t\t\tdie('No direct access to pagecontroller is allowed.');\n\t\t}\n\t}", "function isCurrent() {\r\n if ($this->_link == $_SERVER['PHP_SELF']) {\r\n return true;\r\n }\r\n elseif ($this->_link == str_replace('index.php', '', $_SERVER['PHP_SELF'])) {\r\n return true;\r\n }\r\n elseif ($this->_link == $_SERVER['REQUEST_URI']) {\r\n return true;\r\n }\r\n return false;\r\n }", "private function isInternal()\n {\n return Request::segment(1) != 'api';\n }", "function getControllerContext() ;", "private function checkForActiveController($filename, $navigation_controller)\n {\n $split_filename = explode(\"/\", $filename);\n $active_controller = $split_filename[0];\n\n if ($active_controller == $navigation_controller) {\n return true;\n }\n // default return\n return false;\n }", "static function isLoaded() {\n return Ak::getStaticVar('CurrentUser') != null;\n }", "function is_robots()\n {\n }", "public function testIsActiveReturnsFalseOnDifferentModuleControllerAction()\n {\n $page = new Zym_Navigation_Page_Mvc(array(\n 'label' => 'foo',\n 'action' => 'bar',\n 'controller' => 'index'\n ));\n \n $this->_front->getRequest()->setParams(array(\n 'module' => 'default',\n 'controller' => 'index',\n 'action' => 'index'\n ));\n \n $this->assertEquals(false, $page->isActive()); \n }", "static function requireController($controllerName, $action ) {\n\n\t\t$paths = array_merge(array(\n\t\t\tROOT . 'app' . DS . 'controllers' . DS,\n\t\t\tROOT . 'controllers' . DS,\n\t\t\tAE_CONTROLLERS\n\t\t\t), self::$_paths\n\t\t);\n\n\t\tif (strpos($action, '.') !== false) {\n\t\t\t$action = substr($action, 0, strpos($action, '.'));\n\t\t}\n\t\t\n\t\t$controllerName = camelize($controllerName) . 'Controller';\n\t\t$action = camelize($action);\n\n\t\tforeach ($paths as $p) {\n\t\t\tif (is_file($p . $controllerName . '.php')) {\n\t\t\t\trequire_once($p . $controllerName . '.php');\n\n\t\t\t\tif (!class_exists($controllerName)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($controllerName . ' is not defined as class.');\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!method_exists($controllerName, $action)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not defined in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!is_public_controller_method($controllerName, $action) || substr($controllerName, 0, 1) == '_') {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not public in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\treturn true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function isMain() {\n\t\treturn $this->_page == null;\n\t}", "public function is_robots()\n {\n }", "public function getController() {\n\n\t\t\t$masterView = new \\permag\\view\\MasterView();\n\n\t\t\tif (isset($_GET[self::PAGE_CONTROLLER]) && $_GET[self::PAGE_CONTROLLER] != '') {\n\t\t\t\treturn $_GET[self::PAGE_CONTROLLER];\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->redirectTo($this->getHomeLink());\n\n\t\t\t}\n\t\t}", "public function isCurrentUser()\n {\n return $this->_vars instanceof \\Zend_Session_Namespace;\n }", "public function getController( );", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "function auth_check()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_logged_in();\n\t}", "protected function isDebugbarRequest()\r\n {\r\n return request::segment(1) == config::get('debugbar.route_prefix');\r\n }", "public function getDefaultController()\n {\n return Config::getInstance()->get('defaultController');\n }", "public function isGlobal($provider_id);" ]
[ "0.68273836", "0.68220353", "0.66859335", "0.65938514", "0.6492434", "0.6358076", "0.6356683", "0.63273275", "0.63043517", "0.6268229", "0.6194274", "0.61804473", "0.6147304", "0.61400306", "0.611624", "0.6014839", "0.6014778", "0.59945893", "0.5975065", "0.5960246", "0.5957415", "0.5905379", "0.5905379", "0.5857795", "0.5817861", "0.58171403", "0.5796749", "0.57937455", "0.57324785", "0.57295376", "0.5712577", "0.5698459", "0.5690149", "0.56824315", "0.5666226", "0.563972", "0.562831", "0.56261057", "0.56222504", "0.5620626", "0.56086713", "0.560062", "0.5592933", "0.5588733", "0.558777", "0.55762696", "0.5569255", "0.55526507", "0.5531841", "0.55311644", "0.5528586", "0.55252266", "0.55192065", "0.5498451", "0.5490977", "0.5481838", "0.547892", "0.5470558", "0.5469632", "0.54687643", "0.54464906", "0.5420234", "0.541741", "0.5398986", "0.5396794", "0.5396614", "0.5390331", "0.53851455", "0.5379299", "0.53792304", "0.53617275", "0.5350933", "0.5331633", "0.5325234", "0.5319915", "0.5319915", "0.53128654", "0.53086036", "0.5300349", "0.52957165", "0.52956915", "0.52936727", "0.5293591", "0.5290468", "0.52852505", "0.52757734", "0.52753097", "0.5272168", "0.52691483", "0.5262742", "0.52581394", "0.52565974", "0.52561873", "0.52548736", "0.52541703", "0.5250784", "0.5250784", "0.5250241", "0.5249406", "0.52492666" ]
0.60110235
17
Add sql query to this objects properties
public function addSql(string $query) { $this->query = $query; $this->runScript(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query() {\n // Leave empty to avoid a query on this field.\n }", "function addQuery() {}", "public function sql($sql)\n {\n $this->query['sql'] = $sql;\n return $this;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "function query() {\n $this->field_alias = $this->real_field;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function query() {\n $this->add_additional_fields();\n }", "public function get_sql()\n {\n }", "public function setSql($sql) {\r\n $this->sql = $sql;\r\n return $this;\r\n }", "public function __construct($sql) {\n\t\t$this->sql = $sql;\n\t}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "private function build_query_by_properties()\n {\n $l_sql = '';\n\n foreach ($this->m_view_properties as $l_category_type_id => $l_categories) {\n foreach ($l_categories as $l_category_id => $l_properties) {\n if (isset($l_properties['table'])) {\n $l_table = $l_properties['table'];\n $l_obj_field = $l_properties['obj_id'];\n\n $l_sql .= 'LEFT JOIN ' . $l_table . ' ON ' . $l_obj_field . ' = main.isys_obj__id ';\n\n if (isset($l_properties['join'])) {\n $l_sql .= $l_properties['join']['join_type'] . ' JOIN ' . $l_properties['join']['table'] . ' AS ' . $l_properties['join']['alias'] . ' ON ';\n $l_sql .= $l_properties['join']['join_field'] . ' = ' . $l_properties['join']['alias'] . '.' . $l_properties['join']['field'] . ' ';\n }\n\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n } else {\n // Dynamic property.\n foreach ($l_properties['properties'] as $l_property_key => $l_property_info) {\n $this->m_dynamic_headers[$l_property_key] = $l_property_info;\n }\n\n if (isset($l_properties['helper'])) {\n foreach ($l_properties['helper'] as $l_field => $l_helper) {\n $this->m_helpers[$l_field] = $l_helper;\n }\n }\n }\n }\n }\n\n $l_selection = '*';\n\n if (count($this->m_headers) > 0) {\n $l_selection = '';\n foreach ($this->m_headers as $l_field_alias => $l_field) {\n $l_selection .= $l_field . ' AS ' . $l_field_alias . ',';\n }\n\n $l_selection = rtrim($l_selection, ',');\n }\n\n $this->m_headers = array_merge_recursive($this->m_headers, $this->m_dynamic_headers);\n\n $l_sql_main = 'SELECT ' . $l_selection . ', main.isys_obj__id AS __objid__ FROM isys_obj AS main ' .\n 'INNER JOIN isys_obj_type ON main.isys_obj__isys_obj_type__id = isys_obj_type__id ' . $l_sql;\n\n $this->m_sql = $l_sql_main;\n }", "public function sql($sql)\n\t{\n\t\t$this->sql = (string) $sql;\n\n\t\treturn $this;\n\t}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function getSQL();", "public function sql () {\n\n return $this->_sql;\n }", "public function query($sql) {\n return $this->data($sql);\n }", "public function getSql() { \n return $this->sql;\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function getQuerySql() {\n $sql = parent::getQuerySql();\n $connection = $this->model->getMeta()->getConnection();\n\n return $this->parseVariablesIntoSql($sql, $connection);\n }", "private function setQuery($sql){\n $this->isStatement = false;\n return $this->sqli->query($sql);\n }", "private function query() {\n return ApplicationSql::query($this->_select, $this->_table, $this->_join, $this->_where, $this->_order, $this->_group, $this->_limit, $this->_offset);\n }", "public function _query()\n {\n }", "function createQuery() ;", "public function query()\n {\n }", "public function query()\n {\n }", "function query() {\n $this->ensure_my_table();\n $value = $this->parse_gis_location();\n $this->query->add_where($this->options['group'], \"$this->table_alias.$this->real_field\", $value, $this->operator);\n }", "abstract function getSQL();", "public function query($sql)\n {\n $sql = $this->table_prefix($sql);\n\n if (self::$config[$this->_db_name]['safe_test'])\n {\n $sql = $this->filter_sql($sql);\n }\n\n $this->_sql = $sql;\n $this->_type = $this->get_type($this->_sql);\n // Save the query for debugging\n\n return $this;\n }", "public function newQuery();", "abstract protected function initQuery(): void;", "function getSQL() {\n\t\treturn $this->sql;\n\t}", "private function createBaseQuery(): string\n {\n // Prefix the table columns with 'entries.'\n $tableColumns = array_map(function ($column) {\n return 'entries.' . $column;\n }, self::TABLE_COLUMNS);\n\n if ($this->listView) {\n // Filter out the properties that are not available to the listview\n $jsonColumns = array_filter($this->properties, function (Collection\\Property $property) {\n return $property->getIncludeInJsonListView();\n });\n }\n\n // Create the select syntax for the json data column\n $jsonColumns = array_map(function (Collection\\Property $property) {\n return $this->jsonUnquote($property->getIdentifier()) . ' AS `' . $property->getIdentifier() . '`';\n }, $jsonColumns ?? $this->properties);\n\n // Merge both of the above\n $columns = array_merge($tableColumns, $jsonColumns);\n\n // Create the select statement\n $select = implode(', ', $columns);\n\n // Create the query\n // We need the entries.data to be able to perform a HAVING query on it, when parsing the entry, the DATA object is removed\n return 'SELECT entries.data, ' . $select . ' FROM collection_entries AS entries WHERE entries.collection_id = :collection_id AND entries.active = 1 ';\n }", "public function __toString()\n {\n return $this->getSQL();\n }", "public function get_sql() {\n return $this->sql;\n }", "public static function query()\n {\n }", "public function setQueryString($sql):self\n {\n $this->querystring=$sql;\n return $this;\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "public function __toString()\n {\n return $this->sql;\n }", "public function __toString()\n {\n return $this->sql;\n }", "public function __toString() {\r\n return $this->to_sql();\r\n }", "public function __toString(): string\n {\n $this->buildQuery();\n return $this->query;\n }", "public function __toString()\n {\n $query = '';\n\n switch ($this->type) {\n case 'insert':\n $query .= (string) $this->insert;\n\n // Set method\n if ($this->set) {\n $query .= (string) $this->set;\n }\n // Columns-Values method\n elseif ($this->values) {\n if ($this->columns) {\n $query .= (string) $this->columns;\n }\n\n $elements = $this->insert->getElements();\n $tableName = array_shift($elements);\n\n $query .= 'VALUES ';\n $query .= (string) $this->values;\n\n if ($this->autoIncrementField) {\n $query = 'SET IDENTITY_INSERT ' . $tableName . ' ON;' . $query . 'SET IDENTITY_INSERT ' . $tableName . ' OFF;';\n }\n\n if ($this->where) {\n $query .= (string) $this->where;\n }\n }\n\n break;\n\n default:\n $query = parent::__toString();\n break;\n }\n\n return $query;\n }", "public function __toString() {\n\t\treturn $this->sql;\n\t}", "public function query($sql = null);", "public static function query($sql);", "protected function set_query($sql) {\n $this->open_link();\n $this->conx->query($sql);\n $this->close_link();\n }", "public function toQuery();", "public function queryBuilder($sql){\n\t $$this->con->query($sql); \n\t \n }", "final protected function getSQL()\n {\n return $this->sql;\n }", "public function setEjecucionQuery($sql) {\n return $this->conexion->query($sql);\n }", "public function getSQL() {\n\t\t$o = $this->obj;\n\t\t$sql = \"SELECT\";\n\t\tif ($this->distinct) {\n\t\t\t$sql .= \" DISTINCT\";\n\t\t}\n\t\t$s = $this->getSelects();\n\t\tif ($s == \"\") {\n\t\t\t$sql .= \" \".$this->getTable().\".*\";\n\t\t} else {\n\t\t\t$sql .= \" \".$s;\n\t\t}\n\t\t$sql .= \" FROM \".$this->getFrom();\n\t\t$sql .= $this->getJoins();\n\t\t$where = $this->getFilters()->getSQL();\n\t\tif ($where != \"\") {\n\t\t\t$sql .= \" WHERE \".$where;\n\t\t}\n\n\n\n\t\tif ($this->group !== false) {\n\t\t\tif ($this->group[1] == false) {\n\t\t\t\t$sql .= \" GROUP BY \".$this->getTable().\".`\".$this->db->escape_string($this->group[0]).\"`\";\n\t\t\t} else {\n\t\t\t\t$sql .= \" GROUP BY \".$this->group[0];\n\t\t\t}\n\t\t}\n\t\t//if ($this->filter) {\n\t\t//\t$sql .= \" WHERE \".$this->filter->getSQL();\n\t\t//}\n\t\tif (count($this->order) > 0) {\n\t\t\tif ($this->order[0][0] === false) {\n\t\t\t\t$sql .= \" ORDER BY RAND()\";\n\t\t\t} elseif (isset($this->order[0][0])) {\n\t\t\t\t$sql .= \" ORDER BY \";\n\t\t\t\tforeach ($this->order as $cols) {\n\t\t\t\t\t$sql .= \"`\".$this->db->escape_string($cols[0]).\"`\";\n\t\t\t\t\tif ($this->orderAsc) {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sql .= \" {$cols[1]} \";\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= \", \";\n\t\t\t\t}\n\t\t\t\t$sql = substr($sql, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\tif ($this->start !== false) {\n\t\t\t$sql .= \" LIMIT {$this->start}\";\n\t\t\tif ($this->end !== false) {\n\t\t\t\t$sql .= \",{$this->end}\";\n\t\t\t}\n\t\t}\n\t\treturn $sql;\n\t}", "abstract public function query();", "public function query();", "public function query();", "public function query();", "public function getSql()\n {\n return $this->sql;\n }", "public function to_sql()\n {\n }", "public function Query() {\n \n }", "public function __toString()\n\t{\n\t\treturn $this->sql;\n\t}", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "public function query ($sql) {\n $this->query = $this->conn->query($sql);\n return $this->query;\n }", "abstract public function query($sql);", "function query($sql, $binds = FALSE)\r\n\t{\r\n\t\t// Get by objects properties\r\n\t\t$query = $this->db->query($sql, $binds);\r\n\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t{\r\n\t\t\t// Populate all with records as objects\r\n\t\t\t$this->all = $this->_to_object($query->result(), $this->model);\r\n\r\n\t\t\t// Populate this object with values from first record\r\n\t\t\tforeach ($query->row() as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$this->{$key} = $value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "function get_sql(){\r\n\r\n\t\treturn $this->get_sql_select().$this->get_sql_where().$this->get_sql_order().$this->get_sql_limit();\r\n\r\n\t}", "public function query($sql) {\n if (!$this->connection) {\n $this->setup();\n }\n return parent::query($sql);\n }", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "function set_query($query) {\n\t\t\t// it just sets the query with which to get a recordset\n\t\t\t$this->query = $query;\n\t\t}", "public function getSQL() {\n return $this->_connection->processQuery($this, true);\n }", "public function sql() {\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/select/query.twig.sql\");\n\t\treturn $sqlT->render([\"query\" => $this]);\n\t}", "public function getSql();", "public function getSql();", "function augmentSQL(SQLQuery &$query) {\r\n\t}", "public function Query(){\r\n\t\treturn self::get_query();\r\n\t}", "public function __toString() {\n\t\treturn $this->query;\n\t}", "function __toString() {\n\t\treturn $this->query;\n\t}", "public function __toString() {\n return $this->query;\n }", "public function getForUpdateSQL();", "public function raw($sql) {\n\t\t$this->query ( $sql );\n\t}", "public abstract function get_query();", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "abstract public function newQuery();", "public function get_sql()\n\t{\n\t\treturn $this->sql;\n\t}", "public function __toString()\n {\n return $this->builder->getSql();\n }" ]
[ "0.6363866", "0.6274358", "0.6263191", "0.6240247", "0.62226695", "0.62226695", "0.6220067", "0.6139802", "0.61305684", "0.6108348", "0.60872155", "0.59692746", "0.5914071", "0.5891316", "0.587089", "0.587089", "0.587089", "0.58699334", "0.58664596", "0.58664167", "0.58497494", "0.584472", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5825004", "0.5820847", "0.5818653", "0.5818653", "0.5818653", "0.5818653", "0.58113015", "0.58081853", "0.5778111", "0.5774137", "0.57723796", "0.57571775", "0.57571775", "0.5756379", "0.5750369", "0.57406336", "0.5729594", "0.5727043", "0.57245713", "0.57151204", "0.5711969", "0.5687441", "0.5667009", "0.5662742", "0.56602484", "0.5650594", "0.5650594", "0.5648016", "0.5643718", "0.564354", "0.5640179", "0.5639481", "0.56324184", "0.5618252", "0.5617368", "0.5616196", "0.5614608", "0.561035", "0.55957806", "0.5593221", "0.5587446", "0.5587446", "0.5587446", "0.5572675", "0.55654687", "0.55608857", "0.5554661", "0.5553515", "0.5533369", "0.55286473", "0.5526606", "0.5523083", "0.55210954", "0.5517232", "0.5514825", "0.5513722", "0.5509819", "0.55037737", "0.55037737", "0.5499478", "0.549727", "0.5494807", "0.5494566", "0.5492349", "0.54916716", "0.5490754", "0.54791975", "0.5475602", "0.547134", "0.5470658", "0.54639477" ]
0.0
-1
const MODEL = "App\AuthController"; use RESTActions;
public function __construct() { $this->middleware('auth:api', ['except' => ['login']]); $this->middleware('role', ['except' => ['login','me']]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetController ();", "public function model(){\n return 'App\\ObjLibrary';\n }", "public function GetControllerAction ();", "function model()\n {\n return \"App\\\\Daira\";\n }", "public function & GetController ();", "public function model()\n {\n return 'App\\User';\n }", "public function GetControllerClass ();", "public function getClassName(){return \"Core.Http.ApiRequest\";}", "public function AController() {\r\n\t}", "public function routeController()\n { }", "public function getController();", "public function getController();", "public function getController();", "public function Auth(){\n }", "public static function routeName() : string\n {\n return str_replace('app_http_actions_', '', snake_case(str_replace('\\\\', '', static::class)));\n }", "public function model(): string\n {\n return User::class;\n }", "public function getController( );", "public function model()\n {\n return 'App\\Models\\User';\n }", "public function model()\n {\n return 'App\\Models\\User';\n }", "public function indexController()\n\t{\n\t\t$auth = new Authentification();\n\t}", "function model()\n {\n return 'App\\User';\n }", "public function get_rest_controller()\n {\n }", "public function get_rest_controller()\n {\n }", "public function model()\n {\n return UserAuth::class;\n }", "public function getControllerAction() {}", "public function model()\n {\n return 'App\\Models\\UserModel';\n }", "public function model()\n {\n return 'App\\Models\\MedicoAcesso';\n }", "public function model(): string\n {\n return Role::class;\n }", "public function model() {\n return 'App\\Models\\Customer';\n }", "function model()\n {\n return 'Modules\\User\\Contracts\\Role';\n }", "function model()\n {\n return 'App\\Convenzione';\n }", "public function actionIndex()\n {\n $contrl = $this->get('c', '');\n $action = $this->get('a','');\n $returnParams = [];\n $token = 0;\n if(!empty($contrl) && !empty($action)){\n $apiReflection = new ApiReflection();\n $classNameTemp = Inflector::id2camel($contrl);\n $ref = new \\ReflectionClass('\\\\api\\\\controllers\\\\' . $classNameTemp.'Controller');\n $parendRef = $ref->getParentClass();\n $methods = $ref->getMethods(\\ReflectionMethod::IS_PUBLIC);\n $parentMethods = $parendRef->getMethods(\\ReflectionMethod::IS_PUBLIC);\n $ownMethods = array_diff($methods, $parentMethods);\n\n if($parendRef->getShortName() == 'AuthApiCommonContoller'){\n $token = 1;\n }\n if (!empty($ownMethods)) {\n foreach ($ownMethods as $own) {\n $parm = [];\n $actionName = $own->getName();\n $apiName = '';\n if (strlen($actionName) > 6) {\n $apiName = substr($actionName, 0, 6);\n }\n\n if ($apiName != 'action') {\n continue;\n }\n\n $actionName = Inflector::camel2id(substr($actionName, 6, strlen($actionName) - 6));\n if($actionName == $action){\n $parm['tags'] = $apiReflection->parseDocCommentTags($own);\n if (empty($parm['tags']['description']) === false && strpos($parm['tags']['description'], 'targetDoc->') !== false) {\n $newDocArr = explode('->', $parm['tags']['description']);\n $apiDocClass = $newDocArr[1] ?? '';\n $apiDocMethod = $newDocArr[2] ?? '';\n\n if (empty($apiDocClass) == false && empty($apiDocMethod) == false) {\n $targetMethod = new \\ReflectionMethod($apiDocClass, $apiDocMethod);\n $parm['tags'] = $apiReflection->parseDocCommentTags($targetMethod);\n }\n\n }\n\n if(!empty($parm['tags']['param'])){\n $parm['tags']['param'] = $apiReflection->formatParams($parm['tags']['param']);\n }\n $apiRootUrl = Yii::$app->params['api_root_url'];\n $returnParams['url'] = $apiRootUrl.$contrl.'/'.$action;\n $returnParams['params'] = $parm['tags']['param']??'';\n $returnParams['actondesc'] = $parm['tags']['description']??'';\n }\n\n }\n }\n }\n\n return $this->render('index', ['apiData' => $returnParams,'token'=>$token]);\n }", "public function model()\n {\n return 'Litepie\\\\User\\\\Models\\\\Permission';\n }", "public function model(): string\n {\n return Permission::class;\n }", "public function model(): string\n {\n return Permission::class;\n }", "protected static function getModelClass()\n {\n return str_replace(\"Controllers\\\\\", \"Model\\\\\", get_called_class());\n }", "public function getResourceKey(): string\n {\n return 'model';\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "function request($controller,$action){\n\t\t$data = ucfirst($controller);\n\t\t$file = '\\\\app\\\\module\\\\'. $data . DS . $data .'Controller';\n\t\trequire_once ROOT.$file.'.php';\n\t\t$c = new $file();\n\t\treturn $c->$action(); \n\t}", "public function getBaseControllerName(): string;", "function model()\n\t{\n\t\treturn \\App\\Models\\User::class;\n\t}", "public function model()\n {\n return 'Modules\\User\\Entities\\Entrust\\EloquentUser';\n }", "function controller($controller = '')\n{\n require_once dirname(__DIR__,1) . \"/controller/\" . $controller . \".php\";\n}", "function userModel() { \n $model = config('auth.model');\n return new $model;\n }", "function auth_namespace()\n{\n return LC_NAMESPACE ? 'AuthUser.' . LC_NAMESPACE : 'AuthUser.default';\n}", "private function getNamespace() : string\n {\n $namespace = '\\\\Controllers\\\\';\n\n if (array_key_exists('namespace', $this->params))\n {\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n\n return $namespace;\n }", "public function model()\n {\n //use model\n }", "protected function model() {\n\t\t$model = Config::get('auth.model');\n\n\t\treturn new $model;\n\t}", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function actions()\n {\n\n// ini_set(\"soap.wsdl_cache_enabled\", \"0\");\n return [\n 'hello' => 'mongosoft\\soapserver\\Action',\n ];\n }", "function controller_autoload($class){\r\n include 'controllers/' . ucfirst ($class). '.php';\r\n //var_dump(ucfirst ($class));\r\n //die();\r\n //echo \"suto load: \". var_dump('controllers/' . ucfirst ($class ) . '.php').\"<br>\";\r\n}", "public function model()\n {\n return 'App\\Models\\Config';\n }", "public function modelName()\r\n {\r\n return AccessToken::class;\r\n }", "public function getNamespace(){\n //base namepace\n $namespace = 'App\\Controllers\\\\';\n //if the namepace is defined\n if(array_key_exists('namespace', $this->params)){\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n return $namespace;\n }", "public function model()\n {\n return \"App\\\\Models\\\\Truemoveh\\\\ProductDeviceInventories\";\n }", "public function controller()\n\t{\n\t\n\t}", "function model($model = '')\n{\n require_once dirname(__DIR__,1) . \"/model/\" . $model . \".php\";\n}", "public function model()\n {\n return Users::class;\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "function __construct()\n {\n parent::__construct();\n\n //Load model con nombre base\n $this->load->model('Crud_model', 'Rest_model');\n }", "protected function getClassName(): string\n {\n return \"AuthServiceProvider\";\n }", "public function model()\n {\n return 'App\\Models\\Term';\n }", "function __autoload($class) {\n $arrPart = explode('\\\\', $class);\n $strClassName = strtolower(end($arrPart));\n require 'model/'. $strClassName. '.php';\n}", "function loadMVC() {\r\n if(!empty($_REQUEST['url'])) {\r\n $urlArray = explode('/', $_REQUEST['url']);\r\n $controller = array_shift($urlArray);\r\n $action = array_shift($urlArray); \r\n }\r\n $url['controller'] = !empty($controller) ? $controller.'Controller' : 'baseController';\r\n $url['action'] = !empty($action) ? $action : 'index';\r\n controllerFactory::createControllerObject($url);\r\n}", "public function model()\n {\n return 'App\\QuickBooks';\n }", "public function init()\n {\n require_once(__DIR__.'/controllers/AbstractAuthorizedApiController.php');\n }", "function apiResource(): string\n {\n return 'payments';\n }", "function api_route($path, $controller) {\n Route::post($path, $controller . '@store');\n Route::delete($path . '/{hash}', $controller . '@destroy');\n Route::get($path . \"/{hash}\", $controller . '@fetch');\n Route::put($path . '/{hash}', $controller . '@update');\n Route::get($path, $controller . '@index');\n}", "function RolesCRUD()\n {\n parent::__construct();\n }", "function __construct()\n {\n parent::__construct();\n\n //Set the table name\n $this->users_div = $this->db->dbprefix('users_devicetoken');\n $this->interactions = $this->db->dbprefix('loyalty_interactions');\n //Set the controller and model\n $this->load->library('REST_Controller');\n//echo \"test\";exit;\n $this->load->model('Common_model');\n\n }", "public function __construct()\n {\n $this->middlewere('api.auth', ['except'=>['index','show']]);\n }", "protected function controllerRootNamespace() {\n return 'App\\Http\\Controllers';\n }", "function __autoload($className) {\n require_once \"../model/\" . $className . '.php';\n}", "function autoloadFunction($class){\r\n\tif(preg_match('/Controller$/',$class))\r\n\t\trequire('controllers/'.$class.'.php');\r\n\telse\r\n\t\trequire('models/'.$class.'.php');\r\n}", "public function __construct($str_controller_namespace = '\\\\')\n {\n $this->str_controller_namespace = $str_controller_namespace;\n }", "abstract public function getControllerAction();", "private function getNamespace()\n\t{\n\t\t$namespace = \"App\\Controllers\\\\\";\n\n\t\tif(array_key_exists(\"namespace\", $this->params))\n\t\t{\n\t\t\t$namespace .= $this->params['namespace'] . \"\\\\\";\n\t\t}\n\n\t\treturn $namespace;\n\t}", "function modelClass(): string\n {\n return Area::class;\n }", "function __construct()\n {\n parent::Controller();\n }", "protected function getApiClass(): string {\n\t\treturn CurrentUser::class;\n\t}", "public function model()\n {\n return 'App\\Log';\n }", "public function indexAction(){\n\n}", "function model()\n {\n return 'App\\Models\\Components\\Hotel';\n }", "private function fullModelName($modelName){\n return \"App\\\\\".$modelName;\n }", "function __construct(){\nparent::__construct();\n // Configure limits on our controller methods\n // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php\n $this->methods['users_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['users_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['users_delete']['limit'] = 50; // 50 requests per hour per user/key\n $this->load->model('M_main', 'M_main');\n}", "function modelClass(): string\n {\n return Category::class;\n }", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "final protected function import($obj) {\n foreach ($obj as $key => $value) {\n $module = $key;\n $controller = $value;\n }\n $filter = ucfirst($controller) . 'Filter';\n $nameController = ucfirst($controller);\n\n $url = ROOT . DEFAULT_APP_FOLDER . DS . strtolower($module) . DS . 'controllers' . DS . $nameController . 'Controller.php';\n $urlFilter = ROOT . DEFAULT_APP_FOLDER . DS . $module . DS . 'filters' . DS . $filter . '.php';\n $urlModel = ROOT . DEFAULT_APP_FOLDER . DS . $module . DS . 'models' . DS . $nameController . 'Model.php';\n $urlAssets = ROOT . DEFAULT_APP_FOLDER . DS . $module . DS . 'assets' . DS;\n\n /* verificar si tiene assets */\n if (file_exists($urlAssets)) {\n $this->_readDirectory($urlAssets);\n }\n\n /* cargando trait filter q contiene validacion de formulario */\n if (is_readable($urlFilter)) {\n require_once ($urlFilter);\n }\n\n /* cargando el modelo */\n if (is_readable($urlModel)) {\n require_once ($urlModel);\n }\n\n if (is_readable($url)) {\n require_once $url;\n $class = '\\\\' . ucfirst($module) . '\\\\Controllers\\\\' . $nameController . 'Controller'; #clase con namespace\n\n Obj()->Vendor->Registry->addClass($nameController . 'Controller', $class);\n\n\n /* el namespace */\n $MMDD = ucfirst($module);\n\n /* se crea objeto por el cual se accedera a sus clases */\n if (!is_callable(Obj()->$MMDD)) {\n eval('\n use Vendor\\Obj;\n Obj()->' . $MMDD . ' = function(){\n return Obj::run(\"' . $MMDD . '\");\n };');\n }\n } else {\n throw new Exception('Error: Controlador <b>' . $url . '</b> no encontrado');\n }\n }", "protected function getNamespace(){\n $namespace = 'App\\Controllers\\\\';\n \n if(array_key_exists('namespace', $this->params)){\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n \n return $namespace;\n }", "public static function exportAuthControllers()\n {\n File::delete(app_path('Http/Controllers/LoginController.php'));\n File::copy(__DIR__.'/stubs/Controllers/Auth/LoginController.stub', app_path('Http/Controllers/Auth/LoginController.php'));\n File::delete(app_path('Http/Controllers/ForgotPasswordController.php'));\n File::copy(__DIR__.'/stubs/Controllers/Auth/ForgotPasswordController.stub', app_path('Http/Controllers/Auth/ForgotPasswordController.php'));\n File::delete(app_path('Http/Controllers/ResetPasswordController.php'));\n File::copy(__DIR__.'/stubs/Controllers/Auth/ResetPasswordController.stub', app_path('Http/Controllers/Auth/ResetPasswordController.php'));\n File::copy(__DIR__.'/stubs/Controllers/DashboardController.stub', app_path('Http/Controllers/DashboardController.php'));\n }", "function loader($class){\n require_once \"routes/cats.php\";\n require_once \"models/CatsModel.php\";\n require_once \"models/Database.php\";\n require_once \"models/Mysqldb.php\";\n require_once \"views/CatsView.php\";\n require_once \"controllers/CatsController.php\";\n\n}", "public function model()\n {\n return \"App\\ContactInfoPhone\";\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "public function getAction(): string;", "public function getAction(): string;", "function autoLoad($class)\n{\n if (preg_match('/Controller$/', $class)) {\n require(\"controllers/\" . $class . \".php\");\n }\n else {\n require(\"models/\" . $class . \".php\");\n }\n}", "public function getControllerName() {}", "public function rutasController()\n\t{\n\t\t//limpiamos la url si se envía valor por el método get o no para redirigir a una dirección\n\t\tif (isset($_GET[\"action\"])) {\n\t\t\t$enlace = $_GET[\"action\"];\n\t\t}else{\n\t\t\t$enlace = \"index\";\n\t\t}\n\n\t\t$respuesta = Rutas::rutasModel($enlace);\n\n\t\tinclude $respuesta;\n\t}", "public function CompleteControllerName ($controllerNamePascalCase);", "function getInstance(){\n\treturn MVC_controller::getInstance();\n}", "public function resource($actions, $resource, $model)\n {\n \n //Create a new Resource.\n $instance = $this->resourceFactory->__invoke($actions, $model);\n \n //Attach the resource to the router.\n $this->router->attach('rest.resource.'.$resource, \"{$this->routePrefix}/$resource\", $instance);\n \n //Return it for further manipulation.\n return $instance;\n \n }" ]
[ "0.6264083", "0.5893159", "0.5828662", "0.5781059", "0.57033443", "0.5676315", "0.56633", "0.5655111", "0.55993986", "0.55960315", "0.55570537", "0.55570537", "0.55570537", "0.55540633", "0.5526499", "0.55241394", "0.5522767", "0.54810494", "0.54810494", "0.5470913", "0.5469917", "0.54676336", "0.54676336", "0.54505515", "0.5436558", "0.5432731", "0.54324937", "0.54294837", "0.54229736", "0.54001045", "0.5397885", "0.5388568", "0.5370186", "0.5354441", "0.5354441", "0.53445894", "0.53366137", "0.53356564", "0.5297794", "0.5257977", "0.52282244", "0.52181625", "0.52160317", "0.52048373", "0.5202094", "0.5193826", "0.5190335", "0.5186776", "0.51851845", "0.5176372", "0.51637584", "0.5162011", "0.5159451", "0.51590586", "0.515126", "0.5147015", "0.513795", "0.51251996", "0.5109376", "0.51047784", "0.5100723", "0.5090862", "0.50904065", "0.50897175", "0.50831884", "0.5081502", "0.5078734", "0.5077738", "0.5076638", "0.50654536", "0.50622535", "0.50619763", "0.50619507", "0.50612", "0.5053996", "0.5051524", "0.5048924", "0.5045499", "0.504447", "0.5044294", "0.5040215", "0.50344044", "0.5034131", "0.5032928", "0.5030787", "0.5029907", "0.5023586", "0.50166714", "0.50163364", "0.501385", "0.5010372", "0.5008001", "0.49991333", "0.49963385", "0.49963385", "0.49959153", "0.49925584", "0.4987862", "0.49811", "0.49788707", "0.49727377" ]
0.0
-1
Get the token array structure.
protected function respondWithToken($token) { JWTAuth::setToken($token); $user = JWTAuth::toUser($token); $userData = UsersController::getUserByEmail($user['email']); if($userData->validation == 0) { return response()->json([ "msg"=>"account not activated" ]); } $userData->token=$token; if($userData->role_id !=3) { $userData->save(); } return response()->json([ 'access_token' => $token, 'token_type' => 'bearer', 'user' => $userData, 'expires_in' => Auth::guard('api')->factory()->getTTL() * 60 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToken()\n {\n return array($this->_token, $this->_token_secret);\n }", "public function getTokens(): array\n {\n return $this->tokens;\n }", "function &get_xoops_token()\n{\n\tif ( class_exists('XoopsMultiTokenHandler') )\n\t{\n\t\t$token =& XoopsMultiTokenHandler::quickCreate( $this->_TOKEN_NAME );\n\t\t$name = $token->getTokenName();\n\t\t$value = $token->getTokenValue();\n\t}\n\telse\n\t{\n\t\t$name = 'token';\n\t\t$value = 0;\n\t}\n\t$arr = array($name, $value);\n\treturn $arr;\n}", "private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }", "public function getTokens();", "public function getToken(): object\n {\n $token = (object) [];\n\n if ($this->accessToken && $this->refreshToken && $this->instanceUrl) {\n $token = (object) [\n 'accessToken' => $this->accessToken,\n 'refreshToken' => $this->refreshToken,\n 'instanceUrl' => $this->instanceUrl,\n 'tokenExpiry' => $this->tokenExpiry\n ];\n }\n\n return $token;\n }", "public function get_tokens()\n\t{\n\t\treturn $this->tokens;\n\t}", "public function getTokens()\n {\n return $this->tokens;\n }", "public function getTokens() {\n\t\treturn array_keys($this->tokens);\n\t}", "private function RequestTokens() {\n return (array)$this->oauth->getRequestToken();\n }", "public static function realTokenToArray($token)\n {\n $class = get_class($token);\n\n $tokenArray = array(\n 'class' => $class,\n\n // 'extraParams' => $token->getExtraParams(),\n );\n\n switch($class)\n {\n case 'League\\OAuth1\\Client\\Credentials\\TokenCredentials':\n $tokenArray['identifier'] = $token->getIdentifier();\n $tokenArray['secret'] = $token->getSecret();\n break;\n\n case 'League\\OAuth2\\Client\\Token\\AccessToken':\n $tokenArray['accessToken'] = $token->getToken();\n $tokenArray['refreshToken'] = $token->getRefreshToken();\n $tokenArray['endOfLife'] = $token->getExpires();\n break;\n }\n\n return $tokenArray;\n }", "public function getToken()\n {\n return current($this->tokens);\n }", "public function token() {\n try {\n $payload = JWTUtils::inst()->byBasicAuth($this->request);\n\n return $this->returnArray($payload);\n } catch (JWTUtilsException $e) {\n return $this->httpError(403, $e->getMessage());\n }\n }", "public function toTokenArray() {\n\t\t$ret = [];\n\n\t\t$ret[] = new Token(\n\t\t\tToken::T_FUNCTION,\n\t\t\t[ 'value' => $this->name, 'position' => [ $this->line, $this->pos ] ]\n\t\t);\n\t\t// Manually looping and appending turns out to be noticably faster than array_merge.\n\t\tforeach ( $this->value->toTokenArray() as $v ) {\n\t\t\t$ret[] = $v;\n\t\t}\n\t\t$ret[] = new Token( Token::T_RIGHT_PAREN );\n\n\t\treturn $ret;\n\t}", "public function getTokens()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('tokens');\n }", "public function getUserTokens();", "public function token()\n {\n return $this->token['token'] ?? null;\n }", "public function token()\n {\n return $this->metadata();\n }", "public function arrayStructure()\n\t{\n\t\treturn array();\n\t}", "public function getTokenObject() {\n\n\t\treturn $this->TokenObject;\n\t}", "protected static function getHeaderToken()\n {\n return [];\n }", "protected static function getHeaderToken()\n {\n return [];\n }", "public function tokensDataProvider(): array\n {\n return [\n 'PHP 7' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NS_SEPARATOR, '\\\\'],\n 2 => [T_STRING, 'Object'],\n 3 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ],\n 'PHP 8' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NAME_FULLY_QUALIFIED, '\\\\Object'],\n 2 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ]\n ];\n }", "public function providerDeviceToken()\n {\n return array(\n array('foo_bar', true),\n array(str_repeat('aq', 32), true),\n array(str_repeat('af', 32), false),\n array(str_repeat('AF', 32), false)\n );\n }", "function &get_token_pair()\n{\n\treturn $this->get_token();\n}", "public function getTokenInfo() {\n\t\t\t$error = [\"error\" => \"invalid_token\"];\n\t\t\tif( !isset($_GET[\"access_token\"]) ) return $error;\n\t\t\t$token = $this->getAccessToken($_GET[\"access_token\"]);\n\t\t\tif( $token === NULL ) return $error;\n\t\t\t$client = $this->getClient($token[\"client_id\"]);\n\t\t\tif( $client === FALSE ) return $error;\n\t\t\treturn [\n\t\t\t\t\"audience\"\t=> $client[\"client_id\"],\n\t\t\t\t\"userid\"\t=> $client[\"user_id\"],\n\t\t\t\t\"scope\"\t\t=> $token[\"scope\"],\n\t\t\t\t\"expires\"\t=> $token[\"expires\"] - time()\n\t\t\t\t\n\t\t\t];\n\t\t}", "public static function getToken()\n {\n return isset(self::$_data[self::KEY_TOKEN]) ? self::$_data[self::KEY_TOKEN] : NULL;\n }", "public function decode(string $token): array;", "function get_token(){\n global $token;\n global $identifier;\n global $array_stream;\n global $key_val;\n global $keywords;\n\n global $c_commentary;\n\n $token_end = True;\n $token_type = tokenType::start;\n init_token();\n\n while($token_end){\n /**\n * @warning end of Array works only for PHP7.3!!!!\n */\n if($key_val === array_key_last($array_stream)){\n $token->last = False;\n if($token->data !== PHP_EOL){\n $token->type = tokenType::EOL;\n $token_end = False;\n }\n }\n /* State automaton for lexical analysis combined with usage of regular expressions */\n switch ($token_type) {\n case tokenType::start:\n {\n if($array_stream[$key_val] === \".\"){ //header dection\n $token_type = tokenType::header;\n break;\n }\n elseif($array_stream[$key_val] === \"@\"){ //at mark detected\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::marker;\n identify_operand();\n preset_label();\n $key_val++;\n $token_end = False;\n break;\n }\n elseif($array_stream[$key_val] === \"#\"){ //start of commentary\n $token_type = tokenType::commentary;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL){ //EOL detected\n $token_type = tokenType::EOL;\n break;\n }\n elseif($array_stream[$key_val] === \"\\t\" || $array_stream[$key_val] === \" \"){ //white spaces before instruction/commentary\n $key_val++;\n preset_identifier();\n }\n elseif(ctype_alpha($array_stream[$key_val]) || ctype_digit($array_stream[$key_val]) || preg_match(\"/^_|\\-|\\$|&|%|\\*|!|\\?$/\", $array_stream[$key_val])){ //var/string/int catch\n $token_type = tokenType::charStream;\n break;\n }\n else {\n fwrite(STDERR, \"ERROR : Input doesn't start with .IPPcode19 header\\n\");\n exit(21);#appropriate exit code\n }\n break;\n }\n case tokenType::header:\n {\n /* Load header in loop, until new line space or commentary right after header */\n while(1){\n if($array_stream[$key_val] === PHP_EOL || preg_match(\"/^[ \\t#]$/\",$array_stream[$key_val]) || $key_val === array_key_last($array_stream)){\n if(preg_match(\"/^.ippcode19$/\", strtolower($token->data))){\n $token->type = tokenType::header;\n $token_end = False;\n break;\n }\n else {\n fwrite(STDERR,\"ERROR : Innapropriate header detected\\n\");\n exit(21);//no ippcode header;\n }\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n /* Creates EOL token */\n case tokenType::EOL:\n {\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::EOL;\n $key_val++;\n preset_identifier();\n preset_label();\n $token_end = False;\n break;\n }\n /* Catches commentary, all character are trimmed until EOL*/\n case tokenType::commentary:\n {\n while($array_stream[$key_val] !== PHP_EOL)\n {\n if($key_val === array_key_last($array_stream)) break;\n $key_val++;\n }\n $c_commentary++;\n $token_type = tokenType::EOL;\n break;\n }\n /* string/int or var stream stored into token */\n case tokenType::charStream:\n {\n while(1){\n if(preg_match(\"/^[ \\t@]$/\",$array_stream[$key_val])){\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL || $array_stream[$key_val] === \"#\"){ //read until newline or commentary start\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($key_val === array_key_last($array_stream)){ //read until EOF and add last character to token\n $token->data .= $array_stream[$key_val];\n $token_type = tokenType::identifyStream;\n break;\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n case tokenType::identifyStream:\n {\n if(preg_match(\"/^[a-zA-Z_\\-\\$&%\\*!?][a-zA-Z_\\-\\$&%\\*!?0-9]*$/\", $token->data)){ //matching the identifier\n $token->type = tokenType::identifier;\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $key + 110;\n if(preg_match(\"/^(bool)|(int)|(string)|(nil)|(gf)|(lf)|(tf)$/\", $token->data)){\n identify_operand();\n }\n break;\n }\n }\n isset_identif();\n $token_end = False;\n break;\n }\n if(preg_match(\"/^[+|-]?[0-9]*$/\", $token->data)){ //matching numbers //^[+|-]?[1-9][0-9]*|[+|-][0]|[0]$\n $token->type = tokenType::number;\n $token_end = False;\n break;\n }\n /* Match for string literal - all unicode numbers and escape sequences */\n elseif(preg_match(\"/^([\\x{0024}-\\x{005B}]|[\\x{0021}\\x{0022}]|[\\x{005D}-\\x{FFFF}]|[ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$/\", $token->data)){ //^([ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$\n $token->type = tokenType::stringStream;\n $token_end = False;\n }\n else {\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n break;\n }\n\n default:\n break;\n }\n }\n }", "public function data()\n {\n return [\n 'token' => $this->token\n ];\n }", "public function getToken() {\n\t\treturn $this->_token;\n\t}", "public static function getTokenData() {\n\n\t\t$tokenData = [];\n\n\t\t$tokenData[SSOData::CLAIM_AUDIENCE] = 'testPlugin';\n\t\t$tokenData[SSOData::CLAIM_EXPIRE_AT] = strtotime('10 minutes');\n\t\t$tokenData[SSOData::CLAIM_NOT_BEFORE] = strtotime('-1 minute');\n\t\t$tokenData[SSOData::CLAIM_ISSUED_AT] = time();\n\t\t$tokenData[SSOData::CLAIM_ISSUER] = 'api.staffbase.com';\n\t\t$tokenData[SSOData::CLAIM_INSTANCE_ID] = '55c79b6ee4b06c6fb19bd1e2';\n\t\t$tokenData[SSOData::CLAIM_INSTANCE_NAME] = 'Our locations';\n\t\t$tokenData[SSOData::CLAIM_USER_ID] = '541954c3e4b08bbdce1a340a';\n\t\t$tokenData[SSOData::CLAIM_USER_EXTERNAL_ID] = 'jdoe';\n\t\t$tokenData[SSOData::CLAIM_USER_FULL_NAME] = 'John Doe';\n\t\t$tokenData[SSOData::CLAIM_USER_FIRST_NAME] = 'John';\n\t\t$tokenData[SSOData::CLAIM_USER_LAST_NAME] = 'Doe';\n\t\t$tokenData[SSOData::CLAIM_USER_ROLE] = 'editor';\n\t\t$tokenData[SSOData::CLAIM_ENTITY_TYPE] = 'user';\n\t\t$tokenData[SSOData::CLAIM_THEME_TEXT_COLOR] = '#00ABAB';\n\t\t$tokenData[SSOData::CLAIM_THEME_BACKGROUND_COLOR] = '#FFAABB';\n\t\t$tokenData[SSOData::CLAIM_USER_LOCALE] = 'en_US';\n\t\t$tokenData[SSOData::CLAIM_USER_TAGS] = ['profile:field1:val', 'profile:field2:val'];\n\n\t\treturn $tokenData;\n\t}", "protected function getContextAsTokenData() {\n $data = array();\n foreach ($this->getContexts() as $context) {\n // @todo Simplify this when token and typed data types are unified in\n // https://drupal.org/node/2163027.\n if (strpos($context->getContextDefinition()->getDataType(), 'entity:') === 0) {\n $token_type = substr($context->getContextDefinition()->getDataType(), 7);\n if ($token_type == 'taxonomy_term') {\n $token_type = 'term';\n }\n $data[$token_type] = $context->getContextValue();\n }\n }\n return $data;\n }", "public function getTokenParsers()\n {\n return array();\n }", "public function getTokenParsers()\n {\n return array();\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function get_token() {\n\t\treturn $this->token;\n\t}", "public function GetArray(): array\n {\n return array('mac' => $this->GetMac(), 'name' => $this->GetName());\n }", "public function getToken() {\n\t\treturn $this->token;\n\t}", "public function getArray() : array {\n\t\treturn $this->input;\n\t}", "public function getToken()\n\t{\n\t\treturn $this->token;\n\t}", "public function getToken ()\n {\n return $this->token;\n }", "public function getToken() {\n\n\t\treturn $this->Token;\n\t}", "public function readToken() {}", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function createTokens()\n {\n\n }", "public function getArray(): array\n {\n return $this->array;\n }", "public function getArray(): array\n {\n return $this->array;\n }", "function exportTokens() {\n\t\treturn $this->tokens;\n\t}", "public function getTokenInfoArray($token)\n {\n // Break the token up at the '_'s\n $tokenParts = explode('_', $token);\n // Pop the ApiConsumer ID off the end of the array\n $id = array_pop($tokenParts);\n // Instantiate the empty starter token string\n $starterToken = '';\n // Put the token back together again without the ApiConsumer ID\n foreach ($tokenParts as $tokenPart) {\n $starterToken .= $tokenPart . '_';\n }\n\n // Return the ApiConsumer ID and the Starter Token in an array\n return ['id' => $id, 'starter_token' => rtrim($starterToken, '_')];\n }", "public function getAuthInfoArray() {}", "public function tokenPayload(string $token)\n {\n return (array) JWT::decode($token, $this->JWTSecret, ['HS256']);\n }", "public function getJwtPayload(): array;", "public function getArray()\n {\n return $this->array;\n }", "public function getAsArray();", "protected function fetchNewToken(): array\n {\n $guzzle = new Client;\n $config = $this->config;\n\n $response = $guzzle->post($config['host'] . '/oauth/token', [\n 'form_params' => [\n 'grant_type' => 'client_credentials',\n 'client_id' => $config['client_id'],\n 'client_secret' => $config['client_secret']\n ]\n ]);\n\n return \\json_decode((string)$response->getBody(), true);\n }", "public function getToken() {\n return \\Firebase\\JWT\\JWT::encode($this->elements, self::$secret);\n }", "public static function get_tokens()\n\t{\n\t\treturn static::$client->get_tokens();\n\t}", "function __invoke()\n {\n $token = new AccessToken($this->tokenSettings);\n return ['token' => $token];\n }", "public function get_access_tokens() {\n\t\t$tokens = get_user_meta($this->user->ID, self::META_TYK_ACCESS_TOKENS_KEY, true);\n\t\tif (!is_array($tokens)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// lambda to add an 'is_valid' attribute to each token\n\t\t$map_is_valid = function ($token) {\n\t\t\treturn array_merge($token, array(\n\t\t\t\t'is_valid' => $this->has_token($token['hash']),\n\t\t\t\t));\n\t\t};\n\n\t\treturn array_map($map_is_valid, $tokens);\n\t}", "public function getToken()\n {\n return self::TOKEN;\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "protected function getStructure(): array\n {\n if (isset($this->structure)) {\n return $this->structure;\n }\n\n return [\n 'foo' => 'foo',\n 'money' => 'money substr:1|float:2',\n 'key' => 'nested.key int',\n 'new_key' => 'no_key default:bar',\n 'package.name' => 'name initials',\n 'baz' => 'Illuminate\\Support\\Str::after:hello',\n 'QUX' => 'qux Illuminate\\Support\\Str::upper',\n 'mid_char' => 'chars sampleCustom',\n ];\n }", "public function getTokenizer() {}", "public function getTokenizer() {}", "public function gameTokens();", "public function data()\n {\n return (empty(\\Session::flash())) ? array('token' => \\Token::getToken()) : array_merge(\\Session::flash(), array('token' => \\Token::getToken()));\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }", "public function getToken()\n {\n $accessToken = null;\n if (file_exists($_SERVER['DOCUMENT_ROOT'].$this->tokenFile)) {\n $accessToken = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile));\n }\n\n return json_decode($accessToken);\n }", "public function getToken()\n {\n return $this->controller->getToken();\n }", "private function parse($input) {\n $tokens= [];\n foreach (new Tokens(new StringTokenizer($input)) as $type => $value) {\n $tokens[]= [$type, $value];\n }\n return $tokens;\n }", "function getTokenFull() {\n\t\t\treturn $this->tokenFull;\n\t\t}", "function getArray(){\n\t\t\t\t\t$fieldArray = array('username'=> $this->_username, 'password'=>$this->_password);\n\t\t\t\t\treturn $fieldArray;\n\t\t\t\t}", "public function token($type , $value, $line)\n {\n return array($type , $value, $line);\n }", "public function getComponentToken()\n {\n $url = $this->weconnectDomain . '/sa/componentToken';\n $resultJson = Yii::$app->curl->get($url);\n LogUtil::info(['url' => $url, 'response' => $resultJson], 'channel');\n $result = json_decode($resultJson, true);\n\n if ($result && isset($result['code']) && 200 == $result['code'] && isset($result['data']) && $result['data']['componentToken']['expireDateTime'] > time()) {\n return [\n 'componentAppId' => $result['data']['componentAppId'],\n 'componentToken' => $result['data']['componentToken']['token']\n ];\n } else {\n throw new ApiDataException('GET ' . $url, $resultJson);\n }\n }", "public function getArray() {\n \treturn array(\n \t\t\t'id' => $this->id,\n \t\t\t'name' => $this->name,\n \t\t\t'path' => $this->path,\n \t\t\t'description' => $this->description,\n \t\t\t'version' => $this->version,\n \t\t\t'groups' => $this->groups,\n \t\t\t'enabled' => $this->enabled\n \t);\n }", "public function asArray()\n\t{\n\t\t$fields = [\n\t\t\t'@type' => $this->type(),\n\t\t\t'@key' => $this->key()\n\t\t];\n\n\t\tforeach ($this->fields as $name => $field)\n\t\t{\n\t\t\t$fields[$name] = $field->value;\n\t\t}\n\n\t\treturn $fields;\n\t}", "function getAllTokens($sql){\n $txt = \"\";\n $rez = vrati_podatke($sql);\n $tokens=array();\n if ($rez->num_rows > 0) {\n while ($row = $rez->fetch_assoc()) {\n array_push($tokens, $row[\"token\"]);\n }\n } \n return $tokens;\n}", "public function to_array() /*array*/\n {\n return $_SESSION[self::KEY];\n }" ]
[ "0.71393645", "0.71245617", "0.71064186", "0.7023479", "0.69822", "0.65953726", "0.6563174", "0.654563", "0.64619535", "0.64316744", "0.63753426", "0.6335638", "0.6307287", "0.6257231", "0.6188339", "0.6175191", "0.6066591", "0.60613745", "0.604052", "0.6028691", "0.60033476", "0.60033476", "0.59666926", "0.5965913", "0.5940376", "0.59267956", "0.59142405", "0.590957", "0.5906342", "0.588581", "0.5868592", "0.58580196", "0.58567274", "0.5851598", "0.5851598", "0.5837172", "0.5837172", "0.58211714", "0.5815675", "0.581526", "0.58111364", "0.58030295", "0.57976973", "0.5797022", "0.5792387", "0.5790338", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.5782915", "0.576918", "0.57677084", "0.5755441", "0.5755441", "0.5752143", "0.57451475", "0.5741118", "0.572673", "0.5687677", "0.56840765", "0.56836027", "0.5676895", "0.56653225", "0.56571347", "0.564951", "0.56457055", "0.5645524", "0.5645052", "0.5634442", "0.56255674", "0.56255674", "0.5613941", "0.55919665", "0.55886644", "0.55886644", "0.55886644", "0.55886644", "0.5586096", "0.5584874", "0.55840135", "0.55835223", "0.55659753", "0.55620223", "0.55535984", "0.55469567", "0.5508913", "0.55023634", "0.54994607", "0.54665536" ]
0.0
-1
Display a listing of the resource.
public function index() { // $data= DB::table('users')->join('req_maintenances','req_maintenances.user_id','users.id')->where('req_maintenances.user_id')->get(); return view('handlerequest.index')->with('handlereq', ReqMaintenance::all())->with('handlereq1', User::all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Handelrequest $handelrequest) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Handelrequest $handelrequest) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Invalidates the cache key on edit_comment and wp_insert_comment. If a list of post IDs is provided, the invalidation will only happen if the edited/created comments belongs to one of the given posts.
public function expires_on_comment_save( $post_ids = array() ) { $invalidation = new \Cache\Invalidation\Hook( $this ); $callback = null; if ( ! empty( $post_ids ) ) { $callback = new SerializableClosure( function ( $id ) use ( $post_ids ) { $comment = get_comment( $id ); return in_array( $comment->comment_post_ID, $post_ids ); } ); } $invalidation->on_hook_with_callable( 'edit_comment', $callback ); $invalidation->on_hook_with_callable( 'wp_insert_comment', $callback ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean_comment_cache($ids)\n {\n }", "function _prime_comment_caches($comment_ids, $update_meta_cache = \\true)\n {\n }", "function update_postmeta_cache($post_ids)\n {\n }", "function _prime_post_caches($ids, $update_term_cache = \\true, $update_meta_cache = \\true)\n {\n }", "public function updating(Post $post)\n {\n //---------we kill cache route post.show whene updating post-------------\n\n Cache::forget(\"show-post-{$post->id}\");\n cache::forget(\"comment-show-{$post->id}\");\n }", "function update_post_cache(&$posts)\n {\n }", "function update_comment_cache($comments, $update_meta_cache = \\true)\n {\n }", "function update_post_author_caches($posts)\n {\n }", "public static function action_clean_post_cache( $post_id ) {\n\t\t$type = get_post_type( $post_id );\n\t\t// Ignore revisions, which aren't ever displayed on the site.\n\t\tif ( $type && 'revision' === $type ) {\n\t\t\treturn;\n\t\t}\n\t\tpantheon_wp_clear_edge_keys( array( 'post-' . $post_id, 'rest-post-' . $post_id ) );\n\t}", "function clean_post_cache($post)\n {\n }", "function update_post_caches(&$posts, $post_type = 'post', $update_term_cache = \\true, $update_meta_cache = \\true)\n {\n }", "public function delete_oembed_caches($post_id)\n {\n }", "function tiny_cache_actions() {\n\n // Post ID is received.\n add_action( 'save_post', 'tiny_cache_delete_the_content', 0 );\n add_action( 'edit_post', 'tiny_cache_delete_the_content', 0 );\n add_action( 'delete_post', 'tiny_cache_delete_the_content', 0 );\n add_action( 'wp_trash_post', 'tiny_cache_delete_the_content', 0 );\n add_action( 'clean_post_cache', 'tiny_cache_delete_the_content', 0 );\n // Post as third argument.\n add_action( 'transition_post_status', 'tiny_cache_post_transition', 10, 3 );\n}", "public function clear_cache($entry_ids)\n\t{\n\t\tif ( ! is_array($entry_ids))\n\t\t{\n\t\t\t$entry_ids = array($entry_ids);\n\t\t}\n\t\t\n\t\tforeach ($entry_ids as $entry_id)\n\t\t{\n\t\t\tunset($this->entries[$entry_id]);\n\t\t}\n\t}", "public function optimize() {\n\t\t$clean = \"DELETE FROM `\" . $this->wpdb->commentmeta . \"` WHERE comment_id NOT IN (SELECT comment_id FROM `\" . $this->wpdb->comments . \"`)\";\n\n\t\t// if posted ids in params, then remove only selected items. used by preview widget.\n\t\tif (isset($this->data['ids'])) {\n\t\t\t$clean .= ' AND meta_id in ('.join(',', $this->data['ids']).')';\n\t\t}\n\n\t\t$clean .= \";\";\n\n\t\t$commentstrash_meta = $this->query($clean);\n\t\t$this->processed_trash_count += $commentstrash_meta;\n\n\t\t$clean = \"DELETE FROM `\" . $this->wpdb->commentmeta . \"` WHERE meta_key LIKE '%akismet%'\";\n\n\t\t// if posted ids in params, then remove only selected items. used by preview widget.\n\t\tif (isset($this->data['ids'])) {\n\t\t\t$clean .= ' AND meta_id in ('.join(',', $this->data['ids']).')';\n\t\t}\n\n\t\t$clean .= \";\";\n\n\t\t$commentstrash_meta2 = $this->query($clean);\n\t\t$this->processed_akismet_count += $commentstrash_meta2;\n\t}", "public function expire_posts() {\n\n\t\t$expire_urls = array_unique($this->expire_urls);\n\n\t\tforeach($expire_urls as $url) {\n\n\t\t\t$this->expire($url);\n\t\t}\n \n\t\tif (!empty($expire_urls)) {\n \n\t\t\t// Clear the homepage too to take in to account updated posts\n\t\t\t$this->expire(home_url());\n\n\t\t\t// If content has changed we should really update /sitemap.xml to keep the search engines happy\n\t\t\t$this->expire(site_url() . '/sitemap.xml');\n\n\t\t} \n\n\t}", "private function update_atozsites_comment(WP_Post $post)\n {\n $comment_count = wp_count_comments($post->ID);\n\n if (!is_object($comment_count) || $comment_count->approved < 3) {\n return;\n }\n\n $atozsites_comment = array_reduce(get_comments(array('post_id' => $post->ID)), array($this, 'compare_comments'));\n \n /**\n\t\t * Filter: atozsites_allow_post_author\n\t\t *\n\t\t * Whether to allow post author comments to be atozsites.\n\t\t *\n\t\t * @since 1.1.6\n\t\t *\n\t\t * @param bool false if not, true if yes\n\t\t */\n $allow_post_author = apply_filters( 'atozsites_allow_post_author', false );\n if ( $post->post_author === $atozsites_comment->user_id && ! $allow_post_author ) {\n\t return;\n }\n\n if ($atozsites_comment instanceof WP_Comment) {\n update_post_meta($post->ID, $this->atozsites_comment_id_meta_key, $atozsites_comment->comment_ID);\n }\n }", "function tiny_cache_delete_the_content( $post_id ) {\n\n wp_cache_delete( $post_id, 'the_content' );\n}", "public function except(...$post_ids): Collection;", "function update_post_parent_caches($posts)\n {\n }", "public function handle_deletion_cache( $post_id ) {\n\t\tif ( get_post_status( $post_id ) !== 'publish' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$cache_trigger_url = get_permalink( $post_id );\n\t\tself::$status_before = 'publish';\n\t\tself::$status_after = 'delete';\n\t\tself::$suppress_notification = true;\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tself::purge_cloudflare_cache();\n\t}", "static function del($postID, $callback = false)\n\t{\n\t\t$crons = get_option('delibera-cron', array());\n\t\tif(!is_array($crons)) $crons = array();\n\t\n\t\tif( is_array($callback) )\n\t\t{\n\t\t\t$callback = $callback[0].'_'.$callback[1];\n\t\t}\n\t\n\t\t$crons_new = array();\n\t\tforeach($crons as $cron_data => $cron_value)\n\t\t{\n\t\t\t$new_cron = array();\n\t\t\tforeach ($cron_value as $call)\n\t\t\t{\n\t\t\t\t$cron_callback = $call['call_back'];\n\t\t\t\tif( is_array($call['call_back']) )\n\t\t\t\t{\n\t\t\t\t\t$cron_callback = $call['call_back'][0].'_'.$call['call_back'][1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(array_key_exists('post_id', $call['args'])) $call['args']['post_ID'] = $call['args']['post_id'];\n\t\t\t\t\n\t\t\t\tif($call['args']['post_ID'] != $postID || ($callback !== false && $callback != $cron_callback ))\n\t\t\t\t{\n\t\t\t\t\t$new_cron[] = $call;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(count($new_cron) > 0)\n\t\t\t{\n\t\t\t\t$crons_new[$cron_data] = $new_cron;\n\t\t\t}\n\t\t}\n\t\n\t\tksort($crons_new);\n\t\tupdate_option('delibera-cron', $crons_new);\n\t}", "public function updated(Comment $comment)\n {\n Cache::forget('latest-posts');\n Cache::forget('paginated-posts');\n Cache::forget('comments_verified');\n Cache::forget('comments_not_verified');\n Cache::forget('comment_'.$comment->id);\n Cache::forget('top-posts');\n }", "function challenge_check($comment_id)\n{\n global $wpdb, $user_ID, $comment_count_cache;\n \n if ($user_ID) {\n return;\n }\n \n $hash = $_POST['challenge_hash'];\n $challenge = md5($_POST['challenge']);\n $post_id = $_POST['comment_post_ID'];\n \n if ($hash != $challenge) {\n $wpdb->query(\"DELETE FROM {$wpdb->comments} WHERE comment_ID = {$comment_id}\");\n $count = $wpdb->get_var(\"select count(*) from $wpdb->comments where comment_post_id = {$post_id} and comment_approved = '1'\"); \n $wpdb->query(\"update $wpdb->posts set comment_count = {$count} where ID = {$post_id}\");\n wp_die(__('Desculpe, mas a conta não está correta.'));\n }\n}", "function clear_global_post_cache($post_id)\n {\n }", "public static function action_clean_comment_cache( $comment_id ) {\n\t\tpantheon_wp_clear_edge_keys( array( 'rest-comment-' . $comment_id ) );\n\t}", "function get_the_image_delete_cache_by_post( $post_id ) {\n\twp_cache_delete( $post_id, 'get_the_image' );\n}", "function _close_comments_for_old_posts($posts, $query)\n {\n }", "function _prime_site_caches($ids, $update_meta_cache = \\true)\n {\n }", "function _prime_site_caches( $ids ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $ids, 'sites' );\n\tif ( ! empty( $non_cached_ids ) ) {\n\t\t$fresh_sites = $wpdb->get_results( sprintf( \"SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)\", join( \",\", array_map( 'intval', $non_cached_ids ) ) ) );\n\n\t\tupdate_site_cache( $fresh_sites );\n\t}\n}", "function bulk_edit_posts($post_data = \\null)\n {\n }", "public function invalidComments(int $id_post):array\n {\n $req=$this->pdo->prepare(\n 'SELECT comment_id,commented,commented_by,content,validated,post_id\n FROM comments \n WHERE comments.validated IS NULL AND comments.post_id=?'\n );\n $req->execute([$id_post]);\n $comments = $req->fetchAll(\\PDO::FETCH_OBJ);\n \n return $comments;\n }", "public function edit(Post $posts)\n {\n //\n }", "public static function invalidateCacheOnRejudge(Runs $run) {\n\t\t\t\t\t\t\n\t\ttry {\n\t\t\t$contest = ContestsDAO::getByPK($run->getContestId());\n\t\t\t\n\t\t\t// If the run belongs to a contest, we need to invalidate that scoreboard\n\t\t\tif (!is_null($contest)) {\n\t\t\t\tself::InvalidateScoreboardCache($contest->getContestId());\n\t\t\t}\n\t\t\t\n\t\t\t// Now we need to invalidate problem stats\n\t\t\t$problem = ProblemsDAO::getByPK($run->getProblemId());\n\t\t\t\n\t\t\tif (!is_null($problem)) {\n\t\t\t\t// Invalidar cache stats\n\t\t\t\t$problemStatsCache = new Cache(Cache::PROBLEM_STATS, $problem->getAlias());\n\t\t\t\t$problemStatsCache->delete();\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t// We did our best effort to invalidate the cache...\n\t\t\tLogger::warn(\"Failed to invalidate cache on Rejudge, skipping: \");\n\t\t\tLogger::warn($e);\t\t\t\n\t\t}\n\t}", "function editCommentsPost($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n $commentManager = new CommentManager();\n $listCommentsForPost = $commentManager->getListCommentsForPost($id);\n\n require'../app/Views/backViews/comment/backEditCommentsPostView.php';\n }", "function wp_untrash_post_comments($post = \\null)\n {\n }", "public function deleteComments(int $idPost):void\n {\n $req=$this->pdo->prepare('DELETE FROM comments WHERE post_id=?');\n $req->execute([$idPost]);\n }", "public function handle_comment_cache_edit( $comment_id, $data ) {\n\t\tself::$clearing_comment_cache = true;\n\t\tself::$suppress_notification = true;\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tif ( ! $data['comment_approved'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$post_id = $data['comment_post_ID'];\n\t\tif ( ! $post_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$cache_trigger_url = get_permalink( $post_id );\n\t\tself::$status_before = 'approved';\n\t\tself::$status_after = ( $data['comment_approved'] ? $data['comment_approved'] : 'pending' );\n\n\t\tself::purge_cloudflare_cache( array( get_permalink( $post_id ) ) );\n\t}", "function clean_network_cache($ids)\n {\n }", "public function update(Request $request, $post_id)\n {\n if (!Auth::check()) {\n return redirect('login');\n }\n //TODO: IF NOT AUTHOR\n\n Validator::extend('minTags', function($attribute, $value, $parameters) {\n $min = (int) $parameters[0];\n return count($value) >= $min;\n });\n\n Validator::extend('maxTags', function($attribute, $value, $parameters) {\n $max = (int) $parameters[0];\n return count($value) <= $max;\n });\n\n Validator::extend('noDups', function($attribute, $value, $parameters) {\n return count($value) === count(array_flip($value));\n });\n\n //checkar se tem autorizaçao\n $validator = Validator::make($request->all(),\n [\n 'title' => ['required', 'string', 'max:120'],\n 'thumbnail' => ['image', 'mimes:jpeg,jpg,png,gif'],\n 'content' => ['required', 'string', 'max:5000'],\n 'is_spoiler' => ['boolean'],\n 'type' => ['required', 'string'],\n 'category' => ['required', 'string'],\n 'user_id' => ['required', 'int'],\n 'photos' => ['array'],\n 'tags' => ['array', \"minTags:2\", \"maxTags:10\", \"noDups\"],\n ]);\n if ($validator->fails()) {\n return redirect(url()->previous())->withErrors($validator)->withInput();\n }\n\n DB::beginTransaction();\n try{\n\n $post = Post::find($post_id);\n if($post != null){\n $post->title = $request->input('title');\n\n if($request->file('thumbnail') != null){\n Storage::delete('public/images/posts/'. $post->thumbnail);\n $imageName = $request->file('thumbnail')->store('public/images/posts');\n $imageName = basename($imageName, \"\");\n if(Post::where('id', $post->id)->update(['thumbnail' => $imageName]) != 1){\n return response('Photo update error', 500);\n }\n }\n\n $post->content = $request->input('content');\n $post->is_spoiler = $request->input('is_spoiler');\n $post->type = $request->input('type');\n $post->category = $request->input('category');\n $post->user_id = Auth::user()->id;\n $post->save();\n }\n else{\n return redirect('addpost');\n }\n\n $oldTags = DB::table('tag')->join('post_tag', 'tag.id', '=', 'post_tag.tag_id')->where('post_tag.post_id', '=', $post->id)->get();\n foreach($oldTags as $oldTag){\n $t = DB::table('tag')->where('name', '=', $oldTag->name)->first();\n DB::table('post_tag')->where('post_id', '=', $post->id)->where('tag_id', '=', $t->id)->delete();\n }\n\n foreach($request->input('tags') as $tag){\n if(DB::table('tag')->select('id')->where('name', '=', $tag)->exists()){\n $t = DB::table('tag')->where('name', '=', $tag)->first();\n DB::table('post_tag')->insert(['post_id' => $post->id, 'tag_id' => $t->id]);\n }\n else{\n $new_tag = new Tag();\n $new_tag->name = $tag;\n $new_tag->save();\n DB::table('post_tag')->insert(['post_id' => $post->id, 'tag_id' => $new_tag->id]);\n }\n }\n\n DB::commit();\n\n // return redirect()->action([PostController::class, 'show'],['id'=>$post_id]);\n return redirect('post/'.$post->id);\n\n } catch(QueryException $err){\n DB::rollBack();\n return abort(404, \"Failed to commit transaction\");\n }\n\n }", "public function delete_oembed_caches( $post_ID ) {\n\t\t$post_metas = get_post_custom_keys( $post_ID );\n\t\tif ( empty($post_metas) )\n\t\t\treturn;\n\n\t\tforeach ( $post_metas as $post_meta_key ) {\n\t\t\tif ( '_oembed_' == substr( $post_meta_key, 0, 8 ) )\n\t\t\t\tdelete_post_meta( $post_ID, $post_meta_key );\n\t\t}\n\t}", "public function ceaseDiscs(array $ids = array())\n {\n $ceasedDate = $this->getServiceLocator()->get('Helper\\Date')->getDate(\\DateTime::W3C);\n $data = [];\n\n foreach ($ids as $id) {\n $data[] = [\n 'id' => $id,\n 'ceasedDate' => $ceasedDate,\n '_OPTIONS_' => ['force' => true]\n ];\n }\n\n $this->multiUpdate($data);\n }", "public function edit(Posts $posts)\n {\n //\n }", "function clean_network_cache( $ids ) {\n\tglobal $_wp_suspend_cache_invalidation;\n\n\tif ( ! empty( $_wp_suspend_cache_invalidation ) ) {\n\t\treturn;\n\t}\n\n\tforeach ( (array) $ids as $id ) {\n\t\twp_cache_delete( $id, 'networks' );\n\n\t\t/**\n\t\t * Fires immediately after a network has been removed from the object cache.\n\t\t *\n\t\t * @since 4.6.0\n\t\t *\n\t\t * @param int $id Network ID.\n\t\t */\n\t\tdo_action( 'clean_network_cache', $id );\n\t}\n\n\twp_cache_set( 'last_changed', microtime(), 'networks' );\n}", "public function resetCache(array $ids = NULL) {\n // TODO: Implement resetCache() method.\n }", "function del_comments(){\n\nglobal $db,$log;\n$id = $_POST['selecionar'];\n$ids = implode(',',$id);\nif ($id != null) {\n$showids = $ids ;\n}else {\nshow_error(HACKING_ATTEMPT);\n}\n\n$result = $db->sql_query(\"DELETE FROM \". COMMENTS_TABLE .\" WHERE tid IN ($ids)\");\n$result = $db->sql_query(\"UPDATE \".STORY_TABLE.\" SET comments=comments-1 WHERE sid IN ($ids)\");\nif ($result) {\n$log->lwrite('admin',''. _ADMIN .\":\". LOG_MULTI_DELETE_COMMENTS.'');\n header(\"Location: \".$_SERVER['HTTP_REFERER'].\" \"); \n}else {\nshow_error(SQL_ERROR .\"<br>\".mysql_error());\n}\n}", "protected function removeExpiredCacheEntries() {}", "function wp_trash_post_comments($post = \\null)\n {\n }", "function dsq_add_request_post_ids($posts) {\n\tdsq_add_query_posts($posts);\n\tremove_action('the_posts', 'dsq_log_request_post_ids', 999);\n\treturn $posts;\n}", "function deleteComment($commentId, $postId)\r\n{\r\n $commentManager = new Writer\\Blog\\Model\\CommentManager();\r\n $postManager = new Writer\\Blog\\Model\\PostManager();\r\n $blogManager = new Writer\\Blog\\Model\\BlogManager;\r\n \r\n $affectedLines = $commentManager->deleteComment($commentId);\r\n $post = $postManager->getPost($postId);\r\n $comments = $commentManager->getCommentsByStatus($postId);\r\n $descBlog = $blogManager->getBlog();\r\n $counter = $commentManager->matchComments($postId);\r\n \r\n if ($affectedLines === FALSE) {\r\n throw new Exception('Imposible de mettre à jour le commentaire');\r\n }\r\n else {\r\n session_start();\r\n require('view/backend/postView.php');\r\n }\r\n}", "public static function remove_edit_lock(int $post_id)\n {\n }", "private function comment_edit_submit( ) {\n\n if ( ! ( in('post_ID') || in('comment_ID') || in('comment_parent') ) ) ferror(-500481, \"None of post_ID, comment_ID, comment_parent has provided.\");\n $comment_ID = in( 'comment_ID' );\n $update = $comment_ID ? true : false;\n \n \n if ( $update ) {\n $comment = get_comment( $comment_ID );\n $post_ID = $comment->comment_post_ID;\n }\n else {\n $post_ID = in('post_ID');\n if ( empty( $post_ID ) ) {\n $comment = get_comment(in('comment_parent'));\n $post_ID = $comment->comment_post_ID;\n }\n }\n forum()->setCategoryByPostID($post_ID);\n\n\n\n //\n if ( $update ) { // update\n $this->endIfNotMyComment( $comment_ID );\n remove_filter( 'pre_comment_content', 'wp_filter_kses' );\n $re = wp_update_comment([\n 'comment_ID' => $comment_ID,\n 'comment_content' => in('comment_content')\n ]);\n add_filter( 'pre_comment_content', 'wp_filter_kses' );\n\n if ( ! $re ) {\n // error or content has not changed.\n }\n }\n else { // new\n $user_ID = $this->get_post_author();\n $user = get_user_by( 'id', $user_ID );\n $comment_ID = wp_insert_comment([\n 'comment_post_ID' => $post_ID,\n 'comment_parent' => in('comment_parent'),\n 'comment_author' => $user->user_login,\n 'user_id' => $user_ID,\n 'comment_content' => in('comment_content'),\n 'comment_approved' => 1,\n ]);\n if ( ! $comment_ID ) {\n $this->errorResponse(-50302, \"Comment was not created\");\n }\n }\n\n //$this->updateFileWithPost( FORUM_COMMENT_POST_NUMBER + $comment_ID );\n\n // $url = get_permalink( $post_ID ) . '#comment-' . $comment_ID ; // this is not used.\n\n //\n $files = in('files');\n if ( $files ) {\n $arr = explode('| |', $files);\n $files = array_filter( $arr );\n comment()->meta( $comment_ID, 'files', $files );\n }\n\n\n\n // Save All extra input into post meta.\n comment()->saveAllMeta( $comment_ID );\n\n\n $o = [ 'post_ID' => $post_ID, 'comment_ID' => $comment_ID ];\n // if ( in('response') == 'ajax' ) $o['comment'] = comment()->get_comment_with_meta( $comment_ID );\n $this->response( $o );\n }", "function fbComments_cacheAllCommentCounts() {\n\tglobal $fbc_options;\n\tfbComments_log('In ' . __FUNCTION__ . '()');\n\n\t$fb = fbComments_getFbApi();\n\t$posts = get_posts(array('numberposts' => -1)); // Retrieve all posts\n\n\tif ($posts) {\n\t\tfbComments_log(sprintf(' Looping through %d posts', count($posts)));\n\t\tforeach ($posts as $post) {\n\t\t\t$xid = $fbc_options['xid'] . \"_post{$post->ID}\";\n\t\t\t$query = array(\n\t\t\t\t'method' => 'fql.query',\n\t\t\t\t'query'\t => 'SELECT count FROM comments_info WHERE app_id=\"' . $fb->getAppId() . '\" AND xid=\"' . $xid . '\"'\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tfbComments_log(\" Retrieving Facebook comment count for post with xid=$xid\");\n\t\t\t\t$result = $fb->api($query);\n\n\t\t\t\tif ($result) {\n\t\t\t\t\tupdate_option(\"fbComments_commentCount_$xid\", $result[0]['count']);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tfbComments_log(\" FAILED to retrieve Facebook comment count for post with xid=$xid error: $e\");\n\t\t\t}\n\t\t}\n\t}\n}", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('commentaire_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Commentaire::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function cache_oembed($post_id)\n {\n }", "function undelete_check($post_ids, $topic_ids)\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif ($post_ids !== false && sizeof($post_ids))\r\n\t\t{\r\n\t\t\tforeach ($post_ids as $id)\r\n\t\t\t{\r\n\t\t\t\tif ($auth->acl_get('m_harddelete', $this->post_data[$id]['forum_id']) || $auth->acl_get('m_delete', $this->post_data[$id]['forum_id']) || ($auth->acl_get('f_delete', $this->post_data[$id]['forum_id']) && $this->post_data[$id]['post_deleted'] == $user->data['user_id']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->undelete['p'][] = $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($topic_ids !== false && sizeof($topic_ids))\r\n\t\t{\r\n\t\t\tforeach ($topic_ids as $id)\r\n\t\t\t{\r\n\t\t\t\tif ($auth->acl_get('m_harddelete', $this->topic_data[$id]['forum_id']) || $auth->acl_get('m_delete', $this->topic_data[$id]['forum_id']) || ($auth->acl_get('f_delete', $this->topic_data[$id]['forum_id']) && $this->topic_data[$id]['topic_deleted'] == $user->data['user_id']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->soft_delete['t'][] = $id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function invalidateCache() {\n\t\t// Update the user touched timestamp for the local user\n\t\t$this->mUser->invalidateCache();\n\n\t\tglobal $wgEchoCrossWikiNotifications;\n\t\tif ( $wgEchoCrossWikiNotifications ) {\n\t\t\t// Update the global touched timestamp\n\t\t\t$key = $this->getGlobalMemcKey( 'echo-notification-updated' );\n\t\t\tif ( $key ) {\n\t\t\t\tObjectCache::getMainWANInstance()->touchCheckKey( $key );\n\t\t\t}\n\t\t}\n\t}", "public function do_batch() {\n\t\t$post_ids = array_map( 'intval', $this->get_post_ids() );\n\t\tforeach( $post_ids as $post_to_delete ) {\n\t\t\tadd_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t\twp_delete_post( $post_to_delete, true );\n\t\t\tremove_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t}\n\n\t\t$this->deleted_posts = count( $post_ids );\n\t}", "function user_can_edit_post_comments($user_id, $post_id, $blog_id = 1)\n {\n }", "public function deleting(Post $post)\n {\n $post->posts->each(function ($p) {\n $p->update(['post_id' => null]);\n });\n\n $post->post_type_item_restrictions->each(function ($p) {\n $p->delete();\n });\n\n $post->post_items->each(function ($p) {\n $p->delete();\n });\n\n $post->trans->each(function ($p) {\n $p->delete();\n });\n }", "public function getCacheRelatedPosts($ids = \"\", DataExchange $dataExchange)\n {\n $cacheService = $this->getCacheProvider(Constants::SERVER_CACHE_ARTICLE);\n $keyRelatedPosts = sprintf(Constants::CACHE_RELATED_POSTS, $ids);\n if (($postExchange = $cacheService->get($keyRelatedPosts)) === false) {\n $em = $this->getDoctrine();\n $post = $em->getRepository(PostPublishes::class)->getRelatedPosts($ids);\n $postExchange = $dataExchange->exchangeRelatedArticles($post, 0);\n $cacheService->set($keyRelatedPosts, $postExchange, $this->getParameter('cache_time')['hour']);\n }\n\n return $postExchange;\n }", "function modifyPost($post){\n \tif($method !== 'INSERT' && $method !== 'UPDATE'){\n \t\t$this->_last_error = 'Unknown method stipulated for modifyPost';\n \t\treturn false;\n \t}\n \t$rval = false;\n $now = strtotime(gmdate(\"M d Y H:i:s\"));\n $sections = ':';\n if(isset($post['frm_sections']) && count($post['frm_sections'])>0) {\n $sections = ':'.implode(\":\", $post['frm_sections']).':';\n }\n $rs['title'] = $post['frm_post_title'];\n $rs['body'] = $post['frm_post_body'];\n if($method !== 'UPDATE'){\n\t $rs['posttime'] = (isset($post['posttime'])) ? $post['posttime'] : $now;\n }\n $rs['modifytime'] = (isset($post['modifytime'])) ? $post['modifytime'] : $now;\n $rs['status'] = $post['frm_post_status'];\n $rs['modifier'] = $post['frm_modifier'];\n $rs['sections'] = $sections;\n $rs['ownerid'] = (isset($post['ownerid'])) ? intval($post['ownerid']) : $_SESSION['user_id'];\n $rs['hidefromhome'] = (isset($post['frm_post_hidefromhome']) && $post['frm_post_hidefromhome'] == 1) ? 1: 0;\n $rs['allowcomments'] = (isset($post['frm_post_allowcomments']) && $post['frm_post_allowcomments'] == ('allow' or 'disallow' or 'timed')) ? $post['frm_post_allowcomments'] : 'disallow';\n # TODO this needs refactored as everytime the post is edited, the disable date will auto-change (unintended). Make it use a definite date\n if(isset($post['disallowcommentsdays']) && in_array($post['disallowcommentsdays'], array(7, 14, 30, 90))){\n \t$inc = $post['disallowcommentsdays'];\n \t$rs['autodisabledate'] = strtotime(\"+$inc days\");\n }\n \n if($this->_db->AutoExecute(T_POSTS, $rs, $method, $where, false, get_magic_quotes_runtime()) !== false){\n if($method === 'INSERT' ){\n $rval = intval($this->_db->insert_id());\n }\n else{\n $rval = true;\n }\n if(isset($post['send_trackback']) && $post['send_trackback'] == true){\n \tinclude_once(LOQ_APP_ROOT.'includes/trackbackhandler.class.php');\n \t$tb = new trackbackhandler($this->_db);\n \t$tb->send_trackback('', $post['title'], $post['excerpt'], $post['tburl']);\n }\n }\n else{\n $this->_last_error = $this->_db->ErrorMsg();\n }\n return $rval;\n }", "public static function action_clean_term_cache( $term_ids ) {\n\t\t$keys = array();\n\t\t$term_ids = is_array( $term_ids ) ? $term_ids : array( $term_id );\n\t\tforeach ( $term_ids as $term_id ) {\n\t\t\t$keys[] = 'term-' . $term_id;\n\t\t\t$keys[] = 'rest-term-' . $term_id;\n\t\t}\n\t\tpantheon_wp_clear_edge_keys( $keys );\n\t}", "public function arvan_save_post_action($post_id ){\n \n \n $purge_after_save_status = Redux::get_option( $this->opt_name, 'arvan-save-post-status');\n \n /**\n * Do nothin if option turned off\n */\n if(isset($purge_after_save_status) && ($purge_after_save_status == 'off'))\n return;\n \n\n\n $url = get_permalink($post_id);\n\n \n \n $arvan_url = Redux::get_option( $this->opt_name, 'arvan-cache-endpoint-url');\n $domain = Redux::get_option( $this->opt_name, 'arvan-domain');\n $full_url = $arvan_url . $domain . '/caching';\n \n $full_url .= '?purge=individual&purge_urls='. $url;\n \n $arvan_api_key = Redux::get_option( $this->opt_name, 'arvan-api-key');\n \n $response = wp_remote_get( $full_url, array(\n 'method' => 'DELETE',\n 'blocking' => true,\n 'headers' => array('Authorization' => $arvan_api_key),\n \n )\n );\n \n if ( is_wp_error( $response ) ) {\n $error_message = $response->get_error_message();\n return \"Something went wrong: $error_message\";\n }\n \n \n }", "public function unpublish_expired_posts() {\n $expired_posts = $this->get_expired_posts();\n foreach ( $expired_posts as $expired_post ) {\n // Only automatically unpublish if the corresponding option is enabled for this post\n if ( $expired_post->bbx_best_before_unpublish_when_expired ) {\n // Set post to draft\n wp_update_post(\n array(\n 'ID' => $expired_post->ID,\n 'post_status' => 'draft'\n )\n );\n }\n }\n }", "function postCommentNotify($id, $postId){\r\n $commentManager = new CommentsManager();\r\n $notify = $commentManager->postNotify($id);\r\n}", "function hard_or_soft_check($post_ids, $topic_ids, $mcp_delete_topic = false)\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif ($post_ids !== false && sizeof($post_ids))\r\n\t\t{\r\n\t\t\tforeach ($post_ids as $id)\r\n\t\t\t{\r\n\t\t\t\tif ($this->post_data[$id]['post_deleted'] != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($auth->acl_get('m_harddelete', $this->post_data[$id]['forum_id']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($mcp_delete_topic)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ($this->topic_data[$this->post_data[$id]['topic_id']]['topic_deleted'] != 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->hard_delete['p'][] = $id;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->hard_delete['p'][] = $id;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($auth->acl_get('m_harddelete', $this->post_data[$id]['forum_id']) || $auth->acl_get('m_delete', $this->post_data[$id]['forum_id']) || ($auth->acl_get('f_delete', $this->post_data[$id]['forum_id']) && $this->post_data[$id]['poster_id'] == $user->data['user_id']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->soft_delete['p'][] = $id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($topic_ids !== false && sizeof($topic_ids))\r\n\t\t{\r\n\t\t\tforeach ($topic_ids as $id)\r\n\t\t\t{\r\n\t\t\t\tif ($this->topic_data[$id]['topic_deleted'] != 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($auth->acl_get('m_harddelete', $this->topic_data[$id]['forum_id']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->hard_delete['t'][] = $id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($auth->acl_get('m_harddelete', $this->topic_data[$id]['forum_id']) || $auth->acl_get('m_delete', $this->topic_data[$id]['forum_id']) || ($auth->acl_get('f_delete', $this->topic_data[$id]['forum_id']) && $this->topic_data[$id]['poster_id'] == $user->data['user_id']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->soft_delete['t'][] = $id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function _prime_network_caches( $network_ids ) {\n\tglobal $wpdb;\n\n\t$non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' );\n\tif ( !empty( $non_cached_ids ) ) {\n\t\t$fresh_networks = $wpdb->get_results( sprintf( \"SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)\", join( \",\", array_map( 'intval', $non_cached_ids ) ) ) );\n\n\t\tupdate_network_cache( $fresh_networks );\n\t}\n}", "public function deleteComments()\n\n /* Go through this code if you push delete product in single_post.php, meaning delete specific comment from comments table from specific post */\n {\n if(isset($_GET[\"comments_id\"])){\n\n $comments_id = $_GET[\"comments_id\"];\n\n $statement = $this->pdo->prepare(\"DELETE FROM comments\n WHERE comments_id = :comments_id\");\n\n $statement->execute(\n [\n \":comments_id\" => $comments_id\n ]\n );\n\n return true;\n\n }\n }", "protected function invalidateCache()\n {\n // \\Log::error('invalidate '.$this->getTag());\n \\Cache::tags($this->getTag())->flush();\n //\\Cache::prefixs($this->getTag())->flush();\n }", "function wp_cache_delete_multiple(array $keys, $group = '')\n {\n }", "public function purge_post_on_update($post_id) {\n\t\t$post_type = get_post_type($post_id);\n\n\t\tif ((defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) || 'revision' === $post_type) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Purge the whole cache if set to true, only the edited post otherwise. Default is false.\n\t\t *\n\t\t * @param boolean $purge_all_cache The default filter value\n\t\t * @param integer $post_id The saved post ID\n\t\t */\n\t\tif (apply_filters('wpo_purge_all_cache_on_update', false, $post_id)) {\n\t\t\t$this->purge_cache();\n\t\t\treturn;\n\t\t} else {\n\t\t\tif (apply_filters('wpo_delete_cached_homepage_on_post_update', true, $post_id)) WPO_Page_Cache::delete_homepage_cache();\n\t\t\tWPO_Page_Cache::delete_single_post_cache($post_id);\n\t\t}\n\t}", "public function deletePosts($postIds) {\n if (empty($postIds) || ! is_array($postIds)) {\n Template::set_message('No ha seleccionado ningún registro para eliminar.', 'error');\n return false;\n }\n\n // Only allow users with the correct permission to delete posts\n $this->auth->restrict('Bonfire.Blog.Delete');\n\n // Track any failures while deleting the selected posts.\n $failed = 0;\n foreach ($postIds as $postId) {\n $result = $this->post_model->delete($postId);\n if (! $result) {\n ++$failed;\n }\n }\n\n $result = false;\n if ($failed) {\n Template::set_message(\"Hubo un problema al eliminar {$failed} publicacion(es): {$this->post_model->error}\", 'error');\n } else {\n Template::set_message(count($postIds) . ' publicacion(es) eliminada(s)', 'success');\n $result = true;\n }\n\n // if any tickets were deleted, log the activity.\n if ((count($postIds) - $failed) > 0) {\n log_activity(\n $this->auth->user_id(),\n 'eliminó ' . count($postIds) . ' publicacion(es) : ' . $this->input->ip_address(),\n 'blog'\n );\n }\n\n return $result;\n }", "public function unApproveComments(array $commentIDs)\n {\n return $this->getComments($commentIDs)->each(function (Comment $comment) {\n $comment->published = false;\n $comment->save();\n $this->emitEvent('comment.unapproved', $comment);\n });\n }", "function fl_post_comment_ajax() {\n\tglobal $wpdb;\n\t\n if ( 'POST' != $_SERVER['REQUEST_METHOD'] )\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, only post method allowed.', APP_TD ) ) ) );\n\t\n $comment_post_ID = isset( $_POST['comment_post_ID'] ) ? (int) $_POST['comment_post_ID'] : 0;\n\t$post = get_post( $comment_post_ID );\n\n\tif ( ! $post )\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, item does not exist.', APP_TD ) ) ) );\n\n\t// get_post_status() will get the parent status for attachments.\n\t$status = get_post_status( $post );\n\n\t$status_obj = get_post_status_object( $status );\n\n\tif ( ! comments_open( $comment_post_ID ) ) {\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, comments are closed for this item.', APP_TD ) ) ) );\n\t} elseif ( 'trash' == $status ) {\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, this item is in trash.', APP_TD ) ) ) );\n\t} elseif ( ! $status_obj->public && ! $status_obj->private ) {\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, this item is not public.', APP_TD ) ) ) );\n\t} elseif ( post_password_required( $comment_post_ID ) ) {\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, this item is password protected.', APP_TD ) ) ) );\n\t}\n\n\t$comment_author = ( isset( $_POST['author'] ) ) ? trim( strip_tags( $_POST['author'] ) ) : null;\n\t$comment_author_email = ( isset( $_POST['email'] ) ) ? trim( $_POST['email'] ) : null;\n\t$comment_author_url = ( isset( $_POST['url'] ) ) ? trim( $_POST['url'] ) : null;\n\t$comment_content = ( isset( $_POST['comment'] ) ) ? trim( $_POST['comment'] ) : null;\n\n\t// If the user is logged in\n\t$user = wp_get_current_user();\n\tif ( $user->exists() ) {\n\t\tif ( empty( $user->display_name ) )\n\t\t\t$user->display_name = $user->user_login;\n\t\t$comment_author = esc_sql( $user->display_name );\n\t\t$comment_author_email = esc_sql( $user->user_email );\n\t\t$comment_author_url = esc_sql( $user->user_url );\n\t} else {\n\t\tif ( get_option('comment_registration') || 'private' == $status )\n\t\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Sorry, you must be logged in to post a comment.', APP_TD ) ) ) );\n\t}\n\n\t$comment_type = '';\n\n\tif ( get_option('require_name_email') && ! $user->ID ) {\n\t\tif ( 6 > strlen( $comment_author_email ) || '' == $comment_author )\n\t\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Error: please fill the required fields (name, email).', APP_TD ) ) ) );\n\t\telseif ( ! is_email( $comment_author_email ) )\n\t\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Error: please enter a valid email address.', APP_TD ) ) ) );\n\t}\n\n\tif ( empty( $comment_content ) )\n\t\tdie( json_encode( array( 'success' => false, 'message' => __( 'Error: please type a comment.', APP_TD ) ) ) );\n\n\t$comment_parent = isset( $_POST['comment_parent'] ) ? absint( $_POST['comment_parent'] ) : 0;\n\n\t$commentdata = compact( 'comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID' );\n\n\t// create the new comment in the db and get the comment id\n\t$comment_id = wp_new_comment( $commentdata );\n\n\t// go back and get the full comment so we can return it via ajax\n\t$comment = get_comment( $comment_id );\n\n\tif ( ! $user->ID ) {\n\t\t$comment_cookie_lifetime = apply_filters( 'comment_cookie_lifetime', 30000000 );\n\t\tsetcookie( 'comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( 'comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN );\n\t\tsetcookie( 'comment_author_url_' . COOKIEHASH, esc_url( $comment->comment_author_url ), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN );\n\t}\n\t\n $results['success'] = true;\n \n $GLOBALS['comment'] = $comment;\n\t\n\t$results['comment'] = '';\n\t$results['comment'] .= '<li>';\n\t$results['comment'] .= '<div class=\"items\">';\n\t$results['comment'] .= '<div class=\"rt clearfix\">';\n\t$results['comment'] .= get_avatar($comment, 32 );\n\t$results['comment'] .= '<p>' . get_comment_text() . '</p>';\n\t$results['comment'] .= '<p class=\"comment-meta\">';\n\t$results['comment'] .= '<span class=\"author\"></span>' . __( 'Posted by', APP_TD ) . ' ' . get_comment_author_link() . '<span class=\"date-wrap iconfix\"><i class=\"icon-calendar\"></i>' . get_comment_time(get_option('date_format')) . '<i class=\"icon-time\"></i>' . get_comment_time(get_option('time_format')) . '</span>';\n\t$results['comment'] .= '</p>';\n\t$results['comment'] .= '</div>';\n\t$results['comment'] .= '</div>';\n\t$results['comment'] .= '</li>';\n\t\n\t// get the comment count so we can update via ajax\n\t$comment_count = $wpdb->get_var( $wpdb->prepare( \"SELECT comment_count FROM $wpdb->posts WHERE post_status IN ('publish', 'unreliable') AND ID = %d\", $post->ID ) );\n\t$results['count'] = $comment_count;\n\n\tdie( json_encode( $results ) );\n\t\n}", "public function validate($postId, $message = null)\n {\n if (isset($_SESSION['token'], $_POST['token'])) {\n\n if ($_SESSION['token'] == $_POST['token']) {\n\n //random token for csrf\n $token = $this->csrf->sessionRandom(5);\n\n //post instance\n $data = $this->postManager->getPost($postId);\n $this->post->hydrate($data);\n\n //comments of this post\n $comments = $this->commentManager->getComments($postId);\n echo $this->twig->twigLoad()->render(\n 'backend/postComment.twig', [\n 'post' => $this->post,\n 'comments' => $comments,\n 'message' => $message,\n 'token' => $token\n ]);\n } else {\n header('Location: /error/error/500');\n }\n } else {\n header('Location: /error/error/500');\n }\n }", "public function invalidate($id);", "public function destroy($id)\n {\n \n //sub comment delete\n \n $getSubCom = PostSubComment::commentIdWiseSubComment($id);\n if(count($getSubCom)>0){\n $numSubCom = count($getSubCom);\n for ($i=0; $i < $numSubCom; $i++) { \n $subComment = PostSubComment::findOrFail($getSubCom[$i]->_id);\n $subComment->delete(); \n }\n }\n\n //comment like delete\n $getCommentLike = PostCommentLike::getCommentLike($id);\n if(count($getCommentLike)>0){\n $numLikeCom = count($getCommentLike);\n for ($i=0; $i < $numLikeCom; $i++) { \n $commentLike = PostCommentLike::findOrFail($getCommentLike[$i]->_id);\n $commentLike->delete(); \n }\n }\n\n //comment delete\n $getComment = PostComment::findOrFail($id);\n $getComment->delete();\n \n $getPost =Posts::findOrFail($getComment->fk_post_id);\n $count = $getPost->hits_count;\n\n $data['hits_count'] = $count-1;\n $getPost->update($data); \n return $id;\n }", "public function purge_post_on_comment_status_change($comment_id) {\n\t\tif (!empty($this->config['enable_page_caching'])) {\n\t\t\t$comment = get_comment($comment_id);\n\t\t\tif (is_object($comment) && !empty($comment->comment_post_ID)) WPO_Page_Cache::delete_single_post_cache($comment->comment_post_ID);\n\t\t}\n\t}", "public function unsubscribePostCommentsAction()\r\n\t{\r\n\t\t$user_id = $this->_request->get('user_id');\r\n\r\n\t\tif (!v::regex('/' . My_Regex::BASE64 . '/')->validate($user_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect user ID value');\r\n\t\t}\r\n\r\n\t\t$user_id = base64_decode($user_id);\r\n\r\n\t\tif (!v::intVal()->validate($user_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect user ID value');\r\n\t\t}\r\n\r\n\t\t$userModel = new Application_Model_User;\r\n\t\t$authUser = $userModel->getAuth();\r\n\r\n\t\tif ($user_id == $authUser['id'])\r\n\t\t{\r\n\t\t\t$user = $authUser['id'];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (!$userModel->checkId($user_id, $user))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect user ID: ' .\r\n\t\t\t\t\tvar_export($user_id, true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$data = ['user_id' => $user_id];\r\n\r\n\t\t$post_id = $this->_request->get('post_id');\r\n\r\n\t\tif (!v::optional(v::regex('/' . My_Regex::BASE64 . '/'))->validate($post_id))\r\n\t\t{\r\n\t\t\tthrow new RuntimeException('Incorrect post ID value');\r\n\t\t}\r\n\r\n\t\t$commentSubscriptionModel = new Application_Model_CommentSubscription;\r\n\r\n\t\tif ($post_id != null)\r\n\t\t{\r\n\t\t\t$post_id = base64_decode($post_id);\r\n\r\n\t\t\tif (!v::intVal()->validate($post_id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID value');\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($post_id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID: ' .\r\n\t\t\t\t\tvar_export($post_id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif ($user_id != $post['user_id'])\r\n\t\t\t{\r\n\t\t\t\t$existComment = (new Application_Model_Comments)->findByAttributes([\r\n\t\t\t\t\t'user_id' => $user_id,\r\n\t\t\t\t\t'news_id' => $post_id\r\n\t\t\t\t]);\r\n\r\n\t\t\t\tif (!$existComment)\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$data['post_id'] = $post_id;\r\n\t\t}\r\n\r\n\t\t$isSubscribed = false;\r\n\r\n\t\tif ($commentSubscriptionModel->findByAttributes($data))\r\n\t\t{\r\n\t\t\t$isSubscribed = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($post_id != null)\r\n\t\t\t{\r\n\t\t\t\tif ($commentSubscriptionModel->findByAttributes(\r\n\t\t\t\t\t['user_id' => $user_id, 'post_id' => null]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$isSubscribed = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($isSubscribed)\r\n\t\t{\r\n\t\t\t$redirectUrl = 'unsubscribe-post-comments/already';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$redirectUrl = 'unsubscribe-post-comments/success';\r\n\t\t\t$commentSubscriptionModel->insert($data);\r\n\t\t}\r\n\r\n\t\t$this->_redirect($redirectUrl);\r\n\t}", "public static function clearCache($postId, $post)\n {\n if (wp_is_post_revision($postId) || get_post_status($postId) != 'publish') {\n return false;\n }\n\n wp_cache_delete($postId, self::getKeyGroup());\n wp_cache_delete($post->post_type, self::getKeyGroup());\n\n // Empty post type for all sites in network (?)\n if (function_exists('is_multisite') && is_multisite() && apply_filters('Municipio\\Cache\\EmptyForAllBlogs', false, $post)) {\n $blogs = get_sites();\n\n foreach ($blogs as $blog) {\n wp_cache_delete($post->post_type, self::getKeyGroup($blog->blog_id));\n }\n }\n\n return true;\n }", "public function getCommentsArray($ids, $conversationId) {\n if (empty($ids) || empty($conversationId)) {\n return false;\n }\n if (!is_array($ids)) {\n $ids = array($ids);\n }\n /**\n * @var array Result Comments array\n */\n $comments = array();\n /**\n * @var array Non cached comments\n */\n $nonCached = array();\n /**\n * @var boolean True if one or more comments not cached\n */\n $cached = false;\n $cache = $this->modx->getCacheManager();\n /**\n * Retrieve comments from cache\n * те которых нет пишем в массив $nonCached для дальнейшего получения из базы\n */\n if ($this->mtCache && $cache) {\n $cached = true;\n foreach ($ids as $id) {\n if ($comment = $this->modx->cacheManager->get($id, array(\n xPDO::OPT_CACHE_KEY => 'modxtalks/conversation/' . $conversationId\n ))\n ) {\n $comments[$id] = $comment;\n } else {\n $nonCached[] = $id;\n }\n }\n\n if (count($nonCached)) {\n $cached = false;\n }\n }\n\n /**\n * Get comments by idx and conversation Id\n */\n if ($cached === false) {\n $c = $this->modx->newQuery('modxTalksPost', array('conversationId' => $conversationId));\n $c->select(array('id', 'idx', 'conversationId', 'date', 'content', 'userId', 'time', 'deleteTime', 'deleteUserId', 'editTime', 'editUserId', 'username', 'useremail', 'ip', 'votes', 'properties'));\n if (count($nonCached) && $this->mtCache && $cache) {\n $c->andCondition(array(\n 'idx:IN' => $nonCached\n ));\n } else {\n $c->andCondition(array(\n 'idx:IN' => $ids\n ));\n }\n\n if ($c->prepare() && $c->stmt->execute()) {\n $results = $c->stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach ($results as $result) {\n /**\n * Comment raw content\n */\n $result['raw_content'] = $result['content'];\n /**\n * Comment fully processed content\n */\n $result['content'] = $this->bbcode($result['content']);\n $comments[$result['idx']] = $result;\n /**\n * Cache the comment\n */\n if ($this->mtCache && $cache) {\n $this->modx->cacheManager->set($result['idx'], $result, 0, array(\n xPDO::OPT_CACHE_KEY => 'modxtalks/conversation/' . $conversationId\n ));\n }\n }\n }\n }\n /**\n * Get id's of registered users\n */\n $users = array();\n foreach ($comments as $c) {\n if ($c['userId'])\n $users[] = $c['userId'];\n if ($c['deleteUserId'])\n $users[] = $c['deleteUserId'];\n if ($c['editUserId'])\n $users[] = $c['editUserId'];\n }\n $users = array_unique($users);\n\n /**\n * Sort array ascending by idx\n */\n if (!$this->revers) {\n ksort($comments);\n } else {\n krsort($comments);\n }\n\n return array($comments, $users);\n }", "public function purgePost($p_id){\n \n /**\n * Fetch Post Details\n */\n $posts = Post::where('p_id', '=',$p_id);\n \n $post = $posts->first();\n \n /**\n * Purge Post Reports\n */\n $this->purgeReports('post',$post->p_id);\n \n /**\n * Post Image URI To Delete\n */\n $this->uri = $post->uri;\n \n /**\n * Purge Post Tags\n */\n $this->purgeTags('p_id',$p_id);\n \n /**\n * Purge Post Categories\n */\n $this->purgeCategories('p_id',$p_id);\n \n /**\n * Purge Post Votes\n */\n $this->purgeVotes('post','p_id',$p_id);\n \n /**\n * Fetch Post Comments\n */\n $comments = Comment::where('p_id', '=', $p_id);\n \n foreach($comments->get() as $comment){\n \n /**\n * Fetch Comment Replies\n */\n $replies = Reply::where('comment_id','=',$comment->id); // get comment replies\n \n foreach($replies->get() as $reply){\n \n /**\n * Purge Reply Votes\n */\n $this->purgeVotes('reply','reply_id',$reply->id);\n \n /**\n * Purge Reply Reports\n */\n $this->purgeReports('reply',$reply->id);\n \n /**\n * Purge Reply Notification\n */\n $this->purgeNotification('replylike',$reply->id);\n }\n \n /**\n * Purge Comment Votes\n */\n $this->purgeVotes('comment','comment_id',$comment->id);\n \n /**\n * Purge Comment Reports\n */\n $this->purgeReports('comment',$comment->id);\n \n /**\n * Purge Comment Notifications\n */\n $this->purgeNotification('comment',$comment->p_id);\n \n /**\n * Purge Comment Likes Notification\n */\n $this->purgeNotification('commentlike',$comment->id);\n \n /**\n * Purge Comment Reply Notification\n */\n $this->purgeNotification('commentreply',$comment->id);\n \n /**\n * Purge Reply\n */\n $replies->delete();\n }\n \n /**\n * Purge Image\n */\n $this->purgeImage($this->uri);\n \n /**\n * Purge Notificaion\n */\n Notification::where('target','=',$p_id)->delete();\n \n \n /**\n * Purge Comments & Rosts\n */\n $comments->delete();\n $posts->delete();\n \n return Response::json(array(\n 'status' => true,\n ));\n }", "public function update(Request $request, Post $post)\n {\n //user情報取得\n $user = \\Auth::user();\n if ($user) {\n $login_user_id = $user->id;\n } else {\n $login_user_id = \"\";\n }\n\n /**\n * post_mainをDBへ保存\n */\n //更新用過去データ準備\n $preMainId = $request->preMainId;\n $postMain = Post::find($preMainId);\n\n $ImageFactory = new ImageFactory;\n\n // 画像の投稿がある場合は、保存\n if (!empty($request->file('main_photo'))) {\n //画像を保存し、ファイル名を返す\n $imageName = $ImageFactory->storeImage($request->file('main_photo'));\n $postMain->photo = $imageName;\n }\n\n $postMain->title = $request->title;\n $postMain->area = $request->area;\n $postMain->impression = $request->impression;\n $postMain->budget_id = $request->budget;\n $postMain->year = $request->year;\n $postMain->month = $request->month;\n $postMain->term_id = $request->term;\n $postMain->save();\n //tag情報を格納 where('post_id', 'like', $post_sub_id)->value('tag_id');\n $tagMap = Tag_map::where('post_id', $preMainId)->first();\n $tagMap->tag_id = $request->tag;\n $tagMap->save();\n\n /**\n * post_subをDBへ保存\n */\n\n $count = $request->totalCount + 1;\n\n for ($i=1; $i < $count ; $i++) {\n //更新用$i番目過去データ準備\n $preSubPost = sub_Post::where('post_main_id', $preMainId)\n ->where('post_order', $i)\n ->first();\n\n //delFlagが立っていた場合は、削除\n $delFlag = 'delFlag_'.$i;\n if ($request->$delFlag === \"1\") {\n // 画像を削除\n if ($preSubPost['photo']) {\n $pathdel = public_path('storage/postedImages/'. $preSubPost['photo']);\n \\File::delete($pathdel);\n }\n // tag_mapを削除\n tag_Map::where('post_id', $preSubPost['post_sub_id'])\n ->delete();\n // sub_postを削除\n sub_post::where('post_sub_id', $preSubPost['post_sub_id'])\n ->where('post_order', $i)\n ->delete();\n continue;\n }\n\n //新たに登録用のレコード用意\n $subPost = new sub_Post;\n\n $comment = 'comment_'.$i;\n $tag = 'tag_'.$i;\n //一意のpost_sub_idを生成\n $post_sub_id = $user->id.time().$i;\n\n $subPost->post_sub_id = $post_sub_id;\n $subPost->post_main_id = $preMainId;\n $subPost->post_order = $i;\n\n //画像を保存\n if (!empty($request->file('sub_photo_'.$i))) { // 写真が更新された場合\n //画像を保存しファイル名を返す\n $imageName = $ImageFactory->storeImage($request->file('sub_photo_'.$i));\n $subPost->photo = $imageName;\n //旧写真削除\n if (!empty($preSubPost['photo'])) {\n $pathdel = public_path('storage/postedImages/'. $preSubPost['photo']);\n \\File::delete($pathdel);\n }\n } elseif (!empty($preSubPost['photo'])) { // 写真が更新されない&元々画像があった場合\n $subPost->photo = $preSubPost['photo'];\n } else { // 写真が削除されている場合\n // 未実装\n }\n\n //コメントを保存\n if (!empty($request->$comment)) {\n $subPost->comment = $request->$comment;\n }\n $subPost->save();\n\n //tag情報を格納\n if (!empty($request->$tag)) {\n $tagMap = new Tag_map;\n $tagMap->post_id = $post_sub_id;\n $tagMap->tag_id = $request->$tag;\n $tagMap->save();\n }\n\n // 旧レコードを削除\n if (!empty($preSubPost['post_sub_id'])) {\n Tag_map::where('post_id', $preSubPost['post_sub_id'])\n ->delete();\n sub_post::where('post_sub_id', $preSubPost['post_sub_id'])\n ->where('post_order', $i)\n ->delete();\n }\n }\n return redirect()->route('postShow', ['post_id' => $preMainId]);\n }", "function deletePost($id)\r\n{\r\n $postManager = new \\Writer\\Blog\\Model\\PostManager();\r\n $blogManager = new Writer\\Blog\\Model\\BlogManager;\r\n $commentManager = new \\Writer\\Blog\\Model\\CommentManager();\r\n \r\n $affectedLine = $postManager->deletePost($id);\r\n $posts = $postManager->getAllPosts();\r\n $descBlog = $blogManager->getBlog();\r\n \r\n if ($affectedLine === false) {\r\n throw new Exception('Impossible de mettre à jour le post');\r\n }\r\n else {\r\n foreach ($posts as $data)\r\n {\r\n $counter[$data['id']] = $commentManager->matchReportComments($data['id']);\r\n }\r\n require 'view/backend/listPostsAdmin.php';\r\n }\r\n \r\n}", "public function getCacheTagsToInvalidate();", "protected function overwrite_post_data( $post_id ) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty( $post_id ) || empty( $this->overwrite ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$wpdb->update( $wpdb->posts, $this->overwrite, [\n\t\t\t'ID' => $post_id\n\t\t] );\n\n\t\t// Delete cache since it can be cached even if not saved in the database.\n\t\tforeach ( array_keys( $this->overwrite ) as $key ) {\n\t\t\tpapi_cache_delete( $key, $post_id );\n\t\t}\n\n\t\tclean_post_cache( $post_id );\n\t}", "public function post_edit($id)\n\t{\n\t\tAcl::can('post_comments_edit');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = Blog_Comment::find($id);\n\n\t\t\tif(is_null($comment))\n\t\t\t{\n\t\t\t\treturn Redirect::to('blog/comments');\n\t\t\t}\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Updated comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/edit/'.$id)\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}", "public static function disableAll($threadIDs, $disablePosts = true) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t// disable thread\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDeleted = 0,\n\t\t\t\tisDisabled = 1\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\tWCF::getDB()->sendQuery($sql);\n\t\t\n\t\t// disable post\t\n\t\tif ($disablePosts) {\n\t\t\tPostEditor::disableAll(self::getAllPostIDs($threadIDs));\n\t\t}\n\t}", "function wp_lazyload_comment_meta(array $comment_ids)\n {\n }", "private function process_bulk_delete( $review_ids = array() ) {\n\n\t\t// Bail without my review IDs.\n\t\tif ( empty( $review_ids ) ) {\n\n\t\t\t// Set my error return args.\n\t\t\t$redirect_args = array(\n\t\t\t\t'success' => false,\n\t\t\t\t'wbr-action-result' => 'failed',\n\t\t\t\t'wbr-error-code' => 'missing-review-ids',\n\t\t\t);\n\n\t\t\t// And redirect.\n\t\t\tHelpers\\admin_page_redirect( $redirect_args, Core\\REVIEWS_ANCHOR );\n\t\t}\n\n\t\t// Set an empty array for updating.\n\t\t$tochange = array();\n\n\t\t// Loop my review IDs and start deleting them.\n\t\tforeach ( $review_ids as $review_id ) {\n\n\t\t\t// Run the delete.\n\t\t\t$maybe_deleted = Database\\delete( 'content', $review_id );\n\n\t\t\t// Check for some error return or blank.\n\t\t\tif ( empty( $maybe_deleted ) || false === $maybe_deleted || is_wp_error( $maybe_deleted ) ) {\n\n\t\t\t\t// Figure out the error code.\n\t\t\t\t$error_code = is_wp_error( $maybe_deleted ) ? $maybe_deleted->get_error_code() : 'review-delete-failed';\n\n\t\t\t\t// Set my error return args.\n\t\t\t\t$redirect_args = array(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'wbr-action-result' => 'failed',\n\t\t\t\t\t'wbr-error-code' => $error_code,\n\t\t\t\t);\n\n\t\t\t\t// And do the redirect.\n\t\t\t\tHelpers\\admin_page_redirect( $redirect_args, Core\\REVIEWS_ANCHOR );\n\t\t\t}\n\n\t\t\t// Run my related cleanup.\n\t\t\tUtilities\\delete_related_review_data( $review_id );\n\n\t\t\t// Add the ID to the update.\n\t\t\t$tochange[] = $single_review->product_id;\n\n\t\t\t// Nothing left in the loop to do.\n\t\t}\n\n\t\t// Handle the transient purging for reviews.\n\t\tUtilities\\purge_transients( null, 'reviews', array( 'ids' => $review_ids ) );\n\n\t\t// Run the change loop if we have items.\n\t\tif ( ! empty( $tochange ) ) {\n\n\t\t\t// Get just the individual unique IDs.\n\t\t\t$update_ids = array_unique( $tochange );\n\n\t\t\t// Handle the transient purging for products.\n\t\t\tUtilities\\purge_transients( null, 'products', array( 'ids' => $update_ids ) );\n\n\t\t\t// Update all my counts.\n\t\t\tUtilities\\update_product_review_count( $update_ids );\n\n\t\t\t// Recalculate the total score on each.\n\t\t\tforeach ( $update_ids as $update_id ) {\n\t\t\t\tUtilities\\calculate_total_review_scoring( $update_id );\n\t\t\t}\n\n\t\t\t// Nothing left for the changed items.\n\t\t}\n\n\t\t// Purge my grouping related transients.\n\t\tUtilities\\purge_transients( null, 'taxonomies' );\n\n\t\t// Set my success args.\n\t\t$redirect_args = array(\n\t\t\t'success' => 1,\n\t\t\t'wbr-action-result' => 'reviews-deleted-bulk',\n\t\t);\n\n\t\t// And redirect.\n\t\tHelpers\\admin_page_redirect( $redirect_args, Core\\REVIEWS_ANCHOR );\n\t}", "private function setCachedSwatches(array $optionIds, array $swatches)\n {\n foreach ($optionIds as $optionId) {\n $this->swatchesCache[$optionId] = isset($swatches[$optionId]) ? $swatches[$optionId] : null;\n }\n }", "function clearCommentListCache() {\n global $wgMemc;\n wfDebug( \"Clearing comments for page {$this->id} from cache\\n\" );\n $key = wfMemcKey( 'comment', 'pagelist', $this->id );\n $wgMemc->delete( $key );\n\n if ( is_object( $this->title ) ) {\n $this->title->invalidateCache();\n $this->title->purgeSquid();\n }\n }", "function update_comment_count() {\r\n\t$factory = DbConnectionFactory::getInstance();\r\n\r\n\t$posts_query = 'SELECT id, ( '\r\n\t. 'SELECT COUNT( * ) '\r\n\t. 'FROM wp_comments '\r\n\t. 'WHERE comment_post_ID = id '\r\n\t. ') AS count '\r\n\t. 'FROM wp_posts '\r\n\t. 'WHERE ( '\r\n\t. 'SELECT COUNT( * ) '\r\n\t. 'FROM wp_comments '\r\n\t. 'WHERE comment_post_ID = id '\r\n\t. ') >0';\r\n\r\n\t$update_posts = 'UPDATE wp_posts SET comment_count = ? WHERE ID = ?';\r\n\t$wp = $factory->getConnection('WordPress');\r\n\t$posts = $wp->query($posts_query, MYSQLI_USE_RESULT);\r\n\r\n\t$update_post = $factory->getConnection('WordPress');\r\n\t$update_post_stmt = $update_post->prepare($update_posts);\r\n\r\n\twhile ($post = $posts->fetch_assoc()) {\r\n\t\t$update_post_stmt->bind_param(\r\n\t\t\t'ii',\r\n\t\t$post['count'],\r\n\t\t$post['id']);\r\n\t\t$update_post_stmt->execute();\r\n\t}\r\n\r\n\t$update_post_stmt->close();\r\n\t$update_post->close();\r\n\t$posts->close();\r\n\t$wp->close();\r\n}", "function the_posts_intercept( $posts ) {\n\t\t\tif ( empty( $posts ) && ! is_null( $this->shared_post ) ) {\n\t\t\t\treturn array( $this->shared_post );\n\t\t\t} else {\n\t\t\t\t$this->shared_post = null;\n\n\t\t\t\treturn $posts;\n\t\t\t}\n\t\t}", "public function unallow_comments($id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t\t'allow_comments' => 0\n\t\t\t\t\t );\n\n\t\t$result = $this->common_model->UpdateDB('blog_post',array('id' => $id),$data);\n\n\t\tif ($result) \n\t\t{\n\t\t\tset_flashdata('success','Comments Status has been Changed');\n\t\t\tredirect('blog/posts/manage_posts','refresh');\n\t\t} \n\t}", "function DelTrust($posts)\n {\n foreach($posts as $post){\n if(isset($this->TrustedNetworks[$post])){\n unset($this->TrustedNetworks[$post]); \n }\n }\n }", "function update_post_thumbnail_cache( $wp_query = null ) {\n\tif ( ! $wp_query )\n\t\t$wp_query = $GLOBALS['wp_query'];\n\n\tif ( $wp_query->thumbnails_cached )\n\t\treturn;\n\n\t$thumb_ids = array();\n\tforeach ( $wp_query->posts as $post ) {\n\t\tif ( $id = get_post_thumbnail_id( $post->ID ) )\n\t\t\t$thumb_ids[] = $id;\n\t}\n\n\tif ( ! empty ( $thumb_ids ) ) {\n\t\t_prime_post_caches( $thumb_ids, false, true );\n\t}\n\n\t$wp_query->thumbnails_cached = true;\n}", "public function update(UpdatePostCommentsRequest $request, Comment $post_comment)\n {\n $post_comment->update($request->all());\n Cache::forget('recent_comments');\n return redirect()->route('admin.post_comments.index')->with([\n 'message' => 'Comment updated successfully',\n 'alert-type' => 'success',\n ]);\n }", "public function store(Request $request)\n {\n $data = array(\n 'post_id' => $request->postId,\n 'author_name' => $request->authorName,\n 'author_email' => $request->authorEmail,\n 'author_url' => $request->authorUrl,\n 'body' => $request->body,\n );\n\n /** @var Post $post */\n $post = $this->postRepository->find($data['post_id']);\n if ($post === null) {\n return array(\n 'error' => 1\n );\n }\n\n if (!empty($request->parent)) {\n $data['parent'] = $request->parent;\n }\n\n /** @var User $user */\n $user = Auth::user();\n if ($user !== null) {\n $data['user_id'] = $user->getAttribute('id');\n }\n\n $data['ip'] = getClientIPAddress();\n\n $spam = false;\n if (AkismetController::getInstance()->verifyKey()) {\n $akismetCheckerData = $data + array(\n 'userAgent' => $_SERVER['HTTP_USER_AGENT'],\n 'referrer' => $_SERVER['HTTP_REFERER'],\n 'commentType' => 'comment',\n 'permalink' => $this->siteMetaRepository->getSiteMeta()->url . PostController::getPostPublicUrlByType($post),\n );\n $spam = AkismetController::getInstance()->commentIsSpam($akismetCheckerData);\n }\n\n $data['spam'] = $spam;\n\n $approved = !$spam;\n $data['approved'] = $approved;\n\n if (!$this->commentValidator->with($data)->passes()) {\n\n return array(\n 'error' => 1,\n 'message' => $this->commentValidator->errors(),\n );\n } else {\n $comment = $this->commentRepository->create($data);\n\n /*\n * Clear the comments cache of a single post.\n */\n if (Cache::has('comments_' . $post->slug)) {\n Cache::forget('comments_' . $post->slug);\n }\n\n /**\n * If the new comment is an answer to another comment. Send a notification to the parent comment.\n */\n if (!empty($data['parent'])) {\n $commentParent = $this->commentRepository->find($data['parent']);\n try {\n CommentEmailController::notifyResponse($post, $commentParent);\n } catch (\\Exception $e) {\n // Just do not send the email.\n Log::error($e);\n }\n }\n\n return [\n 'error' => 0,\n 'spam' => $data['spam'] ? 1 : 0,\n 'html' => view('themes.vortex.partials.blog.singleComment', compact('comment'))->render(),\n ];\n }\n }" ]
[ "0.66274947", "0.63293374", "0.6029599", "0.5792569", "0.5717498", "0.55613804", "0.55031", "0.54733425", "0.54707885", "0.52404207", "0.52330625", "0.5191158", "0.50896", "0.50280756", "0.49876598", "0.49760443", "0.49303183", "0.4894563", "0.48845637", "0.48414186", "0.48329446", "0.48046082", "0.47987002", "0.4793482", "0.479153", "0.47577137", "0.47536102", "0.47520846", "0.47256532", "0.47087023", "0.47078112", "0.46879235", "0.46869028", "0.4686407", "0.4686386", "0.46735707", "0.4672221", "0.46712872", "0.46664023", "0.46490508", "0.4647852", "0.46370634", "0.46363756", "0.46231356", "0.4623133", "0.46179068", "0.4613237", "0.46069026", "0.45834166", "0.45777792", "0.45712897", "0.4554236", "0.45231307", "0.45174634", "0.45110434", "0.45085406", "0.4502234", "0.44821605", "0.44696468", "0.44388393", "0.44334024", "0.44321597", "0.44306514", "0.44200972", "0.4416893", "0.44142225", "0.44132334", "0.44118717", "0.44010997", "0.43921134", "0.43919703", "0.4385442", "0.43821353", "0.43799442", "0.43761587", "0.4372373", "0.4359723", "0.434867", "0.43486568", "0.43484524", "0.43458182", "0.4340269", "0.43362963", "0.4334646", "0.43336377", "0.43281284", "0.4327536", "0.43274608", "0.432442", "0.43239528", "0.43099844", "0.4307573", "0.43067572", "0.4293804", "0.42831716", "0.42831707", "0.42808056", "0.4276107", "0.42744404", "0.42715332" ]
0.69485825
0
Run the database seeds.
public function run() { \Illuminate\Support\Facades\DB::table('genders')->delete(); $genders = [ ['en'=> 'Male', 'ar'=> 'ذكر'], ['en'=> 'Female', 'ar'=> 'انثي'], ]; foreach ($genders as $ge) { \App\Models\Gender::create(['Name' => $ge]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Original static call DataTableWidget::setIni( DataTableWidget::INI_QUERY_EXECUTOR, YiiQueryExecutorPlugin::class );
public function setIni($initItem, $value) { $this->ini[$initItem] = $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function useQueryCLI() {\n parent::useQueryCLI();\n }", "abstract protected function initQuery(): void;", "public function getQueryDataProvider() {}", "private function set_query_components() {\n\t\n\t\t$start = (($this->page-1) * $this->rp);\n\t\t\n\t\tif($this->query) {\n\t\t\t$this->query_components['where'] = \" WHERE $qtype LIKE '%\".mysql_real_escape_string($query).\"%' \";\n\t\t}\n\t\telse {\n\t\t\t$this->query_componenets['where'] = \"\";\n\t\t}\n\t\t\n\t\t$this->query_components['sort'] = \"ORDER BY {$this->sortname} {$this->sortorder}\";\n\t\t$this->query_components['limit'] = \"LIMIT $start, {$this->rp}\";\n\t}", "public function getDataGridPluginConfig();", "public function init()\n {\n $this->logger = GeneralUtility::makeInstance(Logger::class);\n\n $sqlQuerySettings = $this->filterConfig->getSettings('optionsSqlQuery');\n\n foreach ($sqlQuerySettings as $type => $part) {\n if (!is_array($part)) {\n $sqlQuerySettings[$type] = trim($part);\n }\n }\n\n $fromPart = trim(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['from']));\n $items = GeneralUtility::trimExplode(' ', $fromPart);\n\n Assert::isInRange(count($items), 1 ,2 , ['message' => 'baseFromClause of Backend in TS has not the correct values! This should be table name and optional alias added by space! 1280234420']);\n\n $fromTable= trim($items[0]);\n $fromAlias = $items[1] ?? null;\n\n /** @var Connection $connection */\n $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($fromTable);\n $this->queryBuilder = $connection->createQueryBuilder();\n\n if ($sqlQuerySettings['select']) {\n $this->queryBuilder->selectLiteral(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['select']));\n }\n $this->queryBuilder->from($fromTable, $fromAlias);\n\n if ($sqlQuerySettings['join']) {\n foreach ($sqlQuerySettings['join'] as $joinPart) {\n $joinFromAlias = trim($joinPart['fromAlias']);\n $joinTable = trim($joinPart['table']);\n $joinAlias = trim($joinPart['alias']) ?: trim($joinPart['table']);\n $joinOn = trim($joinPart['on']);\n $joinMethod = (strtolower(trim($joinPart['type'])) ?: 'inner') . 'Join';\n $this->queryBuilder->$joinMethod($joinFromAlias, $joinTable, $joinAlias, $joinOn);\n }\n }\n\n\n if ($sqlQuerySettings['where']) {\n $this->queryBuilder->where(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['where']));\n }\n\n if ($sqlQuerySettings['orderBy']) {\n $items = GeneralUtility::trimExplode(' ', $sqlQuerySettings['orderBy']);\n $this->queryBuilder->orderBy($items[0], $items[1] ?? '');\n\n }\n if ($sqlQuerySettings['groupBy']) {\n $this->queryBuilder->groupBy(RenderValue::stdWrapIfPlainArray($sqlQuerySettings['groupBy']));\n }\n if ($sqlQuerySettings['limit']) {\n $items = GeneralUtility::trimExplode(',', RenderValue::stdWrapIfPlainArray($sqlQuerySettings['limit']));\n if ($items > 1) {\n $this->queryBuilder->setFirstResult($items[0]);\n $this->queryBuilder->setMaxResults($items[1]);\n } else {\n $this->queryBuilder->setMaxResults($items[0]);\n }\n }\n\n $this->filterField = trim($this->filterConfig->getSettings('filterField'));\n $this->displayFields = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(',', $this->filterConfig->getSettings('displayFields'));\n\n Assert::isNotEmptyString($this->filterField, ['info' => 'No filter field is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221957']);\n Assert::isNotEmptyString($sqlQuerySettings['select'], ['info' => 'No Select part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221958']);\n Assert::isNotEmptyString($sqlQuerySettings['from'], ['info' => 'No from part is given for filter ' . $this->filterConfig->getFilterIdentifier() . ' 1315221959']);\n }", "function query($sql,$calculateRows=false,$fastHint=false);", "public function parametersAndQueriesDataProvider() {}", "public function run()\n {\n DB::disableQueryLog();\n parent::run();\n }", "private function _getDatatablesQuery()\n {\n $this->query = DB::table($this->table);\n $this->query->leftJoin('categories', 'categories.id', '=', 'documents.category_id');\n $this->query->select('documents.stt', 'documents.id', 'documents.title','documents.updated_at');\n\n if (strpos(URL::current(), 'admin') < 0) {\n $this->query->where('categories.searchable', 1);\n }\n\n if (Input::get('cat'))\n $this->query->where('documents.category_id', Input::get('cat'));\n\n if (Input::get('isBuyed')) {\n $this->query->join('users_documents', 'users_documents.document_id', '=', 'documents.stt');\n $this->query->where('users_documents.user_id', Auth::user()->id);\n }\n\n if(Input::has('search.value')) {\n $this->_getSearchStringQuery();\n }\n\n // here order processing\n if (isset($_GET['order'])) {\n $this->query->orderBy(\n $this->column_order[$_GET['order']['0']['column']],\n $_GET['order']['0']['dir']\n );\n } else if (isset($this->order)) {\n $order = $this->order;\n $this->query->orderBy(key($order), $order[key($order)]);\n }\n }", "public function init_save_queries()\n {\n }", "public function getQueryAdapterClass();", "public function runCustomQuery($query, Database_Config $databaseConfig = NULL);", "private function _setDefaults(): void {\n\t\t// default query options\n\t\t$options['limit'] = 50;\n\t\t$options['offset'] = false;\n\t\t$options['sort'] = false;\n\t\t$options['sortDirection'] = false;\n\t\t$this->setQueryOptions($options);\n\t}", "public function cbInit() {\n\t\t\t$this->title_field = \"id\";\n\t\t\t$this->limit = \"20\";\n\t\t\t$this->orderby = \"id,desc\";\n\t\t\t$this->global_privilege = false;\n\t\t\t$this->button_table_action = true;\n\t\t\t$this->button_bulk_action = true;\n\t\t\t$this->button_action_style = \"button_icon\";\n\t\t\t$this->button_add = false;\n\t\t\t$this->button_edit = false;\n\t\t\t$this->button_delete = false;\n\t\t\t$this->button_detail = false;\n\t\t\t$this->button_show = true;\n\t\t\t$this->button_filter = true;\n\t\t\t$this->button_import = false;\n\t\t\t$this->button_export = false;\n//\t\t\t$this->table = \"prd_order_statuses\";\n\t\t\t$this->table = \"prd_orders\";\n\t\t\t# END CONFIGURATION DO NOT REMOVE THIS LINE\n\n\t\t\t# START COLUMNS DO NOT REMOVE THIS LINE\n\t\t\t$this->col = [];\n\t\t\t$this->col[] = [\"label\"=>\"کد سفارش\",\"name\"=>\"order_code\"];\n\t\t\t$this->col[] = [\"label\"=>\"تاریخ سفارش\",\"name\"=>\"order_date\"];\n\t\t\t$this->col[] = [\"label\"=>\"شماره تماس مشتری\",\"name\"=>\"customer_id\",\"join\"=>\"app_users,mobile_number\"];\n//\t\t\t$this->col[] = [\"label\"=>\"مبلغ سفارش\",\"name\"=>\"total_amount\"];\n\t\t\t$this->col[] = [\"label\"=>\"وضعیت سفارش\",\"name\"=>\"id\",\"join\"=>\"shop_orders,order_status_title\"];\n//\t\t\t$this->col[] = [\"label\"=>\"وضعیت سفارش\",\"name\"=>\"(select prd_ostatus.title from ((prd_orders join prd_order_statuses on prd_orders.id = prd_order_statuses.order_id) join prd_order_statuses on prd_ostatus prd_order_statuses.status_id = prd_ostatus.id) where prd_order_statues.status_id = prd_orders.id) as status\"];\n//\t\t\t$this->col[] = [\"label\"=>\"نوع حیوان\",\"name\"=>\"(select aml_types.title from ((aml_animals join aml_types on aml_animals.type_id = aml_types.id) join fc_requests on aml_animals.id = fc_requests.animal_id) where fc_requests.id = request_id) as animal_type\"];\n\n\t\t\t# END COLUMNS DO NOT REMOVE THIS LINE\n\n\t\t\t# START FORM DO NOT REMOVE THIS LINE\t\t\n//\t\t\t$this->form = [];\n//\t\t\t$this->form[] = ['label'=>'Order Code','name'=>'order_code','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Customer Id','name'=>'customer_id','type'=>'select2','validation'=>'required|integer|min:0','width'=>'col-sm-10','datatable'=>'customer,id'];\n//\t\t\t$this->form[] = ['label'=>'Order Date','name'=>'order_date','type'=>'datetime','validation'=>'required|date_format:Y-m-d H:i:s','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Shipment Time','name'=>'shipment_time','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Shipment Cost','name'=>'shipment_cost','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Coupon Value','name'=>'coupon_value','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Transferee','name'=>'transferee','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Delivery Date','name'=>'delivery_date','type'=>'text','validation'=>'required|min:1|max:255','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Total Amount','name'=>'total_amount','type'=>'number','validation'=>'required|integer|min:0','width'=>'col-sm-10'];\n//\t\t\t$this->form[] = ['label'=>'Is Completed','name'=>'is_completed','type'=>'radio','validation'=>'required|integer','width'=>'col-sm-10','dataenum'=>'Array'];\n\t\t\t# END FORM DO NOT REMOVE THIS LINE\n\n\t\t\t# OLD START FORM\n\t\t\t//$this->form = [];\n\t\t\t//$this->form[] = [\"label\"=>\"Order Code\",\"name\"=>\"order_code\",\"type\"=>\"text\",\"required\"=>TRUE,\"validation\"=>\"required|min:1|max:255\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Customer Id\",\"name\"=>\"customer_id\",\"type\"=>\"select2\",\"required\"=>TRUE,\"validation\"=>\"required|integer|min:0\",\"datatable\"=>\"customer,id\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Order Date\",\"name\"=>\"order_date\",\"type\"=>\"datetime\",\"required\"=>TRUE,\"validation\"=>\"required|date_format:Y-m-d H:i:s\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Shipment Time\",\"name\"=>\"shipment_time\",\"type\"=>\"text\",\"required\"=>TRUE,\"validation\"=>\"required|min:1|max:255\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Shipment Cost\",\"name\"=>\"shipment_cost\",\"type\"=>\"number\",\"required\"=>TRUE,\"validation\"=>\"required|integer|min:0\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Coupon Value\",\"name\"=>\"coupon_value\",\"type\"=>\"number\",\"required\"=>TRUE,\"validation\"=>\"required|integer|min:0\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Transferee\",\"name\"=>\"transferee\",\"type\"=>\"number\",\"required\"=>TRUE,\"validation\"=>\"required|integer|min:0\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Delivery Date\",\"name\"=>\"delivery_date\",\"type\"=>\"text\",\"required\"=>TRUE,\"validation\"=>\"required|min:1|max:255\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Total Amount\",\"name\"=>\"total_amount\",\"type\"=>\"number\",\"required\"=>TRUE,\"validation\"=>\"required|integer|min:0\"];\n\t\t\t//$this->form[] = [\"label\"=>\"Is Completed\",\"name\"=>\"is_completed\",\"type\"=>\"radio\",\"required\"=>TRUE,\"validation\"=>\"required|integer\",\"dataenum\"=>\"Array\"];\n\t\t\t# OLD END FORM\n\n\t\t\t/* \n\t | ---------------------------------------------------------------------- \n\t | Sub Module\n\t | ---------------------------------------------------------------------- \n\t\t\t| @label = Label of action \n\t\t\t| @path = Path of sub module\n\t\t\t| @foreign_key \t = foreign key of sub table/module\n\t\t\t| @button_color = Bootstrap Class (primary,success,warning,danger)\n\t\t\t| @button_icon = Font Awesome Class \n\t\t\t| @parent_columns = Sparate with comma, e.g : name,created_at\n\t | \n\t */\n\t $this->sub_module = array();\n\n\n\t /* \n\t | ---------------------------------------------------------------------- \n\t | Add More Action Button / Menu\n\t | ---------------------------------------------------------------------- \n\t | @label = Label of action \n\t | @url = Target URL, you can use field alias. e.g : [id], [name], [title], etc\n\t | @icon = Font awesome class icon. e.g : fa fa-bars\n\t | @color \t = Default is primary. (primary, warning, succecss, info) \n\t | @showIf \t = If condition when action show. Use field alias. e.g : [id] == 1\n\t | \n\t */\n\t $this->addaction = array(\n\t\t \t\t[\"label\"=>\"مشاهده سبد\",\"color\"=>\"success\",\"url\"=>CRUDBooster::mainpath('show-shopping-cart').'/[order_code]'],\n \t\t);\n\n\n\t /* \n\t | ---------------------------------------------------------------------- \n\t | Add More Button Selected\n\t | ---------------------------------------------------------------------- \n\t | @label = Label of action \n\t | @icon \t = Icon from fontawesome\n\t | @name \t = Name of button \n\t | Then about the action, you should code at actionButtonSelected method \n\t | \n\t */\n\t $this->button_selected = array();\n\n\t \n\t /* \n\t | ---------------------------------------------------------------------- \n\t | Add alert message to this module at overheader\n\t | ---------------------------------------------------------------------- \n\t | @message = Text of message \n\t | @type = warning,success,danger,info \n\t | \n\t */\n\t $this->alert = array();\n\t \n\n\t \n\t /* \n\t | ---------------------------------------------------------------------- \n\t | Add more button to header button \n\t | ---------------------------------------------------------------------- \n\t | @label = Name of button \n\t | @url = URL Target\n\t | @icon = Icon from Awesome.\n\t | \n\t */\n\t $this->index_button = array();\n\n\n\n\t /* \n\t | ---------------------------------------------------------------------- \n\t | Customize Table Row Color\n\t | ---------------------------------------------------------------------- \n\t | @condition = If condition. You may use field alias. E.g : [id] == 1\n\t | @color = Default is none. You can use bootstrap success,info,warning,danger,primary. \n\t | \n\t */\n\t $this->table_row_color = array(); \t \n\n\t \n\t /*\n\t | ---------------------------------------------------------------------- \n\t | You may use this bellow array to add statistic at dashboard \n\t | ---------------------------------------------------------------------- \n\t | @label, @count, @icon, @color \n\t |\n\t */\n\t $this->index_statistic = array();\n\n\n\n\t /*\n\t | ---------------------------------------------------------------------- \n\t | Add javascript at body \n\t | ---------------------------------------------------------------------- \n\t | javascript code in the variable \n\t | $this->script_js = \"function() { ... }\";\n\t |\n\t */\n\t $this->script_js = NULL;\n\n\n /*\n\t | ---------------------------------------------------------------------- \n\t | Include HTML Code before index table \n\t | ---------------------------------------------------------------------- \n\t | html code to display it before index table\n\t | $this->pre_index_html = \"<p>test</p>\";\n\t |\n\t */\n\t $this->pre_index_html = null;\n\t \n\t \n\t \n\t /*\n\t | ---------------------------------------------------------------------- \n\t | Include HTML Code after index table \n\t | ---------------------------------------------------------------------- \n\t | html code to display it after index table\n\t | $this->post_index_html = \"<p>test</p>\";\n\t |\n\t */\n\t $this->post_index_html = null;\n\t \n\t \n\t \n\t /*\n\t | ---------------------------------------------------------------------- \n\t | Include Javascript File \n\t | ---------------------------------------------------------------------- \n\t | URL of your javascript each array \n\t | $this->load_js[] = asset(\"myfile.js\");\n\t |\n\t */\n\t $this->load_js = array();\n\t \n\t \n\t \n\t /*\n\t | ---------------------------------------------------------------------- \n\t | Add css style at body \n\t | ---------------------------------------------------------------------- \n\t | css code in the variable \n\t | $this->style_css = \".style{....}\";\n\t |\n\t */\n\t $this->style_css = NULL;\n\t \n\t \n\t \n\t /*\n\t | ---------------------------------------------------------------------- \n\t | Include css File \n\t | ---------------------------------------------------------------------- \n\t | URL of your css each array \n\t | $this->load_css[] = asset(\"myfile.css\");\n\t |\n\t */\n\t $this->load_css = array();\n\t \n\t \n\t }", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "function setQuery($ezSQL='') {\n global $_ezQuery, $_ezMysqli;// $_ezCubrid, $_ezOracle8_9, $_ezOracleTNS; 'recordset' ,'oracle8_9', 'oracletns',\n global $_ezPdo, $_ezPostgresql, $_ezRecordset, $_ezSqlite3, $_ezSqlsrv;\n if (in_array(strtolower($ezSQL), array( 'cubrid', 'mysqli', 'pdo', 'postgresql', 'sqlite3', 'sqlsrv' ))) {\n switch(strtolower($ezSQL)) {\n // case 'cubrid':\n // $_ezQuery = $_ezCubrid;\n // break;\n case 'mysqli':\n $_ezQuery = $_ezMysqli;\n break;\n // case 'oracle8_9':\n // $_ezQuery = $_ezOracle8_9;\n // break;\n // case 'oracletns':\n // $_ezQuery = $_ezOracleTNS;\n // break;\n case 'pdo':\n $_ezQuery = $_ezPdo;\n break;\n case 'postgresql':\n $_ezQuery = $_ezPostgresql;\n break;\n case 'recordset':\n $_ezQuery = $_ezRecordset;\n break;\n case 'sqlite3':\n $_ezQuery = $_ezSqlite3;\n break;\n case 'sqlsrv':\n $_ezQuery = $_ezSqlsrv;\n break; \n }\n return (!empty($_ezQuery)) ? true: false; \n } else {\n\t\t\t$_ezQuery = null;\n unset($_ezQuery);\n return false; \n }\n }", "public function setGridQuery ($value)\r\n\t{\r\n\t\t$this->gridQuery = $value;\r\n\t}", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "public function getQuerySettings() {}", "function BeforeQueryEdit(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}", "protected function prepareExecute()\n {\n parent::prepareExecute();\n }", "function BeforeQueryView(&$strSQL, &$strWhereClause, &$pageObject)\n{\n\n\t\t$strSQL = calendar_getDbValuesById($_REQUEST[\"editid1\"], $pageObject->connection);\n;\t\t\n}", "protected function init()\r\n {\r\n parent::init();\r\n\r\n foreach ($this->options as $name => $value) {\r\n switch ($name) {\r\n case 'query':\r\n if (!is_array($value)) {\r\n $value = array(array('query' => $value));\r\n }\r\n $this->addQueries($value);\r\n break;\r\n }\r\n }\r\n }", "function query_finalize($instance){\r\n $instance->db->where(\"row_active\",1); \r\n}", "function getQuerySettings() ;", "function get_form_query() {\n\n $my_table = new OrTable('table_query');\n $my_table->OP_[align_table]->set('center');\n $my_table->OP_[class_name]->set('tbl_query_body');\n $my_table->set_col($this->get_button_filter());\n $my_table->set_col('เงื่อนไข ');\n $my_table->set_col(' ค่าที่ค้นหา ');\n $my_table->set_row();\n foreach ($this->caption_fields AS $caption => $id) {\n if (!is_object($this->filter_controls[$id])) {\n $this->set_filter_controls(new OrTextbox($id));\n }\n $my_compare = new OrSelectbox('val_compare_' . $id . '_', 'val_compare[' . $id . ']');\n $my_compare->OP_[option]->set(array(\n '=' => '=',\n '<>' => '<>',\n '>=' => '>=',\n '<=' => '<=',\n 'BETWEEN' => 'BETWEEN',\n 'LIKE' => 'LIKE',\n 'IN' => 'IN'\n ));\n $my_compare->OP_[default_value]->set($this->get_filter_compare($id)); //สร้าง Function เพื่อค้นหาค่า Default compare\n $my_compare->OP_[auto_post]->set(true);\n //$my_table->set_col($my_control->OP_[caption]->get() , \"td_caption\");\n debug_mode(__FILE__, __LINE__, $this->filter_controls[$id]->OP_[caption]->get(), 'Filter_controls');\n $my_table->set_col($this->filter_controls[$id]->OP_[caption]->get(), \"td_query_caption\");\n $my_table->set_col($my_compare->get_tag(), \"td_query_compare\");\n $my_table->set_col($this->filter_controls[$id]->get_tag(), \"td_query_value\");\n $my_table->set_row('tr_query_body');\n }\n\n $my_table->set_col('ค้นคำ เรียงลำดับ');\n $my_table->set_col($this->get_control_filter());\n $my_table->set_col($this->get_control_order());\n $my_table->set_row();\n\n return $my_table->get_tag();\n }", "public function getQueryCommand();", "protected function _getTableOptions(){ }", "public function run() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\t$contents=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($this->activeDataProvider === null) {\r\n\t\t\techo $contents;\r\n\t\t} else {\r\n\t\t\tif(($this->hideOnEmpty === true) && ($this->activeDataProvider->totalItemCount == 0)) {\r\n\t\t\t\techo $contents;\r\n\t\t\t} else {\r\n\t\t\t\t$this->render('TableWidget', array(\r\n\t\t\t\t\t'activeDataProvider' => $this->activeDataProvider,\r\n\t\t\t\t\t'fields' => $this->getFields(),\r\n\t\t\t\t\t'title' => $this->title,\r\n\t\t\t\t\t'pagination' => $this->enablePagination,\r\n\t\t\t\t\t'catalog' => $this->getCatalog(),\r\n\t\t\t\t\t'htmlOptions' => $this->htmlOptions,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function queryRun() {\n $action = $this ->widget_vars[\"args\"][1];\n $query = $this ->widget_vars[\"args\"][2];\n //dump($query);\n switch ($action) {\n case \"delete\":\n deleteQuery( $query );\n break;\n case \"run\":\n runQuery( $query );\n break;\n }\n cli_text(\"Ending parse at \".formatDate(null,\"pretty\"),\"blue\",\"white\");\n \n }", "function setQuery($where, $limit, $orderBy, $varName, $allowOrderByOveride=true) {\n $this->query_where = $where;\n if($this->getSessionVariable(\"query\", \"where\") != $where) {\n $this->query_where_has_changed = true;\n $this->setSessionVariable(\"query\", \"where\", $where);\n }\n\n $this->query_limit = $limit;\n if(!$allowOrderByOveride) {\n $this->query_orderby = $orderBy;\n return;\n }\n $this->getOrderBy($varName, $orderBy);\n\n $this->setLocalSessionVariable($varName, \"QUERY_WHERE\", $where);\n}", "public static function enableQueryLog()\n {\n }", "function setQuery($sql, $onlyFirstInstance = false)\n\t{\n\t\tif( !empty($this->dbprefix) )\n\t\t{\n\t\t\t// Substitute the db prefix\n\t\t\tif(!$onlyFirstInstance)\n\t\t\t{\n\t\t\t\t$sql = str_replace('#__', $this->dbprefix, $sql);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pos = strpos($sql, '#__');\n\t\t\t\t// # FIX 2.3.1 -- It is possible that the #__ doesn't exist. Stupid me!\n\t\t\t\tif($pos !== false)\n\t\t\t\t\t$sql = substr_replace( $sql, $this->dbprefix, $pos, 3);\n\t\t\t}\n\t\t}\n\n\t\t$this->sql = $sql;\n\t}", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "public function _testInitQuery() {\n $view = Views::getView('test_view');\n $view->setDisplay();\n\n $view->initQuery();\n $this->assertInstanceOf(QueryTestPlugin::class, $view->query);\n }", "public function setExecutor($executor)\n {\n $this->executor = $executor;\n }", "abstract public function exec($query='');", "protected function executeQuery() {\n return array();\n }", "public function getQueryRunner() {\n return $this->queryRunner;\n }", "public function preExecute(SelectInterface $query = NULL);", "public function set_default_query($query){\n $this->default_query = $query;\n }", "public function store_default_query( $args, $widget ) {\n\n\t\t\tif ( 'jet-listing-calendar' !== $widget->get_name() ) {\n\t\t\t\treturn $args;\n\t\t\t}\n\n\t\t\t$settings = $widget->get_settings();\n\n\t\t\tif ( empty( $settings['_element_id'] ) ) {\n\t\t\t\t$query_id = false;\n\t\t\t} else {\n\t\t\t\t$query_id = $settings['_element_id'];\n\t\t\t}\n\n\t\t\tjet_smart_filters()->query->store_provider_default_query( $this->get_id(), $args, $query_id );\n\n\t\t\tif ( is_callable( array( $widget, 'get_required_settings' ) ) ) {\n\t\t\t\t$provider_settings = call_user_func( array( $widget, 'get_required_settings' ) );\n\t\t\t} else {\n\t\t\t\t$provider_settings = array(\n\t\t\t\t\t'lisitng_id' => isset( $settings['lisitng_id'] ) ? $settings['lisitng_id'] : false,\n\t\t\t\t\t'group_by' => isset( $settings['group_by'] ) ? $settings['group_by'] : false,\n\t\t\t\t\t'group_by_key' => isset( $settings['group_by_key'] ) ? $settings['group_by_key'] : false,\n\t\t\t\t\t'allow_multiday' => isset( $settings['allow_multiday'] ) ? $settings['allow_multiday'] : false,\n\t\t\t\t\t'end_date_key' => isset( $settings['end_date_key'] ) ? $settings['end_date_key'] : false,\n\t\t\t\t\t'custom_start_from' => isset( $settings['custom_start_from'] ) ? $settings['custom_start_from'] : false,\n\t\t\t\t\t'week_days_format' => isset( $settings['end_date_key'] ) ? $settings['end_date_key'] : false,\n\t\t\t\t\t'start_from_month' => isset( $settings['start_from_month'] ) ? $settings['start_from_month'] : date( 'F' ),\n\t\t\t\t\t'start_from_year' => isset( $settings['start_from_year'] ) ? $settings['start_from_year'] : date( 'Y' ),\n\t\t\t\t\t'posts_query' => isset( $settings['posts_query'] ) ? $settings['posts_query'] : array(),\n\t\t\t\t\t'meta_query_relation' => isset( $settings['meta_query_relation'] ) ? $settings['meta_query_relation'] : false,\n\t\t\t\t\t'tax_query_relation' => isset( $settings['tax_query_relation'] ) ? $settings['tax_query_relation'] : false,\n\t\t\t\t\t'hide_widget_if' => isset( $settings['hide_widget_if'] ) ? $settings['hide_widget_if'] : false,\n\t\t\t\t\t'caption_layout' => isset( $settings['caption_layout'] ) ? $settings['caption_layout'] : 'layout-1',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tjet_smart_filters()->providers->store_provider_settings( $this->get_id(), $provider_settings, $query_id );\n\n\t\t\t$args['suppress_filters'] = false;\n\t\t\t$args['jet_smart_filters'] = jet_smart_filters()->query->encode_provider_data(\n\t\t\t\t$this->get_id(),\n\t\t\t\t$query_id\n\t\t\t);\n\n\t\t\treturn $args;\n\t\t}", "public function init()\n {\n // Default user search for all users\n if ($this->userSearchUrl == \"\") {\n // provide the space id if the widget is calling from a space\n if (Yii::$app->controller->id == 'space') {\n $spaceId = Yii::$app->controller->getSpace()->id;\n $this->userSearchUrl = Url::toRoute(['/teams/search/json', 'keyword' => '-keywordPlaceholder-', 'space_id' => $spaceId]);\n } else {\n $this->userSearchUrl = Url::toRoute(['/teams/search/json', 'keyword' => '-keywordPlaceholder-']);\n }\n }\n }", "public function init() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\tob_start();\n\t}", "public function init() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\tob_start();\r\n\t}", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n $this->getTableName('users'));\n\n $this->conf['select-user-groups'] = sprintf('\n\t\t\tSELECT title as `group` FROM %s as groups\n\t\t\tLEFT JOIN %s as groupmap ON groups.id = groupmap.group_id\n\t\t\tLEFT JOIN %s as user ON groupmap.user_id = user.id\n\t\t\tWHERE user.username = :user OR user.id = :uid ',\n $this->getTableName('usergroups'),\n $this->getTableName('user_usergroup_map'),\n $this->getTableName('users'));\n\n $this->conf['select-groups'] = sprintf('\n\t\t\tSELECT title as `group`, id as gid FROM %s',\n $this->getTableName('usergroups'));\n }", "public function init()\n\t{\n\t $id=$this->getId();\n\n\t\tif($this->url!==null)\n\t\t\t$this->url=CHtml::normalizeUrl($this->url);\n else\n throw new CException(Yii::t(\"JPeriodicalUpdater.main\", 'JPeriodicalUpdater.url must be set!'));\n\n \t$baseUrl = CHtml::asset(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets');\n\n $JsFile = (YII_DEBUG)\n ? \"/js/jquery.periodicalupdater.js\"\n : \"/js/jquery.periodicalupdater.min.js\";\n\n\t\t$options=$this->getClientOptions();\n\t\t$options=$options===array()?'{}' : CJavaScript::encode($options);\n\n $js = \"$.PeriodicalUpdater(\";\n $js .= \"$options,\\n\";\n $js .= (isset ($this->callback))\n ? $this->createCallbackScript($this->callback)\n : \"\\n\";\n $js .= (isset ($this->autoStopCallback))\n ? \",\\n\".$this->createCallbackScript($this->autoStopCallback).\"\\n\"\n : \"\\n\";\n $js .= \");\";\n\n \t\tYii::app()->getClientScript()\n ->registerCoreScript('jquery')\n ->registerScriptFile($baseUrl.$JsFile)\n ->registerScript('Yii.JPeriodicalUpdater#'.$id, $js);\n\t}", "protected function buildQueryCallback() {\n }", "public function hookItemBrowseSql()\n {\n\n $context = Zend_Controller_Action_HelperBroker::getStaticHelper('ContextSwitch')->getCurrentContext();\n if ($context == 'neatlinetime-json') {\n $search = new ItemSearch($select);\n $newParams[0]['element_id'] = neatlinetime_get_option('item_date');\n $newParams[0]['type'] = 'is not empty';\n $search->advanced($newParams);\n }\n\n }", "public function __invoke()\n {\n $this->execute();\n }", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}", "private function before_execute()\n {\n }", "public function getSqlQueriesManager();", "private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }", "public function execute ()\n\t{\n\t\treturn parent::execute();\n\t}", "public function execute ()\n\t{\n\t\treturn parent::execute();\n\t}", "public function searchQueryDataProvider() {}", "private function init_consolidationAndSelect()\n {\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n return;\n }\n // RETURN : there isn't any filter\n // Add tableUids to the consolidation array\n $this->init_consolidationAndSelect_setArrayConsolidation();\n\n // Add tableFields to the ts property SELECT\n $this->init_consolidationAndSelect_setTsSelect();\n }", "public function init() {\n //$this->js[] = YII_DEBUG ? 'js/juidatepicker.js' : 'js/juidatepicker.js';\n }", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "static function getLoadQry()\n {\n return \"SELECT `smartukm_band`.*, \n `td`.`td_demand`,\n `td`.`td_konferansier`\n \";\n }", "private function getDataTablesQuery() {\n\n\t\t$this->db->select('*');\n $this->db->from($this->table);\n //$this->db->where_not_in('akses',2); // mendandakan dia admin\n \n $i = 0;\n foreach ($this->column as $item)\n {\n if($_POST['search']['value'])\n ($i===0) ? $this->db->like($item, $_POST['search']['value']) : $this->db->or_like($item, $_POST['search']['value']);\n $column[$i] = $item;\n $i++;\n }\n \n if(isset($_POST['order']))\n {\n $this->db->order_by($column[$_POST['order']['0']['column']], $_POST['order']['0']['dir']);\n }\n else if(isset($this->order))\n {\n $order = $this->order;\n $this->db->order_by(key($order), $order[key($order)]);\n }\n }", "public function actionExeSql()\n {\n //$mysql->runSql($sql);\n }", "function CustomQuery($dalSQL)\n{\n\t$connection = getDefaultConnection();\n\t$result = $connection->query( $dalSQL );\n\tif($result)\n\t\treturn $result;\n}", "public function setGeneralDefaultQuery()\n {\n return $this;\n }", "public function setDefaultQuerySettings(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface $defaultQuerySettings)\n {\n $this->defaultQuerySettings = $defaultQuerySettings;\n }", "function query() {\n $this->ensure_my_table();\n switch ($this->options['granularity']) {\n case 'second':\n default:\n $this->query->add_orderby($this->table_alias, $this->real_field, $this->options['order']);\n return;\n case 'minute':\n $formula = views_date_sql_format('YmdHi', \"$this->table_alias.$this->real_field\");\n break;\n case 'hour':\n $formula = views_date_sql_format('YmdH', \"$this->table_alias.$this->real_field\");\n break;\n case 'day':\n $formula = views_date_sql_format('Ymd', \"$this->table_alias.$this->real_field\");\n break;\n case 'month':\n $formula = views_date_sql_format('Ym', \"$this->table_alias.$this->real_field\");\n break;\n case 'year':\n $formula = views_date_sql_format('Y', \"$this->table_alias.$this->real_field\");\n break;\n }\n\n // Add the field.\n $this->query->add_orderby(NULL, $formula, $this->options['order'], $this->table_alias . '_' . $this->field . '_' . $this->options['granularity']);\n }", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "protected function getPlottableParams()\n {\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( !$kinst )\n\t{\n\t print( \"plottable params query failed, must specify kinst\\n\" );\n\t exit( 0 ) ;\n\t}\n\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$kinst = mysql_real_escape_string( trim( $kinst ) ) ;\n\n\t$query = \"SELECT DISTINCT parameter_id, plot_func \" ;\n\t$query .= \"FROM tbl_plotting_params \" ;\n\t$query .= \"WHERE kinst='$kinst'\" ;\n\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "public function __construct(){\n DB::enableQueryLog();\n }", "public static function lista($arConfiguracao = array(), $arWhere = array())\n {\n if (!empty($arConfiguracao) && is_array($arConfiguracao)) {\n extract($arConfiguracao);\n }\n \n $oDimensao = new Dimensao();\n //$sql = $oDimensao->lista('string', $_SESSION['par']['itrid'], $arWhere );\n $sql = $oDimensao->lista('string', $_SESSION['par']['itrid']);\n \n // CABEÇALHO da lista\n $arCabecalho = array(\"Comando\",\"Descrição da Subação\");\n \n // parametros que cofiguram as colunas da lista, a ordem do array equivale a ordem do cabeçalho\n $arParamCol[0] = array(\"type\" => Lista::TYPESTRING,\n \"style\" => \"width:1200px;\",\n \"html\" => \"{dimcod}.{arecod}.{indcod} - {sbadsc}\",\n \"align\" => \"left\");\n /*$arParamCol[1] = array(\"type\" => Lista::TYPESTRING,\n //\"style\" => \"color:red;\",\n \"html\" => \"<img src=\\\"/imagens/fluxodoc.gif\\\" border=0 title=\\\"\\\" style=\\\"cursor:pointer;\\\" onclick=\\\"\\\">\",\n \"align\" => \"center\");\n */\n $acao = \"<center>\n\t\t\t\t <!-- input onclick=\\\"\\\" {checked} type=\\\"checkbox\\\" name=\\\"rdo_grupo\\\" id=\\\"rdo_grupo_{gpdid}\\\" value=\\\"{gpdid}\\\" -->\n\t\t\t\t <img border=\\\"0\\\" src=\\\"../imagens/alterar.gif\\\" onclick=\\\"popupSubacao({sbaid})\\\" >\n\t\t\t\t <center>\";\n \n // ARRAY de parametros de configuração da tabela\n $arConfig = array(//\"style\" => \"width:95%;\",\n \"totalLinha\" => false,\n \"totalRegistro\" => true);\n \n $oPaginacaoAjax = new PaginacaoAjax();\n $oPaginacaoAjax->setNrPaginaAtual($nrPaginaAtual);\n $oPaginacaoAjax->setNrRegPorPagina($nrRegPorPagina);\n $oPaginacaoAjax->setNrBlocoPaginacaoMaximo($nrBlocoPaginacaoMaximo);\n $oPaginacaoAjax->setNrBlocoAtual($nrBlocoAtual);\n $oPaginacaoAjax->setDiv('divLista');\n $oPaginacaoAjax->setCabecalho($arCabecalho);\n $oPaginacaoAjax->setSql($sql);\n $oPaginacaoAjax->setAcao($acao);\n $oPaginacaoAjax->setParamCol($arParamCol);\n $oPaginacaoAjax->setConfig($arConfig);\n $oPaginacaoAjax->show();\n }", "public function parseSQLDataProvider() {}", "public function execute() {\n\n // Add convenience tag to mark that this is an extended query. We have to\n // do this in the constructor to ensure that it is set before preExecute()\n // gets called.\n if (!$this->preExecute($this)) {\n return NULL;\n }\n\n // A NULL limit is the \"kill switch\" for pager queries.\n if (empty($this->limit)) {\n return;\n }\n $this->ensureElement();\n\n $total_items = $this->getCountQuery()->execute()->fetchField();\n $current_page = pager_default_initialize($total_items, $this->limit, $this->element);\n $this->range($current_page * $this->limit, $this->limit);\n\n // Now that we've added our pager-based range instructions, run the query normally.\n return $this->query->execute();\n }", "public function getDatagridViewBuilder();", "public function datagrid($query_debug = FALSE) {\n $page = request('page'); // la página requerida\n $limit = request('rows'); // cuantas filas queremos tener en la grilla\n $sidx = request('sidx'); // obtener la fila indice, es decir la que el usuario clickeó para ordenar\n $sord = request('sord'); // obtener la dirección (asc o desc)\n\n // renombra key búsqueda\n $sidx = !$sidx? $this->get_columns('%s.%s')[0] : $this->get_column_name($sidx); \n \n //filtros para busqueda multiple\n $filters = json_decode(request('filters', ''), true);\n $filters_rules = isset($filters['rules']) ? $filters['rules'] : [];\n $search = request('_search');\n \n //busqueda sin filtros multiples\n if($search == 'true' and empty($filters_rules)) {\n $field = request('searchField');\n $data = call_user_func($this->filter_format, $field, request('searchString'));\n $op = request('searchOper'); \n $this->set_where_rule($field, $op, $data);\n } else if ($search == 'true' and !empty($filters_rules)) { // Busqueda con filtros multiples\n foreach ($filters_rules as $filter_rule) {\n extract($filter_rule);\n $data = call_user_func($this->filter_format, $field, $data);\n $this->set_where_rule($field, $op, $data);\n }\n }\n\n $query_string = $this->get_query_str();\n $count = DB::select(\"SELECT COUNT(*) AS count FROM($query_string) count;\")[0]->count;\n\n if ($count > 0) {\n $total_pages = ceil($count / $limit);\n } else {\n $total_pages = 0;\n }\n if ($page > $total_pages)\n $page = $total_pages;\n $start = $limit * $page - $limit; // no poner $limit*($page - 1)\n \n if($query_debug) DB::enableQueryLog();\n $result = $this->query->orderBy($sidx, $sord)->skip($start)->take($limit)->get();\n\n $response['page'] = $page;\n $response['total'] = $total_pages;\n $response['records'] = $count;\n $response['rows'] = $this->set_response_rows($result);\n\n return $query_debug? $this->get_query_str() : response()->json($response);\n }", "function createQuery() ;", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }" ]
[ "0.5540766", "0.54948103", "0.5123556", "0.5087313", "0.50859964", "0.5069802", "0.50218034", "0.49462068", "0.49112695", "0.48888272", "0.48802665", "0.4871102", "0.4845782", "0.48343918", "0.48231456", "0.48170742", "0.48170742", "0.48138908", "0.4807427", "0.480096", "0.47903994", "0.47677973", "0.47589767", "0.47310725", "0.4720006", "0.47118062", "0.4708609", "0.46851295", "0.4673274", "0.4663137", "0.4652999", "0.46451685", "0.46384507", "0.46294165", "0.46293008", "0.46195796", "0.45987755", "0.45909712", "0.45842898", "0.45805526", "0.45787707", "0.457755", "0.457514", "0.45546833", "0.455319", "0.45525625", "0.4547657", "0.45476002", "0.45438397", "0.45374098", "0.45345658", "0.45185572", "0.45182452", "0.45181072", "0.45130172", "0.45061684", "0.45036724", "0.45036724", "0.45032072", "0.4503112", "0.4501667", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.44974536", "0.4488628", "0.44842348", "0.44677898", "0.4462003", "0.44588792", "0.44569388", "0.44547203", "0.44528058", "0.44466922", "0.44462764", "0.44411924", "0.44377804", "0.44279885", "0.44274402", "0.44269463", "0.4415076", "0.44148734", "0.44148734", "0.44148734", "0.44148734", "0.44148734", "0.44148734", "0.44148734", "0.44148734", "0.44148734" ]
0.0
-1
Builds LibriProducts from ONIX file.
public static function makeFromFile(string $file): array { // get catalog update identifier list($catalogUpdateIdentifier,$suffix) = explode('.',basename($file)); // get date of catalog update (don't use simplexml, the file might be very large) $dateOfCatalogUpdate = new Carbon(self::getDateOfCatalogUpdate($file)); // get number of items in file to make a progress bar $numberOfItems = substr_count(file_get_contents($file),'<product>'); $progress = ConsoleOutput::progress($numberOfItems); // holds all products $products = []; $productHandler = function($product) use ($progress,&$products,$dateOfCatalogUpdate, $catalogUpdateIdentifier) { ConsoleOutput::advance($progress); try { // create Object from ONIX message $libriProduct = self::create($product); if(!is_null($libriProduct)) { $libriProduct->DateOfData = $dateOfCatalogUpdate; $libriProduct->LibriUpdate = $catalogUpdateIdentifier; $products[] = $libriProduct; } } catch (MissingDataException $e) { ConsoleOutput::error($e->getMessage()); Log::warning($e->getMessage()); } }; try { $parser = new Parser(); // create instance of PINOpar Parser $parser->setProductHandler($productHandler); // define a product handler which will be called for each <product> tag $parser->useFile($file); $parser->parse(); ConsoleOutput::finish($progress); } catch(PONIpar\XMLException $e) { // error in ONIXMessage, e.g. missing <ProductIdentifier> // todo: find a way to continue parsing the onixmessage ConsoleOutput::error($e->getMessage()); Log::warning($e->getMessage()); } catch(Exception $e) { ConsoleOutput::error($e->getMessage()); Log::error($e->getMessage()); // todo: find a way to continue parsing after caught exception } // clear $products from null values $products = array_filter($products, function($item) { return !is_null($item); }); return $products; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function create(PONIpar\\Product $onix){\n $libriProduct = new LibriProduct;\n $controller = new LibriProductFactory();\n $controller->product = $onix;\n\n $recordReference = $controller->getRecordReference();\n\n /* ---------------- required data -------------- */\n $libriProduct->RecordReference = $recordReference;\n $libriProduct->ProductForm = $controller->getProductForm();\n $libriProduct->DistinctiveTitle = $controller->getDistinctiveTitle();\n\n $tmpReference = $controller->getProductReference();\n if(!$tmpReference) return null; // if no valid reference was found, this product is invalid\n\n $libriProduct->ProductReference = (String) $tmpReference[0];\n $libriProduct->ProductReferenceType = (String) $tmpReference[1];\n\n // test required fields\n $requiredFields = [\n 'RecordReference',\n 'ProductReference',\n 'DistinctiveTitle',\n 'ProductForm'\n ];\n\n foreach ($requiredFields as $field) {\n if ($libriProduct->$field === false) throw new MissingDataException(\"Content of `$field` not found or empty.\", $recordReference);\n }\n\n /* ---------------- optional data -------------- */\n $libriProduct->OrderTime = (Integer) $controller->getOrderTime();\n $libriProduct->QuantityOnHand = (Integer) $controller->getQuantityOnHand();\n $libriProduct->AvailabilityStatus = (Integer) $controller->getAvailabilityStatus();\n $libriProduct->NumberOfPages = (Integer) $controller->getNumberOfPages();\n $libriProduct->VLBSchemeOld = (Integer) $controller->getVLBSchemeOld();\n $libriProduct->ProductWeight = (Integer) $controller->getProductWeight();\n $libriProduct->ProductWidth = (Integer) $controller->getProductWidth();\n $libriProduct->ProductThickness = (Integer) $controller->getProductThickness();\n $libriProduct->AudienceCodeValue = (Integer) $controller->getAudienceCodeValue();\n\n $libriProduct->Author = (String) $controller->getAuthor();\n $libriProduct->CoverLink = (String) $controller->getCoverLink();\n $libriProduct->ProductLanguage = (String) $controller->getProductLanguage();\n $libriProduct->PublisherName = (String) $controller->getPublisherName();\n $libriProduct->PublicationDate = (String) $controller->getPublicationDate();\n $libriProduct->Blurb = (String) $controller->getBlurb();\n\n $controller->CurrentPrice = $controller->getPriceDeCurrent();\n $libriProduct->PriceAmount = (float) $controller->getPriceAmount();\n $libriProduct->PriceTypeCode = (Integer) $controller->getPriceTypeCode();\n $libriProduct->DiscountPercent = (Integer) $controller->getDiscountPercent();\n $libriProduct->TaxRateCode1 = (String) $controller->getTaxRateCode1();\n $libriProduct->NotificationType = $controller->getNotificationType();\n $libriProduct->Lib_MSNo = $controller->getLibriNotificationKey();\n $libriProduct->AvailabilityCode = $controller->getAvailabilityCode();\n $libriProduct->PublishingStatus = $controller->getPublishingStatus();\n\n return $libriProduct;\n }", "public function make_gear_products_import() {\n\t\tWP_CLI::line( 'GO!' );\n\t\t$rei = file_get_contents( get_stylesheet_directory_uri() . '/inc/wp-cli/rei.xml' );\n\t\t$xml = simplexml_load_string( $rei );\n\t\tforeach ($xml->Product as $products ) {\n\t\t\t$post = array(\n\t\t\t\t'post_title' => $products->Product_Name,\n\t\t\t\t'post_type' \t=> 'gear',\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_author' => 0,\n\t\t\t\t'post_content'\t=> $products->Long_Description,\n\t\t\t\t'post_excerpt'\t=> $products->Short_Description,\n\t\t\t);\n\n\t\t\t$id = wp_insert_post( $post );\n\n\t\t\tif ( $id ) {\n\t\t\t\tWP_CLI::success( get_the_title( $id ) );\n\t\t\t} elseif ( is_wp_error( $id ) ) {\n\t\t\t\tWP_CLI::warning( $products->Product_Name );\n\t\t\t}\n\n\t\t\t$terms = wp_set_object_terms( $id, array( $products->Category, $products->SubCategory ), 'category', true );\n\n\t\t\t$tags = explode( ',', $products->Keywords );\n\n\t\t\tprint_r( $tags );\n\n\t\t\t$the_tags = wp_set_object_terms( $id, $tags, 'post_tag', true );\n\n\t\t\t$the_tags = wp_set_object_terms( $id, $products->BrandName, 'post_tag', true );\n\n\t\t\t$keys = array( 'SKU',\n\t\t\t\t'Manufacturer_Id',\n\t\t\t\t'Brand_Name',\n\t\t\t\t'Thumb_URL',\n\t\t\t\t'Medium_Image_URL',\n\t\t\t\t'Image_URL',\n\t\t\t\t'Buy_Link',\n\t\t\t\t'Retail_Price',\n\t\t\t\t'Sale_Price',\n\t\t\t\t'Brand_Page_Link',\n\t\t\t\t'Brand_Logo_Image',\n\t\t\t\t'Product_Page_View_Tracking',\n\t\t\t\t'Product_Content_Widget',\n\t\t\t\t'Google_Categorization'\n\t\t\t\t);\n\t\t\tWP_CLI::line('| Post ID ' . $id );\n\t\t\t// WP_CLI::line('| Post SKU' . ( $sku ) ? get_post_meta( $id, 'SKU', true ) : 'Nope...' );\n\t\t\tforeach ( $keys as $key ) {\n\t\t\t\tWP_CLI::line( '| ' . $key );\n\t\t\t\t$meta = ( !empty( $products->$key ) ) ? add_post_meta( $id, $key, (string) $products->$key ) : null;\n\t\t\t\tif ( $meta ) {\n\t\t\t\t\tWP_CLI::line( '| Added: ' . $products->$key );\n\t\t\t\t} else {\n\t\t\t\t\tWP_CLI::warning( 'Didn\\'t add ' . $key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tWP_CLI::line( '' );\n\t\t\tWP_CLI::line( '' );\n\t\t\tWP_CLI::line( '' );\n\t\t}\n\t}", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "function dbInstall($data) {\r\n/*\r\nproducts - Products\r\nproduct_categories - Categories\r\nshopping_list_items - Shopping List\r\n*/\r\n $data = <<<EOD\r\n\r\n products: ID int(10) unsigned NOT NULL auto_increment\r\n products: TITLE varchar(255) NOT NULL DEFAULT ''\r\n products: CATEGORY_ID int(10) NOT NULL DEFAULT '0'\r\n products: IMAGE varchar(70) NOT NULL DEFAULT ''\r\n products: WILL_EXPIRE int(3) NOT NULL DEFAULT '0'\r\n products: EXPIRE_DATE date\r\n products: EXPIRE_DEFAULT int(10) NOT NULL DEFAULT '0'\r\n products: UPDATED datetime\r\n products: QTY int(10) NOT NULL DEFAULT '0'\r\n products: MIN_QTY int(10) NOT NULL DEFAULT '0'\r\n products: DETAILS text\r\n products: DEFAULT_PRICE float DEFAULT '0' NOT NULL\r\n\r\n product_categories: ID int(10) unsigned NOT NULL auto_increment\r\n product_categories: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_categories: PRIORITY int(10) NOT NULL DEFAULT '0'\r\n product_categories: PARENT_ID int(10) NOT NULL DEFAULT '0'\r\n product_categories: SUB_LIST text\r\n product_categories: PARENT_LIST text\r\n\r\n shopping_list_items: ID int(10) unsigned NOT NULL auto_increment\r\n shopping_list_items: TITLE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n shopping_list_items: PRICE float DEFAULT '0' NOT NULL\r\n shopping_list_items: CODE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: IN_CART int(3) NOT NULL DEFAULT '0'\r\n\r\n product_log: ID int(10) unsigned NOT NULL auto_increment\r\n product_log: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_log: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: CODE_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: QTY int(10) NOT NULL DEFAULT '0'\r\n product_log: ACTION char(10) NOT NULL DEFAULT ''\r\n product_log: UPDATED datetime\r\n\r\n product_codes: ID int(10) unsigned NOT NULL auto_increment\r\n product_codes: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: CODE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n\r\n\r\nEOD;\r\n parent::dbInstall($data);\r\n }", "function getProducts(){\r\n\r\n\t$products = false;\r\n\t$pList = simplexml_load_file('data/productList.xml');\r\n\tif( isset( $pList->product ) ){\r\n\t\t$products = array();\r\n\t\tforeach ($pList->product as $p) {\r\n\t\t\t$cur = array();\r\n\t\t\t\r\n\t\t\t$cur['id'] \t\t\t= (string)$p->id;\r\n\t\t\t$cur['name'] \t\t= (string)$p->name;\r\n\t\t\t$cur['category'] \t= (string)$p->category;\r\n\t\t\t$cur['price'] \t\t= (string)$p->price;\r\n\t\t\t$cur['quantity'] \t= (string)$p->quantity;\r\n\t\t\t$cur['offer'] \t\t= (string)$p->offer;\r\n\t\t\t$cur['picture'] \t= (string)$p->picture;\r\n\t\t\t$cur['date'] \t\t= (string)$p->date;\r\n\t\t\t$cur['userId'] \t\t= (string)$p->userId;\r\n\t\t\t$cur['status'] \t\t= (string)$p->status;\r\n\r\n\t\t\t$products[] = $cur;\r\n\t\t\tunset($cur);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\treturn $products;\r\n}", "protected static function buildBaseTcaFromSingleFiles() {}", "public function buildCoreFields(): void\n {\n //====================================================================//\n // Product SKU\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"identifier\")\n ->name(\"Product SKU\")\n ->microData(\"http://schema.org/Product\", \"model\")\n ->isListed()\n ->isReadOnly()\n ;\n //====================================================================//\n // Active => Product Is Enables & Visible\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->identifier(\"enabled\")\n ->name(\"Enabled\")\n ->microData(\"http://schema.org/Product\", \"offered\")\n ->isListed()\n ;\n //====================================================================//\n // Product Family\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_code\")\n ->name(\"Family Code\")\n ->group(\"Metadata\")\n ->addChoices($this->variants->getFamilyChoices())\n ->microData(\"http://schema.org/Product\", \"famillyCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Product Family Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_label\")\n ->name(\"Family Name\")\n ->group(\"Metadata\")\n ->microData(\"http://schema.org/Product\", \"famillyName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Product Family Variant\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_variant_code\")\n ->name(\"Family Variant Code\")\n ->group(\"Metadata\")\n ->addChoices($this->variants->getFamilyChoices())\n ->microData(\"http://schema.org/Product\", \"famillyVariantCode\")\n ->isNotTested()\n ;\n //====================================================================//\n // PhpUnit/Travis Mode => Force Variation Types\n if (Splash::isTravisMode()) {\n $this->fieldsFactory()->addChoice(\"clothing_color\", \"Color\");\n }\n }", "public abstract function build();", "public abstract function build();", "abstract function build();", "abstract public function build();", "abstract public function build();", "function ciniki_products_processPDFCatalog(&$ciniki, $tnid, $catalog_id) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUUID');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'hooks', 'insertFromImagick');\n\n //\n // Load the pdf catalog\n //\n $strsql = \"SELECT id, uuid, status, permalink \"\n . \"FROM ciniki_product_pdfcatalogs \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $catalog_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 10 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.products', 'catalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['catalog']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.33', 'msg'=>'Catalog does not exist'));\n }\n $catalog = $rc['catalog'];\n \n //\n // Update the pdf catalog status to lock\n //\n $strsql = \"UPDATE ciniki_product_pdfcatalogs SET status = 20 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $catalog_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 10 \"\n . \"\";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.products');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_affected_rows'] < 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.34', 'msg'=>'Unable to lock catalog for processing.'));\n }\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n //\n // Check the file exists\n $storage_filename = $tenant_storage_dir . '/ciniki.products/pdfcatalogs/' . $catalog['uuid'][0] . '/' . $catalog['uuid'];\n if( !file_exists($storage_filename) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.35', 'msg'=>'Unable to open pdf.'));\n }\n\n //\n // Copy to tmp directory so it's local for processing. Remove files take too long to open over and over for each page.\n //\n if( isset($ciniki['config']['ciniki.core']['tmp_dir']) ) {\n $tmp_filename = $ciniki['config']['ciniki.core']['tmp_dir'] . '/' . $catalog['uuid'];\n } else {\n $tmp_filename = '/tmp/' . $catalog['uuid'];\n }\n\n if( !copy($storage_filename, $tmp_filename) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.36', 'msg'=>'Unable to copy pdf.'));\n }\n\n ini_set('memory_limit', '4096M');\n\n $imagick = new Imagick();\n $imagick->setResolution(300, 300);\n\n $imagick->pingImage($tmp_filename);\n $num_pages = $imagick->getNumberImages();\n $imagick->clear();\n $imagick->destroy();\n\n $imagick = new Imagick();\n $imagick->setResolution(300, 300);\n\n $page_number = 0;\n for($page_number = 0; $page_number < $num_pages; $page_number++) {\n $imagick->readImage($tmp_filename . '[' . $page_number . ']');\n $imagick = $imagick->flattenImages();\n $imagick->setImageFormat('jpeg');\n \n //\n // Add the image\n //\n $rc = ciniki_images_hooks_insertFromImagick($ciniki, $tnid, array(\n 'image'=>$imagick,\n 'original_filename'=>$catalog['permalink'] . '-' . ($page_number+1) . '.jpg',\n 'name'=>'',\n 'force_duplicate'=>'no',\n 'perms'=>1,\n ));\n if( $rc['stat'] != 'ok' && $rc['stat'] != 'exists' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.37', 'msg'=>\"Unable to save image for page $page_number.\", 'err'=>$rc['err']));\n }\n $image_id = $rc['id'];\n\n //\n // Add the pdfcatalog image\n //\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.products.pdfcatalogimage', array(\n 'catalog_id'=>$catalog_id,\n 'page_number'=>($page_number+1),\n 'image_id'=>$image_id,\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.38', 'msg'=>\"Unable to save image for page $page_number.\"));\n }\n }\n\n unlink($tmp_filename);\n\n //\n // Update the pdf catalog status to lock\n //\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.products.pdfcatalog', $catalog_id, array(\n 'status'=>30,\n 'num_pages'=>$num_pages,\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n return array('stat'=>'ok');\n}", "protected function buildProducts($vtexBaseProduct)\n {\n $baseProduct = [\n 'brand' => $vtexBaseProduct->brand,\n 'description' => $vtexBaseProduct->description,\n 'url' => preg_replace('/https?:\\/\\/.*\\.vtexcommercestable\\.com\\.br/si', $this->vtexConnector->getStoreUrl(), $vtexBaseProduct->link),\n 'base_name' => $vtexBaseProduct->productName,\n 'release_date' => $vtexBaseProduct->releaseDate\n ];\n\n $categories = $this->vtexConnector->getCategories();\n if ($this->hasCategory($categories, $vtexBaseProduct)) {\n $baseProduct['category'] = $categories[$vtexBaseProduct->categoryId];\n }\n\n if ($customAttributes = $this->getCustomAttributes($vtexBaseProduct)) {\n $baseProduct['custom_attributes'] = $customAttributes;\n }\n\n foreach ($vtexBaseProduct->items as $vtexProduct) {\n if (!$this->hasSku($vtexProduct)) {\n continue;\n }\n $sku = $vtexProduct->referenceId[0]->Value;\n\n yield $baseProduct + [\n 'image_url' => $this->getImageUrl($vtexProduct),\n 'thumbnail_url' => $this->getImageUrl($vtexProduct),\n 'sku' => $sku,\n 'name' => $vtexProduct->name,\n 'price' => $this->getItemListPrice($vtexProduct),\n 'offer_price' => $this->getItemPrice($vtexProduct),\n 'stock' => $this->getItemStock($vtexProduct),\n 'available' => true,\n ];\n }\n }", "function m_packageBuild()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_MAIN_BLK\", \"main_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAIN_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\tif(!isset($this->request['owner']))\n\t\t{\n\t\t\t$this->request['owner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['type']))\n\t\t{\n\t\t\t$this->request['type']=\"product\";\n\t\t}\n\t\tif(!isset($this->request['otype']))\n\t\t{\n\t\t\t$this->request['otype']=\"department\";\n\t\t}\n\t\tif(!isset($this->request['kitid']))\n\t\t{\n\t\t\t$this->request['kitid']=\"\";\n\t\t}\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OWNER\",$this->request['owner']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$this->request['type']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OTYPE\",$this->request['otype']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"LANG_VAR_BUILDPACKAGE\",LANG_BUILDPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CURRENTPACKAGE\",LANG_CURRENTPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CODE\",LANG_CODE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCT\",LANG_PRODUCTSTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_QTY\",LANG_QTYTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SORT\",LANG_SORT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_REMOVE\",LANG_REMOVE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_HOME\",LANG_HOME);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_ALLORPHAN\",LANG_ALLORPHAN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_RETURNPACK\",LANG_RETURNTOPACK);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_VIEWITEMS\",LANG_VIEWITEMS);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_UPDATEPACKAGE\",LANG_UPDATEPACKAGE);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\t\n\t\t\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t}\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\n\t\t#START DISPLAY PRODUCT BLOCK\n\t\t#IF TYPE IS CONTENT\n\t\tif(isset($this->request['postOwner']))#PRODUCT\n\t\t{#FOR ORPHAN PRODUCT\n\t\t\tif($this->request['postOwner']==\"orphan\")\n\t\t\t{\n\t\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='\".$this->request['type'].\"'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t}\n\t\telse#POST OWNER NOT SET\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",\"\");\n\t\t}\n\n\t\t$this->obDb->query=\"SELECT vTitle FROM \".PRODUCTS.\" WHERE iProdId_PK='\".$this->request['kitid'].\"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif(!empty($rs[0]->vTitle))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",$this->libFunc->m_displayContent($rs[0]->vTitle));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",\"\");\n\t\t}\n\t\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$query1 = \"SELECT vSku,vTitle,iProdId_PK,iKitId_PK,iSort,iQty FROM \".PRODUCTS.\", \".PRODUCTKITS.\" WHERE iProdId_PK=iProdId_FK AND iKitId='\".$this->request['kitid'].\"' order by iSort\";\n\t\t$this->obDb->query=$query1;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_QTY\",$queryResult[$j]->iQty);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SORT\",$queryResult[$j]->iSort);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SKU\",$this->libFunc->m_displayContent($queryResult[$j]->vSku));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$str=str_replace(\"'\",\"\\'\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE1\",$str);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_KID\",$queryResult[$j]->iKitId_PK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\n\t\t\t}\n\n\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\tif(empty($this->request['kitid']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"main_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_BUILDPACK);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_ADDTOPACK);\n\t\t}\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "public function get_all_product_information () {\n $this->json_source_file = file_get_contents(\"products.json\");\n $this->json_source_array = json_decode($this->json_source_file,true);\n\n }", "public function product_action()\n\t{\n\t\t// shut up php\n\t\terror_reporting(0);\n\t\tee()->load->helper('xml');\n\n\t\t$output = new Oxymel;\n\n\t\t// create our structure\n\t\t$output->xml->products->contains;\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t$query = ee()->sync_db\n\t\t\t->where('processed', 0)\n\t\t\t->get('products', 500);\n\n\t\t$ids_processed = array();\n\n\t\tforeach($query->result() as $row)\n\t\t{\n\n\t\t\tif($row->tax_exempt == 0)\n\t\t\t{\n\t\t\t\t$tax_exempt = \"Taxable\";\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tax_exempt = \"\";\n\t\t\t}\n\n\t\t\tif(!empty($row->product_category_3))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_3;\n\t\t\t}\t\n\t\t\telseif(!empty($row->product_category_2))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_1;\n\t\t\t}\n\n\t\t\t// append a product\n\t\t\t$output\n\t\t\t\t->product->contains\n\t\t\t\t \t->title->contains->cdata($row->sku .' - ' . $row->name)->end\n\t\t\t\t \t->sku($row->sku)\n\t\t\t\t \t->name->contains->cdata($row->name)->end\n\t\t\t\t \t->price($row->price)\n\t\t\t\t \t->weight($row->weight)\n\t\t\t\t \t->length($row->length)\n\t\t\t\t \t->width($row->width)\n\t\t\t\t \t->height($row->height)\n\t\t\t\t \t->handling($row->handling)\n\t\t\t\t \t->free_shipping($row->free_shipping)\n\t\t\t\t \t->tax_exempt($tax_exempt)\n\t\t\t\t \t->category->contains->cdata($product_category)->end\n\t\t\t\t \t->product_number($row->product_number)\n\t\t\t\t \t->manufacturer->contains->cdata($row->product_manufacturer)->end\n\t\t\t\t \t->container($row->product_container)\n\t\t\t\t \t->condition($row->product_condition)\n\t\t\t\t \t->listed($row->product_listed)\n\t\t\t\t \t->location($row->product_location)\n\t\t\t\t \t->tested($row->product_tested)\n\t\t\t\t \t->cosmetic_condition->contains->cdata($row->product_cosmetic_condition)->end\n\t\t\t\t \t->keywords->contains->cdata($row->product_keywords)->end\n\t\t\t\t \t->natural_search->contains->cdata($row->product_natural_search)->end\n\t\t\t\t \t->description->contains->cdata($row->product_description)->end\n\t\t\t\t \t->image($row->product_image_filename)\n\t\t\t\t \t->stock_level($row->product_stock_level)\n\t\t\t\t \t->sell_online($row->product_sell_online)\n\t\t\t\t \t->timestamp($row->timestamp)\n\t\t\t\t->end;\t\n\n\t\t\t$ids_processed[] = $row->id;\n\n\t\t}\t\n\n\t\t// close our structure\n\t\t$output->end;\t\n\t\t\t \t\n\t\t// update processed flag on records\t\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('products');\n\t\t}\n\n\t\theader('Content-Type: text/xml');\n\t\texit($output->to_string());\n\n\t}", "protected function _buildMerge($product)\n {\n $import = $this->_root->appendChild($this->_doc->createElement('import'));\n\n $import->setAttribute('type', 'product');\n $import->setAttribute('operation', 'merge');\n $import->setAttribute('externalReference', $product->getExternalReference());\n\n $content = \"\";\n\n foreach ($product->toArray(true) as $key => $value) {\n $content .= $key.\"=\".$value.\"\\n\";\n }\n\n $import->appendChild($import->ownerDocument->createCDATASection(substr($content, 0, -1)));\n }", "function cc_import_xml_file($file){\n\t\n\t// apro file ed elaboro xml\t\n\t$xml = @simplexml_load_file($file);\t\n\n\tif($xml){\t\t\n\t\t// ok struttura xml valida, recupero tag root Offerte\n\t\t$offerte = $xml->Offerte;\n\n\t\tif($offerte){\t\n\t\t\t// tutto ok procedo con elavorazione\n\t\t\t\n\t\t\t$nofferte = count($offerte); // numeri di record all'interno del file\n\t\t\tcc_update_configs(\"source\", $nofferte); // aggiorno file di config con il numerod i record nel file xml\n\t\t\t\n\t\t\t/***\n\t\t\t * Elabora oggetto xml\n\t\t\t * Restituisce array con chiave Rif e valore \"updated\", \"inserted\" o false\n\t\t\t*/\n\t\t\treturn cc_elabora_file_xml($offerte); // restriuisci array a cc_controllo_nuovi_immobili()\t\t \n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t// E' un file xml ma con struttura errata (manca tag apertura Offerte) - invio email di notifica \n\t\t\tcc_import_error(\"Nessuna offerta trovata nel file XML \".$file);\n\t\t\treturn false; // ritorno a cc_controllo_nuovi_immobili()\n\t\t\t\n\t\t}\n\t\t\n\t}else{\n\t\t\t\t\n\t\t// Non è un file xml valido - invio email di notifica \n\t\tcc_import_error($file.\" non è un file XML valido!\");\n\t\treturn false; // ritorno a cc_controllo_nuovi_immobili()\n\t\t\n\t} // end if xml\t\t\n\t\n}", "public function importABCProducts()\n {\n try {\n $input = Request::onlyLegacy('file', 'supplier_id');\n $validator = Validator::make($input, FinancialProduct::getImportFileRules());\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $import = App::make(ImportProducts::class);\n $import->import($input['file'], $input['supplier_id']);\n\n return ApiResponse::success([\n 'message' => trans('response.success.imported', ['attribute' => 'File']),\n ]);\n } catch (InvalidImportTemplate $e) {\n return ApiResponse::errorGeneral($e->getMessage());\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.something_wrong'), $e);\n }\n }", "function makeProduct($productcode) {\n\t$product = new Product();\n \t$product->category = substr($productcode, 0, 1);\n \t$i = strpos($productcode, '-', 1) + 1;\n \t$product->style = substr($productcode, 1, $i - 2);\n \t$j = strpos($productcode, '-', $i) + 1;\n \t$product->type = substr($productcode, $i, $j - 1 - $i);\n \t$product->material = substr($productcode, $j);\n\treturn $product;\n}", "public function init($config = array())\n\t{\t\t\t\t\n\t\tif (isset($config['languageId'])) {\n\t\t\t$this->languageId = $config['languageId'];\n\t\t}\n\t\tif (isset($config['categoryKey'])) {\n\t\t\t$this->categoryKey = $config['categoryKey'];\n\t\t}\n\t\tif (isset($config['cronTask'])) {\n\t\t\t$this->setCron($config['cronTask']);\n\t\t}\n\t\tif (isset($config['csvOptions'])) {\n\t\t\t$this->setCsvOptions($config['csvOptions']);\n\t\t}\n\t\tif (isset($config['importFields'])) {\n\t\t\t$this->importFields = $config['importFields'];\n\t\t}\n\t\tif (isset($config['productStatus'])) {\n\t\t\t$this->productStatus = $config['productStatus'];\n\t\t}\n\t\tif (isset($config['categoryStatus'])) {\n\t\t\t$this->categoryStatus = $config['categoryStatus'];\n\t\t}\n\t\tif (isset($config['categoryCreate'])) {\n\t\t\t$this->categoryCreate = $config['categoryCreate'];\n\t\t}\n\t\tif (isset($config['categoryDelimiter'])) {\n\t\t\t$this->categoryDelimiter = $config['categoryDelimiter'];\n\t\t}\n\t\tif (isset($config['csvSkipFirstLine'])) {\n\t\t\t$this->csvSkipFirstLine = $config['csvSkipFirstLine'];\n\t\t}\n\t\tif (isset($config['addToSubCategories'])) {\n\t\t\t$this->addToSubCategories = $config['addToSubCategories'];\n\t\t}\n\t\tif (isset($config['imageFileTpl'])) {\n\t\t\t$this->prepareImages($config['imageFileTpl']);\n\t\t}\n\t\t$this->_baseProduct = $this->getBaseProduct();\n\t\t$this->_baseCategory = $this->getBaseCategory();\n\t\t\n\t\tif ($this->handle && $this->csvSkipFirstLine) {\n\t\t\t$this->getItem();\n\t\t\t$this->csvSkipFirstLine = 0;\n\t\t}\n\t}", "function jft_assistant_sdk( $products ) {\n\t$products[] = __FILE__;\n\n\treturn $products;\n}", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "function getProductInfos($oid){\n if (!isset($this->products[$oid])){\n $r = array('pool'=>NULL, 'ticket'=>NULL, 'person'=>NULL, 'taarticleno'=>NULL);\n $selectedfields = array('tapool', 'taperson', 'taticket', 'prdconf');\n if ($this->xwtscatalog->fieldExists('taarticleno')){\n $selectedfields[] = 'taarticleno';\n }\n $dp = $this->xwtscatalog->display(array('oid'=>$oid,\n 'selectedfields'=>$selectedfields,\n 'options'=>array('tapool'=>array('target_fields'=>array('prjno', 'poolno')),\n 'taperson'=>array('target_fields'=>array('ptno')),\n 'prdconf'=>array('target_fields'=>array('calendar')),\n 'taticket'=>array('target_fields'=>array('tapool', 'ttno'))\n )\n )\n );\n $r['project'] = $dp['otapool']->link['oprjno']->raw;\n $r['pool'] = $dp['otapool']->link['opoolno']->raw;\n $r['ticket'] = $dp['otaticket']->link['ottno']->raw;\n $r['person'] = $dp['otaperson']->link['optno']->raw;\n $r['calendartype'] = $dp['oprdconf']->link['ocalendar']->link['otype']->raw;\n if (isset($dp['otaarticleno']))\n $r['taarticleno'] = $dp['otaarticleno']->raw;\n $this->products[$oid] = $r;\n }\n return $this->products[$oid];\n }", "function catalog_db2xml($lang_id=\"default\")\n{\n\t# Start catalog\n\t$string_data = <<<EOF\n<?xml version=\"1.0\"?>\n<catalog lang=\"$lang_id\" descr=''>\n\t<entity id=\"section\" descr=\"Lab Section\">\nEOF;\n\t$handle = fopen(\"../../langdata/\".$lang_id.\"_catalog.xml\", \"w\");\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM test_category\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['test_category_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add test types\n\t$string_data = <<<EOF\n\n\t<entity id=\"test\" descr=\"Test Type\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM test_type WHERE disabled=0\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['test_type_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add measures\n\t$string_data = <<<EOF\n\n\t<entity id=\"measure\" descr=\"Measures\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM measure\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['measure_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# Add specimen types\n\t$string_data = <<<EOF\n\n\t<entity id=\"specimen\" descr=\"Specimen Types\">\nEOF;\n\tfwrite($handle, $string_data);\n\t$query_string = \"SELECT * FROM specimen_type WHERE disabled=0\";\n\t$resultset = query_associative_all($query_string);\n\tforeach($resultset as $record)\n\t{\n\t\t$key = $record['specimen_type_id'];\n\t\t$value = $record['name'];\n\t\t$string_data = <<<EOF\n\n\t\t<term>\n\t\t\t<key>$key</key>\n\t\t\t<value>$value</value>\n\t\t</term>\nEOF;\n\t\tfwrite($handle, $string_data);\n\t}\n\t$string_data = <<<EOF\n\n\t</entity>\nEOF;\n\tfwrite($handle, $string_data);\n\t# End catalog\n\t$string_data = <<<EOF\n\n</catalog>\nEOF;\n\tfwrite($handle, $string_data);\n\tfclose($handle);\n}", "public function __construct(){\n\t\t$this->storage = FileStorageFactory::create($this->filename);\n\t\t$this->json = $this->storage->getFile();\n\t\t$this->products = json_decode($this->json,true);\n\t\tif(!is_array($this->products)){\n\t\t\tthrow new \\Exception('Not valid Products!');\n\t\t}\n\t}", "public function importmagento()\n {\n $base_url=\"http://myshoes.fastcomet.host/Magentos/\";\n //API user\n $user=\"apiuser\";\n //API key\n $password=\"81eRvINu9r\";\n\n\n $api_url=$base_url.'index.php/api/soap/?wsdl';\n $client = new SoapClient($api_url);\n $session = $client->login($user,$password);\n\n $params = array(array(\n 'status'=>array('eq'=>'enabled')\n ));\n\n $result1 = $client->call($session, 'catalog_product.list');\n\n $i=0;\n foreach($result1 as $key => $value)\n {\n $result2 = $client->call($session, 'catalog_product.info',$result1[$key]['product_id']);\n $result3 = $client->call($session, 'cataloginventory_stock_item.list',$result1[$key]['product_id']);\n $arr[$i]['Product']['product_id']=$result1[$key]['product_id'];\n $arr[$i]['Product']['name']=$result1[$key]['name'];\n $arr[$i]['Product']['description']=$result2['description'];\n $arr[$i]['Product']['uom']='';\n $arr[$i]['Product']['category']= '';\n $arr[$i]['Product']['group']='';\n $arr[$i]['Product']['sku']=$result1[$key]['sku'];\n $arr[$i]['Product']['value']= number_format((float)$result2['price'], 2, '.', '');\n $arr[$i]['Product']['reorderpoint']='';\n $arr[$i]['Product']['safetystock']='';\n $arr[$i]['Product']['bin']='';\n $arr[$i]['Product']['imageurl']='';\n $arr[$i]['Product']['pageurl']=$base_url.$result2['url_path'];\n $arr[$i]['Product']['weight']= number_format((float)$result2['weight'], 2, '.', '');\n $arr[$i]['Product']['height']='';\n $arr[$i]['Product']['width']='';\n $arr[$i]['Product']['depth']='';\n $arr[$i]['Product']['barcodesystem']='';\n $arr[$i]['Product']['barcode_number']='';\n $arr[$i]['Product']['packaginginstructions']='';\n $arr[$i]['Product']['color']='';\n $arr[$i]['Product']['size']='';\n $arr[$i]['Inventory']['inventoryquantity']=$result3[0]['qty'];\n $arr[$i]['Product']['createdinsource']=$result2['created_at'];\n $arr[$i]['Product']['modifiedinsource']=$result2['updated_at'];\n $i++;\n }\n $this->importcsv(null, $arr);\n return $this->redirect(array('controller' => 'products', 'action' => 'index'));\n }", "public function build_product_data( $item=array(), $old_item=array() ) {\n\n // summarize product details\n $retProd = array(\n 'ASIN' => isset($item['ASIN']) ? $item['ASIN'] : '',\n 'ParentASIN' => isset($item['ParentASIN']) ? $item['ParentASIN'] : '',\n \n 'ItemAttributes' => isset($item['ItemAttributes']) ? $item['ItemAttributes'] : array(),\n 'Title' => isset($item['ItemAttributes']['Title']) ? stripslashes($item['ItemAttributes']['Title']) : '',\n 'SKU' => isset($item['ItemAttributes']['SKU']) ? $item['ItemAttributes']['SKU'] : '',\n 'Feature' => isset($item['ItemAttributes']['Feature']) ? $item['ItemAttributes']['Feature'] : '',\n 'Brand' => isset($item['ItemAttributes']['Brand']) ? $item['ItemAttributes']['Brand'] : '',\n 'Binding' => isset($item['ItemAttributes']['Binding']) ? $item['ItemAttributes']['Binding'] : '',\n //'ListPrice' => isset($item['ItemAttributes']['ListPrice']['FormattedPrice']) ? $item['ItemAttributes']['ListPrice']['FormattedPrice'] : '',\n \n 'Variations' => isset($item['Variations']) ? $item['Variations'] : array(),\n 'VariationSummary' => isset($item['VariationSummary']) ? $item['VariationSummary'] : array(),\n 'BrowseNodes' => isset($item['BrowseNodes']) ? $item['BrowseNodes'] : array(),\n 'DetailPageURL' => isset($item['DetailPageURL']) ? $item['DetailPageURL'] : '',\n 'SalesRank' => isset($item['SalesRank']) ? $item['SalesRank'] : 999999,\n\n 'SmallImage' => isset($item['SmallImage']['URL']) ? trim( $item['SmallImage']['URL'] ) : '',\n 'LargeImage' => isset($item['LargeImage']['URL']) ? trim( $item['LargeImage']['URL'] ) : '',\n\n 'Offers' => isset($item['Offers']) ? $item['Offers'] : '',\n 'OfferSummary' => isset($item['OfferSummary']) ? $item['OfferSummary'] : '',\n 'EditorialReviews' => isset($item['EditorialReviews']['EditorialReview']['Content'])\n ? $item['EditorialReviews']['EditorialReview']['Content'] : '',\n \n\t\t\t\t'hasGallery'\t\t\t=> 'false',\n );\n\t\t\t\n\t\t\t// try to rebuid the description if is empty\n\t\t\tif( trim($retProd[\"EditorialReviews\"]) == \"\" ){\n\t\t\t\tif( isset($item['EditorialReviews']['EditorialReview']) && count($item['EditorialReviews']['EditorialReview']) > 0 ){\n\t\t\t\t\t\n\t\t\t\t\t$new_description = array();\n\t\t\t\t\tforeach ($item['EditorialReviews']['EditorialReview'] as $desc) {\n\t\t\t\t\t\tif( isset($desc['Content']) && isset($desc['Source']) ){\n\t\t\t\t\t\t\t//$new_description[] = '<h3>' . ( $desc['Source'] ) . ':</h3>';\n\t\t\t\t\t\t\t$new_description[] = $desc['Content'] . '<br />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( isset($new_description) && count($new_description) > 0 ){\n\t\t\t\t\t$retProd[\"EditorialReviews\"] = implode( \"\\n\", $new_description );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n // CustomerReviews url\n if ( isset($item['CustomerReviews'], $item['CustomerReviews']['HasReviews'])\n && $item['CustomerReviews']['HasReviews'] ) {\n $retProd['CustomerReviewsURL'] = $item['CustomerReviews']['IFrameURL'];\n }\n\n // Images\n $retProd['images'] = $this->build_images_data( $item );\n if ( empty($retProd['images']['large']) ) {\n // no images found - if has variations, try to find first image from variations\n $retProd['images'] = $this->get_first_variation_image( $item );\n }\n \n if ( empty($retProd['SmallImage']) ) {\n if ( isset($retProd['images']['small']) && !empty($retProd['images']['small']) ) {\n $retProd['SmallImage'] = $retProd['images']['small'][0];\n }\n }\n if ( empty($retProd['LargeImage']) ) {\n if ( isset($retProd['images']['large']) && !empty($retProd['images']['large']) ) {\n $retProd['LargeImage'] = $retProd['images']['large'][0];\n }\n }\n\n\t\t\t// has gallery: get gallery images\n\t\t\tif ( isset($item['ImageSets']) && count($item['ImageSets']) > 0 ) {\n\t\t\t\tforeach ( $item['ImageSets'][\"ImageSet\"] as $key => $value ) {\n\t\t\t\t\tif ( isset($value['LargeImage']['URL']) ) {\n\t\t\t\t\t\t$retProd['hasGallery'] = 'true';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n return $retProd;\n }", "public function buildAutoloadInformationFiles() {}", "function xml_form_by_file($xml_file) {\r\n\t\t$xml = new my_xml_parser ( $xml_file );\r\n\t\t$this->xml_form_by_obj ( $xml );\r\n\t\t\r\n//\t\tif($this->config_service['multilang']==\"1\"){\r\n//\t\t\t$xml_and = simplexml_load_file($xml_file) or die(\"feed not loading\");\r\n//\t\t\tforeach($xml_and->field as $key => $val){\r\n//\t\t\t\tforeach( $val->txt_value as $k => $v ){\r\n//\t\t\t\t\techo $k ;print_R($v); echo \"--<br>\";\r\n//\t\t\t\t\t\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t}\r\n\t}", "function __construct() {\n // require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/NuSOAP/lib/nusoap'.EXT);\n require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/nusoap/nusoap'.EXT);\n }", "function rawXMLImport($buffer)\r\n\t{\r\n\t\tglobal $myDB;\r\n\t\tglobal $myPT;\r\n\r\n\t\t$_versions = Array();\r\n\r\n\t\t$_xml = @simplexml_load_string($buffer);\r\n\t\tif ($_xml)\r\n\t\t{\r\n\t\t\t$ptversion = (string)pt_package_xml_decode($_xml->meta->ptversion);\r\n\t\t\tif ($ptversion==\"3.0\")\r\n\t\t\t{\r\n\t\t\t\t$ptversion = \"9.0.0\";\r\n\t\t\t}\r\n\r\n\t\t\t$pag_id = (int)pt_package_xml_decode($_xml->meta->pag_id);\r\n\t\t\t$grp_id = (int)pt_package_xml_decode($_xml->meta->grp_id);\r\n\r\n\t\t\t$action = \"insert\";\r\n\t\t\t$sql = \"SELECT pag_id FROM page WHERE pag_id=\".$pag_id;\r\n\t\t\t$rs=$myDB->query($sql);\r\n\t\t\tif (mysql_num_rows($rs)==1)\r\n\t\t\t{\r\n\t\t\t\t$action=\"update\";\r\n\t\t\t}\r\n\r\n\t\t\t$mySQL = new SQLBuilder();\r\n\t\t\t$mySQL->addField(\"ver_id\",$ver_id,DB_NUMBER);\r\n\t\t\t$mySQL->addField(\"grp_id\",$grp_id,DB_NUMBER);\r\n\r\n\t\t\t$_fields = Array(\"pag_uid\",\"pag_bez\",\"pag_titel\",\"pag_alttitel\",\"pag_comment\",\"pag_quickfinder\",\"pag_searchtext\",\"pag_url\",\"pag_url1\",\"pag_url2\",\"pag_url3\",\"pag_url4\");\r\n\t\t\tforeach ($_fields AS $k)\r\n\t\t\t{\r\n\t\t\t\t$mySQL->addField($k,(string)pt_package_xml_decode($_xml->content->$k));\r\n\t\t\t}\r\n\r\n\t\t\tif ($ptversion<\"2.6.0\" AND $ptversion != \"2.10\")\r\n\t\t\t{\r\n\t\t\t\t$_props=(string)pt_package_xml_decode($_xml->content->pag_props);\r\n\t\t\t\t$mySQL->addField(\"pag_props_locale\",base64_decode($_props));\r\n\t\t\t\t$_props = Array();\r\n\t\t\t\t$_props[\"pag_url1\"]=(string)pt_package_xml_decode($_xml->content->pag_url);\r\n\t\t\t\t$mySQL->addField(\"pag_props\",serialize($_props));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_props=(string)pt_package_xml_decode($_xml->content->pag_props);\r\n\t\t\t\t$mySQL->addField(\"pag_props\",base64_decode($_props));\r\n\t\t\t\t$_props=(string)pt_package_xml_decode($_xml->content->pag_props_locale);\r\n\t\t\t\t$mySQL->addField(\"pag_props_locale\",base64_decode($_props));\r\n\t\t\t}\r\n\t\t\t$_fields = Array (\"pag_id_mimikry\",\"pag_id_top\",\"pag_pos\",\"pag_cache\",\"pag_status\",\"usr_id_creator\",\"pag_creationdate\",\"usr_id\",\"pag_date\");\r\n\t\t\tforeach ($_fields AS $k)\r\n\t\t\t{\r\n\t\t\t\t$mySQL->addField($k,(int)pt_package_xml_decode($_xml->content->$k),DB_NUMBER);\r\n\t\t\t}\r\n\r\n\t\t\t// Content-Type (since 2.10)\r\n\t\t\t$pag_contenttype = (int)pt_package_xml_decode($_xml->content->pag_contenttype);\r\n\t\t\tif ($pag_contenttype!=0)\r\n\t\t\t{\r\n\t\t\t\t$mySQL->addField(\"pag_contenttype\",$pag_contenttype,DB_NUMBER);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($action==\"insert\")\r\n\t\t\t{\r\n\t\t\t\t$mySQL->addField(\"pag_id\",$pag_id,DB_NUMBER);\r\n\t\t\t\t$sql = $mySQL->insert(\"page\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql = $mySQL->update(\"page\",\"pag_id=\".$pag_id);\r\n\t\t\t}\r\n\t\t\t$myDB->query($sql);\r\n\r\n\r\n\t\t\t// generate versions, delete old versions\r\n\r\n\t\t\t$sql =\"SELECT * FROM pageversion WHERE pag_id =\".$pag_id.\" AND pag_exec_script=1\";\r\n\t\t\t$rs=$myDB->query($sql);\r\n\t\t\twhile ($row=mysql_fetch_array($rs))\r\n\t\t\t{\r\n\t\t\t\t$file = APPPATH . \"pagescripts/\".sprintf(\"%04d\",$pag_id) .\"_\" .sprintf(\"%04d\", $row[\"ver_id\"]) .\".inc.php\";\r\n\t\t\t\t@unlink($file);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"DELETE FROM pageversion WHERE pag_id =\".$pag_id;\r\n\t\t\t$myDB->query($sql);\r\n\r\n\t\t\t$ver_id_activate =0;\r\n\r\n\t\t\tforeach ($_xml->content->pageversions->version AS $_xml_version)\r\n\t\t\t{\r\n\t\t\t\t$mySQL = new SqlBuilder();\r\n\t\t\t\t$mySQL->addField(\"pag_id\",$pag_id,DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"ver_nr\",(int)pt_package_xml_decode($_xml_version->ver_nr),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"lay_id\",(int)pt_package_xml_decode($_xml_version->lay_id),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"ver_bez\",(string)pt_package_xml_decode($_xml_version->ver_bez));\r\n\t\t\t\t$mySQL->addField(\"pag_fullsearch\",(string)pt_package_xml_decode($_xml_version->pag_fullsearch));\r\n\t\t\t\t$mySQL->addField(\"inc_id1\",(int)pt_package_xml_decode($_xml_version->inc_id1),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"inc_id2\",(int)pt_package_xml_decode($_xml_version->inc_id2),DB_NUMBER);\r\n\t\t\t\t$sql = $mySQL->insert(\"pageversion\");\r\n\t\t\t\t$myDB->query($sql);\r\n\r\n\t\t\t\t$ver_id = mysql_insert_id();\r\n\r\n\t\t\t\t// mapping old version_id to new version_id\r\n\t\t\t\t// no brutal overwrite so that users can continue working on pages, even if\r\n\t\t\t\t// a few pages are overwritten\r\n\r\n\t\t\t\t$_versions[(int)pt_package_xml_decode($_xml_version->ver_id)] = $ver_id;\r\n\r\n\t\t\t\tif ($ver_id_activate==0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ver_id_activate = $ver_id;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ((int)pt_package_xml_decode($_xml_version->ver_status)==1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ver_id_activate = $ver_id;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$script = (string)pt_package_xml_decode($_xml_version->script);\r\n\t\t\t\tif ($script!=\"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$file = APPPATH . \"pagescripts/\".sprintf(\"%04d\",$pag_id) .\"_\" .sprintf(\"%04d\", $ver_id) .\".inc.php\";\r\n\t\t\t\t\t$fp = fopen ($file,\"w\");\r\n\t\t\t\t\tfputs ($fp,$script);\r\n\t\t\t\t\tfclose ($fp);\r\n\t\t\t\t\t@chmod ($file,UMASK);\r\n\t\t\t\t\t$sql = \"UPDATE pageversion SET pag_exec_script=1 WHERE ver_id=\".$ver_id;\r\n\t\t\t\t\t$myDB->query($sql);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Version changes\r\n\t\t\t\t$sql = \"DELETE FROM pageversion_autoactivate WHERE pag_id=\".$pag_id;\r\n\t\t\t\t$myDB->query($sql);\r\n\r\n\t\t\t\tforeach ($_xml_version->autoactivation AS $_xml_versionchange)\r\n\t\t\t\t{\r\n\t\t\t\t\t$mySQL = new SqlBuilder();\r\n\t\t\t\t\t$mySQL->addField(\"pag_id\",$pag_id,DB_NUMBER);\r\n\t\t\t\t\t$mySQL->addField(\"ver_id\",$ver_id,DB_NUMBER);\r\n\t\t\t\t\t$mySQL->addField(\"ver_date\",$_xml_versionchange[\"date\"],DB_NUMBER);\r\n\t\t\t\t\t$sql = $mySQL->insert(\"pageversion_autoactivate\");\r\n\t\t\t\t\t$myDB->query($sql);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"DELETE FROM page_language WHERE pag_id =\".$pag_id;\r\n\t\t\t$myDB->query($sql);\r\n\r\n\t\t\tforeach ($_xml->content->languages AS $_xml_language)\r\n\t\t\t{\r\n\t\t\t\t$mySQL = new SqlBuilder();\r\n\t\t\t\t$mySQL->addField(\"pag_id\",$pag_id,DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"lng_id\",(int)pt_package_xml_decode($_xml_language->lng_id),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"pag_titel\",(string)pt_package_xml_decode($_xml_language->pag_titel));\r\n\t\t\t\t$sql = $mySQL->insert(\"page_language\");\r\n\t\t\t\t$myDB->query($sql);\r\n\t\t\t}\r\n\r\n\t\t\t// insert components\r\n\r\n\t\t\t$sql = \"DELETE FROM sequence_data WHERE pag_id=\".$pag_id;\r\n\t\t\tforeach ($_xml->content->sequence_data->component AS $_xml_component)\r\n\t\t\t{\r\n\t\t\t\t$mySQL = new SQLBuilder();\r\n\t\t\t\t$mySQL->addField(\"pag_id\",$pag_id,DB_NUMBER);\r\n\t\t\t\t$ver_id = $_versions[(int)pt_package_xml_decode($_xml_component->ver_id)];\r\n\t\t\t\t$mySQL->addField(\"ver_id\",$ver_id,DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"lng_id\",(int)pt_package_xml_decode($_xml_component->lng_id),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"dat_visible\",(int)pt_package_xml_decode($_xml_component->dat_visible),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"dat_blocknr\",(int)pt_package_xml_decode($_xml_component->dat_blocknr),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"dat_pos\",(int)pt_package_xml_decode($_xml_component->dat_pos),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"com_id\",(int)pt_package_xml_decode($_xml_component->com_id),DB_NUMBER);\r\n\t\t\t\t$mySQL->addField(\"dat_comdata\",base64_decode((string)pt_package_xml_decode($_xml_component->dat_comdata)));\r\n\t\t\t\t$mySQL->addField(\"dat_fullsearch\",(string)pt_package_xml_decode($_xml_component->dat_fullsearch));\r\n\t\t\t\t$sql= $mySQL->insert(\"sequence_data\");\r\n\t\t\t\t$myDB->query($sql);\r\n\t\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t$myPage = new PhenotypePage($pag_id);\r\n\t\t\t$myPage->activateVersion($ver_id_activate);\r\n\t\t\t// Properties f�r eine Einzelseite nach unten verteilen, reicht beim Vollimport nicht aus!\r\n\t\t\t$_props = Array();\r\n\t\t\t$myPage->spreadProps($pag_id,$_props);\r\n\t\t\treturn $pag_id;\r\n\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn (false);\r\n\t\t}\r\n\t}", "public function addUpdateProduct(RexToBddController $rexToBddController) {\n\n $veloVitaTxt = file_get_contents( veloVitaApiuUrl);\n $veloVitaArrayBefore = explode( PHP_EOL, $veloVitaTxt);\n $iZero = array_values(explode('|', $veloVitaArrayBefore[0]));\n\n foreach ($veloVitaArrayBefore as $value) {\n if (substr_count($value, '|') == 14) {\n $explodedArray = explode('|', $value);\n $veloVitaArray[] = array_combine( $iZero, $explodedArray );\n }\n }\n unset($veloVitaArray[0]);\n\n $today = new \\DateTime();\n $today = $today->format('Y-m-d H:i:s');\n $matchingForRex = \"\";\n $brands = [];\n foreach ($veloVitaArray as $product) {\n if ($product['BRAND'] != '') {\n $brands[] = $product['BRAND'];\n }\n\n $supplier = \"Velo Vita\";\n $supplierCode = \"VV\";\n\n $matchingForRex .= \"\n <Product>\n <ShortDescription>\".$this->xmlEscape($product['Description']).\"</ShortDescription>\n <SupplierSKU>\".$this->xmlEscape($product['Model No']).\"</SupplierSKU>\n <ManufacturerSKU>\".$this->xmlEscape($product['EAN']).\"</ManufacturerSKU>\n <ProductType>\".$this->xmlEscape($category).\"</ProductType>\n <Supplier>\".$this->xmlEscape($supplier).\"</Supplier>\n <SupplierCode>\".$this->xmlEscape($supplierCode).\"</SupplierCode>\n <Brand>\".$this->xmlEscape($product['BRAND']).\"</Brand>\n <SupplierBuy>\".$this->adjustDecimal($product['WSALE']).\"</SupplierBuy>\n <POSPrice>\".$this->adjustDecimal($product['F_RETAIL']).\"</POSPrice>\n <WebPrice>\".$this->adjustDecimal($product['F_RETAIL']).\"</WebPrice>\n <LastUpdated>\".$this->xmlEscape($today).\"</LastUpdated>\n </Product>\";\n }\n\n (new RexSoapController)->addBrands($brands);\n $rexToBddController->rexToBddBrands($brands);\n $rexRequest = (new RexSoapController)->addProducts($matchingForRex);\n $rexRequest = preg_replace(\"/(<\\/?)(\\w+):([^>]*>)/\", \"$1$2$3\", $rexRequest->getContent());\n $xml = new \\SimpleXMLElement($rexRequest);\n $body = $xml->xpath('//soapBody')[0];\n $array = json_decode(json_encode((array)$body), TRUE);\n\n return $array['SaveProductsResponse']['SaveProductsResult']['Response'];\n }", "protected function build()\n\t{\n\t}", "function ciniki_merchandise_web_productLoad($ciniki, $tnid, $args) {\n \n $strsql = \"SELECT ciniki_merchandise.id, \"\n . \"ciniki_merchandise.uuid, \"\n . \"ciniki_merchandise.name, \"\n . \"ciniki_merchandise.permalink, \"\n . \"ciniki_merchandise.flags, \"\n . \"ciniki_merchandise.primary_image_id, \"\n . \"'' AS primary_image_caption, \"\n . \"ciniki_merchandise.synopsis, \"\n . \"ciniki_merchandise.description \"\n . \"FROM ciniki_merchandise \"\n . \"WHERE ciniki_merchandise.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n if( isset($args['permalink']) && $args['permalink'] != '' ) {\n $strsql .= \"AND ciniki_merchandise.permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \";\n } elseif( isset($args['id']) && $args['id'] > 0 ) {\n $strsql .= \"AND ciniki_merchandise.id = '\" . ciniki_core_dbQuote($ciniki, $args['id']) . \"' \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.27', 'msg'=>'No product specified'));\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'product');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.28', 'msg'=>'Product not found', 'err'=>$rc['err']));\n }\n if( !isset($rc['product']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.29', 'msg'=>'Unable to find Product'));\n }\n $product = $rc['product'];\n\n //\n // Get the images\n //\n if( isset($args['images']) && $args['images'] == 'yes' ) {\n $strsql = \"SELECT id, \"\n . \"name AS title, \"\n . \"permalink, \"\n . \"flags, \"\n . \"image_id, \"\n . \"description \"\n . \"FROM ciniki_merchandise_images \"\n . \"WHERE product_id = '\" . ciniki_core_dbQuote($ciniki, $product['id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(\n array('container'=>'images', 'fname'=>'id', 'fields'=>array('id', 'title', 'permalink', 'flags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['images']) ) {\n $product['images'] = $rc['images'];\n } else {\n $product['images'] = array();\n }\n if( $product['primary_image_id'] > 0 ) {\n $found = 'no';\n foreach($product['images'] as $image) {\n if( $image['image_id'] == $product['primary_image_id'] ) {\n $found = 'yes';\n }\n }\n if( $found == 'no' ) {\n array_unshift($product['images'], array('title'=>'', 'flags'=>1, 'permalink'=>$product['uuid'], 'image_id'=>$product['primary_image_id'], 'description'=>''));\n }\n }\n }\n\n return array('stat'=>'ok', 'product'=>$product);\n}", "public function build() {}", "public function build() {}", "public function build() {}", "public function build()\n {\n if(($document = $this->getDocument()) === null) {\n $document = $this->loader->getInstance(NodeLoader::DOCUMENT_NODE);\n $this->setDocument($document);\n }\n\n if(($header = $document->getHeader()) === null) {\n $header = $this->loader->getInstance(NodeLoader::HEADER_NODE);\n $document->setHeader($header);\n }\n\n if(($supplier = $header->getSupplier()) === null) {\n $supplier = $this->loader->getInstance(NodeLoader::SUPPLIER_NODE);\n $header->setSupplier($supplier);\n }\n\n if(($catalog = $header->getCatalog()) === null) {\n $catalog = $this->loader->getInstance(NodeLoader::CATALOG_NODE);\n $header->setCatalog($catalog);\n }\n\n if(($datetime = $catalog->getDateTime()) === null) {\n $datetime = $this->loader->getInstance(NodeLoader::DATE_TIME_NODE);\n $catalog->setDateTime($datetime);\n }\n\n if(($newCatalog = $document->getNewCatalog()) === null) {\n $newCatalog = $this->loader->getInstance(NodeLoader::NEW_CATALOG_NODE);\n $document->setNewCatalog($newCatalog);\n }\n\n return $document;\n }", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function import($addProducts, $updateProducts, $processFullFile, $processUpdateFile, $getNewFiles, $deleteFiles, $sendSucessLog)\n {\n \tMage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n \t$startTime = time();\n \t$successCount = 0;\n \t$errorCount = 0;\n \t$myEditionTypes = array();\n\t\t$myAnswerCodes = array();\n\t\t$taxClassIds = array();\n\t\t$inventoryFiles = array();\n \t$logFile = 'Vista_Inventory_Update.log';\n \t$errorFile = 'Vista_Inventory_Error'.date(\"YmdHis\", time()).'.log';\n $isSaoEnabled = Mage::getStoreConfig('vistainventory_section/vistainventory_group/vistainventory_enablesao');\n if ($isSaoEnabled) $saoCodes = $this->getSaoCodes();\n\n $inventoryDir = Mage::getBaseDir() . '/var/importexport/vista_inventory';\n\n\t\t//create folders\n\t\t$baseDir = Mage::getBaseDir() . '/var/importexport';\n\t\tif (!file_exists($baseDir)) mkdir($baseDir, 0777);\n \t\n $inventoryDir = $baseDir . '/vista_inventory';\n if (!file_exists($inventoryDir)) mkdir($inventoryDir, 0777);\n \n $inventoryExecutedDir = $inventoryDir.'/executed';\n if (!file_exists($inventoryExecutedDir)) mkdir($inventoryExecutedDir, 0777);\n \n //DOWNLOAD Inventory Files from VISTA Ftp server\n if($getNewFiles == true)\n {\n \ttry \n\t {\n\t \t$this->getInventoryUpdateFiles($processFullFile, $processUpdateFile, $deleteFiles, $errorFile);\n\t } \n\t catch (Exception $e) \n\t {\n\t\t\t\tMage::log('FTP Error: '.$e,null,$errorFile);\n\t\t\t\t$errorCount++;\n\t }\n }\n \n $this->initGlobals($myEditionTypes,$myAnswerCodes, $taxClassIds);\n $this->initInventoryFiles($inventoryDir, $inventoryFiles);\n\n\t //data[1] = sku\n \t//data[2] = edition type\n \t//data[3] = answer code\n \t//data[4] = quantity\n \t//data[5] = price\n \t//data[6] = publication date \n \t//data[7] = isbn 12\n \t//data[8] = isbn 10\n \t//data[9] = weight\n \t//data[10] = number of pages\n \t//data[11] = warehouse availability date\n \t//data[12] = Short Name ==> used for new products\n \t//data[13] = Magento Flag\n \t//data[14] = Cost\n\t //data[18] = Taxware Taxcode\n //data[19] and up = SAO code\n \t\n\t //Process each found file\n\t\tforeach ($inventoryFiles AS $inventoryFile) \n { \n\n \t//Open the Sku tracking file for this specific update file\n \tunset($processedSkus); \n \t$slashPosition = strripos($inventoryFile,'/');\n \t\n \tif($slashPosition == false)\n \t{\n \t\t$slashPosition = strripos($inventoryFile,'\\\\');\n \t}\n \t\n \t$fileName = substr($inventoryFile, $slashPosition + 1);\n \t$fileName = str_replace('.DWF', '.log', $fileName); \n \t$processedSkuFile = $inventoryDir.'/Processed_'.$fileName;\n \t\n \t$deadLockfileName = substr($inventoryFile, $slashPosition + 1);\n \t$deadLockSkuFile = $inventoryDir.'/DEADLOCK_'.$deadLockfileName;\n \t\n \tif(file_exists($processedSkuFile))\n \t{\n \t\tif (($handle = fopen($processedSkuFile, \"r\")) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\twhile (($data = fgetcsv($handle, 10000, \",\")) !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$processedSkus[$data[0]] = $data[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n \t}\n\t \n \tMage::log(\"Processing File:\".$inventoryFile.\"\\r\\n\",null,$logFile);\n \tif (($handle = fopen($inventoryFile, \"r\")) !== FALSE) \n \t{\n\t\t\t\twhile (($data = fgetcsv($handle, 100000, \"|\")) !== FALSE) \n\t\t\t\t{\n\t\t\t\t\t$sku = $data[1];\n\t\t\t\t\t\n\t\t\t\t\tif(!isset($processedSkus[$sku]))\n\t\t\t\t\t{\n\t\t\t \ttry \n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tif($sku != \"\")\n\t\t\t\t\t\t\t{\n //Might be able to just remove this if block, since both \"V\" and \"D\" will be considered non managed and the qty will get set to one in that check.\n\t\t\t\t\t\t\t\tif($data[13] == \"V\" || $data[13] == \"D\")//for virtual/download products this qty has to always be at least 1 even for products that we dont manage the stock for bundled products will function correctly on front end\n\t\t\t\t\t \t{\n //Overwrite $data[4] = 1 as that is where the inventory is stored\n $data[4] = 1;\n\t\t\t\t\t \t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t$inventoryProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);\n\n //Check SAO Codes\n if(!empty($saoCodes) && $data[13] != \"N\" && $data[13] != \"\") {\n $productSaoCodes = array_filter(array_slice($data, 19), 'trim');\n $match = array_intersect($productSaoCodes, $saoCodes);\n\n if (empty($productSaoCodes) && empty($inventoryProduct)) {\n Mage::log(\"No SAO codes on new product. Sku:\".$sku.\"\\r\\n\", null, $logFile);\n } elseif (empty($productSaoCodes) && !empty($inventoryProduct)) {\n Mage::log(\"No SAO codes on existing product. Sku:\".$inventoryProduct->getsku().\"\\r\\n\", null, $logFile);\n } elseif (!empty($productSaoCodes) && !empty($inventoryProduct) && empty($match)) {\n Mage::log(\"Existing product does not have SAO codes that match those set in admin. Sku:\".$inventoryProduct->getsku().\"\\r\\n\", null, $logFile);\n }\n\n if (empty($match)) { //Product does not have SAO codes matching those set in Magento Admin, skip product\n continue;\n }\n }\n\n\t\t\t\t\t\t\t\tif(!$inventoryProduct)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(isset($data[13]))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($addProducts == true && $data[13] != \"N\" && $data[13] != \"\")//dont add non-magento products if the magento field is populated, the add products flag was included and the field value is not N\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$inventoryProduct = $this->createNewProduct($data, $taxClassIds, $logFile);\n\t\t\t\t\t\t\t\t\t\t\t$newProduct = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$newProduct = false;\n\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\tif($inventoryProduct)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\tif($newProduct || ($newProduct == false && $updateProducts == true))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//Product Update\n\t\t\t\t\t\t\t\t\t\t$this->updateProduct($inventoryProduct, $myEditionTypes, $myAnswerCodes, $data);\n\n\t\t\t\t\t\t\t\t\t\t//Stock Update\n\t\t\t\t\t\t\t\t\t\tif(isset($data[15]) && $data[15] == \"N\")\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$manageStock = 0;\n //Force qty to be 1 on a product where stock isn't managed.\n $data[4] = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$manageStock = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$this->updateStockItem($inventoryProduct,$data[3], $data[4], $manageStock, $logFile);\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$fh = fopen($processedSkuFile, 'a'); \n\t\t\t\t\t\t\t\t\t\tfwrite($fh, $sku.\"\\r\\n\"); \n\t\t\t\t\t\t\t\t\t\tfclose($fh);\n\t\t\t\t\t\t\t\t\t\t$successCount++;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMage::log(\"Updated sku:\".$inventoryProduct->getsku().\"\\r\\n\",null,$logFile);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\tcatch (Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMage::log($sku.\":\".$e->getMessage(),null,$errorFile);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(strstr($e->getMessage(), \"1205 Lock wait timeout exceeded\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$fh2 = fopen($deadLockSkuFile, 'a'); \n\t\t\t\t\t\t\t\t\tforeach($data as $field)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfwrite($fh2, $field.\"|\"); \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfwrite($fh2, PHP_EOL); \n\t\t\t\t\t\t\t\t\tfclose($fh2);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$errorCount++;\n\t\t\t\t\t\t\t\tif($errorCount > 0)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\t$this->sendEmail(\"Vista Inventory Update Error\", \"There was an error(s) in the Vista Inventory Update process\", Mage::getBaseDir().\"/var/log/\", $errorFile);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\tif($sendSucessLog && $successCount > 0)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\t$this->sendEmail(\"Vista Inventory Update\", \"Metrics for the Vista Inventory Update process\", Mage::getBaseDir().\"/var/log/\", $logFile);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \tfclose($handle);\n\t\t\t\t\t\t \treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($inventoryProduct,$sku, $data);\n\t\t\t\t\t} \n\t\t\t\t}\n\t \t}\n\t \tfclose($handle);\n\t \tunset($handle);\n\t \t$fileNameExecuted= str_replace('.dwf', '.executed.' . date('Ymd-His') . '.dwf', $inventoryFile);\n\t \t$fileNameExecuted= str_replace('.DWF', '.executed.' . date('Ymd-His') . '.DWF', $inventoryFile);\n $fileNameExecuted = str_replace($inventoryDir, $inventoryExecutedDir, $fileNameExecuted);\n rename($inventoryFile, $fileNameExecuted);\n \n unlink($processedSkuFile); \n }\n \n\t\tMage::log(\"************************ Inventory Completed ************************\\r\\n\",null,$logFile);\n\t\tMage::log(\"Time Elapsed :\".round(abs(time() - $startTime) /60,2).\" minutes\\r\\n\",null,$logFile);\n\t\tMage::log(\"Successes : \".$successCount.\"\\r\\n\",null,$logFile);\n\t\tMage::log(\"Errors : \".$errorCount.\"\\r\\n\",null,$logFile);\n\t\tMage::log(\"*********************************************************************\\r\\n\",null,$logFile);\n\n \tif($errorCount > 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update Error', 'There was an error(s) in the Vista Inventory Update process', Mage::getBaseDir().'/var/log/', $errorFile);\n \t}\n \t\n \tif($sendSucessLog && $successCount > 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update', 'Metrics for the Vista Inventory Update process', Mage::getBaseDir().'/var/log/', $logFile);\n \t}\n \t\n \tif(count($inventoryFiles) == 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update - NO FILES FOUND', 'There were no inventory files found to process', Mage::getBaseDir().'/var/log/', null);\n \t}\n }", "public function run($args) {\n // args[1] = Target file\n try {\n // Open source file\n $fHandle = fopen($args[0], 'r');\n @unlink($args[1]);\n // Create XML\n $nativeXml = new DOMDocument(\"1.0\", \"UTF-8\");\n $root = $nativeXml->createElement('Cfds');\n $root = $nativeXml->appendChild($root);\n $invoiceNbr = 'XXX';\n $row = 1;\n while (($data = fgetcsv($fHandle, 0, ',')) !== FALSE) {\n // Skip first row\n if ($row != 1) {\n $data = self::normalizeDataRow($data);\n // Skip if colcount is not right\n if (count($data) != self::COL_COUNT)\n continue;\n if ($invoiceNbr != $data[self::INVOICE_NBR_COL]) {\n $invoiceNbr = $data[self::INVOICE_NBR_COL];\n // Find SAT certificate for vendor RFC\n $dt = self::getInvoiceDt($data[self::INVOICE_DATE_COL]);\n $certificate = SatCertificate::model()->validAsOf($dt)->find('rfc = :rfc', array(':rfc' => $data[self::VENDOR_RFC_COL]));\n if (!$certificate)\n throw new CException(yii::t('yanus', 'Cannot find a valid certifate for RFC \"{rfc}\"', array('{rfc}' => $data[self::VENDOR_RFC_COL])));\n $invoice = $root->appendChild($nativeXml->createElement('Cfd'));\n\n $invoice->setAttribute('folio', $data[self::INVOICE_NBR_COL]);\n $invoice->setAttribute('dttm', $dt->format(DateTime::ISO8601));\n $invoice->setAttribute('paymentType', 'PAGO EN UNA SOLA EXHIBICION');\n// $invoice->setAttribute('paymentTerm', $data[self::PAYMENT_TERM_COL]);\n// $invoice->setAttribute('currency', 'MXP');\n $invoice->setAttribute('voucherType', ($data[GamaHelper::DOCUMENT_TYPE_COL] == 0 ? 'ingreso' : 'egreso'));\n $invoice->setAttribute('paymentMethod', $data[self::PAYMENT_METHOD_COL]);\n if ($data[self::PAYMENT_METHOD_COL] != 'NO IDENTIFICADO')\n $invoice->setAttribute('paymentAcctNbr', $data[self::BANK_ACCT_COL]);\n\n\n // Parties\n// $cfdParties = $invoice->appendChild($nativeXml->createElement('CfdParties'));\n // Currency\n $currency = $invoice->appendChild($nativeXml->createElement('Currency'));\n $currency->setAttribute('code', 'MXP');\n\n $paymentTerm = $invoice->appendChild($nativeXml->createElement('PaymentTerm'));\n $paymentTerm->setAttribute('name', $data[self::PAYMENT_TERM_COL]);\n\n // Vendor\n $cfdParty = $invoice->appendChild($nativeXml->createElement('CfdParty'));\n $cfdParty->setAttribute('type', CfdPartyTypeBehavior::VENDOR);\n $party = $cfdParty->appendChild($nativeXml->createElement('Party'));\n $party->setAttribute('person', (strlen($data[self::VENDOR_RFC_COL]) == 13) ? 1 : 0);\n\n// $partyIdentifiers = $party->appendChild($nativeXml->createElement('PartyIdentifiers'));\n $partyIdentifier = $party->appendChild($nativeXml->createElement('PartyIdentifier'));\n $partyIdentifier->setAttribute('type', 'primary');\n $identifier = $partyIdentifier->appendChild($nativeXml->createElement('Identifier'));\n $identifier->setAttribute('type', IdentifierTypeBehavior::RFC);\n $identifier->setAttribute('value', $data[self::VENDOR_RFC_COL]);\n\n// $partyNames = $party->appendChild($nativeXml->createElement('PartyNames'));\n $partyName = $party->appendChild($nativeXml->createElement('PartyName'));\n $partyName->setAttribute('type', 'primary');\n $name = $partyName->appendChild($nativeXml->createElement('Name'));\n $name->setAttribute('name', $data[self::VENDOR_NAME_COL]);\n\n // Customer\n $cfdParty = $invoice->appendChild($nativeXml->createElement('CfdParty'));\n $cfdParty->setAttribute('type', CfdPartyTypeBehavior::CUSTOMER);\n $party = $cfdParty->appendChild($nativeXml->createElement('Party'));\n $party->setAttribute('person', (strlen($data[self::CUSTOMER_RFC_COL]) == 13) ? 1 : 0);\n\n// $partyIdentifiers = $party->appendChild($nativeXml->createElement('PartyIdentifiers'));\n $partyIdentifier = $party->appendChild($nativeXml->createElement('PartyIdentifier'));\n $partyIdentifier->setAttribute('type', 'primary');\n $identifier = $partyIdentifier->appendChild($nativeXml->createElement('Identifier'));\n $identifier->setAttribute('type', IdentifierTypeBehavior::RFC);\n $identifier->setAttribute('value', $data[self::CUSTOMER_RFC_COL]);\n\n// $partyNames = $party->appendChild($nativeXml->createElement('PartyNames'));\n $partyName = $party->appendChild($nativeXml->createElement('PartyName'));\n $partyName->setAttribute('type', 'primary');\n $name = $partyName->appendChild($nativeXml->createElement('Name'));\n $name->setAttribute('name', $data[self::CUSTOMER_NAME_COL]);\n\n // Address\n// $cfdAddresses = $invoice->appendChild($nativeXml->createElement('CfdAddresses'));\n//\n $cfdAddress = $invoice->appendChild($nativeXml->createElement('CfdAddress'));\n $cfdAddress->setAttribute('type', AddressTypeBehavior::PRIMARY);\n $cfdAddress->setAttribute('reference', $data[self::VENDOR_ADDRESS_REFERENCE_COL]);\n $address = $cfdAddress->appendChild($nativeXml->createElement('Address'));\n $address->setAttribute('street', $data[self::VENDOR_ADDRESS_STREET_COL]);\n $address->setAttribute('neighbourhood', $data[self::VENDOR_ADDRESS_COLONY_COL]);\n $address->setAttribute('city', $data[self::VENDOR_ADDRESS_CITY_COL]);\n $address->setAttribute('country', $data[self::VENDOR_ADDRESS_COUNTRY_COL]);\n $address->setAttribute('municipality', $data[self::VENDOR_ADDRESS_MUNICIPALITY_COL]);\n $address->setAttribute('state', $data[self::VENDOR_ADDRESS_STATE_COL]);\n $address->setAttribute('zipCode', substr('00000' . $data[self::VENDOR_ADDRESS_ZIPCODE_COL], -5));\n//\n $cfdAddress = $invoice->appendChild($nativeXml->createElement('CfdAddress'));\n $cfdAddress->setAttribute('type', AddressTypeBehavior::BILL_TO);\n $address = $cfdAddress->appendChild($nativeXml->createElement('Address'));\n $address->setAttribute('street', $data[self::CUSTOMER_ADDRESS_STREET_COL]);\n $address->setAttribute('neighbourhood', $data[self::CUSTOMER_ADDRESS_COLONY_COL]);\n $address->setAttribute('city', $data[self::CUSTOMER_ADDRESS_CITY_COL]);\n $address->setAttribute('country', $data[self::CUSTOMER_ADDRESS_COUNTRY_COL]);\n $address->setAttribute('municipality', $data[self::CUSTOMER_ADDRESS_MUNICIPALITY_COL]);\n $address->setAttribute('state', $data[self::CUSTOMER_ADDRESS_STATE_COL]);\n $address->setAttribute('zipCode', substr('00000' . $data[self::CUSTOMER_ADDRESS_ZIPCODE_COL], -5));\n//\n// $cfdTaxRegimes = $invoice->appendChild($nativeXml->createElement('CfdTaxRegimes'));\n $cfdTaxRegime = $invoice->appendChild($nativeXml->createElement('CfdTaxRegime'));\n $cfdTaxRegime->setAttribute('name', 'Régimen General de Ley Personas Morales');\n\n// $cfdTaxes = $invoice->appendChild($nativeXml->createElement('CfdTaxes'));\n $cfdTax = $invoice->appendChild($nativeXml->createElement('CfdTax'));\n $cfdTax->setAttribute('name', $data[self::TAX_NAME_COL]);\n $cfdTax->setAttribute('rate', $data[self::TAX_RATE_COL]);\n $cfdTax->setAttribute('amt', $data[self::TAX_AMOUNT_COL]);\n $invoice->setAttribute('tax', $data[self::TAX_AMOUNT_COL]);\n\n// $cfdItems = $invoice->appendChild($nativeXml->createElement('CfdItems'));\n $subTotal = 0;\n $total = $data[self::TAX_AMOUNT_COL];\n }\n // Process items\n $item = $invoice->appendChild($nativeXml->createElement('CfdItem'));\n $item->setAttribute('qty', $data[self::ITEM_QTY_COL]);\n $item->setAttribute('uom', 'EA');\n $item->setAttribute('description', $data[self::ITEM_DESCRIPTION_COL]);\n $item->setAttribute('unitPrice', $data[self::ITEM_UNIT_PRICE_COL]);\n $item->setAttribute('amt', $data[self::ITEM_AMOUNT_COL]);\n if ($data[self::CAR_COL])\n $item->setAttribute('vehicle', $data[self::CAR_COL]);\n if ($data[self::CAR_KM_COL])\n $item->setAttribute('km', $data[self::CAR_KM_COL]);\n if ($data[self::LICENSE_PLATE_COL])\n $item->setAttribute('licensePlate', $data[self::LICENSE_PLATE_COL]);\n if ($data[self::CAR_USERNAME_COL])\n $item->setAttribute('userName', $data[self::CAR_USERNAME_COL]);\n if ($data[self::CAR_ENGINE_NBR_COL])\n $item->setAttribute('engineNbr', $data[self::CAR_ENGINE_NBR_COL]);\n if ($data[self::CAR_SERIAL_NBR_COL])\n $item->setAttribute('serialNbr', $data[self::CAR_SERIAL_NBR_COL]);\n if ($data[self::CAR_INVENTORY_NBR_COL])\n $item->setAttribute('inventoryNbr', $data[self::CAR_INVENTORY_NBR_COL]);\n if ($data[self::AUTH_NBR_COL])\n $item->setAttribute('authNbr', $data[self::AUTH_NBR_COL]);\n\n $subTotal += $data[self::ITEM_AMOUNT_COL];\n $total += $data[self::ITEM_AMOUNT_COL];\n $invoice->setAttribute('subTotal', $subTotal);\n $invoice->setAttribute('total', $total);\n }\n $row++;\n }\n fclose($fHandle);\n $nativeXml->save($args[1]);\n } catch (Exception $e) {\n yii::trace($e->getMessage(), __METHOD__);\n }\n }", "public function __construct(){\n $arModuleVersion = [];\n include(__DIR__ . \"/version.php\");\n\n $this->MODULE_ID = 'almaybee.addstorestoorderproducts';\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_DESCRIPTION\");\n $this->PARTNER_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_PARTNER_NAME\");\n// $this->PARTNER_URI = Loc::getMessage(\"CRM_GENESIS_SLOTS_PARTNER_URI\");\n }", "private function loadContent() {\n\t\t$expression =\n\t\t\t'/sunflower-'. // match only right files\n\t\t\t'(\\d+\\.\\d+\\w?)[\\.-](\\d+)'. // version\n\t\t\t'(?:-(\\d)+)?'. // package build number\n\t\t\t'(?:[\\.-](all|any|noarch|i386|amd64))?(?:\\.([\\w\\d]+))?'. // architecture and os\n\t\t\t'(\\.[\\w\\d\\.]+)/iu'; // extension\n\n\t\t// get files from directory\n\t\t$data = array();\n\t\t$files = scandir($this->file_path);\n\t\tforeach ($files as $file_name) {\n\t\t\t$matched = preg_match($expression, $file_name, $matches) == 1;\n\n\t\t\tif ($matched) {\n\t\t\t\t$build = $matches[2];\n\n\t\t\t\t// create storage array for build number\n\t\t\t\tif (!isset($data[$build]))\n\t\t\t\t\t$data[$build] = array();\n\n\t\t\t\t// treat different extensions differently\n\t\t\t\tswitch($matches[6]) {\n\t\t\t\t\tcase '.tgz.sig':\n\t\t\t\t\tcase '.deb.sig':\n\t\t\t\t\tcase '.rpm.sig':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 4);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['signature'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '.tgz.sha256':\n\t\t\t\t\tcase '.deb.sha256':\n\t\t\t\t\tcase '.rpm.sha256':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 7);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['hash'] = file_get_contents($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$file_name]))\n\t\t\t\t\t\t\t$data[$build][$file_name] = array();\n\n\t\t\t\t\t\t// get storage array for easier access\n\t\t\t\t\t\t$file_data = $data[$build][$file_name];\n\n\t\t\t\t\t\t// populate parameters\n\t\t\t\t\t\t$file_data['url'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\t$file_data['version'] = $matches[1];\n\t\t\t\t\t\t$file_data['build'] = $matches[2];\n\t\t\t\t\t\t$file_data['package_build'] = $matches[3];\n\t\t\t\t\t\t$file_data['architecture'] = $matches[4];\n\t\t\t\t\t\t$file_data['platform'] = $matches[5];\n\t\t\t\t\t\t$file_data['extension'] = $matches[6];\n\n\t\t\t\t\t\t// store data array back to main array\n\t\t\t\t\t\t$data[$build][$file_name] = $file_data;\n\n\t\t\t\t\t\t// store version to reference list\n\t\t\t\t\t\t$this->version_list[$build] = $matches[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort version list\n\t\tkrsort($this->version_list);\n\n\t\t// store parsed data\n\t\t$this->file_list = $data;\n\t}", "private function packResources()\n {\n $resources = include_once __DIR__ . '/elements/resources.php';\n if (!is_array($resources)) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'Cannot build resources');\n } else {\n foreach ($resources as $resource) {\n $this->builder->putVehicle($this->builder->createVehicle($resource, [\n xPDOTransport::UNIQUE_KEY => 'id',\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true\n ]));\n }\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($resources) . ' resources.');\n }\n }", "protected function buildCoreFields(): void\n {\n //====================================================================//\n // Register Product Configurator\n $this->fieldsFactory()->registerConfigurator(\n \"Address\",\n new AddressConfigurator()\n );\n //====================================================================//\n // Customer\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name(\"Customer\")\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isNotTested()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country_iso\")\n ->name(\"Country ISO (Code)\")\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isRequired()\n ;\n }", "function create_product()\n{\ninclude(\"authheaders.php\");\n$createProductURL='http://api.spreadshirt.net/api/v1/shops/'.get_option('spreadshop_shop_id').'/products';\n$productData = new SimpleXmlElement('<product xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://api.spreadshirt.net\">\n<productType id=\"6\"/>\n<appearance id=\"1\"/>\n<size id=\"12\"/>\n<restrictions>\n<freeColorSelection>false</freeColorSelection>\n<example>false</example>\n</restrictions>\n</product>');\n\t$header = array();\n\t$header[] = createSprdAuthHeader(\"POST\", $createProductURL);\n\t$header[] = \"Content-Type: application/xml\";\n\t$ch = curl_init($createProductURL);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $productData->asXML());\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n\t$result = parseHttpHeaders(curl_exec($ch),\"Location\");\n\tcurl_close($ch);\n\t$result = explode('products/', $result);\n\treturn $result[1];\t\t\n\tdie();\n\t}", "public function run()\n {\n $names = [\n 'ПЫЛЕСОС SAMSUNG VC18M31A0HP/EV',\n 'ХОЛОДИЛЬНИК LG GA-B379SLUL',\n 'СТРУЙНЫЙ МФУ EPSON L3101',\n 'КОЛОНКИ SVEN 312',\n 'ФИТНЕС БРАСЛЕТ XIAOMI MI SMART BAND 5',\n 'НАБОР ПОСУДЫ TEFAL COMFORT MAX NEW C973SB34 (11 ПРЕДМЕТОВ)',\n 'СТОЛОВЫЙ НАБОР LUMINARC ОКЕАН ЭКЛИПС 45 ПР. (L5110)',\n 'СМАРТФОН ОРРО RENO5 STARRY BLACK',\n 'СМАРТФОН APPLE IPHONE 12 256GB BLACK',\n 'СМАРТФОН APPLE IPHONE 12 PRO MAX 512GB GRAPHITE',\n 'СМАРТФОН VIVO X60 PRO BLUE',\n 'НОУТБУК APPLE MACBOOK PRO 16\" I9 2.3/16/1TB SSD SPACE GREY (MVVK2)',\n 'НОУТБУК ASUS ROG ZEPHYRUS GX701L (90NR03Q1-M02600)',\n 'КОМПЬЮТЕР ACER PREDATOR PO9-920 DG.E24MC.001',\n 'НАСТОЛЬНЫЙ КОМПЬЮТЕР APPLE MAC MINI I385UX MXNG2'];\n\n $prices=[51990,\n 199990,\n 70990,\n 3990,\n 17990,\n 45990,\n 24990,\n 219990,\n 549890,\n 859890,\n 369990,\n 1542990,\n 1399990,\n 2370990,\n 617990];\n\n for($i=0;$i<15;$i++)\n {\n $product = new Product();\n $product->name=$names[$i];\n $product->price=$prices[$i];\n if ($i==1 || $i==7 || $i==9 || $i==10 || $i==14)\n $product->image='storage/products/product_'.($i+1).'.png';\n else\n $product->image='storage/products/product_'.($i+1).'.jpg';\n $product->save();\n }\n }", "function init__make_release()\n{\n\trequire_code('files2');\n\n\t// Make sure builds folder exists\n\tget_builds_path();\n\n\t// Tracking\n\tglobal $MAKE_INSTALLERS__FILE_ARRAY,$MAKE_INSTALLERS__DIR_ARRAY,$MAKE_INSTALLERS__TOTAL_DIRS,$MAKE_INSTALLERS__TOTAL_FILES;\n\t$MAKE_INSTALLERS__FILE_ARRAY=array();\n\t$MAKE_INSTALLERS__DIR_ARRAY=array();\n\t$MAKE_INSTALLERS__TOTAL_DIRS=0;\n\t$MAKE_INSTALLERS__TOTAL_FILES=0;\n}", "private function loadOpenModuleFile()\r\n\t{\r\n\t\tif(file_exists($this->filename))\r\n\t\t{\r\n\t\t\t$file = file_get_contents($this->filename);\r\n\t\t\t$file = preg_replace(\"/\".preg_quote(\"----------- BEGIN CTM.MODULE LICENSE FOR [\").\"(.*?)\".preg_quote(\"] -----------\").\"/i\", NULL, trim($file));\r\n\t\t\t$file = preg_replace(\"/\".preg_quote(\"----------- END CTM.MODULE LICENSE FOR [\").\"(.*?)\".preg_quote(\"] -----------\").\"/i\", NULL, trim($file));\r\n\t\t\t$file = str_replace(array(\"\\r\", \"\\n\"), NULL, $file);\r\n\t\t\t\r\n\t\t\t$data = CTM_Crypt::stringNewDecoder(base64_decode($file), $this->cryptKey);\r\n\t\t\tpreg_match(\"/\\[--(.*?)--\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $token);\r\n\t\t\tpreg_match(\"/\\[\\*\\*(.*?)\\*\\*\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $license);\r\n\t\t\tpreg_match(\"/\\[%%(.*?)%%\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $apiKey);\r\n\t\t\t\r\n\t\t\t$this->token = $token[1];\r\n\t\t\t$this->license = $license[1];\r\n\t\t\t$this->API_Key = $apiKey[1];\r\n\t\t}\r\n\t}", "private function createNewProduct($data, $taxClassIds, $logFile)\n\t{\t\n\t\t$sku = $data[1];\n\t\t$inventory = $data[4];\n\t\t$answer_code = $data[3];\n\n\t\t$websiteIds[0] = Mage::getModel('core/website')->load('Main Website', 'name')->getId();\n\t\t$storeIds[0] = Mage::getModel('core/store')->load('Default Store View', 'name')->getId();\n \t\n\t\t$product = new Mage_Catalog_Model_Product();\n\t\t$product->setWebsiteIDs($websiteIds);\n\t\t$product->setStoreIDs($storeIds);\n\t\t\t\n\t\tif($data[13] == \"V\") //Virtual Product\n\t\t{\n\t\t\t$product->setTypeId('virtual');\n\t\t}\n\t\telse if ($data[13] == \"D\") //Downloadable\n\t\t{\n\t\t\t$product->setTypeId('downloadable');\t\n\t\t}\n\t\telse if ($data[13] == \"G\") //Gift Card\n\t\t{\n\t\t\t$product->setTypeId('giftcard');\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$product->setTypeId('simple');\t\n\t\t}\n\n\t\t//Attribute Set Id\n\t\t$attrSetName = \"Default\";\n\t\t$entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();\n\t\t$attributeSetName = $attrSetName;\n\t\t$attributeSetId = Mage::getModel('eav/entity_attribute_set')\n\t\t\t->getCollection()\n\t\t\t->setEntityTypeFilter($entityTypeId)\n\t\t\t->addFieldToFilter('attribute_set_name', $attributeSetName)\n\t\t\t->getFirstItem()->getAttributeSetId();\n\t\t\t\t\t\n\t\t$product->setAttributeSetId($attributeSetId);\n\t\t$product->setSku($sku);\t\t \t \t\t\n\t\t$product->setName($data[12]);\n \t\t$product->setVisibility(1);\n\t\t$product->setStatus(1);\n\n\t\t$urlKey = $product->getName();\n\t\t$urlKey = Mage::helper('catalog/product_url')->format($urlKey);\n\t\t$urlKey = preg_replace('#[^0-9a-z]+#i', '-',$urlKey);\n\t\t$urlKey = $urlKey . '-' . $sku;\n\t\t$urlKey = strtolower($urlKey);\n\t\ttrim($urlKey, '-');\n\t\t$product->setUrlKey($urlKey);\n\n\t $product->setTaxClassId($taxClassIds[\"Taxable Goods\"]);\n\t\t$product->setData('taxware_taxcode',$data[19]);\n\t\t\t\n\t\t$product->save();\n\t\tMage::log(\"Created Product: \".$product->getSku().\"\\r\\n\",null, $logFile);\n \t\t\t\t\t\n \t$this->createStockItem($product, $logFile);\n\n\t\treturn $product;\n\t}", "function rooney_build() {\n\t\n\treturn '/picard/prod/0.1.0/20131217/1'; // Edit this string to update theme across site.\n\t\n}", "public function importProductsAdd($request)\n {\n $return;\n $importData = [];\n $path = $this->getPath($request);\n\n \\Excel::load($path, function ($reader) use (&$importData) {\n\n $items = $reader->get();\n foreach ($items AS $item) {\n $pcode = '';\n if (isset($item['products#product_code'])) $pcode = $item['products#product_code']; \n if (isset($item['product_code'])) $pcode = $item['product_code'];\n if ($pcode == '') {\n continue;\n }\n foreach ($item AS $key => $value) {\n if(strpos($key, '#') !== false) {\n $segments = explode('#', $key);\n $table = $segments[0];\n $field = @$segments[1];\n }\n else {\n $table = 'products';\n $field = $key;\n }\n if (in_array($table, $this->allowedTables)) {\n $importData[$pcode][$table][$field] = str_replace('.0', '', $value);\n }\n }\n }\n });\n\n $products = Products::select('product_code')->whereIn('product_code', array_keys($importData))->get();\n\n if(!$products->isEmpty())\n {\n return ['all' => array_keys($importData), 'duplicated' => $products->toArray()];\n }\n\n foreach ($importData AS $key => $data) {\n $return = $key;\n $product = new Product(true, ['product_code' => $key], true);\n\n /* create slug */\n if (isset($data['products']['name'])) {\n $data['products']['slug'] = '';\n }\n\n foreach ($data AS $key => $items) {\n /* key is a table name */\n $key_method = '_' . $key;\n $product->$key_method($data[$key]);\n }\n\n $getProduct= Product::select('*')->where('product_code',$return)->first();\n if(!empty($getProduct -> name) && !empty($getProduct -> ef_proizvodjac) && !empty($getProduct -> ef_dezen))\n {\n $descName = $getProduct->name;\n $proizvodjac = $getProduct->ef_proizvodjac;\n $dezen = $getProduct -> ef_dezen;\n \n app('App\\Http\\Controllers\\Admin\\ProductsController')->updateProductDescription($return,$descName);\n app('App\\Http\\Controllers\\Admin\\ProductsController')->updateProductShortDesc($return,$proizvodjac,$dezen); \n }\n\n unset($product);\n }\n }", "private function buildProducts(array $products)\n {\n $productDocuments = [];\n foreach ($products as $product) {\n $repository = $this->getManager()->getRepository('AcmeTestBundle:Product');\n\n /** @var Product $productDocument */\n $productDocument = $repository->createDocument();\n $productDocument->__setInitialized(true);\n $productDocument->setId($product['id']);\n $productDocument->setTitle($product['title']);\n $productDocument->setPrice($product['price']);\n $productDocument->setDescription($product['description']);\n $productDocument->setLocation($product['location']);\n $productDocument->setScore($product['score']);\n $productDocuments[] = $productDocument;\n }\n\n return $productDocuments;\n }", "public function process_mkarapuz_price_file() {\n $xml = file_get_contents('http://www.mkarapuz.com.ua/price/mamaclub.xml');\n $xml = $movies = new SimpleXMLElement($xml);\n $storeId = 131;\n\n foreach ($xml->item as $item) {\n $barCode = (string)$item->EAN[0];\n\n $parameterGroup = ManagerHolder::get('ParameterGroup')->getOneWhere(array('bar_code' => $barCode), 'e.*, product.*');\n if (empty($parameterGroup)) {\n $product = ManagerHolder::get('Product')->getOneWhere(array('bar_code' => $barCode), 'e.*');\n } else {\n $product = $parameterGroup['product'];\n }\n\n if (empty($product)) {\n continue;\n }\n\n $where = array('product_id' => $product['id'], 'bar_code' => $barCode, 'store_id' => $storeId);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = (int)$item->qty[0];\n\n if (!empty($parameterGroup)) {\n $entity['product_group_id'] = $parameterGroup['id'];\n }\n\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n $productUpdate = array();\n $productUpdate['price'] = $item->rrc;\n $productUpdate['cost_price'] = $item->price;\n ManagerHolder::get('Product')->updateAllWhere(array('id' => $product['id']), $productUpdate);\n }\n }", "public function getBaseProduct($languageId = null) \n\t{\t\n\t\t$baseProduct = $this->getTableFields('product');\n\t\tunset($baseProduct['product_id']);\t\t\n\n\t\t$baseProductDescription = $this->getTableFields('product_description');\n\t\tunset($baseProductDescription['product_id']);\n\t\t\n\t\tif ($languageId == null) {\n\t\t\t$languageId = $this->config->get('config_language_id');\n\t\t}\n\t\t$baseProduct['product_description'] = array();\n\t\t$baseProduct['product_description'][$languageId] = $baseProductDescription;\n\t\t\n\t\treturn $baseProduct;\t\n\t}", "protected function buildItemsFields(): void\n {\n //====================================================================//\n // Order Line Description\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"title\")\n ->inList(\"lines\")\n ->name(\"[L] Description\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/partOfInvoice\", \"description\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Product Identifier\n $this->fieldsFactory()->create((string) self::objects()->encode(\"Product\", SPL_T_ID))\n ->identifier(\"product_id\")\n ->inList(\"lines\")\n ->name(\"[L] Product\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/Product\", \"productID\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Product SKU\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"sku\")\n ->inList(\"lines\")\n ->name(\"[L] SKU\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/Product\", \"sku\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Discount\n $this->fieldsFactory()->create(SPL_T_DOUBLE)\n ->identifier(\"discount\")\n ->inList(\"lines\")\n ->name(\"[L] Discount %\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/Order\", \"discount\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Unit Price\n $this->fieldsFactory()->create(SPL_T_PRICE)\n ->identifier(\"price\")\n ->inList(\"lines\")\n ->name(\"[L] Unit Price\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/PriceSpecification\", \"price\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Line Tax Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"tax_name\")\n ->inList(\"lines\")\n ->name(\"[L] VAT Tax Code\")\n ->group(\"Items\")\n ->microData(\"http://schema.org/PriceSpecification\", \"valueAddedTaxName\")\n ->association(\"title@lines\", \"quantity@lines\", \"price@lines\")\n ->isReadOnly()\n ;\n }", "public function initialize()\n\t{\n\t // attributes\n\t\t$this->setName('producto');\n\t\t$this->setPhpName('Producto');\n\t\t$this->setClassname('Producto');\n\t\t$this->setPackage('lib.model.geografia');\n\t\t$this->setUseIdGenerator(true);\n\t\t// columns\n\t\t$this->addPrimaryKey('ID_PRODUCTO', 'IdProducto', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('ID_CATEGORIA', 'IdCategoria', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('ID_TIPO', 'IdTipo', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('ID_LINEA', 'IdLinea', 'INTEGER', true, 11, null);\n\t\t$this->addColumn('CODIGO', 'Codigo', 'VARCHAR', true, 10, null);\n\t\t$this->addColumn('NOME_PRODUCTO', 'NomeProducto', 'VARCHAR', true, 20, null);\n\t\t$this->addColumn('DESCRICAO', 'Descricao', 'LONGVARCHAR', true, null, null);\n\t\t$this->addColumn('MEDIDA', 'Medida', 'VARCHAR', true, 100, null);\n\t\t$this->addColumn('FOTO', 'Foto', 'VARCHAR', true, 30, null);\n\t\t$this->addColumn('FOTO2', 'Foto2', 'VARCHAR', true, 30, null);\n\t\t$this->addColumn('FOTO3', 'Foto3', 'VARCHAR', true, 30, null);\n\t\t$this->addColumn('ARQUIVO', 'Arquivo', 'VARCHAR', true, 50, null);\n\t\t$this->addColumn('STATUS', 'Status', 'CHAR', true, null, null);\n\t\t$this->addColumn('DESTAQUE', 'Destaque', 'CHAR', true, null, null);\n\t\t// validators\n\t}", "function products(){\n\t\tif(isset($_POST['Controller']) && $_POST['Controller'] == \"AddToCart\" && isset($_POST['qty']) && isset($_POST['id']) && isset($_POST['price']) ){\n\t\t\t$this->addToCart();\n\t\t\treturn;\n\t\t}\n\t\t$myBuff = ''; // Buffer holding HTML from our templates \n\t\t$PString = ''; // Empty string to hold our pagination\n\t\ttry {\n\t\t\tif(isset($_GET['id'])){\n\t\t\t\tif($contBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pLarge'])){\n\t\t\t\t\t$programs = new SoapClient($this->HTTP.$this->URLS['programs']); // Initiate our SOAP client\n\t\t\t\t\t\n\t\t\t\t\t$wrapper = new stdClass;\n\t\t\t\t\t$wrapper->id = new SoapVar( $_GET['id'] , XSD_STRING, \"string\"); // Set our Start date\n\t\t\t\t\t\n\t\t\t\t\t$res = $programs->Get($wrapper); // Retrieve active programs from our SOAP client\n\t\t\t\t\t//var_dump($rows);\n\t\t\t\t\t$info=&$res->GetResult;\n\t\t\t\t\t\n\t\t\t\t\t$SDate=date(\"M j, Y\",strtotime($info->NITA_StartDate)); // format our program start date\n\t\t\t\t\t$EDate=date(\"M j, Y\",strtotime($info->NITA_EndDate)); // format our program end date\n\t\t\t\t\t$Facility=array();\n\t\t\t\t\tif(!is_null($info->NITA_FacilityName)) $Facility[]=$info->NITA_FacilityName;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr1)) $Facility[]=$info->NITA_FacilityAddr1;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr2)) $Facility[]=$info->NITA_FacilityAddr2;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr3)) $Facility[]=$info->NITA_FacilityAddr3;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityAddr4)) $Facility[]=$info->NITA_FacilityAddr4;\n\t\t\t\t\tif(!is_null($info->NITA_FacilityCity) && !is_null($info->NITA_FacilityState) && !is_null($info->NITA_FacilityZip) )\n\t\t\t\t\t\t\t$Facility[]= (!is_null($info->NITA_FacilityCity)?$info->NITA_FacilityCity.', ':'').\n\t\t\t\t\t\t\t\t\t\t\t\t\t (!is_null($info->NITA_FacilityState)?$info->NITA_FacilityState.' ':'').\n\t\t\t\t\t\t\t\t\t\t\t\t\t (!is_null($info->NITA_FacilityZip)?$info->NITA_FacilityZip:'');\n\t\t\t\t\t\n\t\t\t\t\t$CLE=array();\n\t\t\t\t\tif(!is_null($info->Nita_50MinuteCredits)) $CLE[]=\"50 Minute Credits: \".$info->Nita_50MinuteCredits;\n\t\t\t\t\tif(!is_null($info->Nita_60MinuteCredits)) $CLE[]=\"60 Minute Credits: \".$info->Nita_60MinuteCredits;\n\t\t\t\t\tif(count($CLE)==0) $CLE[]=\"No CLE Credits\";\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$this->HTML.=$this->processCodes($contBuff,array('ID'\t\t\t\t=> $this->ckNULL($info->NITA_ProgramId),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Name'\t\t\t=> $this->ckNULL($info->NITA_Title),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Desc'\t\t\t=> $this->ckNULL($info->NITA_Description),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'SKU'\t\t\t=> $info->NITA_name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'SDate'\t\t=> $SDate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'EDate'\t\t=> $EDate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Avail'\t\t=> 'Open to Registration',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Fac'\t\t\t=> '<p>'.implode(\"<br />\",$Facility).'</p>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'CLE'\t\t\t=> '<p>'.implode(\"<br />\",$CLE).'</p>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Price'\t\t=> '$'.number_format($this->ckNULL($info->NITA_TuitionPriceStandard),2,'.',','),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'PriceInt'\t=> $this->ckNULL($info->NITA_TuitionPriceStandard),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Attr'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'AddCart'\t=> $_SERVER['PHP_SELF'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'URL'\t\t\t=> $this->Files['prodDet'].'?id='.$info->NITA_ProgramId,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pLarge']);\n\t\t\t} else { // If we have not selected a program to look at provide a list of programs.\n\t\t\t\t$programs = new SoapClient($this->HTTP.$this->URLS['programs']); // Initiate our SOAP client\n\t\t\t\t// var_dump($programs->__getFunctions() ); // Dumps the active function from our client\n\t\t\t\t$wrapper = new stdClass;\n\t\t\t\t$wrapper->startDate = new SoapVar( date(\"c\") , XSD_DATETIME, \"dateTime\"); // Set our Start date\n\t\t\t\t$wrapper->endDate = new SoapVar( date(\"c\",mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")+5 ) ), XSD_DATETIME, \"dateTime\"); // Drop an end date a year out\n\t\n\t\t\t\t$rows = $programs->GetActivePrograms($wrapper); // Retrieve active programs from our SOAP client\n\t\t\t\tif(isset($_GET['s'])) $this->SKey=explode(',',$_GET['s']);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif($contBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pListCont'])){ // Get our product list template from the server\n\t\t\t\t\t$contBuff=$this->processCodes($contBuff, array(\t'SortTitle'\t\t=>$_SERVER['PHP_SELF'].'?s=Name,'.(($this->SKey[0]=='Name' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'SortDate'\t\t=>$_SERVER['PHP_SELF'].'?s=Date,'.(($this->SKey[0]=='Date' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'SortLoc'\t\t\t=>$_SERVER['PHP_SELF'].'?s=Location,'.(($this->SKey[0]=='Location' && $this->SKey[1]=='ASC')?'DESC':'ASC'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'SortPrice'\t\t=>$_SERVER['PHP_SELF'].'?s=Price,'.(($this->SKey[0]=='Price' && $this->SKey[1]=='ASC')?'DESC':'ASC')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)); // Drop our sorting links into the product list\n\t\t\t\t\t//var_dump($rows);\n\t\t\t\t\t$programs=&$rows->GetActiveProgramsResult->ProgramModel;// Set our list of programs to an array for easier use\t\t\t\t\n\t\t\t\t\t$Sorting=array();// Our Sorting header\n\t\t\t\t\tif( is_array($this->SArray[$this->SKey[0]]) ) foreach($this->SArray[$this->SKey[0]] as $Sort) $Sorting[$Sort]=$this->SKey[1];\n\t\t\t\t\telse $Sorting[$this->SArray[$this->SKey[0]]]=$this->SKey[1];\n\t\t\t\t\t\n\t\t\t\t\t$this->ObjectSorter($programs, $Sorting); // Sort our array of objects based on an object property\n\t\t\t\t\t\n\t\t\t\t\tif($itemBuff=$this->LoadTemplate($this->rp.$this->TEMPPath.$this->TEMP['pList'])){// Get Item templace from the server\n\t\t\t\t\t\tif(intval($this->Limit)>0){ \n\t\t\t\t\t\t\tif(isset($_GET['p'])) $this->Page=intval($_GET['p']);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->TotalRows = count($programs); // Total number of products in the database\n\t\t\t\t\t\t\t$this->TotalPages = ceil($this->TotalRows/$this->Limit)-1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$PString=$this->Pagination(); // Get our pagination string from our class function\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$programs = array_slice($programs, ($this->Page*$this->Limit), $this->Limit); // Get the programs on our selected page\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tforeach ($programs as $row){ // For each program set the appropriate data to our hooks\n\t\t\t\t\t\t\t$SDate=date(\"M j, Y\",strtotime($row->NITA_StartDate)); // format our program start date\n\t\t\t\t\t\t\t$EDate=date(\"M j, Y\",strtotime($row->NITA_EndDate)); // format our program end date\n\t\t\t\t\t\t\t$myBuff.=$this->processCodes($itemBuff,array('ID'=>\t\t\t\t$this->ckNULL($row->NITA_ProgramId\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Name'=>\t\t\t$this->ckNULL($row->NITA_Title\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'SDate'=>\t\t$SDate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'EDate'=>\t\t$EDate,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'City'=>\t\t\t$this->ckNULL($row->NITA_FacilityCity\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'State'=>\t\t$this->ckNULL($row->NITA_FacilityState\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'Price'=>\t\t'$'.number_format($this->ckNULL($row->NITA_TuitionPriceStandard),2,'.',','),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'PriceInt'=>\t$this->ckNULL($row->NITA_TuitionPriceStandard),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'AddCart'=>\t$_SERVER['PHP_SELF'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'URL'=>\t\t\t$this->Files['prodDet'].'?id='.$this->ckNULL($row->NITA_ProgramId)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($programs);\n\t\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pList']);\n\t\t\t\t\t$this->HTML.=str_replace(\"[List]\", $myBuff, $contBuff); // Place our products into our template\n\t\t\t\t} else throw new FatalError('Cannot open template '.$this->TEMP['pListCont']);\n\t\t\t}\n\t\t\t$this->HTML=$PString.$this->HTML.$PString;\n\t\t} catch (FatalError $e) {\n\t\t\t$this->NitaERROR(102, $e->getMessage()); // Coding fault 102\n\t\t} catch (SoapFault $fault) {\n\t\t\t//echo '<pre>';\n\t\t\t//var_dump($fault);\n\t\t\t//echo '</pre>';\n\t\t\t$this->NitaERROR(101, $fault->faultcode.\", \".$fault->faultstring); // SOAP fault 101, error to our SOAP connection\n\t\t} catch (Exception $e) {\n\t\t\t$this->NitaERROR(103, $e->getMessage()); // Catch all error 103\n\t\t}\n\t}", "function baseStructureInstall(){\n // products table alter\n $alter=true;\n $fl = tep_db_query('SHOW COLUMNS FROM ' . TABLE_PRODUCTS);\n if (tep_db_num_rows($fl) > 0) {\n while ($row = tep_db_fetch_array($fl)) {\n if($row['Field'] == 'products_type'){\n $alter = false;\n }\n }\n }\n if($alter){\n tep_db_query('alter table ' . TABLE_PRODUCTS . ' add products_type enum(\\'standard\\', \\'recurring\\') not null default \\'standard\\'');\n }\n // orders alters\n $alter1=true;\n $alter2=true;\n $fl = tep_db_query('SHOW COLUMNS FROM ' . TABLE_ORDERS);\n if (tep_db_num_rows($fl) > 0) {\n while ($row = tep_db_fetch_array($fl)) {\n if($row['Field'] == 'payment_module'){\n $alter1 = false;\n }elseif($row['Field'] == 'paypal_transaction_id'){\n $alter2 = false;\n }\n }\n }\n if($alter1){\n tep_db_query('ALTER TABLE ' . TABLE_ORDERS . ' ADD payment_module CHAR(35) DEFAULT NULL');\n }\n if($alter2){\n tep_db_query('ALTER TABLE ' . TABLE_ORDERS . ' ADD paypal_transaction_id CHAR(18) DEFAULT NULL');\n }\n // orders_products alter\n $alter=true;\n $fl = tep_db_query('SHOW COLUMNS FROM ' . TABLE_ORDERS_PRODUCTS);\n if (tep_db_num_rows($fl) > 0) {\n while ($row = tep_db_fetch_array($fl)) {\n if($row['Field'] == 'rp_profile_id'){\n $alter = false;\n }\n }\n }\n if($alter){\n tep_db_query('alter table ' . TABLE_ORDERS_PRODUCTS . ' add rp_profile_id char(20) default null');\n }\n // customers alter\n $alter=true;\n $fl = tep_db_query('SHOW COLUMNS FROM ' . TABLE_CUSTOMERS);\n $custFieldArr = array();\n if (tep_db_num_rows($fl) > 0) {\n while ($row = tep_db_fetch_array($fl)) {\n $custFieldArr[] = $row['Field'];\n if($row['Field'] == 'customers_paypal_payerid'){\n $alter = false;\n }\n }\n }\n if($alter){\n tep_db_query('alter table ' . TABLE_CUSTOMERS . ' ADD customers_paypal_payerid VARCHAR( 20 )');\n }\n $alter = true;\n if(count($custFieldArr)>0){\n foreach ($custFieldArr as $field){\n if($field == 'customers_paypal_ec'){\n $alter = false;\n }\n }\n }\n if($alter){\n tep_db_query('alter table ' . TABLE_CUSTOMERS . ' ADD customers_paypal_ec TINYINT (1) UNSIGNED DEFAULT \\'0\\'');\n }\n // list all the tables\n $tablesArr=array();\n $tablesSql = 'SHOW TABLES';\n $tl = tep_db_query($tablesSql);\n while ($row = tep_db_fetch_array($tl)) {\n $tablesArr[] = $row['Tables_in_'.DB_DATABASE];\n }\n // add table - rp\n $create = true;\n if(in_array(TABLE_RP_PAYPAL_PRODUCT_PROFILE, $tablesArr)){\n $create = false;\n }\n if($create){\n $createSql = \"\n CREATE TABLE \" . TABLE_RP_PAYPAL_PRODUCT_PROFILE . \" (\n id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n products_id int(11) UNSIGNED NOT NULL DEFAULT 0,\n profileStartDate datetime DEFAULT NULL,\n billingPeriod enum('day','week','semimonth','month','year') DEFAULT NULL,\n billingFrequency smallint(5) UNSIGNED NOT NULL DEFAULT 1,\n totalBillingCycles smallint(5) UNSIGNED NOT NULL DEFAULT 0,\n trialProfileStartDate datetime DEFAULT NULL,\n trialBillingPeriod enum('day','week','semimonth','month','year') DEFAULT NULL,\n trialBillingFrequency smallint(5) UNSIGNED NOT NULL DEFAULT 1,\n trialTotalBillingCycles smallint(5) UNSIGNED NOT NULL DEFAULT 1,\n trialAmt decimal(15,4) NOT NULL,\n initAmt smallint(5) unsigned NOT NULL DEFAULT 0,\n failedInitAmtAction enum('ContinueOnFailure', 'CancelOnFailure') NOT NULL DEFAULT 'ContinueOnFailure',\n PRIMARY KEY (`id`),\n KEY `products_id` (`products_id`)\n )\n \";\n tep_db_query($createSql);\n // add to array\n $tablesArr[] = TABLE_RP_PAYPAL_PRODUCT_PROFILE;\n }\n // add table - rp\n $create = true;\n if (in_array(TABLE_RP_PAYPAL_PRODUCT_LOOKUP, $tablesArr)){\n $create = false;\n }\n if($create){\n $createSql = \"\n CREATE TABLE \" . TABLE_RP_PAYPAL_PRODUCT_LOOKUP . \" (\n id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n products_id int(11) UNSIGNED NOT NULL DEFAULT 0,\n paypal_rp_product_profile_id int(11) UNSIGNED NOT NULL DEFAULT 0,\n PRIMARY KEY (`id`),\n UNIQUE KEY `rpProd` (`products_id`, `paypal_rp_product_profile_id`)\n )\n \";\n tep_db_query($createSql);\n // add to array\n $tablesArr[] = TABLE_RP_PAYPAL_PRODUCT_LOOKUP;\n }\n // add table - fmf\n $create = true;\n if (in_array(TABLE_FMF_PAYPAL_ORDERS_STATUS, $tablesArr)){\n $create = false;\n }\n if($create){\n $createSql = \"\n CREATE TABLE \" . TABLE_FMF_PAYPAL_ORDERS_STATUS . \" (\n orders_id int(11) UNSIGNED NOT NULL DEFAULT 0,\n paypal_fmf_status_id tinyint(3) UNSIGNED NOT NULL DEFAULT 0,\n action_taken enum('None', 'Accepted', 'Denied') NOT NULL DEFAULT 'None',\n action_date datetime DEFAULT NULL,\n UNIQUE KEY `orderStatus` (`orders_id`, `paypal_fmf_status_id`)\n )\n \";\n tep_db_query($createSql);\n // add to array\n $tablesArr[] = TABLE_FMF_PAYPAL_ORDERS_STATUS;\n }\n // add table - fmf\n $create = true;\n if (in_array(TABLE_FMF_PAYPAL_STATUS, $tablesArr)){\n $create = false;\n }\n if($create){\n $createSql = \"\n CREATE TABLE \" . TABLE_FMF_PAYPAL_STATUS . \" (\n paypal_fmf_status_id tinyint(3) UNSIGNED NOT NULL DEFAULT '0',\n language_id tinyint(3) UNSIGNED NOT NULL DEFAULT '1',\n fmf_status_name char(45) NOT NULL,\n PRIMARY KEY (`paypal_fmf_status_id`,`language_id`),\n KEY `fmf_status_name` (`fmf_status_name`)\n )\n \";\n tep_db_query($createSql);\n // add to array\n $tablesArr[] = TABLE_FMF_PAYPAL_STATUS;\n }\n // load data - fmf TABLE_FMF_PAYPAL_STATUS\n $cntSql = 'SELECT count(*) as `count` FROM ' . TABLE_FMF_PAYPAL_STATUS;\n $rs = tep_db_query($cntSql);\n $row = tep_db_fetch_array($rs);\n $loadData = false;\n if(is_array($row)){\n if($row['count'] == 0){\n $loadData = true;\n }\n }else{\n $loadData = true;\n }\n if($loadData){\n $sql = \"\n INSERT INTO \" . TABLE_FMF_PAYPAL_STATUS . \" VALUES (1, 1, 'AVS No Match'), (2, 1, 'AVS Partial Match'), (3, 1, 'AVS Unavailable/Unsupported'),\n (4, 1, 'Card Security Code (CSC) Mismatch'), (5, 1, 'Maximum Transaction Amount'), (6, 1, 'Unconfirmed Address'), (7, 1, 'Country Monitor'),\n (8, 1, 'Large Order Number'), (9, 1, 'Billing/Shipping Address Mismatch'), (10, 1, 'Risky ZIP Code'), (11, 1, 'Suspected Freight Forwarder Check'),\n (12, 1, 'Total Purchase Price Minimum'), (13, 1, 'IP Address Velocity'), (14, 1, 'Risky Email Address Domain Check'),\n (15, 1, 'Risky Bank Identification Number (BIN) Check'), (16, 1, 'Risky IP Address Range'), (17, 1, 'PayPal Fraud Model')\n \";\n tep_db_query($sql);\n }\n // load data - orders_status\n $status_sql = 'select count(*) as `count` from ' . TABLE_ORDERS_STATUS . ' WHERE orders_status_name like \\'%Paypal FMF%\\'';\n $rs = tep_db_query($status_sql);\n $row = tep_db_fetch_array($rs);\n $loadData = false;\n if(is_array($row)){\n if($row['count'] == 0){\n $loadData = true;\n }\n }else{\n $loadData = true;\n }\n if($loadData){\n $sql = \"\n INSERT INTO \" . TABLE_ORDERS_STATUS . \" VALUES (5, 1, 'Review [Paypal FMF]', 0, 0),(5, 2, 'Review [Paypal FMF]', 0, 0),(5, 3, 'Review [Paypal FMF]', 0, 0)\n \";\n tep_db_query($sql);\n }\n }", "public function load()\n {\n\n /*\n $folder = new LibFilesystemFolder(PATH_GW.'data/bdl/');\n $files = $folder->getPlainFiles();\n\n $this->data = array();\n\n // Load als xmi Files\n foreach ($files as $file)\n if (substr($file, -3 , strlen($file)) == \"xml\")\n $this->data[] = $file;\n */\n\n $data = array();\n\n include PATH_GW.'conf/map/bdl/projects/projects.php';\n\n $this->data = $data;\n\n ksort($this->data);\n\n }", "function LoadProduct($orderid) {\n\t$proids = array();\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"orderproduct\",array('id','orderid','proid','number','price','returnnow','modlcharge'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$idobj = $factory->getIdentityObject()->field('orderid')->eq($orderid);\n\t$order_pro = $finder->find($idobj);\n\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"product\",array('id','classid','length','width','think','unitlen','unitwid','unitthi','unit','sharp','note'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$pro = $order_pro->next();\n\t$i = 0;\n\t$data = array();\n\twhile($pro){\n\t\t$data[$i][0] = $i+1;\n\t\t$idobj = $factory->getIdentityObject()->field('id')->eq($pro->getProid());\n\t\t$collection = $finder->find($idobj);\n\t\t$product = $collection->current();\n\t\t$data[$i][1] = $product->getSize();\n\t\t$data[$i][2] = $pro->getNumber();\n\t\t$price = $pro->getPrice()-$pro->getReturnnow();\n\t\t$data[$i][3] = sprintf(\"%.2f\",$price);\n\t\t$data[$i][4] = sprintf(\"%.2f\",$price*$data[$i][2]);\n\t\t$i++;\n\t\t$pro = $order_pro->next();\n\t}\n\treturn $data;\n}", "public function build()\n {\n }", "public function getProducts()\n {\n $file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\") or die();\n return json_decode($file);\n\n }", "private function construct_xml_contain(){\r\n global $CFG;\r\n $xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.'<!DOCTYPE root [<!ENTITY nbsp \"&#160;\">]>'.'<catalogue/>');\r\n\r\n foreach($this->offers as $offer){\r\n $resource_link = '';\r\n if (OfferCourse::isCentralizedRessourcesAvailable()) {\r\n if(isset($offer->thumbnailid) && $offer->thumbnailid != null){\r\n $DBC = get_centralized_db_connection();\r\n $cr_resource = $DBC->get_record('cr_resources', array('resourceid'=>$offer->thumbnailid));\r\n $resource_link = \"\";\r\n if($cr_resource){\r\n $url_resource = '/'.$CFG->centralizedresources_media_types['indexthumb'].'/'.$cr_resource->cleanname;\r\n $resource_link = get_resource_centralized_secure_url($url_resource, $cr_resource->hashname.$cr_resource->createdate, $CFG->secure_link_timestamp_image);\r\n }\r\n }\r\n }\r\n $formation = $xml->addChild('formation');\r\n if (isset($resource_link)){\r\n $formation->addChild('image', htmlspecialchars($resource_link));\r\n }\r\n $formation->addChild('nom_parcours', htmlspecialchars($offer->fullname));\r\n if (isset($offer->domain_name)){\r\n $formation->addChild('domaine', htmlspecialchars($offer->domain_name));\r\n }\r\n if (isset($offer->publics)){\r\n $formation->addChild('public', htmlspecialchars($offer->publics));\r\n }\r\n if (isset($offer->col_name)){\r\n $formation->addChild('collection', htmlspecialchars($offer->col_name));\r\n }\r\n if (isset($offer->authors)){\r\n $formation->addChild('formateur', htmlspecialchars($offer->authors));\r\n }\r\n if (isset($offer->summary)){\r\n $description = strip_tags($offer->summary,'');\r\n $formation->addChild('description', htmlspecialchars($description));\r\n }\r\n if (isset($offer->objectif)){\r\n $objectif = strip_tags($offer->objectif,'');\r\n $formation->addChild('objectifs', htmlspecialchars($objectif));\r\n }\r\n if (isset($offer->tps_en_presence)){\r\n $temps_presence = OfferCourse::string_format_time($offer->tps_en_presence);\r\n if($temps_presence == null){\r\n $temps_presence = get_string('no_lead_time_attendance', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_presence', htmlspecialchars($temps_presence));\r\n }\r\n if (isset($offer->tps_a_distance)){\r\n $temps_distance = OfferCourse::string_format_time($offer->tps_a_distance);\r\n if($temps_distance == null){\r\n $temps_distance = get_string('no_lead_time_remote', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_distance', htmlspecialchars($temps_distance));\r\n }\r\n if (isset($offer->validateby)){\r\n $formation->addChild('validation', htmlspecialchars($offer->validateby));\r\n }\r\n if (isset($offer->aca_name)){\r\n $formation->addChild('origine', OfferCourse::string_format_origine_offers($offer->aca_name));\r\n }\r\n if (isset($offer->timepublished)){\r\n $updatedate = (isset($offer->timepublished)?date('YmdHis',$offer->timepublished):date('YmdHis',$offer->updatedate));\r\n $formation->addChild('date_publication', $updatedate);\r\n }\r\n $formation->addChild('url', $offer->courseurl);\r\n }\r\n\r\n $this->xml_structure = $xml->asXML();\r\n }", "public function Build() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement it's \" .\n \"creation in the RDBMS.\"\n , debug_backtrace()\n );\n }", "public function populateProducts(): bool\n {\n if (!$this->validate()) {\n return false;\n }\n if (!$this->file || !($this->file instanceof UploadedFile)) {\n $this->addError('file', 'Incorrect file');\n return false;\n }\n //Extract file to array\n $rows = array_map('str_getcsv', file($this->file->tempName));\n\n //Extract and validate header\n $header = array_map(function ($item) {\n $item = strtolower(trim($item));\n return self::HEADER_MAPPING[$item] ?? $item;\n }, array_shift($rows));\n //Basic Header validation\n $missingHeader = array_diff(self::REQUIRED_HEADERS, $header);\n if ($missingHeader) {\n $this->addError('header', 'Header has missing elements: ' . implode(',', $missingHeader));\n return false;\n }\n //Process row by row, populate and validate products\n foreach ($rows as $key => $row) {\n if (count($this->getErrors()) > 50) {\n $this->addError('File', 'The file contains too many errors. Processing terminated.');\n break;\n }\n $this->processRow($row, $key, $header);\n }\n\n return !$this->hasErrors();\n }", "public function buildFromXML($eloXML = null){\n\t\tif ($eloXML !== null){\n\t\t\t$dom = str_get_dom($eloXML);\n\t\t\t\n\t\t\t$contentWithDataTag = $this->getElemAtPos($dom, 'content', 0);\n\t\t\t$dataTag = $this->getElemAtPos($contentWithDataTag, 'data', 0); \n\t\t\tif ($dataTag->innertext !== null){\n\t\t\t\t$content = $dataTag->innertext;\n\t\t\t}else{\n\t\t\t\t$content = '';\n\t\t\t}\n\t\t\t\n\t\t\t$this->setContent($content);\n\t\t\t\n\t\t\t$metadataElem = $this->getElemAtPos($dom, 'metadata', 0);\n\t\t\tif ($metadataElem !== null){\n\t\t\t\tforeach($metadataElem->childNodes() as $curMetadataElem){\n\t\t\t\t\t\n\t\t\t\t\tif ($curMetadataElem->tag == 'uri'){\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem->find('entry');\n\t\t\t\t\t\t$curMetadataElem = $curMetadataElem[0];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$key = 'uri';\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$key = $curMetadataElem->tag;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$value = $curMetadataElem->innertext;\n\t\t\t\t\t$this->_metadata[$key] = $value;\n\n\t\t\t\t\t// extract the id from URI\n\t\t\t\t\tif ($key === 'uri'){\n\t\t\t\t\t\t$this->_id = substr(strrchr($value, '/'), 1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// This code is to dynamically set the values for the\n\t\t\t\t\t// elo's metadatas\n\t\t\t\t\t/*\n\t\t\t\t\t * THIS WAS MESSING UP THE POPULATION OF THE CODE. \n\t\t\t\t\t * SEEMS TO BE DOING THE EXACT SAME THING AS $this->_metadata[$key] = $value; BUT ADDING A _<mt key> VARIABLE THAT\n\t\t\t\t\t * MESSES UP THE XML GENERATION.\n\t\t\t\t\t */\n//\t\t\t\t\t$keyVar = \"_\" . $key;\n//\t\t\t\t\t$this->$keyVar = $value;\n//\t\t\t\t\t$this->addMetadata($key, $value);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$resourceElem = $this->getElemAtPos($dom, 'resource', 0);\n\t\t\tif ($resourceElem !== null){\n\t\t\t\tif ($resourceElem ){\n\t\t\t\t\tforeach($resourceElem->childNodes() as $curResourceElem){\n\t\t\t\t\t\t$key = $curResourceElem->tag;\n\t\t\t\t\t\t$value = $curResourceElem->innertext;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->_resources[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function build()\n {\n $this->request = $this->client->createRequest(RequestInterface::DELETE, 'items/' . $this->get('pio_iid'));\n }", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "public function loadProducts()\n {\n if (!isset($this->mix_id)) {\n return false;\n }\n\n $this->products = array();\n $query = \"SELECT mg.*, sup.*, p.product_id, p.product_nr, p.name, p.paint_chemical, coat.coat_desc as coatDesc \" .\n \"FROM \" . TB_MIXGROUP . \" mg \" .\n \"JOIN \" . TB_PRODUCT . \" p ON p.product_id = mg.product_id \" .\n \"JOIN \" . TB_SUPPLIER . \" sup ON p.supplier_id = sup.supplier_id \" .\n \"JOIN \" . TB_COAT . \" coat ON coat.coat_id = coating_id \" .\n \"WHERE mg.mix_id = {$this->db->sqltext($this->mix_id)}\";\n\n $this->db->query($query);\n if ($this->db->num_rows() == 0) {\n return false;\n }\n\n $productsData = $this->db->fetch_all();\n\n $unittype = new Unittype($this->db);\n //get pfp if exist\n $pfp = $this->getPfp();\n $pfpProduct = array();\n if ($pfp) {\n $pfpProducts = $pfp->getProducts();\n }\n\n foreach ($productsData as $productData) {\n $mixProduct = new MixProduct($this->db);\n foreach ($productData as $property => $value) {\n if (property_exists($mixProduct, $property)) {\n $mixProduct->$property = $productData->$property;\n }\n }\n //\tTODO: add userfriendly records to product properties\n $mixProduct->initializeByID($mixProduct->product_id);\n\n //\tif there is a primary product then this is an pfp-based mix\n if ($mixProduct->is_primary) {\n $this->isPfp = true;\n }\n\n if ($productData->ratio) {\n $mixProduct->ratio_to_save = $productData->ratio;\n }\n\n $mixProduct->unittypeDetails = $unittype->getUnittypeDetails($mixProduct->unit_type);\n $unittypeClass = $unittype->getUnittypeClass($mixProduct->unit_type);\n\n $mixProduct->unittypeDetails['unittypeClass'] = $unittypeClass;\n $mixProduct->initUnittypeList($unittype);\n\n $mixProduct->json = json_encode($mixProduct);\n //get is Ratio \n foreach ($pfpProducts as $pfpProduct) {\n if ($pfpProduct->getProductId() == $productData->product_id) {\n if (!is_null($pfpProduct->getRatioFromOriginal()) && !is_null($pfpProduct->getRatioToOriginal())) {\n $mixProduct->isRange = true;\n $mixProduct->range_ratio = trim($pfpProduct->getRatioFromOriginal()) . '-' . trim($pfpProduct->getRatioToOriginal());\n } else {\n $mixProduct->isRange = false;\n }\n break;\n }\n }\n //\tpush to mix products\n array_push($this->products, $mixProduct);\n }\n\n return $this->products;\n }", "function domain_add_xmlfile($key,$file){\n if(is_object($this->tool)) $file = $this->tool->det_file($file,0,'abs');\n if(!file_exists($file) or !is_readable($file)) return 20;\n $xml = new opc_sxml($file);\n if(!is_null($xml->error_msg)) return 21;\n return $this->domain_add_xml($key,$xml);\n }", "private function addXmlNode(array $item, DOMDocument $xmlFile, DOMNode $xmlRoot) : void\n {\n /** @var JobParameters $parameters */\n $parameters = $this->jobParameters;\n /** @var \\DOMElement $xmlItem */\n $xmlItem = $xmlFile->createElement($this->exportEntity);\n $xmlItem = $xmlRoot->appendChild($xmlItem);\n\n $xmlItem->setAttribute('id', $item['product'][$parameters->get('id')]);\n $this->addItemChild('name', $item['product'], $parameters->get('name'), $xmlItem, $xmlFile);\n $this->addItemChild('description', $item['product'], $parameters->get('description'), $xmlItem, $xmlFile);\n $this->addItemChild('producturl', $item['product'], $parameters->get('productUrl'), $xmlItem, $xmlFile);\n $this->addItemChild('smallimage', $item['product'], $parameters->get('smallImage'), $xmlItem, $xmlFile);\n $this->addItemChild('bigimage', $item['product'], $parameters->get('bigImage'), $xmlItem, $xmlFile);\n $this->addItemChild('price', $item['product'], $parameters->get('price'), $xmlItem, $xmlFile);\n $this->addItemChild('retailprice', $item['product'], $parameters->get('retailPrice'), $xmlItem, $xmlFile);\n $this->addItemChild('recommendable', $item['product'], $parameters->get('recommendable'), $xmlItem, $xmlFile);\n if ($parameters->get('includeCategories')) {\n $productCategories = $this->removeCategoriesNotInChannel($item['categories']);\n $productCategoriesLabel = $this->getCategoriesLabel($productCategories);\n $i = 1;\n foreach ($productCategoriesLabel as $categoryLabel) {\n if ($i <= $this->maxCategoriesDepth) {\n $xmlItem->appendChild($xmlFile->createElement('categoryid' . $i, $categoryLabel));\n }\n $i++;\n }\n }\n }", "function _buildXML() {\r\n\r\n\t\t$db = &FabrikWorker::getDbo();\r\n\t\t$this->clearExportBuffer();\r\n\t\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\\n\";\r\n\t\t$strXML .= \"<install type=\\\"fabrik\\\" version=\\\"2.0\\\">\\n\";\r\n\r\n\t\t$strXML .= \"<creationDate>\" . JRequest::getVar('creationDate', '', 'post') . \"</creationDate>\\n\";\r\n\t \t$strXML .= \"<author>\" . JRequest::getVar('creationDate', '', 'author') . \"</author>\\n\";\r\n\t \t$strXML .= \"<copyright>\" . JRequest::getVar('creationDate', '', 'copyright') . \"</copyright>\\n\";\r\n\t \t$strXML .= \"<authorEmail>\" . JRequest::getVar('creationDate', '', 'authoremail') . \"</authorEmail>\\n\";\r\n\t \t$strXML .= \"<authorUrl>\" . JRequest::getVar('creationDate', '', 'authorurl') . \"</authorUrl>\\n\";\r\n\t \t$strXML .= \"<version>\" . JRequest::getVar('creationDate', '', 'version') . \"</version>\\n\";\r\n\t \t$strXML .= \"<liscence>\" . JRequest::getVar('creationDate', '', 'license') . \"</liscence>\\n\";\r\n\t \t$strXML .= \"<description>\" . JRequest::getVar('creationDate', '', 'description') . \"</description>\\n\";\r\n\r\n\t\t$aTableObjs = array();\r\n\r\n\t\t$tables = $this->packageModel->_tables;\r\n\t\t$forms = $this->packageModel->_forms;\r\n\t\tif ($this->fabrikData) {\r\n\r\n\t\t\t$strXML .= \"<tables>\\n\";\r\n\t\t\tif (is_array($this->tableIds)) {\r\n\r\n\t\t\t\tforeach ($tables as $table) {\r\n\t\t\t\t\t$vars = get_object_vars($table);\r\n\t\t\t\t\t$strXML .= \"\\t<table>\\n\";\r\n\t\t\t\t\tforeach( $vars as $key=>$val ) {\r\n\t\t\t\t\t\tif (substr($key, 0, 1) != '_' ) {\r\n\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</tables>\\n\\n\";\r\n\r\n\t\t\t$strXML .= \"<forms>\\n\";\r\n\r\n\t\t\tforeach ($forms as $form) {\r\n\t\t\t\t$vars = get_object_vars($form);\r\n\t\t\t\t$strXML .= \"\\t<form>\\n\";\r\n\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$strXML .= \"\\t</form>\\n\";\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</forms>\\n\\n\";\r\n\r\n\t\t\t$strElementXML \t\t= \"<elements>\\n\";\r\n\t\t\t$strXML \t\t\t.= \"<groups>\\n\";\r\n\t\t\t$strValidationXML \t= \"<validations>\\n\";\r\n\t\t\tforeach ($this->_aTables as $listModel) {\r\n\t\t\t\t$groups = $listModel->_oForm->getGroupsHiarachy();\r\n\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tforeach ($groups as $groupModel) {\r\n\t\t\t\t\t$group = $groupModel->getGroup();\r\n\t\t\t\t\t$vars = get_object_vars($group);\r\n\t\t\t\t\t$strXML .= \"\\t<group form_id=\\\"\".$listModel->getFormModel()->getId().\"\\\" ordering=\\\"\" . $i .\"\\\">\\n\";\r\n\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t//dont insert join_id as this isnt in the group table\r\n\t\t\t\t\t\tif ($key != \"join_id\") {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$strXML .= \"\\t</group>\\n\";\r\n\t\t\t\t\t$elementModels = $groupModel->getPublishedElements();\r\n\t\t\t\t\tforeach ($elementModels as $elementModel) {\r\n\t\t\t\t\t\t$element = $elementModel->getElement();\r\n\t\t\t\t\t\t$vars = get_object_vars($element);\r\n\t\t\t\t\t\t$strElementXML .= \"\\t<element>\\n\";\r\n\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strElementXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$strElementXML .= \"\\t</element>\\n\\n\";\r\n\r\n\t\t\t\t\t\tforeach ($elementModel->_aValidations as $oValidation) {\r\n\t\t\t\t\t\t\t$vars = get_object_vars($oValidation);\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t<validation>\\n\";\r\n\t\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t\t$strValidationXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t</validation>\\n\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML \t\t\t.= \"</groups>\\n\";\r\n\t\t\t$strElementXML \t\t.= \"</elements>\\n\\n\";\r\n\t\t\t$strValidationXML \t.= \"</validations>\\n\\n\";\r\n\t\t\t$strXML .= $strElementXML . $strValidationXML;\r\n\r\n\t\t}\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t\tif ($this->incTableStructure) {\r\n\t\t\t$strXML = $this->_createTablesXML($strXML);\r\n\t\t}\r\n\t\t$strXML .= $this->getTemplateFiles();\r\n\t\t$strXML .= \"</install>\";\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t}", "function ciniki_products_typeObjectDefUpdate($ciniki, $object_def, $args) {\n\n if( $object_def == NULL ) {\n $object_def = array(\n 'name'=>array('name_s'=>'', 'name_p'=>''),\n );\n }\n if( !isset($object['parent']) ) {\n $object['parent'] = array('products'=>array());\n }\n if( !isset($object['parent']['products']) ) {\n $object['parent']['products'] = array();\n }\n\n $product_fields = array(\n 'name',\n 'code',\n 'sequence',\n 'category',\n 'source',\n 'flags',\n 'status',\n 'barcode',\n 'supplier_tnid',\n 'supplier_product_id',\n 'price',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'cost',\n 'msrp',\n 'sell_unit',\n 'supplier_id',\n 'supplier_item_number',\n 'supplier_minimum_order',\n 'supplier_order_multiple',\n 'manufacture_min_time',\n 'manufacture_max_time',\n 'inventory_flags',\n 'inventory_current_num',\n 'inventory_reorder_num',\n 'inventory_reorder_quantity',\n 'shipping_flags',\n 'shipping_weight',\n 'shipping_weight_units',\n 'shipping_length',\n 'shipping_width',\n 'shipping_height',\n 'shipping_size_units',\n 'primary_image_id',\n 'short_description',\n 'long_description',\n 'description',\n 'start_date',\n 'end_date',\n 'webflags',\n 'detail01',\n 'detail02',\n 'detail03',\n 'detail04',\n 'detail05',\n 'detail06',\n 'detail07',\n 'detail08',\n 'detail09',\n );\n foreach($product_fields as $field) {\n if( isset($args['parent_product_' . $field]) ) {\n if( $args['parent_product_' . $field] == 'on' ) {\n $object_def['parent']['products'][$field] = array();\n } elseif( $args['parent_product_' . $field] == 'off' \n && isset($object_def['parent']['products'][$field]) ) {\n unset($object_def['parent']['products'][$field]);\n }\n }\n if( (!isset($args['parent_product_' . $field . '-name']) || $args['parent_product_' . $field . '-name'])\n && isset($args['parent_product_' . $field . '-name']) ) {\n if( isset($object_def['parent']['products']) ) {\n $object_def['parent']['products'][$field]['name'] = $args['parent_product_' . $field . '-name'];\n }\n }\n if( isset($args['child_product_' . $field]) ) {\n if( $args['child_product_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) {\n $object_def['child'] = array('products'=>array());\n }\n $object_def['child']['products'][$field] = array();\n } elseif( $args['child_product_' . $field] == 'off' \n && isset($object_def['child']['products'][$field]) ) {\n unset($object_def['child']['products'][$field]);\n }\n }\n if( (!isset($args['child_product_' . $field . '-name']) || $args['child_product_' . $field . '-name'])\n && isset($args['child_product_' . $field . '-name']) ) {\n if( isset($object_def['child']['products']) ) {\n $object_def['child']['products'][$field]['name'] = $args['child_product_' . $field . '-name'];\n }\n }\n }\n\n $price_fields = array(\n 'name',\n 'pricepoint_id',\n 'available_to',\n 'min_quantity',\n 'unit_amount',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'start_date',\n 'end_date',\n 'webflags',\n );\n\n foreach($price_fields as $field) {\n if( isset($args['parent_price_' . $field]) ) {\n if( $args['parent_price_' . $field] == 'on' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array();\n } elseif( $args['parent_price_' . $field] == 'hidden' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array('ui-hide'=>'yes');\n } elseif( $args['parent_price_' . $field] == 'off' \n && isset($object_def['parent']['prices'][$field]) ) {\n unset($object_def['parent']['prices'][$field]);\n }\n if( $args['parent_price_' . $field] != 'off' ) {\n if( isset($args['parent_price_' . $field . '-default']) \n && $args['parent_price_' . $field . '-default'] != '' ) {\n $object_def['parent']['prices'][$field]['default'] = $args['parent_price_' . $field . '-default'];\n }\n }\n }\n if( isset($args['child_price_' . $field]) ) {\n if( $args['child_price_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) { $object_def['child'] = array('products'=>array()); }\n if( !isset($object_def['child']['prices']) ) { $object_def['child']['prices'] = array(); }\n $object_def['child']['prices'][$field] = array();\n } elseif( $args['child_price_' . $field] == 'off' \n && isset($object_def['child']['prices'][$field]) ) {\n unset($object_def['child']['prices'][$field]);\n }\n }\n }\n\n //\n // Remove old ones\n //\n if( isset($object_def['parent']['subcategories']) ) { unset($object_def['parent']['subcategories']); }\n\n// $args['object_def'] = serialize($object_def);\n\n //\n // Check for subcategories\n //\n for($i=11;$i<30;$i++) {\n $field = 'parent_subcategories-' . $i;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent']['subcategories-' . $i] = array();\n if( isset($args[$field . '-sname']) ) {\n $object_def['parent']['subcategories-' . $i]['sname'] = $args[$field . '-sname'];\n }\n if( isset($args[$field . '-pname']) ) {\n $object_def['parent']['subcategories-' . $i]['pname'] = $args[$field . '-pname'];\n }\n } elseif( $args[$field] == 'off' && isset($object_def['parent']['subcategories-' . $i]) ) {\n unset($object_def['parent']['subcategories-' . $i]);\n }\n }\n }\n\n $extras = array('categories', \n// 'subcategories-11', 'subcategories-12', 'subcategories-13', 'subcategories-14', 'subcategories-15', \n 'tags', 'images', 'audio', 'files', 'similar', 'recipes');\n foreach($extras as $extra) {\n $field = 'parent_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['parent'][$extra]) ) {\n unset($object_def['parent'][$extra]);\n }\n }\n $field = 'child_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['child'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['child'][$extra]) ) {\n unset($object_def['child'][$extra]);\n }\n }\n }\n\n return array('stat'=>'ok', 'object_def'=>$object_def);\n}", "private function parseProducts($xml){\n $catalogue = $xml->shop->offers;\n $productData = array();\n foreach ($catalogue as $offers) {\n foreach ($offers as $product) {\n foreach ($product->attributes() as $key => $value) {\n if ($key == 'id') $productData['id_prom'] = $value;\n }\n $productData['model'] = $product->vendorCode;\n $productData['id_group_prom'] = $product->categoryId;\n $this->addProduct($productData);\n }\n }\n }", "public function _construct()\n {\n $this->_init('configbox_magento_xref_mprod_cbprod', 'id');\n }", "public static function build($type) {\n $product = $type;\n if (class_exists($product)) {\n return new $product();\n }\n else {\n throw new Exception(\"Invalid product type given.\");\n }\n }", "function wc_sample_xml_get_line_items( $order ) {\n \n \t//connect\n \t\tUse Wp\n\t//output the product elements from the order\n\tforeach( $order->get_items() as $item_id => $item_data ) {\n \t\t $OrderId = $order->id; \n\t\t //grab the data we need\n\t$query = \"Request to grab data from bd based on the $OrderId\";\n\t\t $sql = $connexion->query($query);\t \n\t\t $curData = array();\n \t $count = 0;\n\n\t\t //data specific info for each line item\n\n while($Ca = $sql -> fetch()) {\n\t\t\t $curData[] = $Ca;\n\t\t\t $count ++;\n\t\t\t}\n\t\t\t//If the product ned some customizations before generating the xml\n \tif ($count >0){\n\t\t\t //Format the file name and replace spaces by \"-\"\n\t\t\t $titlePath = sanitize_title( trim($ItemName) );\n\t\t\t $title = $order_idmeta.'_order_item_generated';\n\t\t\t $filePath = content_url('/fancy_products_orders/images/'.$OrderId.'/'.$order_idmeta.'/'.$title.'.png');\n\t\t\t //If the item's image is not generated\n\t\t\t $urlLiveSite = 'http://www.yourWebsite.com/';\n\t\t\t $NofilePath = ($urlTestSite.'/'.$pathElement.'/'.$titlePath);\n\t\t\t //Check if the file physically exists\n\t\t\t if (file($filePath)) {\n\t\t\t $png_url = array('Source'\t=> $filePath);\n\t\t\t } \n\t\t\t else {\n\t\t\t $png_url = array('Source'\t=> $NofilePath);\n\t\t\t }\n\n\t\t$product = $order->get_product_from_item( $item_data );\n\t\t//This is the final xml customized \n\t\t$items[] = array(\n\t\t\t'LineNumber'\t\t\t\t=> $LineNumber,\n\t\t\t'ProductCode'\t\t\t\t=> $ProductCode,\n\t\t\t'ProductUPC'\t\t\t\t=> '0004-2478',\n\t\t\t'ItemDescription'\t\t\t=> $ItemName,\n\t\t\t'Quantity'\t\t\t\t\t=> $item_data['qty'],\n\t\t\t//we need to write a function that grabs the image URL, store the url as a variable and then pass it as the value here\n\t\t\t'FileList' \t\t\t=> $png_url,\n\t\t);\n\t } //end if\n\t} //end for\n}", "function setup() {\n\n $this->log(\"--- Setup jelix16 starts\");\n $allModulesDir = $this->parameters->getAllModulesDirs();\n $allPluginsDir = $this->parameters->getAllPluginsDirs();\n $allModules = $this->parameters->getAllSingleModuleDirs();\n\n $appDir = $this->parameters->getAppDir();\n if (!$appDir) {\n throw new \\Exception(\"No application directory is set in JelixParameters\");\n }\n\n $this->readProjectXml();\n $ini = $this->loadLocalConfigFile();\n $configDir = $this->parameters->getVarConfigDir();\n if (!file_exists($configDir)) {\n throw new ReaderException(\"The var/config directory of the jelix application cannot be found. Indicate its path into the composer.json of the application, into an extra/jelix/var-config-dir parameter\");\n }\n $vendorPath = $this->getFinalPath('./');\n\n // retrieve the current modulesPath value\n $modulesPath = $this->getCurrentModulesPath($configDir, $ini, $vendorPath);\n if (count($allModulesDir)) {\n // add all declared modules directories\n foreach($allModulesDir as $path) {\n $modulesPath[] = $this->getFinalPath($path);\n }\n }\n $modulesPath = implode(',', array_unique($modulesPath));\n if ($ini->getValue('modulesPath') != $modulesPath) {\n $ini->setValue('modulesPath', $modulesPath);\n $this->log('New modulesPath: '.$modulesPath);\n }\n\n // retrieve the current pluginsPath value\n $pluginsPath = $this->getCurrentPluginsPath($configDir, $ini, $vendorPath);\n if (count($allPluginsDir)) {\n // add all declared plugins directories\n foreach($allPluginsDir as $path) {\n $pluginsPath[] = $this->getFinalPath($path);\n }\n }\n $pluginsPath = implode(',', array_unique($pluginsPath));\n if ($ini->getValue('pluginsPath') != $pluginsPath) {\n $ini->setValue('pluginsPath', $pluginsPath);\n $this->log('New pluginsPath: '.$pluginsPath);\n }\n\n $modulePathToRemove = array();\n foreach($ini->getValues('modules') as $key => $val) {\n if (preg_match(\"/\\\\.path$/\", $key) && strpos($val, $vendorPath) === 0) {\n $modulePathToRemove[$key] = $val;\n }\n }\n\n if (count($allModules)) {\n // declare path of single modules\n foreach($allModules as $path) {\n $path = $this->fs->normalizePath($path);\n $moduleName = basename($path);\n\n $path = $this->getFinalPath($path);\n $this->log(\"setup path to module $moduleName\");\n if ($ini->getValue($moduleName.'.path', 'modules') != $path) {\n $ini->setValue($moduleName.'.path', $path, 'modules');\n }\n\n if (isset($modulePathToRemove[$moduleName.'.path'])) {\n unset($modulePathToRemove[$moduleName.'.path']);\n }\n }\n }\n\n // erase all \"<module>.path\" keys of modules that are not inside a package anymore\n foreach ($modulePathToRemove as $key => $path) {\n $ini->removeValue($key, 'modules');\n $this->log(\"remove path to module $key\");\n }\n\n $this->setupModuleAccess($ini);\n\n $ini->save();\n foreach($this->entryPoints as $epIni) {\n $epIni->save();\n }\n $this->log(\"Setup jelix16 ends\");\n }", "public function create(string $file):array\n{\n\n // Load YAML file\n try {\n $vars = Yaml::parseFile($file);\n } catch (ParseException $e) { \n throw new ApexException('error', tr(\"Unable to parse YAML file for CRUD creation. Message: {1}\", $e->getMessage()));\n }\n\n // Set variables\n $this->package = $vars['package'] ?? '';\n $this->dbtable = $vars['dbtable'] ?? '';\n $this->alias = $vars['alias'] ?? preg_replace(\"/^\" . $this->package . \"_/\", \"\", $this->dbtable);\n $views = $vars['views'] ?? [];\n $admin_uri = $views['admin'] ?? '';\n\n // Get singular alias\n $inflector = new EnglishInflector();\n $single = $inflector->singularize($this->alias);\n $this->alias = is_array($single) ? $single[0] : $single;\n\n // Get plural alias\n $plural = $inflector->pluralize($this->alias);\n $this->alias_plural = is_array($plural) ? $plural[0] : $plural;\n\n // Perform checks\n $this->perform_checks();\n\n // Get columns\n $this->columns = db::show_columns($this->dbtable, true);\n if (isset($this->columns['id'])) { unset($this->columns['id']); }\n\n // Create form\n $form = $vars['form'] ?? [];\n $this->create_form($form);\n\n // Create table\n $table = $vars['table'] ?? [];\n $this->create_table($table, $admin_uri);\n\n // Create admin view\n if ($admin_uri != '') { \n $form_exclude = $form['exclude'] ?? [];\n $this->create_view_admin($admin_uri, $form_exclude);\n }\n\n // Return\n return array($this->alias, $this->package, $this->created_files);\n\n}", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "function add_new_product($product_info) {\r\n try {\r\n $params = array(\r\n array('name' => ':product_name', 'value' => $product_info['product_name']),\r\n array('name' => ':product_number', 'value' => &$product_info['product_number']),\r\n array('name' => ':product_type', 'value' => &$product_info['product_type']),\r\n array('name' => ':notes', 'value' => &$product_info['notes']),\r\n array('name' => ':category_id', 'value' => &$product_info['category_id']),\r\n array('name' => ':width', 'value' => &$product_info['width']),\r\n array('name' => ':height', 'value' => &$product_info['height']),\r\n array('name' => ':h_length', 'value' => &$product_info['h_length']),\r\n array('name' => ':re_demand_border', 'value' => &$product_info['re_demand_border']),\r\n array('name' => ':primary_unit_name', 'value' => &$product_info['primary_unit_name']),\r\n array('name' => ':secondary_unit_name', 'value' => &$product_info['secondary_unit_name']),\r\n array('name' => ':primary_unit_quantity', 'value' => &$product_info['primary_unit_quantity']),\r\n array('name' => ':secondary_unit_quantity', 'value' => &$product_info['secondary_unit_quantity']),\r\n array('name' => ':quantity_status', 'value' => &$product_info['quantity_status']),\r\n array('name' => ':res', 'value' => &$result)\r\n );\r\n\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"begin :res := product_actions.add_new_product(:product_name,:product_number,:product_type,:notes,:category_id,:width,:height,:h_length,:re_demand_border,:primary_unit_name,:secondary_unit_name,:primary_unit_quantity,:secondary_unit_quantity,:quantity_status); end;\");\r\n foreach ($params as $variable) {\r\n oci_bind_by_name($stmt, $variable[\"name\"], $variable[\"value\"]);\r\n }\r\n oci_execute($stmt);\r\n return $result;\r\n } catch (Exception $ex) {\r\n return $ex;\r\n }\r\n }", "private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }", "public function testOrdersBundleProductsReading(): void\n {\n //====================================================================//\n // Search for Orders including Bundle Products\n /** @var Mage_Sales_Model_Order_Item $model */\n $model = Mage::getModel('sales/order_item');\n $collection = $model\n ->getCollection()\n ->addAttributeToFilter('product_type', array('eq' => \"bundle\"))\n ->addAttributeToSelect('order_id')\n ;\n\n //====================================================================//\n // Skip if Empty\n if ($collection->getSize() < 1) {\n $this->markTestSkipped('No Orders including Bundle Products in Database.');\n }\n\n //====================================================================//\n // Perform Tests\n foreach ($collection->getItems() as $listItem) {\n //====================================================================//\n // Setup Bundle Products Prices Mode\n $this->setBundlePricesMode(false);\n //====================================================================//\n // Verify order Items\n $this->verifyItems($listItem[\"order_id\"]);\n //====================================================================//\n // Setup Bundle Products Prices Mode\n $this->setBundlePricesMode(true);\n //====================================================================//\n // Verify order Items\n $this->verifyItems($listItem[\"order_id\"]);\n }\n }", "public function arrayProductsPOS($filePath)\n {\n $this->rows = array();\n Excel::load($filePath, function($archivo)\n { \n $result=$archivo->get();\n foreach($result as $key => $value)\n {\n $row = new UPCRowView($value->upc,$value->nombre,$value->cantidad); \n array_push($this->rows, $row);\n };\n })->get();\n return $this->rows;\n }", "public function actionProductUpdateUsingFile()\n\t{\n\t\t$filePath = Yii::getAlias('@webroot').'/frontend/modules/walmart/filestorage/product/update';\n\t\t$files = scandir($filePath);\n\t\tforeach($files as $file){\n\t\t\t$fullFilePath = $filePath.'/'.$file;;\n\t\t\tif(!is_dir($fullFilePath)){\n\t\t\t\t$storedData = require $fullFilePath;\n\t\t\t\t$merchant_id = str_replace('.php','',$file);\n\t\t\t\t$xmlDir = $filePath.'/xml/'.$merchant_id;\n\t\t\t\tif (!file_exists($xmlDir)) {\n\t\t mkdir($xmlDir, 0775, true);\n\n\t\t }\n\t\t $xmlFile = $xmlDir. '/MPProduct-' . time() . '.xml';\n\t\t $xml = new Generator();\n $xml->arrayToXml($storedData)->save($xmlFile);\n Walmartapi::unEscapeData($xmlFile);\n $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$merchant_id.\"'\",'one','select');\n $walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n $response = $walmartApi->postRequest(Walmartapi::GET_FEEDS_ITEMS_SUB_URL, ['file' => $xmlFile]);\n $response = str_replace('ns2:', \"\", $response);\n\n $responseArray = [];\n $responseArray = Walmartapi::xmlToArray($response);\n if (isset($responseArray['FeedAcknowledgement'])) {\n $result = [];\n unlink($fullFilePath);\n $feedId = isset($responseArray['FeedAcknowledgement']['feedId']) ? $responseArray['FeedAcknowledgement']['feedId'] : '';\n if ($feedId != '') {\n $result = $walmartApi->getFeeds($feedId);\n if (isset($results['results'][0], $results['results'][0]['itemsSucceeded']) && $results['results'][0]['itemsSucceeded'] == 1) {\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n } elseif ($responseArray['errors']) {\n $error['feedError'] = $responseArray['errors'];\n }\n\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tdie;\n\t}", "private function get_items($file)\n\t\t{\n\t\t\t$xml = new NBXML(PATH_POSTS . $file, 0, TRUE, '', FALSE);\n\n\t\t\t$file_info = explode('.', $file);\n\n\t\t\t$content = (string) $xml->getChild('content');\n\t\t\t$tmp_content = explode(\"<!-- pagebreak -->\", $content);\n\n\t\t\t$tmp_array = array('read_more'=>false);\n\n\t\t\t$tmp_array['filename']\t\t\t= (string) $file;\n\n\t\t\t$tmp_array['id']\t\t\t\t= (int) $file_info[1];\n\t\t\t$tmp_array['id_cat']\t\t\t= (int) $file_info[2];\n\t\t\t$tmp_array['id_user']\t\t\t= (int) $file_info[3];\n\t\t\t$tmp_array['mode']\t\t\t\t= (string) $file_info[4];\n\t\t\t$tmp_array['draft']\t\t\t\t= (bool) ($file_info[4]=='draft');\n\t\t\t$tmp_array['visits']\t\t\t= (int) $xml->getChild('visits');\n\n\t\t\t$tmp_array['type']\t\t\t\t= (string) $xml->getChild('type');\n\t\t\t$tmp_array['title']\t\t\t\t= (string) $xml->getChild('title');\n\t\t\t$tmp_array['description']\t\t= (string) $xml->getChild('description');\n\n\t\t\t$tmp_array['pub_date_unix']\t\t= (string) $xml->getChild('pub_date');\n\t\t\t$tmp_array['mod_date_unix']\t\t= (string) $xml->getChild('mod_date');\n\n\t\t\t$tmp_array['allow_comments']\t= (bool) ((int)$xml->getChild('allow_comments'))==1;\n\n\t\t\t// Slug\n\t\t\t$tmp_array['slug'] = $this->slug_get($tmp_array['id']);\n\n\t\t\t// CONTENT\n\t\t\t$tmp_array['content'][0] = $content;\n\n\t\t\t$tmp_array['content'][1] = $tmp_content[0];\n\n\t\t\tif( isset($tmp_content[1]) )\n\t\t\t{\n\t\t\t\t$tmp_array['content'][2] = $tmp_content[1];\n\t\t\t\t$tmp_array['read_more'] = true;\n\t\t\t}\n\n\t\t\t// POST TYPE\n\t\t\tif($tmp_array['type']=='video')\n\t\t\t{\n\t\t\t\t$tmp_array['video']\t\t\t= (string) $xml->getChild('video');\n\t\t\t}\n\t\t\telseif($tmp_array['type']=='quote')\n\t\t\t{\n\t\t\t\t$tmp_array['quote']\t\t\t= (string) $xml->getChild('quote');\n\t\t\t}\n\n\t\t\treturn( $tmp_array );\n\t\t}", "function products($product_ids = array(), $return_all = false, $lang = 'en_us')\n\t{\n\t\t$lang = str_replace('_', '-', $lang);\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\t\t <soap:Header>\n\t\t <ServiceAuthHeader xmlns=\"http://tempuri.org/\">\n\t\t <UserName>' . $this->username . '</UserName>\n\t\t\t <Password>' . $this->password . '</Password>\n\t\t </ServiceAuthHeader>\n\t\t </soap:Header>\n\t\t <soap:Body>\n\t\t <products xmlns=\"http://tempuri.org/\">';\n\t\t if ($return_all) {\n\t\t $content .= '<return_all>true</return_all>\n\t\t \t<product_ids>\n\t\t \t\t<anyType xsi:type=\"xsd:int\">123</anyType>\n\t\t \t</product_ids>';\n\t\t } else {\n\t\t $content .= '<return_all>false</return_all>\n\t\t <product_ids>';\n\t\t \tif (!empty($product_ids)) {\n\t\t \tforeach ($product_ids as $id) $content .= '<anyType xsi:type=\"xsd:int\">'.$id.'</anyType>';\n\t\t \t }\n\t\t\t $content .= '</product_ids>';\n\t\t\t}\n\t\t$content .= '<lang>'.$lang.'</lang></products>\n\t\t </soap:Body>\n\t\t</soap:Envelope>';\n\t\t\n\t\t$headers = array( \n\t\t\t'POST /redactedapiservice.asmx HTTP/1.1',\n\t\t\t'Host: 000.00.000.185',\n\t\t\t'Content-Type: text/xml; charset=utf-8',\n\t\t\t'Content-Length: ' . strlen($content),\n\t\t\t'SOAPAction: \"http://tempuri.org/products\"',\n\t\t);\n\t\t\n\t\treturn $this->_init_curl($content, $this->url, $headers);\n\t\n\t}", "function buildzip() {\n\t\t// make list of files to include\n\t\t$files = array_keys(index());\n\t\tforeach($_POST as $p => $v) if (substr($p, 0, 6) == 'build_') $files[] = substr($p, 6).'.php';\n\n\t\t// get the base script to modify\n\t\t$hypha = file_get_contents('hypha.php');\n\n\t\t// insert superuser name and password\n\t\t$hypha = preg_replace('/\\$username = \\'.*?\\';/', '\\$username = \\''.$_POST['username'].'\\';', $hypha);\n\t\t$hypha = preg_replace('/\\$password = \\'.*?\\';/', '\\$password = \\''.$_POST['password'].'\\';', $hypha);\n\n\t\t// build data library of zipped files to include\n\t\t$data = \"\t\t\t//START_OF_DATA\\n\";\n\t\t$data .= '\t\t\tcase \\'index\\': $zip = \"'.base64_encode(gzencode(implode(',', array_keys(index())), 9)).'\"; break;'.\"\\n\";\n\t\tforeach ($files as $file) $data.= '\t\t\tcase \\''.$file.'\\': $zip = \"'.base64_encode(gzencode(file_get_contents($file), 9)).'\"; break;'.\"\\n\";\n\t\t$data .= \"\t\t\t//END_OF_DATA\\n\";\n\n\t\t// include data library\n\t\t$hypha = preg_replace('#^\\t*//START_OF_DATA\\n.*//END_OF_DATA\\n#ms', $data, $hypha);\n\n\t\t// push script to client\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename=\"hypha.php\"');\n\t\techo $hypha;\n\t\texit;\n\t}", "function create($products = array())\n {\n if (is_array($products) && !empty($products)) {\n $i = 1;\n $e = 1;\n foreach($products as $item) {\n foreach($item as $key => $value) {\n if (is_array($value)) {\n foreach($value as $key2 => $vv) {\n if (in_array($key2, $this->__init['format'])) $this->__items[$i][] = $this->__serialiseItem($key2, $vv, $i);\n }\n ++$i;\n } else {\n if (in_array($key, $this->__init['format'])) $this->__items[$e][] = $this->__serialiseItem($key, $value, $e);\n }\n }\n $e++;\n }\n }\n }", "function Parse($xml)\n\t{\n\t\tforeach($xml->release->dbinfo AS $o) {\n\t\t\t$db = $o->attributes()->dbname.\" v\".$o->attributes()->version.\" (\".$o->attributes()->entry_count.\" entries) [\".$o->attributes()->file_date.\"]\";\n\t\t\t$this->AddRDF($this->QQuadL($this->GetDatasetURI(), \"interpro_vocabulary:contains\", $db));\n\t\t}\n\t\t// now interate over the entries\n\t\tforeach($xml->interpro AS $o) {\n\t\t\t$this->WriteRDFBufferToWriteFile();\n\t\t\t\n\t\t\t$interpro_id = $o->attributes()->id;\n\t\t\techo \"$interpro_id\".PHP_EOL;\n\t\t\t\n\t\t\t$name = $o->name;\n\t\t\t$short_name = $o->attributes()->short_name;\n\t\t\t$type = $o->attributes()->type;\n\t\t\t$s = \"interpro:$interpro_id\";\n\t\t\t\n\t\t\t$this->AddRDF($this->QQuadL($s,\"rdfs:label\",\"$name ($short_name) $type [$s]\"));\n\t\t\t$this->AddRDF($this->QQuad($s,\"rdf:type\",\"interpro_vocabulary:$type\"));\n\t\t\t$this->AddRDF($this->QQuad($s,\"void:inDataset\",$this->GetDatasetURI()));\n\t\t\t\n\t\t\t// get the pubs\n\t\t\tunset($pubs);\n\t\t\tforeach($o->pub_list->publication AS $p) {\n\t\t\t\t$pid = (string) $p->attributes()->id;\n\t\t\t\tif(isset($p->db_xref)) {\n\t\t\t\t\tif($p->db_xref->attributes()->db == \"PUBMED\") {\n\t\t\t\t\t\t$pmid = (string) $p->db_xref->attributes()->dbkey;\n\t\t\t\t\t\t$pubs['pid'][] = '<cite idref=\"'.$pid.'\"/>';\n\t\t\t\t\t\t$pubs['pmid'][] = '<a href=\"http://www.ncbi.nlm.nih.gov/pubmed/'.$pmid.'\">pubmed:'.$pmid.'</a>';\n\t\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-pubmed\",\"pubmed:$pmid\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$abstract = (string) $o->abstract->p->asXML();\n\t\t\tif(isset($pubs)) {\n\t\t\t\t$abstract = str_replace($pubs['pid'],$pubs['pmid'],$abstract);\n\t\t\t}\n\t\t\t\n\t\t\t$this->AddRDF($this->QQuadL($s,\"dc:description\",$this->SafeLiteral($abstract)));\n\t\t\t\n\t\t\tforeach($o->example_list->example AS $example) {\n\t\t\t\t$db = (string) $example->db_xref->attributes()->db;\n\t\t\t\t$id = (string) $example->db_xref->attributes()->dbkey;\n\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:example-entry\", $this->GetNS()->MapQName(\"$db:$id\")));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($o->parent_list->rel_ref)) {\n\t\t\t\tforeach($o->parent_list->rel_ref AS $parent) {\n\t\t\t\t\t$id = (string) $parent->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:parent\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->child->rel_ref)) {\n\t\t\t\tforeach($o->child->rel_ref AS $child) {\n\t\t\t\t\t$id = (string) $child->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:child\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->contains->rel_ref)) {\n\t\t\t\tforeach($o->contains->rel_ref AS $contains) {\n\t\t\t\t\t$id = (string) $contains->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:contains\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->found_in->rel_ref)) {\n\t\t\t\tforeach($o->found_in->rel_ref AS $f) {\n\t\t\t\t\t$id = (string) $f->attributes()->ipr_ref;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:found-in\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->sec_list->sec_ac)) {\n\t\t\t\tforeach($o->sec_ac AS $s) {\n\t\t\t\t\t$id = (string) $s->attributes()->acc;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:secondary-accession\", \"interpro:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// xrefs\n\t\t\tif(isset($o->member_list->dbxref)) {\n\t\t\t\tforeach($o->member_list->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->external_doc_list)) {\n\t\t\t\tforeach($o->external_doc_list->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($o->structure_db_links->db_xref)) {\n\t\t\t\tforeach($o->structure_db_links->db_xref AS $dbxref) {\n\t\t\t\t\t$db = (string) $dbxref->attributes()->db;\n\t\t\t\t\t$id = (string) $dbxref->attributes()->dbkey;\n\t\t\t\t\t$this->AddRDF($this->QQuad($s,\"interpro_vocabulary:x-\".strtolower($db), \"$db:$id\"));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// taxon distribution\n\t\t\tforeach($o->taxonomy_distribution->taxon_data AS $t) {\n\t\t\t\t$organism = (string) $t->attributes()->name;\n\t\t\t\t$number = (string) $t->attributes()->proteins_count;\n\t\t\t\t$this->AddRDF($this->QQuadL($s,\"interpro_vocabulary:taxon-distribution\", \"$organism ($number)\"));\n\t\t\t}\n\t\t}\n\t}", "public static function makeFakeProduct($attributes = []) {\n list($product) = self::makeFromFile(storage_path('/testing/VALID_TESTFILE.XML'));\n foreach ($attributes as $attribute => $value) {\n $product->$attribute = $value;\n }\n return $product;\n }" ]
[ "0.6253491", "0.5181114", "0.5112983", "0.5110384", "0.50576365", "0.503746", "0.49284264", "0.48707747", "0.48707747", "0.4832499", "0.4815969", "0.4815969", "0.4783766", "0.47737586", "0.4726791", "0.4719312", "0.467551", "0.46643233", "0.46590096", "0.4658956", "0.46509764", "0.4647398", "0.4642674", "0.46100882", "0.46100882", "0.46100882", "0.46100882", "0.46100882", "0.46100882", "0.46100882", "0.46058735", "0.45953017", "0.45767334", "0.45671493", "0.45579514", "0.45506787", "0.4544001", "0.4532336", "0.4531976", "0.45307368", "0.4513011", "0.45082912", "0.45013925", "0.45012915", "0.45012915", "0.4498155", "0.44861287", "0.4486128", "0.4470017", "0.44538984", "0.44481876", "0.4447093", "0.44191182", "0.44190347", "0.44182527", "0.43980023", "0.4392348", "0.43807828", "0.43759412", "0.4375677", "0.43696204", "0.43598405", "0.43486333", "0.43435657", "0.43375042", "0.43310508", "0.4322733", "0.43128136", "0.43125623", "0.43105108", "0.43072635", "0.43068188", "0.43041164", "0.4303605", "0.42992824", "0.4294805", "0.42908165", "0.42861935", "0.42857897", "0.4279911", "0.42778313", "0.42754346", "0.42751732", "0.42727026", "0.4269154", "0.4254264", "0.42440876", "0.42424834", "0.42383376", "0.4232929", "0.4230022", "0.42266083", "0.42265922", "0.42248437", "0.42130563", "0.42093822", "0.42092106", "0.42065567", "0.42030737", "0.4198598" ]
0.6799675
0
Returns the catalogue update date.
private static function getDateOfCatalogUpdate($file) { $file = fopen($file, "r"); if ($file) { while (($line = fgets($file)) !== false) { $match = Null; preg_match('/\<m182\>([0-9]{8})\<\/m182\>/',$line,$match); if(isset($match[1])) return $match[1]; } } else { throw new Exception("Unable to open the file $file."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdate_date(){\n return $this->update_date;\n }", "function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->dateUpdate;\n }", "public function getLatestUpdateDate()\n {\n return $this->channel->getLatestUpdateDate();\n }", "public function getUpdatedDate()\n {\n return $this->updated;\n }", "public function getUpdatedDate()\n {\n return $this->updated_date;\n }", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getAppReleaseDate() : string {\n return $this->configVars['version-info']['release-date'];\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated() {\n return $this->dateUpdated;\n }", "public function getAuthorUpdatedDate();", "public function getRelease_date()\n {\n return $this->release_date;\n }", "public function getRelease_date()\n {\n return $this->release_date;\n }", "public function getReleaseDate()\n {\n return $this->releaseDate;\n }", "public function getReleaseDate()\n {\n return $this->release_date;\n }", "public function getDateUpdated()\n {\n $rtn = $this->data['date_updated'];\n\n if (!empty($rtn)) {\n $rtn = new \\DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getChangeDate()\n {\n return $this->changeDate;\n }", "function getLatestDate() {\n\t\t$date = $this->LatestDatePacked;\n\t\tif(!$date && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$date = $this->LatestDatePacked;\n\t\t}\n\t\treturn $date;\n\t}", "public function getLastUpdateDatetime()\n {\n return $this->getValue('nb_icontact_prospect_last_update_datetime');\n }", "public function getUpdDate()\n {\n return $this->upd_date;\n }", "public function getRevisionDate()\n {\n return $this->revisionDate;\n }", "public function updated_at()\n {\n return ExpressiveDate::make($this->updated_at)->getRelativeDate();\n }", "public function getEntryDate()\n {\n return $this->entry_date;\n }", "public function getPurchaseDateModified() {\n return $this->PurchaseDateModified;\n }", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function getArchiveDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->archiveDate;\r\n\t}", "public function getLastUpdated()\n {\n $packages = Package::get()->limit(1);\n if (!$packages->count()) {\n return '';\n }\n /** @var DBDatetime $datetime */\n $datetime = $packages->first()->dbObject('LastEdited');\n return $datetime->Date() . ' ' . $datetime->Time12();\n }", "public function getRevdate()\n {\n return $this->revdate;\n }", "public function getCompdate()\n {\n return $this->compdate;\n }", "public function getVersionUpdateTime()\n {\n return $this->version_update_time;\n }", "public function getUserUpdatedDate(): ?string\n {\n return $this->get($this->UPDATECOLUMN);\n }", "public function updated_at()\n {\n return $this->date($this->updated_at);\n }", "public function getModeratorUpdatedDate();", "public function getUpdated()\n {\n if (is_string($this->updated))\n $this->updated = new UDate($this->updated);\n return $this->updated;\n }", "public function updatedAt(){\n return $this->_formatDate($this->updated_at);\n }", "function get_date() {\n\t\treturn $this->get_data( 'comment_date' );\n\t}", "function getLastBuildDate() {\n\t\treturn $this->getElementText(DOMIT_RSS_ELEMENT_LASTBUILDDATE);\n\t}", "public function getReturnDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->returnDate;\r\n\t}", "public function getUpdatedDateAttribute() {\n\n\t\tif (request()->segment(1) == 'api') {\n\t\t\t$date = change_date_format($this->attributes['updated_at']);\n\t\t\t$datemonth = date($date, strtotime($this->attributes['updated_at']));\n\t\t\treturn $datemonth;\n\t\t} else {\n\n\t\t\t$new_str = new DateTime($this->attributes['updated_at'], new DateTimeZone(Config::get('app.timezone')));\n\t\t\t$user = auth()->guard('store')->user();\n\t\t\t$new_str->setTimeZone(new DateTimeZone($user->user_address->default_timezone));\n\n\t\t\t$date = change_date_format($this->attributes['updated_at']);\n\t\t\t$datemonth = date($date, strtotime($this->attributes['updated_at']));\n\t\t\treturn $datemonth;\n\n\t\t}\n\n\t}", "public function getDateLastUpdated()\n {\n if (isset($this->data['LastUpdatedDate'])) {\n return $this->data['LastUpdatedDate'];\n } else {\n return false;\n }\n }", "public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }", "public function getLastUpdateDatetime()\n {\n return $this->getValue('nb_domain_zone_last_update_datetime');\n }", "function date($index)\n\t{\n\t\treturn $this->getItemTagValue($this->_isAtom ? \"updated\" : \"pubDate\" , $index);\n\t}", "public function getUpdatedAt()\n {\n return $this->sys->getUpdatedAt();\n }", "public function getViewDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->viewDate;\r\n\t}", "public function getCloseDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->closeDate;\r\n\t}", "public function getDate()\n {\n return $this->getNodeText('/p:package/p:date');\n }", "function authCAS_getMyCurrentDate()\n{\n\treturn G::CurDate('Y-m-d');\n}", "public function getReleaseDate()\n {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_RELEASE_DATE, 1)) {\n return trim($strReturn);\n }\n }\n return $this->strNotFound;\n }", "function wpmu_update_blogs_date()\n {\n }", "public function getDateUpdated() : DateTime\n {\n $rtn = $this->data['date_updated'];\n\n if (!empty($rtn)) {\n $rtn = new DateTime($rtn);\n }\n\n return $rtn;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function current_date_db(){\n\t\t$date = date('Y-m-d');\n\t\treturn $date;\n\t}", "public function getDate(){\n\t\treturn $this->laDate;\n\t}", "function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }", "public function getDate() { return $this->date; }", "public function updated_at_formatted()\n {\n return ucfirst(app(DateFactory::class)->make($this->wrappedObject->updated_at)->format(Config::get('setting.incident_date_format', 'l jS F Y H:i:s')));\n }", "function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "public function getDate()\n\t{\n\t\treturn $this->date;\n\t}", "function getDate() {\n return $this->date;\n }", "public function getDate()\r\n {\r\n return $this->date;\r\n }", "public function getDate() {\n\t\treturn $this->_date;\n\t}", "public function get_date_modified();", "public function getDeliveryDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->deliveryDate;\r\n\t}", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }", "public function getDate()\n {\n return $this->date;\n }" ]
[ "0.74124306", "0.74124306", "0.74124306", "0.74124306", "0.7404963", "0.72613376", "0.7217745", "0.7217745", "0.7152229", "0.6920275", "0.68992794", "0.6789645", "0.674563", "0.674563", "0.66533566", "0.6562129", "0.6562129", "0.65447944", "0.65199184", "0.6445013", "0.6445013", "0.63608724", "0.6355671", "0.6316698", "0.6296275", "0.62825215", "0.62138754", "0.61918175", "0.6181436", "0.6155728", "0.61402905", "0.6120836", "0.6109493", "0.6109493", "0.6109493", "0.61070716", "0.6096528", "0.60875714", "0.60424316", "0.60405797", "0.60337836", "0.6015465", "0.60046405", "0.59363997", "0.5932211", "0.59304935", "0.5906366", "0.587281", "0.5868706", "0.5863423", "0.58510023", "0.5847193", "0.5834215", "0.58341795", "0.5827979", "0.582317", "0.5786355", "0.5783666", "0.5772966", "0.5760089", "0.5749358", "0.57310617", "0.57232374", "0.57211846", "0.5719558", "0.57191277", "0.57134855", "0.57090324", "0.570809", "0.570809", "0.570809", "0.57051545", "0.5690153", "0.5686759", "0.56861055", "0.56763905", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983", "0.5662983" ]
0.5893999
47
Generate a fake Product for testing purposes.
public static function makeFakeProduct($attributes = []) { list($product) = self::makeFromFile(storage_path('/testing/VALID_TESTFILE.XML')); foreach ($attributes as $attribute => $value) { $product->$attribute = $value; } return $product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mockCreateInitialProducts() {\n $listaProdutos = &obterListaProdutos();\n\n $produto = createProduct(\"Caneca de Vidro\", \"Caneca\", \"Suporta 350 ml\", 100, 50.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n\n $produto = createProduct(\"Caneca de Plastico\", \"Caneca\", \"Suporta 500 ml\", 200, 20.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n}", "public function fakeProduct($productFields = [])\n {\n return new Product($this->fakeProductData($productFields));\n }", "abstract public function factoryMethod(): Product;", "public function testCreateProductStore()\n {\n\n }", "public function testAdminNewProduct(): void\n {\n $name = 'Product Title '.mt_rand();\n $summary = $this->generateRandomString(255);\n $content = $this->generateRandomString(1024);\n $price = 600900;\n //$imageUrl = \"https://telecomtalk.info/wp-content/uploads/2020/05/bsnl-rs2-prepaid-plan-extension-you-should-know.jpg\";\n \n $client = static::createClient([], [\n 'PHP_AUTH_USER' => 'vandana_admin',\n 'PHP_AUTH_PW' => 'vandana@admin',\n ]);\n\n $crawler = $client->request('POST', '/en/admin/product/new');\n $form = $crawler->selectButton('Create product')->form([\n 'product[name]' => $name,\n 'product[summary]' => $summary,\n 'product[content]' => $content,\n 'product[price]' => $price,\n //'product[imageUrl]' => $imageUrl,\n ]);\n $client->submit($form);\n\n /** @var \\App\\Entity\\Product $product */\n $product = self::$container->get(ProductRepository::class)->findOneBy(array('name' => $name));\n $this->assertNotNull($product);\n $this->assertSame($name, $product->getName());\n $this->assertSame($content, $product->getContent());\n }", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "public function factoryMethod(): Product\n {\n return new ConcreteProduct1;\n }", "public function getProduct(){\r\n return rand(0,1);\r\n }", "public function testProductCreation()\n {\n $response = $this->json('POST', '/api/v1/products', ['name' => 'Sally','sku'=>'Test']);\n\n $response->assertStatus(201)->assertJson(['code' => 201]);\n }", "public function fakeProductData($productFields = [])\n {\n $fake = Faker::create();\n return $productFields;\n }", "public function can_create_a_product()\n {\n //Given\n $faker = Factory::create();\n\n //When\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('POST', '/api/products', [\n 'name' => $name = $faker->company,\n 'slug' => str_slug($name),\n 'price' => $price = random_int(10, 100)\n ]);\n // post request create product\n\n //Then\n // product exists\n $response->assertJsonStructure([\n 'id','name','slug','price','created_at'\n ])\n ->assertJson([\n 'name' => $name,\n 'slug' => str_slug($name),\n 'price' => $price\n ])\n ->assertStatus(201);\n\n $this->assertDatabaseHas('products', [\n 'name' => $name,\n 'slug' => str_slug($name),\n 'price' => $price\n ]);\n }", "public function sample()\n {\n $this->authorize('indexPublic', Product::class);\n\n $organizationIds = FundProvider::query()->whereIn(\n 'fund_id', Implementation::activeFunds()->pluck('id')\n )->where('state', 'approved')->pluck('organization_id');\n\n $products = Product::query()->select([\n 'id', 'organization_id'\n ])->whereIn(\n 'organization_id', $organizationIds\n )->where('sold_out', false)->where(\n 'expire_at', '>', date('Y-m-d')\n )->has('medias')->get();\n\n $groupedProducts = $products->groupBy('organization_id');\n\n $resultProducts = collect($groupedProducts->random(\n min(6, $groupedProducts->count())\n )->map(function($products) {\n return collect($products)->random();\n }));\n\n if ($resultProducts->count() < 6) {\n $remainingProducts = $groupedProducts->flatten()->diff($resultProducts);\n $resultProducts = $resultProducts->merge(\n $remainingProducts->random(min(6 - $resultProducts->count(), $remainingProducts->count()))\n );\n }\n\n return ProductResource::collection(Product::query()->whereIn(\n 'id', $resultProducts->pluck('id')\n )->get()->load(ProductResource::$load));\n }", "public function makeProduct($productFields = [])\n {\n $theme = $this->fakeProductData($productFields);\n return $theme;\n }", "public function testCatalogGetRandomProducts()\n {\n\n }", "protected function getNewProduct(): ProductInterface\n {\n $product = $this->productFactory->create();\n $product->setAttributeSetId($this->defaultSetId);\n\n return $product;\n }", "public function test_show_single_product()\n {\n Product::factory()->create();\n $response = $this->getJson('/api/products/1');\n\n $response\n ->assertStatus(200);\n }", "public function testCatalogGetProduct()\n {\n\n }", "public function testGetProduct()\n\t{\n $catalog2 = new Catalog(); \n $prod = $catalog2->getProductByID(1);\n\n\t\t$this->assertEquals(\"Cat!\", $prod->getName());\n }", "public function createAddonProduct()\n {\n ++$this->productCount;\n\n // Create basic product.\n $product = $this->productFactory->createEntity();\n $this->entityManager->persist($product);\n $product->setNumber('AddonProductNumber-' . $this->productCount);\n $product->setManufacturer('EnglishManufacturer-' . $this->productCount);\n $product->setType($this->addonProductType);\n $product->setStatus($this->productStatus);\n $product->setCreated(new DateTime());\n $product->setChanged(new DateTime());\n $product->setSupplier($this->contactTestData->accountSupplier);\n $product->setOrderUnit($this->orderUnit);\n $product->setContentUnit($this->contentUnit);\n $product->setOrderContentRatio(2.0);\n $product->setTaxClass($this->taxClass);\n\n // Add prices\n $this->addPrice($product, 5.99);\n $this->addPrice($product, 3.85, 4.0);\n\n // Product translation\n $this->addProductTranslation($product);\n\n return $product;\n }", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "public function generateProductSKU()\n {\n return $this->skuString . int_random();\n }", "public function test_registerProduct()\n {\n $ODOO_ID = 21;\n $MAGE_ID = 43;\n /** === Setup Mocks === */\n // $this->_registerMageIdForOdooId(EntityProduct::ENTITY_NAME, $mageId, $odooId);\n // $this->_repoBasic->addEntity($entityName, $bind);\n $this->mRepoGeneric\n ->shouldReceive('addEntity')->once();\n /** === Call and asserts === */\n $res = $this->obj->registerProduct($MAGE_ID, $ODOO_ID);\n }", "public function testAllProducts()\n {\n factory(Product::class)->create([\n 'lm' => '123456',\n 'name' => 'First Product'\n ]);\n\n factory(Product::class)->create([\n 'lm' => '234567',\n 'name' => 'Second Product'\n ]);\n\n $auth_token = \"p2lbgWkFrykA4QyUmpHihzmc5BNzIABq\";\n $headers = ['Authorization' => \"$auth_token\"];\n\n $response = $this->json('GET', '/api/products', [], $headers)\n ->assertStatus(200)\n ->assertJsonStructure([\n '*' => ['id', 'lm', 'name', 'free_shipping', 'description', 'price', 'category', 'created_at', 'updated_at'],\n ]);\n\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function create(Product $product)\n {\n \n }", "function makeProduct($productcode) {\n\t$product = new Product();\n \t$product->category = substr($productcode, 0, 1);\n \t$i = strpos($productcode, '-', 1) + 1;\n \t$product->style = substr($productcode, 1, $i - 2);\n \t$j = strpos($productcode, '-', $i) + 1;\n \t$product->type = substr($productcode, $i, $j - 1 - $i);\n \t$product->material = substr($productcode, $j);\n\treturn $product;\n}", "public function testAddProduct()\n {\n $product = new Product('Really good stuff', 'Awesome description', 99.99, 'PLN');\n\n $em = $this->getMockedEntityManager();\n $em\n ->shouldReceive('persist')\n ->once()\n ->withArgs([$product]);\n $em\n ->shouldReceive('flush')\n ->once()\n ->withNoArgs();\n\n $service = new DoctrineProducts($em);\n $service->addProduct($product);\n }", "public function getProduct();", "public function testGetProducts()\n {\n $stub = $this->getMockBuilder('AppBundle\\Parser\\PageFetcher')->getMock();\n $stub->method('fetchHtml')->willReturn($this->sampleHtml);\n\n $productParser = new ProductParser();\n\n $productsResponse = $productParser->getProducts($this->url);\n\n $this->assertInstanceOf('\\AppBundle\\ValueObj\\ProductsResponse', $productsResponse);\n }", "private function createProduct(): Product\n {\n //retrieve product by model's attributes or create anew\n $product = $this->productRepository->getProductByModelData($this->productData);\n\n // create product\n if (!$product) {\n $product = $this->productRepository->createProduct($this->productData);\n }\n\n // insert product 'new' badge\n $this->productBadges->insertProductBadge($product, ProductBadgesInterface::NEW);\n\n // insert product attributes\n $this->attachProductAttributes($product);\n\n // insert product images\n $this->insertProductImages($product);\n\n // insert product comments\n $this->insertProductComments($product);\n\n return $product;\n }", "public function testPostProduct()\n {\n $producto = factory(Product::class)->make();\n\n $response = $this->json('POST','/api/product',[\n 'name' => $producto->name,\n 'descripcion' => $producto->descripcion\n ]);\n\n $response->assertJsonStructure(['id','name','descripcion'])->assertStatus(201);\n\n $this->assertDatabaseHas('products',[\n 'name' => $producto->name,\n 'descripcion' => $producto->descripcion\n ]);\n\n }", "public function products()\n {\n // api call to shopify\n// try {\n// $request = $this->client->get($this->url);\n// $response = $request->getBody();\n\n $response = array(\n 0 =>\n array(\n 'id' => 799,\n 'name' => 'Ship Your Idea',\n 'slug' => 'ship-your-idea-22',\n 'permalink' => 'https://example.com/product/ship-your-idea-22/',\n 'date_created' => '2017-03-23T17:03:12',\n 'date_created_gmt' => '2017-03-23T20:03:12',\n 'date_modified' => '2017-03-23T17:03:12',\n 'date_modified_gmt' => '2017-03-23T20:03:12',\n 'type' => 'variable',\n 'status' => 'publish',\n 'featured' => false,\n 'catalog_visibility' => 'visible',\n 'description' => '<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n',\n 'short_description' => '<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n',\n 'sku' => '',\n 'price' => '',\n 'regular_price' => '',\n 'sale_price' => '',\n 'date_on_sale_from' => NULL,\n 'date_on_sale_from_gmt' => NULL,\n 'date_on_sale_to' => NULL,\n 'date_on_sale_to_gmt' => NULL,\n 'price_html' => '',\n 'on_sale' => false,\n 'purchasable' => false,\n 'total_sales' => 0,\n 'virtual' => false,\n 'downloadable' => false,\n 'downloads' =>\n array(),\n 'download_limit' => -1,\n 'download_expiry' => -1,\n 'external_url' => '',\n 'button_text' => '',\n 'tax_status' => 'taxable',\n 'tax_class' => '',\n 'manage_stock' => false,\n 'stock_quantity' => NULL,\n 'stock_status' => 'instock',\n 'backorders' => 'no',\n 'backorders_allowed' => false,\n 'backordered' => false,\n 'sold_individually' => false,\n 'weight' => '',\n 'dimensions' =>\n array(\n 'length' => '',\n 'width' => '',\n 'height' => '',\n ),\n 'shipping_required' => true,\n 'shipping_taxable' => true,\n 'shipping_class' => '',\n 'shipping_class_id' => 0,\n 'reviews_allowed' => true,\n 'average_rating' => '0.00',\n 'rating_count' => 0,\n 'related_ids' =>\n array(\n 0 => 31,\n 1 => 22,\n 2 => 369,\n 3 => 414,\n 4 => 56,\n ),\n 'upsell_ids' =>\n array(),\n 'cross_sell_ids' =>\n array(),\n 'parent_id' => 0,\n 'purchase_note' => '',\n 'categories' =>\n array(\n 0 =>\n array(\n 'id' => 9,\n 'name' => 'Clothing',\n 'slug' => 'clothing',\n ),\n 1 =>\n array(\n 'id' => 14,\n 'name' => 'T-shirts',\n 'slug' => 't-shirts',\n ),\n ),\n 'tags' =>\n array(),\n 'images' =>\n array(\n 0 =>\n array(\n 'id' => 795,\n 'date_created' => '2017-03-23T14:03:08',\n 'date_created_gmt' => '2017-03-23T20:03:08',\n 'date_modified' => '2017-03-23T14:03:08',\n 'date_modified_gmt' => '2017-03-23T20:03:08',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_4_front-11.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n 1 =>\n array(\n 'id' => 796,\n 'date_created' => '2017-03-23T14:03:09',\n 'date_created_gmt' => '2017-03-23T20:03:09',\n 'date_modified' => '2017-03-23T14:03:09',\n 'date_modified_gmt' => '2017-03-23T20:03:09',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_4_back-10.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n 2 =>\n array(\n 'id' => 797,\n 'date_created' => '2017-03-23T14:03:10',\n 'date_created_gmt' => '2017-03-23T20:03:10',\n 'date_modified' => '2017-03-23T14:03:10',\n 'date_modified_gmt' => '2017-03-23T20:03:10',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_3_front-10.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n 3 =>\n array(\n 'id' => 798,\n 'date_created' => '2017-03-23T14:03:11',\n 'date_created_gmt' => '2017-03-23T20:03:11',\n 'date_modified' => '2017-03-23T14:03:11',\n 'date_modified_gmt' => '2017-03-23T20:03:11',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_3_back-10.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n ),\n 'attributes' =>\n array(\n 0 =>\n array(\n 'id' => 6,\n 'name' => 'Color',\n 'position' => 0,\n 'visible' => false,\n 'variation' => true,\n 'options' =>\n array(\n 0 => 'Black',\n 1 => 'Green',\n ),\n ),\n 1 =>\n array(\n 'id' => 0,\n 'name' => 'Size',\n 'position' => 0,\n 'visible' => true,\n 'variation' => true,\n 'options' =>\n array(\n 0 => 'S',\n 1 => 'M',\n ),\n ),\n ),\n 'default_attributes' =>\n array(),\n 'variations' =>\n array(),\n 'grouped_products' =>\n array(),\n 'menu_order' => 0,\n 'meta_data' =>\n array(),\n '_links' =>\n array(\n 'self' =>\n array(\n 0 =>\n array(\n 'href' => 'https://example.com/wp-json/wc/v3/products/799',\n ),\n ),\n 'collection' =>\n array(\n 0 =>\n array(\n 'href' => 'https://example.com/wp-json/wc/v3/products',\n ),\n ),\n ),\n ),\n 1 =>\n array(\n 'id' => 794,\n 'name' => 'Premium Quality',\n 'slug' => 'premium-quality-19',\n 'permalink' => 'https://example.com/product/premium-quality-19/',\n 'date_created' => '2017-03-23T17:01:14',\n 'date_created_gmt' => '2017-03-23T20:01:14',\n 'date_modified' => '2017-03-23T17:01:14',\n 'date_modified_gmt' => '2017-03-23T20:01:14',\n 'type' => 'simple',\n 'status' => 'publish',\n 'featured' => false,\n 'catalog_visibility' => 'visible',\n 'description' => '<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n',\n 'short_description' => '<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n',\n 'sku' => '',\n 'price' => '21.99',\n 'regular_price' => '21.99',\n 'sale_price' => '',\n 'date_on_sale_from' => NULL,\n 'date_on_sale_from_gmt' => NULL,\n 'date_on_sale_to' => NULL,\n 'date_on_sale_to_gmt' => NULL,\n 'price_html' => '<span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">&#36;</span>21.99</span>',\n 'on_sale' => false,\n 'purchasable' => true,\n 'total_sales' => 0,\n 'virtual' => false,\n 'downloadable' => false,\n 'downloads' =>\n array(),\n 'download_limit' => -1,\n 'download_expiry' => -1,\n 'external_url' => '',\n 'button_text' => '',\n 'tax_status' => 'taxable',\n 'tax_class' => '',\n 'manage_stock' => false,\n 'stock_quantity' => NULL,\n 'stock_status' => 'instock',\n 'backorders' => 'no',\n 'backorders_allowed' => false,\n 'backordered' => false,\n 'sold_individually' => false,\n 'weight' => '',\n 'dimensions' =>\n array(\n 'length' => '',\n 'width' => '',\n 'height' => '',\n ),\n 'shipping_required' => true,\n 'shipping_taxable' => true,\n 'shipping_class' => '',\n 'shipping_class_id' => 0,\n 'reviews_allowed' => true,\n 'average_rating' => '0.00',\n 'rating_count' => 0,\n 'related_ids' =>\n array(\n 0 => 463,\n 1 => 47,\n 2 => 31,\n 3 => 387,\n 4 => 458,\n ),\n 'upsell_ids' =>\n array(),\n 'cross_sell_ids' =>\n array(),\n 'parent_id' => 0,\n 'purchase_note' => '',\n 'categories' =>\n array(\n 0 =>\n array(\n 'id' => 9,\n 'name' => 'Clothing',\n 'slug' => 'clothing',\n ),\n 1 =>\n array(\n 'id' => 14,\n 'name' => 'T-shirts',\n 'slug' => 't-shirts',\n ),\n ),\n 'tags' =>\n array(),\n 'images' =>\n array(\n 0 =>\n array(\n 'id' => 792,\n 'date_created' => '2017-03-23T14:01:13',\n 'date_created_gmt' => '2017-03-23T20:01:13',\n 'date_modified' => '2017-03-23T14:01:13',\n 'date_modified_gmt' => '2017-03-23T20:01:13',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_2_front-4.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n 1 =>\n array(\n 'id' => 793,\n 'date_created' => '2017-03-23T14:01:14',\n 'date_created_gmt' => '2017-03-23T20:01:14',\n 'date_modified' => '2017-03-23T14:01:14',\n 'date_modified_gmt' => '2017-03-23T20:01:14',\n 'src' => 'https://example.com/wp-content/uploads/2017/03/T_2_back-2.jpg',\n 'name' => '',\n 'alt' => '',\n ),\n ),\n 'attributes' =>\n array(),\n 'default_attributes' =>\n array(\n 0 =>\n array(\n 'id' => 6,\n 'name' => 'Color',\n 'option' => 'black',\n ),\n 1 =>\n array(\n 'id' => 0,\n 'name' => 'Size',\n 'option' => 'S',\n ),\n ),\n 'variations' =>\n array(),\n 'grouped_products' =>\n array(),\n 'menu_order' => 0,\n 'meta_data' =>\n array(),\n '_links' =>\n array(\n 'self' =>\n array(\n 0 =>\n array(\n 'href' => 'https://example.com/wp-json/wc/v3/products/794',\n ),\n ),\n 'collection' =>\n array(\n 0 =>\n array(\n 'href' => 'https://example.com/wp-json/wc/v3/products',\n ),\n ),\n ),\n ),\n );\n\n $products = $this->transformData($response);\n\n return response()->json($products);\n// }catch (\\Exception $exception){\n// Log::error($exception->getMessage(), ['_trace' => $exception->getTraceAsString()]);\n//\n// throw new \\Exception('Whoops! something went wrong with WooCommerce product listings.', 500);\n// }\n }", "public function can_return_a_product()\n {\n //Model name\n $product = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('GET', \"api/products/$product->id\");\n\n $response->assertStatus(200)\n ->assertExactJson([\n 'id' => $product->id,\n 'name' => $product->name,\n 'slug' => $product->slug,\n 'price' => $product->price,\n 'created_at' => (string)$product->created_at,\n ]);\n }", "private function createWarrantyProduct()\n {\n /**\n * @var $product Mage_Catalog_Model_Product\n */\n foreach ($this->warrantyProductSkus as $warrantyProductSku => $productName) {\n if (!$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $warrantyProductSku)) {\n $product = Mage::getModel('catalog/product');\n\n $product->setTypeId(Mulberry_Warranty_Model_Product_Type_Warranty::TYPE_ID)\n ->setSku($warrantyProductSku)\n ->setName($productName)\n ->setDescription(sprintf('%s, Product Placeholder', $productName))\n ->setShortDescription(sprintf('%s, Product Placeholder', $productName))\n ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)\n ->setAttributeSetId(4)\n ->setTaxClassId(0)\n ->setPrice(10.00)\n ->setStockData(array(\n 'use_config_manage_stock' => 0,\n 'manage_stock' => 0,\n 'is_in_stock' => 1,\n 'qty' => 10,\n ));\n\n $product->save();\n }\n }\n }", "public function getProduct() {\n return Mage::registry('product');\n }", "private function set_generator() {\n\t\tif ( ! isset( $this->generator ) ) {\n\t\t\t$this->generator = new ProductGenerator();\n\t\t\t$this->generator->setPlatform( $this->platform->get_name(), $this->platform->get_version() );\n\t\t\t$this->generator->setUri( $this->uri );\n\t\t}\n\t}", "function getProductObjectFromId( $id, $productname ) {\r\n\treturn new Product ($id, $productname );\r\n}", "public function test_product_from_plugin() {\n\n\t\t$file = dirname( __FILE__ ) . '/sample_products/sample_plugin/plugin_file.php';\n\n\t\t$product = new \\ThemeisleSDK\\Product( $file );\n\n\t\t$this->assertEquals( $product->get_type(), 'plugin' );\n\t\t$this->assertEquals( $product->get_slug(), 'sample_plugin' );\n\t\t$this->assertEquals( $product->get_store_name(), 'ThemeIsle' );\n\t\t$this->assertEquals( $product->get_version(), '1.1.1' );\n\t\t$this->assertGreaterThanOrEqual( $product->get_install_time(), time() );\n\t\t$this->assertEquals( $product->get_store_url(), 'https://store.themeisle.com/' );\n\t\t$this->assertFalse( $product->requires_license() );\n\t\t$this->assertFalse( $product->is_wordpress_available() );\n\t}", "public function testProductWithoutVariationsDoesNotCrash() {\n $this->enableLayoutsForBundle('default', TRUE);\n $this->configureDefaultLayout('default');\n\n $product = $this->createEntity('commerce_product', [\n 'type' => 'default',\n 'title' => $this->randomMachineName(),\n 'stores' => $this->stores,\n 'body' => ['value' => 'Testing product does not crash!'],\n ]);\n $this->drupalGet($product->toUrl());\n $this->assertSession()->pageTextContains('Testing product does not crash!');\n }", "private function newProduct($ean, $name)\n {\n $product = new Product();\n $product->ean = $ean;\n $product->name = $name;\n \n return $product;\n }", "function createProduct($nome, $categoria, $descricao, $quantidade, $preco, $foto) {\n return [\n 'id' => hash('sha256', uniqid(\"\")), // gera um idenficador unico para o registro\n 'nome' => $nome,\n 'categoria' => $categoria, \n 'descricao' => $descricao,\n 'quantidade' => $quantidade,\n 'preco' => $preco, \n 'foto' => $foto\n ];\n}", "public function createProduct($item)\n\t{\n\t\t\t\n\t\t\t\n\t\t\t$productSku = $item->LITM;\n\t\t\t$productLoad = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);\n\t\t\t \n\t\t\t if(!$productLoad){\n\t\t\t\t$product = Mage::getModel('catalog/product');\n \n\t\t\t } else {\n\t\t\t\t $product = Mage::getModel('catalog/product')->load($productLoad->getId());\n\t\t\t }\n\t\t\t \n\t\t\t $product->setStoreId(1) //you can set data in store scope\n\t\t\t\t\t\t->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array\n\t\t\t\t\t\t->setAttributeSetId(4) //ID of a attribute set named 'default'\n\t\t\t\t\t\t->setTypeId('simple') //product type\n\t\t\t\t\t\t->setCreatedAt(strtotime('now')) //product creation time\n\t\t\t\t\t\t->setStatus(1) //product status (1 - enabled, 2 - disabled)\n\t\t\t\t\t\t->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n\t\t\t\t\t\t->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH); //catalog and search visibility\n\t\t\t\n\t\t\t $product->setGtin($item->part_number->EITM);\n\t\t\t $product->setMpn($item->part_number->MITM);\n\t\t\t $product->setName($item->part_description->WTXT);\n\t\t\t $product->setShortDescription($item->part_description->DES2);\n\t\t\t $product->setDescription($item->part_description->WTX2);\n\t\t\t $product->setWeight($item->additional_information->GWGH);\n\t\t\t \n\t\t\t\n\t\t\t $product->setManufacturer($this->retrieveOptionId('manufacturer',$item->additional_information->MAFT)); //option needs to be selected\n\t\t\t\n\t\t\t\n\t\t\t $product->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'\t\t\t => 1, //manage stock\n 'min_sale_qty'\t\t\t => 1, //Minimum Qty Allowed in Shopping Cart\n 'use_config_max_sale_qty' => 1, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' \t\t\t => 1, //Stock Availability\n 'qty' \t\t\t\t\t => $item->additional_information->STQU //qty\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$product->setSku($item->LITM);\n\t\t\t$product->setDistributor($this->retrieveOptionId(\"distributor\",\"Alltron\"));\n\t\t\t$product->setEstimatedShippingTime(\"1-2 Werktage\");\n\t\t\t$product->setQty($item->STQU);\n\t\t\t\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT1);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT2);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT3);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CATA);\t\t\t\n\t\t\t$product->setCategoryIds($categories);\n\n\t\t\t$product->save();\n\t}", "public function testGenerateSlugIfItWillCreateUniqueSlug()\n {\n factory(Product::class)->create()->each(function ($product) {\n $expectedSlug = $product->slug . '-2';\n $returnedSlug = Product::generateSlug($product->title);\n\n $this->assertEquals($expectedSlug, $returnedSlug);\n });\n }", "function product( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = new eZProduct( $this->ProductID );\n \n return $ret;\n }", "public function testProduct()\n {\n $this->post('/api/v1/login',['email' => '[email protected]','password' => 12345])\n ->get('api/v1/producto')\n ->seeJson([]);\n }", "public function createProduct($data);", "public function model()\n {\n return new Product();\n }", "private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }", "public function testSetUserProducts()\n {\n $headers = $this->authenticate();\n $payload = [\n 'user_id' => 1,\n 'product_sku' => 'battery-4'\n ];\n $response = $this->json('POST', '/api/user/products', $payload, $headers);\n $response->assertStatus(200);\n }", "public function testProductGet()\r\n {\r\n\t\t$this->json('get', '/api/products/1')->assertStatus(200);\r\n\t}", "public function __construct(Product $product = null)\n {\n $this->locale = Locale::workingLocale();\n $this->productEntity = $product;\n $this->specification_values = new ArrayCollection();\n $this->remove_specification_values = new ArrayCollection();\n $this->specials = new ArrayCollection();\n $this->remove_specials = new ArrayCollection();\n $this->dimensions = new ArrayCollection();\n $this->remove_dimensions = new ArrayCollection();\n $this->dimension_notifications = new ArrayCollection();\n $this->remove_dimension_notifications = new ArrayCollection();\n $this->related_products = new ArrayCollection();\n $this->up_sell_products = new ArrayCollection();\n $this->remove_up_sell_products = new ArrayCollection();\n $this->remove_related_products = new ArrayCollection();\n $this->images = MediaGroup::create(MediaGroupType::fromString(Type::IMAGE));\n $this->downloads = MediaGroup::create(MediaGroupType::fromString(Type::FILE));\n $this->weight = (float)0.00;\n $this->sequence = $this->getProductRepository()->getNextSequence($this->locale, $this->category);\n\n if (!$this->hasExistingProduct()) {\n return;\n }\n\n $this->id = $product->getId();\n $this->meta = $product->getMeta();\n $this->category = $product->getCategory();\n $this->brand = $product->getBrand();\n $this->vat = $product->getVat();\n $this->stock_status = $product->getStockStatus();\n $this->hidden = $product->isHidden();\n $this->type = $product->getType();\n $this->min_width = $product->getMinWidth();\n $this->min_height = $product->getMinHeight();\n $this->max_width = $product->getMaxWidth();\n $this->max_height = $product->getMaxHeight();\n $this->extra_production_width = $product->getExtraProductionWidth();\n $this->extra_production_height = $product->getExtraProductionHeight();\n $this->title = $product->getTitle();\n $this->summary = $product->getSummary();\n $this->text = $product->getText();\n $this->dimension_instructions = $product->getDimensionInstructions();\n $this->locale = $product->getLocale();\n $this->weight = $product->getWeight();\n $this->price = $product->getPrice();\n $this->stock = $product->getStock();\n $this->order_quantity = $product->getOrderQuantity();\n $this->from_stock = $product->isFromStock();\n $this->sku = $product->getSku();\n $this->ean13 = $product->getEan13();\n $this->isbn = $product->getIsbn();\n $this->sequence = $product->getSequence();\n $this->specification_values = $product->getSpecificationValues();\n $this->specials = $product->getSpecials();\n $this->dimensions = $product->getDimensions();\n $this->dimension_notifications = $product->getDimensionNotifications();\n $this->images = $product->getImages();\n $this->downloads = $product->getDownloads();\n $this->related_products = $product->getRelatedProducts();\n $this->up_sell_products = $product->getUpSellProducts();\n\n // just a fallback\n if (!$this->images instanceof MediaGroup) {\n $this->images = MediaGroup::create(MediaGroupType::fromString(Type::IMAGE));\n }\n\n // just a fallback\n if (!$this->downloads instanceof MediaGroup) {\n $this->downloads = MediaGroup::create(MediaGroupType::fromString(Type::FILE));\n }\n }", "public function getProduct(): Product\n {\n return $this->product;\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public static function product($product)\n {\n static::$product = $product;\n }", "public function testSetPriceProduct()\n {\n $product = new Product();\n $value = 10.99;\n $product->setPrice($value);\n $this->assertEquals($value, $product->getPrice());\n }", "public function run()\n {\n factory(Product::class, 50)->create()->each(function ($product){\n /* Tags */\n // mỗi product sẽ có từ 1 đến 3 tag,\n // giá trị tag là id (từ 1 đến 50, do mình tạo ở DatabaseSeeder)\n $arr = [];\n for ($i = 0; $i <= rand(0, 2); $i++){\n if($i == 0){\n $arr[] = rand(1, 15);\n }\n if($i == 1){\n $arr[] = rand(16, 35);\n }\n if($i == 2){\n $arr[] = rand(36, 50);\n }\n }\n // Dòng này muốn chạy cần cho seeder tags chạy trước\n $product->tags()->sync($arr);\n\n /*\n // -------Orders-------\n // Mỗi product có thể có từ 1 đến 3 order (thuộc 1 đến 50 chọn ra 3 cái)\n // Và đi kèm theo là số lượng hàng quantity của mỗi đơn hàng order\n $arr = [];\n // $arr[14] = ['quantity' => 69]\n // (order_id) -> mà cái này là random, nên sẽ có tr hợp k dính!\n for ($i = 0; $i <= rand(0, 2); $i++){\n if($i == 0){\n $arr[rand(1, 15)] = ['quantity' => rand(1, 99)];\n }\n if($i == 1){\n $arr[rand(16, 35)] = ['quantity' => rand(1, 99)];\n }\n if($i == 2){\n $arr[rand(36, 50)] = ['quantity' => rand(1, 99)];\n }\n }\n $product->orders()->sync($arr);\n */\n });\n }", "public function papperTest() {\n// $product->setName(\"proudct name\");\n// $product->setFirstname(\"firstname\");\n// $product->setLastname(\"\");\n// $product->setPrice(\"123\");\n// $product = $this->provider->Product()->find('58aef52f29c39f1413000029');\n//// $product->setName(\"proudct name\");\n// Papper::createMap('AppBundle\\Document\\Profile', 'AppBundle\\Shared\\DTO\\ProductDTO');\n//\n// $userDTO = Papper::map($product)->toType('AppBundle\\Shared\\DTO\\ProductDTO');\n// print_r($userDTO);\n// exit;\n }", "public function getProductById($id){\n $prodDB=$this->promodel->getProductById($id);\n // create a new product\n $product = new Product();\n $product->id=$prodDB->id;\n $product->name=$prodDB->name;\n $product->category=$prodDB->category;\n $product->price=$prodDB->price;\n $product->qty=0;\n return $product;\n }", "public function test_product_from_theme() {\n\n\t\t$file = dirname( __FILE__ ) . '/sample_products/sample_theme/style.css';\n\n\t\t$product = new \\ThemeisleSDK\\Product( $file );\n\n\t\t$this->assertEquals( $product->get_type(), 'theme' );\n\t\t$this->assertEquals( $product->get_slug(), 'sample_theme' );\n\t\t$this->assertEquals( $product->get_store_name(), 'ThemeIsle' );\n\t\t$this->assertEquals( $product->get_version(), '2.0.18' );\n\t\t$this->assertGreaterThanOrEqual( $product->get_install_time(), time() );\n\t\t$this->assertEquals( $product->get_store_url(), 'https://store.themeisle.com/' );\n\t\t$this->assertTrue( $product->requires_license() );\n\t\t$this->assertTrue( $product->is_wordpress_available() );\n\t}", "public function run()\n {\n Product::truncate();\n\n $product = new Product();\n $product->name = \"Pc Gamer Alto Rendimiento Ideal Diseño Vfx Y Animacion 3d\";\n $product->reference = \"intel1234\";\n $product->stock = \"5\";\n $product->details = \"Marca: CoolerMaster MSI INTEL\n Modelo: PC GAMER DISEÑO 2021 16 NUCLEOS\n Procesador: Intel Core i7 10Ma Generacion! 12 NUCLEOS\n Disco duro: 4.5 TB\n RAM: 32 GB\n Sistema operativo: Windows 10\";\n $product->description = \"TORRE + MONITOR + TECLADO/MOUSE + CONECTIVIDAD +FUNKO-POP 3 Ventiladores RGB EN CHASIS FRONTAL DETALLES TECNICOS *Procesador: Core i7 10Th Generación!\n ---- *REFRIGERACION LIQUIDA COOLER MASTER 360 ESPEJO RGB *Board: MSI Z490 TORPEDO *MEMORIA RAM: 32GB 3600MHZ *TARJETA DE VIDEO DEDICADA: RTX 3060TI 8GB DEDICADOS GDDR6 4 PUERTOS DE VIDEO, MULTIPLES PANTALLAS\";\n $product->price = 4499.99;\n $product->shipping_cost = 0.99;\n $product->image_path = \"pc-gamer-1.png\";\n $product->save();\n\n $product = new Product();\n $product->name = \"Pc Gamer Ryzen 5/16gb Ram/500gb Ssd M.2/gtx 1650 4gb Video\";\n $product->reference = \"asus1234\";\n $product->stock = \"7\";\n $product->details = \"Marca: ASUS TUF GAMIN\n Modelo: GTX 1650\n Procesador: RYZEN 5\n Disco duro: 500 GB\n RAM: 16 GB\n Sistema operativo: Windows 10\";\n $product->description = \"- MEMORIA RAM: 16GB PC DDR4 3200MHZ RGB.\n - BOARD PLACA : MSI B450 GAMING PLUS\n - DISCO SOLIDO: 500 GB ADATA SATA 3.0.\n - FUENTE DE PODER: 600W REDRAGON CERTIFICADA 80 PLUS BRONZE\n - CHASIS REDRAGON ATX 4 VENTILADORES RGB + CONTROL\n -TARJETA DE VIDEO: ASUS TUF GAMING GTX 1650 DE 4GB DDR6\n - COMBO TECLADO, MOUSE Y DIADEMA GAMER RGB JYR.\n - SISTEMA OPERATIVO: WINDOWS 10.\n - Monitor Samsung 22 Ips Ref F22t350fhl 1920 X 1080 5ms 75hz\";\n $product->price = 1899.99;\n $product->shipping_cost = 0.99;\n $product->image_path = \"pc-gamer-2.png\";\n $product->save();\n\n $product = new Product();\n $product->name = \"Pc Gamer Amd Ryzen 5 Disc Ssd 240 + 1tb Ram 16gb Monitor 22\";\n $product->reference = \"amd2413\";\n $product->stock = \"10\";\n $product->details = \"Marca: AMD\n Modelo: RYZEN 5\n Procesador: AMD RYZEN 5 3400G\n Disco duro: 1 TB\n RAM: 16 GB\n Sistema operativo: Windows 10\";\n $product->description = \"- PROCESADOR AMD RYZEN 5 3400G RELOJ DE AUMENTO MAX: 4.2GHz\n N.º DE NUCLEOS DE CPU: 4 N.º DE SUBPROCESOS 8.\n - TARJETA DE VIDEO : VEGA 11 DE 2GB !\n N.º DE NUCLEOS DE GPU: 11\n - MEMORIA RAM :PC DDR4 16GB (2X8) 3000MHZ ADATA XPG RGB\n - TIPO DE PLACA O BOARD : B450 PRO4 AM4 AMD\n - DISCO SOLIDO : M.2 240GB KINGSTON\n - DISCO HHD: 1000GB MECANICO.\n - CAJA & CHASIS : POOWER GROUP RGB EN VIDRIO\n - MONITOR SAMSUNG O LG : 22 FULL HD CON HDMI\n - FUENTE DE PODER: 450W REAL CERTIFICADA.\n - ACCESORIOS :TECLADO Y MOUSE GAMER RGB.\n - SISTEMA OPERATIVO: WINDOWS 10\";\n $product->price = 1199.99;\n $product->shipping_cost = 0.99;\n $product->image_path = \"pc-gamer-5.png\";\n $product->save();\n\n $product = new Product();\n $product->name = \"Pc Gamer Clx Con Procesador Intel Core I9-7900x Memoria\";\n $product->reference = \"clx1243\";\n $product->stock = \"2\";\n $product->details = \"Procesador Intel Core i97900X\n RAM 32Gb\n tarjeta gráfica Nvidia GeForce GTX 1080 Ti\n SSD 480Gb HDD 3Tb\";\n $product->description = \"Experiencia impresionante escenas realistas con la NVIDIA GeForce RTX tarjeta gráfica de este CLX escritorio de juego bundle.. Windows 10 64bitVR ReadyNVIDIA GeForce RTX 2070 8GB dedicado graphicsTechnical detalles: 9 de Generación de los procesadores Intel Core i79700K de procesador memoria de 16 gb; 960GB; unidad de estado sólido duro de 3 tb drive\";\n $product->price =3399.99;\n $product->shipping_cost = 0.99;\n $product->image_path = \"pc-gamer-3.png\";\n $product->save();\n\n $product = new Product();\n $product->name = \"NextComputing EDGE XT2i Creative Pro Workstation\";\n $product->reference = \"asd1243\";\n $product->stock = \"2\";\n $product->details = \"3.0 GHz Intel Core i9-10980XE 18-Core\n 128GB of 2666 MHz DDR4 RAM\n NVIDIA GeForce RTX 3090 (24GB GDDR6X)\n 1TB M.2 NVMe SSD + 512GB M.2 NVMe SSD\";\n $product->description = \"Diseñada para aplicaciones que incluyen Blackmagic DaVinci Resolve, Adobe Premiere Pro y After Effects, FXhome HitFilm, MAGIX Vegas Pro, Grass Valley EDIUS, Assimilate SCRATCH y The Foundry NUKE, la estación de trabajo EDGE XT2i Creative Pro de NextComputing proporciona un equilibrio de hardware para permitir los usuarios aprovechan al máximo su software de edición de video y se enfocan en crear contenido avanzado.\";\n $product->price =8999.99;\n $product->shipping_cost = 0.99;\n $product->image_path = \"pc-gamer-4.png\";\n $product->save();\n }", "public function run()\n {\n $product = new Product([\n 'title' => 'Praesent dictum orci',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vitae turpis et purus consequat dictum nec eu ante. Praesent eget eros enim. Praesent eu nunc metus. Vestibulum ac maximus ligula. Praesent a lacinia nisi, non rhoncus odio. In quis odio imperdiet, pellentesque orci sit amet, pellentesque nisl. Sed vitae dignissim magna. Suspendisse vel mi gravida, volutpat augue a, feugiat turpis. Nulla eu sollicitudin tortor. Nam bibendum elit nec turpis lacinia efficitur. In neque ante, pellentesque sed mauris id, condimentum suscipit massa. Fusce quis ligula at erat luctus maximus egestas non dolor. Aenean aliquam est nisi, quis volutpat mi sagittis sed. Praesent sit amet lobortis lectus. Duis tellus est, ullamcorper sed metus in, viverra pretium libero. Curabitur porttitor orci ac justo venenatis, et dapibus justo vulputate.',\n 'image_path' => 'goods_001.jpg',\n 'price' => 41\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Etiam semper ornare',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at maximus dolor, dignissim euismod ex. Nullam sit amet convallis dolor. Suspendisse erat diam, rhoncus at pharetra et, blandit in ligula. Etiam at auctor sem. Mauris vehicula sodales metus vel fermentum. Proin lacinia sem risus, vitae porta metus tempus in. Vestibulum convallis, odio non placerat accumsan, nunc leo aliquam orci, non lacinia ante nisi non nisi. In cursus sapien eu orci lacinia gravida. Sed eu nunc vitae magna semper tristique vitae a dui. Vestibulum eu finibus nisl. Sed rutrum egestas nisl, sed iaculis ipsum placerat vel. Praesent pulvinar imperdiet est quis pharetra. Suspendisse aliquet nulla vitae feugiat feugiat. Quisque sit amet dui lectus. Aenean commodo tellus massa, quis iaculis nisl aliquam a. Maecenas ullamcorper ultricies sollicitudin.',\n 'image_path' => 'goods_002.jpg',\n 'price' => 25\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Sed sed risus',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut quis quam orci. Proin non metus bibendum, eleifend nibh eget, hendrerit mi. Aliquam sollicitudin finibus mollis. Phasellus erat tellus, placerat vitae imperdiet at, sagittis ac felis. Suspendisse faucibus placerat nisi, vel mollis orci cursus at. Sed ac pulvinar risus, id pharetra elit. Etiam bibendum, nulla ac porta suscipit, est tortor dapibus augue, venenatis ultrices diam est elementum sem. Morbi malesuada varius nulla, ut elementum est semper sit amet. Suspendisse scelerisque metus vitae sagittis bibendum. Phasellus ullamcorper tellus id leo dignissim venenatis nec ac ante. Pellentesque nisl nibh, sollicitudin vitae aliquam a, molestie vel sapien. Donec non libero blandit, maximus sapien ut, dictum tellus. Sed tincidunt, elit imperdiet tempor placerat, ligula sapien aliquam turpis, non fringilla ex diam vel ante.',\n 'image_path' => 'goods_003.jpg',\n 'price' => 29\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Vivamus non sodales',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mattis, massa non posuere aliquet, mauris eros tincidunt nibh, sit amet bibendum quam neque et sapien. Morbi porttitor malesuada fermentum. Sed vestibulum, nunc ac porttitor efficitur, justo neque mollis massa, vel porttitor lectus massa vel sem. Integer suscipit nisl metus, sed luctus sem tincidunt et. Sed aliquam nunc non euismod laoreet. Sed id dolor auctor, volutpat dui in, dignissim metus. Vestibulum sit amet semper tortor. Duis eget erat et est volutpat malesuada. Aenean efficitur orci lacus, efficitur semper felis tincidunt a. Aenean fringilla ligula et sapien aliquet, vitae rhoncus sapien mattis.',\n 'image_path' => 'goods_004.jpg',\n 'price' => 27\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Sed magna diam',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vel mollis mauris. Suspendisse pharetra egestas semper. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus velit dolor, sodales et vestibulum sit amet, scelerisque at tellus. Fusce eu cursus neque. Pellentesque quis tincidunt nibh. Vestibulum fermentum eu est eu blandit. Integer sem nunc, maximus quis facilisis in, convallis vel nisi. Sed ac pellentesque lacus. Curabitur euismod ultricies egestas. Mauris ipsum lectus, pretium sit amet metus in, pellentesque aliquam magna. Praesent finibus a nunc ultrices pulvinar.',\n 'image_path' => 'goods_005.jpg',\n 'price' => 44\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Nam eu arcu',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc porta auctor nisl, id porttitor mauris gravida quis. Ut non elit venenatis, gravida elit sit amet, pharetra arcu. Mauris id tempus sem, nec dapibus orci. Aliquam ac nibh egestas, fringilla nibh non, tincidunt leo. Pellentesque nec lacinia tortor, sed laoreet enim. Duis et urna sed ante consectetur iaculis dapibus sit amet purus. Aliquam et gravida odio, sit amet luctus augue. Mauris ultrices sagittis enim non mollis. Phasellus tempus elit non quam semper, id varius ex dignissim. Proin sed pellentesque eros, vehicula efficitur nunc. Aliquam ultrices dolor sit amet neque semper, sed efficitur tellus blandit. Morbi non rhoncus nibh. Etiam blandit ante quis sapien lobortis laoreet. Vestibulum maximus commodo justo nec efficitur.',\n 'image_path' => 'goods_006.jpg',\n 'price' => 26\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Vestibulum at ultricies',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam nisl tortor, fermentum quis sem ut, accumsan aliquet est. In interdum porta lacus ut posuere. Curabitur egestas erat rutrum sem vehicula condimentum. Sed sit amet consectetur velit, vitae elementum neque. Maecenas sodales arcu sed lorem euismod, id dignissim elit dictum. Duis lacus ipsum, fermentum in finibus vel, tristique vitae orci. Nam ullamcorper a ipsum in pulvinar.',\n 'image_path' => 'goods_007.jpg',\n 'price' => 29\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Praesent pretium, diam',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi massa libero, molestie vitae urna a, sagittis vestibulum elit. Cras et nibh odio. Sed ut augue blandit, lacinia est eget, laoreet velit. Praesent ante mauris, imperdiet id facilisis eget, cursus eu nunc. Integer sit amet enim eget magna vulputate aliquet. Sed augue mauris, finibus at urna sit amet, malesuada bibendum quam. Sed ornare egestas ante ac auctor. Nam pharetra consectetur magna vel iaculis. Vestibulum at finibus dui. Maecenas mollis efficitur dui ut tempus. Aenean laoreet urna vitae accumsan suscipit. Nulla in arcu a odio ultrices vestibulum at at mi. Nullam congue lacinia lacinia. Phasellus eu placerat libero.',\n 'image_path' => 'goods_008.jpg',\n 'price' => 22\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Phasellus varius massa',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In nec mauris commodo, ultricies mauris vel, iaculis elit. Fusce varius ipsum at nisl convallis, sed sodales turpis fringilla. Quisque lacinia ac nisl id blandit. Sed ac turpis tortor. Fusce gravida sed arcu sit amet pharetra. Vivamus pellentesque, ante sed hendrerit semper, diam ligula consectetur felis, quis luctus lectus ipsum in urna. In dictum volutpat velit sit amet elementum. Sed nisl augue, feugiat ac elit in, gravida facilisis mauris. Vestibulum porta nisi vitae leo lacinia, nec mollis ante pellentesque. Praesent efficitur pharetra auctor. Proin rutrum elementum erat et commodo.',\n 'image_path' => 'goods_009.jpg',\n 'price' => 22\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Quisque in orci',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultrices urna quis risus ultricies porttitor. Curabitur ornare est lacus, eget posuere ex condimentum a. Donec imperdiet nibh neque, ut consequat leo fermentum et. Sed ut metus semper, feugiat leo non, imperdiet ligula. Curabitur vestibulum, sapien ut eleifend tempus, tortor arcu condimentum lorem, efficitur lobortis felis nunc nec arcu. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla ligula urna, rhoncus eget facilisis eu, dictum et erat. Vivamus cursus, ante ut interdum maximus, ex justo ultrices lacus, vitae interdum lectus justo in est. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur fringilla iaculis turpis. Donec nec ligula sapien. Nunc tincidunt dui nec lacus rhoncus sagittis. Proin nec neque et mi sagittis dignissim.',\n 'image_path' => 'goods_010.jpg',\n 'price' => 22\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Vestibulum feugiat leo',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod aliquam est at viverra. Pellentesque non venenatis ligula. Vivamus rutrum id sapien nec aliquam. Nullam fermentum, turpis in congue efficitur, nunc eros consectetur mi, non suscipit odio tellus mollis risus. Proin nec velit tincidunt, lacinia nulla vitae, posuere purus. Quisque venenatis urna ut consectetur faucibus. Aliquam scelerisque mi non efficitur faucibus. Sed aliquet ac eros nec pellentesque. Praesent dignissim mauris id libero finibus semper. Sed ornare velit faucibus enim facilisis imperdiet.',\n 'image_path' => 'goods_011.jpg',\n 'price' => 22\n ]);\n $product->save();\n\n $product = new Product([\n 'title' => 'Suspendisse in magna',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet scelerisque lacus. Interdum et malesuada fames ac ante ipsum primis in faucibus. In mauris nulla, lobortis at arcu quis, pharetra pharetra justo. Integer diam odio, consequat eget consequat non, fringilla eget ligula. Integer nec elementum metus. Maecenas neque justo, ullamcorper vitae sapien nec, congue lobortis ligula. Quisque fermentum magna eget vulputate imperdiet. Suspendisse varius molestie elit, quis congue metus hendrerit at. Aenean eu vulputate sem.',\n 'image_path' => 'goods_012.jpg',\n 'price' => 22\n ]);\n $product->save();\n }", "public function getItemProduct(InjectableFixture $product)\n {\n return $this->blockFactory->create(\n \\Magento\\GiftMessage\\Test\\Block\\Adminhtml\\Order\\Create\\Items\\ItemProduct::class,\n [\n 'element' => $this->browser->find(\n sprintf($this->itemProduct, $product->getName()),\n Locator::SELECTOR_XPATH\n )\n ]\n );\n }", "function createProduct($parent = null);", "public function run(Faker $faker)\n {\n for ($i=0; $i < 100; $i++) {\n $new_product = new Product();\n $new_product->name = \"Nome Prodotto \" . ($i + 1 );\n $new_product->slug = Str::slug($new_product->name, '-');\n $new_product->description = ($i + 1 ) . \" Lorem ipsum, dolor sit amet consectetur adipisicing elit. Nam harum possimus quaerat consequatur eveniet! Ducimus soluta quasi accusamus veritatis dignissimos quas quos esse! Ullam repellat minima aspernatur perferendis necessitatibus numquam.\";\n /* $new_product->image = $faker->imageUrl(640, 480, 'animals', true); */\n $new_product->quantity = $faker->numberBetween(0,20);\n $new_product->price = $faker->randomFloat(2, 0.99, 999.99);\n $new_product->save();\n }\n }", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public function testProductPension()\n {\n $this->assertDatabaseHas('products', [\n 'name' => 'pensions'\n ]);\n\n }", "public function createProductInstance($idProduct, $params = array())\n {\n $wooFactory = new WC_Product_Factory();\n $product = $wooFactory->get_product($idProduct, $params);\n return $product;\n }", "protected static function newFactory(): Factory\n {\n return ProductInventoryFactory::new();\n }", "public function testCatalogGetProducts()\n {\n\n }", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "private function __adjustProduct (&$product, $skipRelations = true) {\n global $app;\n // adjusting\n $productID = intval($product['ID']);\n $product['ID'] = $productID;\n $product['OriginID'] = intval($product['OriginID']);\n $product['CategoryID'] = intval($product['CategoryID']);\n $product['_category'] = API::getAPI('shop:categories')->getCategoryByID($product['CategoryID']);\n $product['_origin'] = API::getAPI('shop:origins')->getOriginByID($product['OriginID']);\n $product['Attributes'] = $this->getProductAttributes($productID);\n $product['IsPromo'] = intval($product['IsPromo']) === 1;\n $product['IsFeatured'] = intval($product['IsFeatured']) === 1;\n $product['IsOffer'] = intval($product['IsOffer']) === 1;\n $product['ShowBanner'] = intval($product['ShowBanner']) === 1;\n\n // create display product title\n $displayName = array();\n if (!empty($product['Name'])) {\n $displayName[] = $product['Name'];\n }\n if (!empty($product['_origin'])) {\n $displayName[] = $product['_origin']['Name'];\n }\n if (!empty($product['Model'])) {\n $displayName[] = $product['Model'];\n }\n $product['_displayNameFull'] = implode(' ', $displayName);\n $product['_displayName'] = implode(' ', array_slice($displayName, 1));\n\n // misc data\n if (!$skipRelations) {\n $product['Relations'] = $this->getProductRelations($productID);\n }\n\n // features\n $product['Features'] = $this->getProductFeatures($productID);\n\n // media\n $product['Images'] = $this->getProductImages($productID);\n $product['Videos'] = $this->getProductVideos($productID);\n $product['Banners'] = $this->getProductBanners($productID);\n\n // Utils\n $product['viewExtrasInWish'] = API::getAPI('shop:wishlists')->productIsInWishList($productID);\n $product['viewExtrasInCompare'] = API::getAPI('shop:comparelists')->productIsInCompareList($productID);\n $product['viewExtrasInCartCount'] = API::getAPI('shop:orders')->productCountInCart($productID);\n\n // is available\n $product['_available'] = in_array($product['Status'], dbquery::getProductStatusesWhenAvailable());\n $product['_archived'] = in_array($product['Status'], dbquery::getProductStatusesWhenDisabled());\n\n // promo\n $promo = API::getAPI('shop:promos')->getSessionPromo();\n $product['_promo'] = $promo;\n\n // prices and actual price\n $price = floatval($product['Price']);\n $prevprice = floatval($product['PrevPrice']);\n $actualPrice = 0;\n $priceHistory = $this->getProductPriceHistory($productID);\n if ($product['IsPromo'] && !empty($promo) && !empty($promo['Discount']) && $promo['Discount'] > 0) {\n $product['_promoIsApplied'] = true;\n $actualPrice = (100 - intval($promo['Discount'])) / 100 * $price;\n } else {\n $product['_promoIsApplied'] = false;\n $actualPrice = $price;\n }\n $actualPrice = floatval($actualPrice);\n $savingValue = $prevprice - $actualPrice;\n unset($product['Price']);\n unset($product['PrevPrice']);\n\n // apply currencies\n $convertedPrices = API::getAPI('shop:exchangerates')->convertToRates($actualPrice);\n $convertedPrevPrices = API::getAPI('shop:exchangerates')->convertToRates($prevprice);\n $convertedSavings = API::getAPI('shop:exchangerates')->convertToRates($savingValue);\n\n // create product prices object\n $product['_prices'] = array(\n 'price' => $price,\n 'previous' => $prevprice,\n 'actual' => $actualPrice,\n 'others' => $convertedPrices,\n 'history' => $priceHistory,\n 'previousothers' => $convertedPrevPrices,\n 'savings' => $savingValue,\n 'savingsothers' => $convertedSavings\n );\n\n $product['ShopDiscount'] = $prevprice > 0 ? 100 - intval($price * 100 / $prevprice) : 0;\n $product['IsBigSavings'] = $product['ShopDiscount'] > 5;\n $product['GoodToShowPreviousPrice'] = $savingValue > 10;\n\n if (!empty($product['Attributes']['PROMO_TEXT'])) {\n $product['Attributes']['PROMO_TEXT'] = str_replace('[DisplayName]', $product['_displayName'], $product['Attributes']['PROMO_TEXT']);\n }\n\n // // save product into recently viewed list\n // $isDirectRequestToProduct = Request::hasInGet('id') || Request::hasInGet('params');\n // if (Request::isGET() && !$app->isToolbox() && !empty($isDirectRequestToProduct)) {\n // $recentProducts = isset($_SESSION[$this->_listKey_Recent]) ? $_SESSION[$this->_listKey_Recent] : array();\n // $recentProducts[] = $productID;\n // $_SESSION[$this->_listKey_Recent] = array_unique($recentProducts);\n // }\n\n // var_dump($product);\n return $product;\n }", "public function testInsertProductUsingPOST()\n {\n }", "public function create(OrderProduct $item): OrderProduct;", "public function populateProduct($req)\n {\n $product = new Product();\n $id = trim($req->getPost('id'));\n if ($id !== '') {\n $product->id = $id;\n }\n $product->name = trim($req->getPost('name'));\n $product->price = (int)trim($req->getPost('price'));\n $image = trim($req->getPost('image'));\n $product->image = (!empty($image) ? $image : null);\n $product->description = trim($req->getPost('description'));\n $product->available = (bool)$req->getPost('available');\n $product->categoryIds = $req->getPost('category', []);\n return $product;\n }", "public function run()\n {\n $product = new Product();\n $product->title = \"Iphone 11 Pro Max\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 1100;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 1;\n $product->save();\n\n $product = new Product();\n $product->title = \"Samsung Galaxy S10\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 800;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 1;\n $product->save();\n\n $product = new Product();\n $product->title = \"Huawai P30\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 500;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 1;\n $product->save();\n\n $product = new Product();\n $product->title = \"ASUS PC portable Vivobook Flip Tactile\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 600;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 2;\n $product->save();\n\n $product = new Product();\n $product->title = \"Ordinateur Portable - DELL Inspiron 15 5593\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 900;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 2;\n $product->save();\n\n $product = new Product();\n $product->title = \"Apple - 13,3\\\" MacBook Air -128Go SSD - Argent\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 1000;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 2;\n $product->save();\n\n $product = new Product();\n $product->title = \"Console PS4 Slim 500Go Noire/Jet Black\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 300;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 3;\n $product->save();\n\n $product = new Product();\n $product->title = \"Xbox One S 1To 2 manettes\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 350;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 3;\n $product->save();\n\n $product = new Product();\n $product->title = \"Console Nintendo Switch Lite Grise\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 250;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 3;\n $product->save();\n\n $product = new Product();\n $product->title = \"BEKO REC52S - Réfrigérateur congélateur bas\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 500;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 4;\n $product->save();\n\n $product = new Product();\n $product->title = \"ELECTROLUX ECF6P62X - Four électrique encastrable\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 350;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 4;\n $product->save();\n\n $product = new Product();\n $product->title = \"Lave Linge frontal connecté CANDY CS1292D3S - 9kg\";\n $product->slug = Str::slug($product->title, '-');\n $product->price = 300;\n $product->description = 'Lorem, ipsum dolor sit amet consectetur adipisicing elit. Fugit, quibusdam iusto perferendis voluptatibus libero aperiam illum. Eos unde aut iusto. Ad voluptates consectetur temporibus asperiores quaerat esse laboriosam soluta a? Dolorum nobis amet, illo impedit corrupti labore similique aspernatur deleniti eaque! Velit dolorum assumenda eius minus, molestias quisquam tempora temporibus vel voluptates ipsam magnam dolor vero ratione consectetur nihil incidunt odio unde. Pariatur dolores libero dignissimos quo tempora mollitia veritatis ut architecto, distinctio possimus odit voluptate voluptatibus expedita harum quod maiores obcaecati alias. Accusantium id dolorum dicta suscipit porro quibusdam, minus velit numquam ab fuga quia consequuntur eum eveniet illum.';\n $product->img = \"https://picsum.photos/400/350?random=\" . mt_rand(1, 500);\n $product->category_id = 4;\n $product->save();\n\n }", "public function create($request) {\n\n\t\t$image = $request['photo'];\n\t\tif($image !== null) {\n\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t$request['photo'] = $name;\n\t\t} else {\n\t\t\t$request['photo'] = \"product-empty.png\";\n\t\t}\n\t\t$request['user_id'] = auth()->user()->id;\n\t\treturn $this->product->create($request);\n\t}", "private function setupProducts()\n {\n $products = [\n ['name' => 'Product 1'],\n ['name' => 'Product 2'],\n ['name' => 'Product 3'],\n ['name' => 'Product 4'],\n ];\n\n $container = $this->setupData($products, Product::class);\n\n $this->products = $container;\n }", "public function run()\n {\n factory('App\\Product')->create(['name' => 'Rings']);\n factory('App\\Product')->create(['name' => 'Earrings']);\n factory('App\\Product')->create(['name' => 'Bracelets']);\n factory('App\\Product')->create(['name' => 'Necklaces']);\n factory('App\\Product')->create(['name' => 'Soltaires']);\n }", "public function an_admin_user_can_create_a_product()\n {\n $this->withExceptionHandling();\n $product = [\n 'name' => 'My First Product',\n 'code' => 'a100',\n 'description' => 'This is my first Product',\n 'image' => UploadedFile::fake()->image('random.jpg'),\n 'price' => '10.50'\n ];\n $admin = $this->createAdmin();\n\n $this->actingAs($admin)\n ->post(route('admin.products.store'), $product)\n ->assertRedirect('admin/product/my-first-product');\n //->assertSee('My First Product');\n\n $this->assertDatabaseHas('products', [\n 'user_id' => $admin->id,\n 'name' => \"My First Product\",\n 'slug' => 'my-first-product',\n 'code' => 'a100',\n 'image' => 'product-images/random.jpg',\n 'description' => 'This is my first Product',\n 'price' => '10.50'\n ]);\n }", "public function run()\n {\n // factory(ProductProperty::class, 200)->create();\n //1\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '2gb',\n 'product_id' => 1\n ]);\n ProductProperty::create([\n 'name' => 'sim-cards-number',\n 'title' => 'Number of SIM cards',\n 'value' => '2',\n 'product_id' => 1\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'ios',\n 'product_id' => 1\n ]);\n ProductProperty::create([\n 'name' => 'memory',\n 'title' => 'Memory',\n 'value' => '64',\n 'product_id' => 1\n ]);\n ProductProperty::create([\n 'name' => 'processor-manufacturer',\n 'title' => 'Processor manufacturer',\n 'value' => 'dragon',\n 'product_id' => 1\n ]);\n //2\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '3gb',\n 'product_id' => 2\n ]);\n ProductProperty::create([\n 'name' => 'sim-cards-number',\n 'title' => 'Number of SIM cards',\n 'value' => '1',\n 'product_id' => 2\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'android',\n 'product_id' => 2\n ]);\n ProductProperty::create([\n 'name' => 'memory',\n 'title' => 'Memory',\n 'value' => '8',\n 'product_id' => 2\n ]);\n ProductProperty::create([\n 'name' => 'processor-manufacturer',\n 'title' => 'Processor manufacturer',\n 'value' => 'dragon',\n 'product_id' => 2\n ]);\n //3\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '1gb',\n 'product_id' => 3\n ]);\n ProductProperty::create([\n 'name' => 'sim-cards-number',\n 'title' => 'Number of SIM cards',\n 'value' => '2',\n 'product_id' => 3\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'ios',\n 'product_id' => 3\n ]);\n ProductProperty::create([\n 'name' => 'memory',\n 'title' => 'Memory',\n 'value' => '16',\n 'product_id' => 3\n ]);\n ProductProperty::create([\n 'name' => 'processor-manufacturer',\n 'title' => 'Processor manufacturer',\n 'value' => 'dragon',\n 'product_id' => 3\n ]);\n //4\n ProductProperty::create([\n 'name' => 'screen',\n 'title' => 'Screen',\n 'value' => 'amoled',\n 'product_id' => 4\n ]);\n ProductProperty::create([\n 'name' => 'year',\n 'title' => 'Year',\n 'value' => '2018',\n 'product_id' => 4\n ]);\n ProductProperty::create([\n 'name' => 'size',\n 'title' => 'Size',\n 'value' => '1000x3000',\n 'product_id' => 4\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'black',\n 'product_id' => 4\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'andriod',\n 'product_id' => 4\n ]);\n //5\n ProductProperty::create([\n 'name' => 'screen',\n 'title' => 'Screen',\n 'value' => 'notamoled',\n 'product_id' => 5\n ]);\n ProductProperty::create([\n 'name' => 'year',\n 'title' => 'Year',\n 'value' => '2014',\n 'product_id' => 5\n ]);\n ProductProperty::create([\n 'name' => 'size',\n 'title' => 'Size',\n 'value' => '1200x3000',\n 'product_id' => 5\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'white',\n 'product_id' => 5\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'tvos',\n 'product_id' => 5\n ]);\n //6\n ProductProperty::create([\n 'name' => 'screen',\n 'title' => 'Screen',\n 'value' => 'notaled',\n 'product_id' => 6\n ]);\n ProductProperty::create([\n 'name' => 'year',\n 'title' => 'Year',\n 'value' => '2013',\n 'product_id' => 6\n ]);\n ProductProperty::create([\n 'name' => 'size',\n 'title' => 'Size',\n 'value' => '100x300',\n 'product_id' => 6\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'red',\n 'product_id' => 6\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'andriodTV',\n 'product_id' => 6\n ]);\n \n //7\n ProductProperty::create([\n 'name' => 'display-resolution',\n 'title' => 'Display resolution',\n 'value' => '1800x2400',\n 'product_id' => 7\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '30',\n 'product_id' => 7\n ]);\n ProductProperty::create([\n 'name' => 'processor',\n 'title' => 'Processor',\n 'value' => 'intel',\n 'product_id' => 7\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '8',\n 'product_id' => 7\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '128',\n 'product_id' => 7\n ]);\n ProductProperty::create([\n 'name' => 'video-card',\n 'title' => 'Video Card',\n 'value' => 'nvidia',\n 'product_id' => 7\n ]);\n //8\n ProductProperty::create([\n 'name' => 'display-resolution',\n 'title' => 'Display resolution',\n 'value' => '1260x2200',\n 'product_id' => 8\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '32',\n 'product_id' => 8\n ]);\n ProductProperty::create([\n 'name' => 'processor',\n 'title' => 'Processor',\n 'value' => 'intel',\n 'product_id' => 8\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '4',\n 'product_id' => 8\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '256',\n 'product_id' => 8\n ]);\n ProductProperty::create([\n 'name' => 'video-card',\n 'title' => 'Video Card',\n 'value' => 'nvidia',\n 'product_id' => 8\n ]);\n //9\n ProductProperty::create([\n 'name' => 'display-resolution',\n 'title' => 'Display resolution',\n 'value' => '1800x3600',\n 'product_id' => 9\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '24',\n 'product_id' => 9\n ]);\n ProductProperty::create([\n 'name' => 'processor',\n 'title' => 'Processor',\n 'value' => 'intel',\n 'product_id' => 9\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '16',\n 'product_id' => 9\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '16',\n 'product_id' => 9\n ]);\n ProductProperty::create([\n 'name' => 'video-card',\n 'title' => 'Video Card',\n 'value' => 'nvidia',\n 'product_id' => 9\n ]);\n //10\n ProductProperty::create([\n 'name' => 'matrix',\n 'title' => 'Matrix',\n 'value' => 'amoled',\n 'product_id' => 10\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'ios',\n 'product_id' => 10\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '10',\n 'product_id' => 10\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '2',\n 'product_id' => 10\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '16',\n 'product_id' => 10\n ]);\n //11\n ProductProperty::create([\n 'name' => 'matrix',\n 'title' => 'Matrix',\n 'value' => 'aawwmoled',\n 'product_id' => 11\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'andriod',\n 'product_id' => 11\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '6',\n 'product_id' => 11\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '4',\n 'product_id' => 11\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '32',\n 'product_id' => 11\n ]);\n //12\n ProductProperty::create([\n 'name' => 'matrix',\n 'title' => 'Matrix',\n 'value' => 'aawmoed',\n 'product_id' => 12\n ]);\n ProductProperty::create([\n 'name' => 'os',\n 'title' => 'OS',\n 'value' => 'ios',\n 'product_id' => 12\n ]);\n ProductProperty::create([\n 'name' => 'display-size',\n 'title' => 'Diagonal display',\n 'value' => '7',\n 'product_id' => 12\n ]);\n ProductProperty::create([\n 'name' => 'ram',\n 'title' => 'RAM',\n 'value' => '2',\n 'product_id' => 12\n ]);\n ProductProperty::create([\n 'name' => 'memory-size',\n 'title' => 'Memory Size',\n 'value' => '25',\n 'product_id' => 12\n ]);\n //13\n ProductProperty::create([\n 'name' => 'type',\n 'title' => 'Type',\n 'value' => 'best',\n 'product_id' => 13\n ]);\n ProductProperty::create([\n 'name' => 'connection-type',\n 'title' => 'Type of connection',\n 'value' => 'wireless',\n 'product_id' => 13\n ]);\n ProductProperty::create([\n 'name' => 'noise-reduction',\n 'title' => 'Noise Reduction',\n 'value' => '33',\n 'product_id' => 13\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'black',\n 'product_id' => 13\n ]);\n ProductProperty::create([\n 'name' => 'cable',\n 'title' => 'Cable',\n 'value' => 'metal',\n 'product_id' => 13\n ]);\n ProductProperty::create([\n 'name' => 'frequency-range',\n 'title' => 'Frequency Range',\n 'value' => '25cm',\n 'product_id' => 13\n ]);\n //14\n ProductProperty::create([\n 'name' => 'type',\n 'title' => 'Type',\n 'value' => 'loew',\n 'product_id' => 14\n ]);\n ProductProperty::create([\n 'name' => 'connection-type',\n 'title' => 'Type of connection',\n 'value' => 'wire',\n 'product_id' => 14\n ]);\n ProductProperty::create([\n 'name' => 'noise-reduction',\n 'title' => 'Noise Reduction',\n 'value' => '23',\n 'product_id' => 14\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'white',\n 'product_id' => 14\n ]);\n ProductProperty::create([\n 'name' => 'cable',\n 'title' => 'Cable',\n 'value' => 'metal',\n 'product_id' => 14\n ]);\n ProductProperty::create([\n 'name' => 'frequency-range',\n 'title' => 'Frequency Range',\n 'value' => '20cm',\n 'product_id' => 14\n ]);\n //15\n ProductProperty::create([\n 'name' => 'type',\n 'title' => 'Type',\n 'value' => 'aredil',\n 'product_id' => 15\n ]);\n ProductProperty::create([\n 'name' => 'connection-type',\n 'title' => 'Type of connection',\n 'value' => 'wireless',\n 'product_id' => 15\n ]);\n ProductProperty::create([\n 'name' => 'noise-reduction',\n 'title' => 'Noise Reduction',\n 'value' => '20',\n 'product_id' => 15\n ]);\n ProductProperty::create([\n 'name' => 'color',\n 'title' => 'Color',\n 'value' => 'red',\n 'product_id' => 15\n ]);\n ProductProperty::create([\n 'name' => 'cable',\n 'title' => 'Cable',\n 'value' => 'metal',\n 'product_id' => 15\n ]);\n ProductProperty::create([\n 'name' => 'frequency-range',\n 'title' => 'Frequency Range',\n 'value' => '25cm',\n 'product_id' => 15\n ]);\n }", "public function run()\n {\n\n Product::truncate();\n $total = 60;\n $publisherArray = ['紅樹林出版','九章出版社','天下文化','天下雜誌','雄獅圖書','幼獅文化','卓著出版社'];\n $bookArray = ['唐吉軻德','雙城記','童軍警探','紅樓夢','麥田捕手','黑美人','玫瑰之名','天地一沙鷗','天使與魔鬼','安妮日記'];\n $InterpreterArray = ['呂相儒','林光 (當代翻譯家)','黎烈文','賴明珠','林曙光 (作家)',\n '劉其偉','劉墉 (作家、畫家)','李昂 (作家)','劉慕沙'];\n $fake = \\Faker\\Factory::create('zh_TW');\n foreach (range(1,$total) as $id){\n $price = rand(300,1200);\n $category_id = Category::inRandomOrder()->first()->id;\n $subcategory_id=Subcategory::inRandomOrder()->where('category_id',$category_id)->first()->subcategory_id;\n $product = Product::create([\n 'title' => $bookArray[($id-1)%10],\n 'subtitle' => $fake->realText(rand(10,15)),\n 'description' => $fake->realText(rand(10,15)),\n 'type' => 0,\n 'author' => \"作者\".($id-1)%10,\n 'publisher' => $publisherArray[rand(0,6)],\n 'publish_year'=>rand(1,2020),\n 'isbn'=>$this->randISBN(),\n 'category_id' =>$category_id,\n 'subcategory_id'=>$subcategory_id,\n 'author_description' =>$fake->realText(rand(10,15)),\n 'interpreter' => $InterpreterArray[rand(0,8)],\n 'list_price' => $price,\n 'sale_price' => floor($price*rand(60,100)/100),\n 'stock' => rand(0,10),\n ]);\n foreach (range(1,3) as $id){\n $product->tags()->attach(rand(1,8));\n }\n }\n }", "public function testSetWeightProduct()\n {\n $product = new Product();\n $value = 100;\n $product->setWeight($value);\n $this->assertEquals($value, $product->getWeight());\n }", "public function testInsertProduct_ValidData()\n\t{\n\t\t// Create new Product object\n\t\t$args = new SimpleProduct();\n\t\t$args->module_srl = 201;\n\t\t$args->member_srl = 4;\n\t\t$args->product_type = \"simple\";\n\t\t$args->title = \"Product 1\";\n\t\t$args->description = \"Lorem ipsum dolor sit amet, te amet scaevola volutpat eum, ius an decore recteque patrioque, mel sint epicurei ut. Ea lorem noluisse est, ea sed nisl libris electram. Cu vivendum facilisis scribentur mel, bonorum elaboraret no per. Nec eu vidit omittantur, ei putant timeam detraxit quo, urbanitas efficiendi sit id. Mei putent eirmod voluptua ut, at dictas invenire delicata duo.\n\nPatrioque conceptam in mea. Est ad ullum ceteros, pro quem accumsan appareat id, pro nominati electram no. Duo lorem maiorum urbanitas te, cu eum dicunt laoreet, etiam sententiae scriptorem at mel. Vix tamquam epicurei et, quo tota iudicabit an. Duo ea agam antiopam. Et per diam percipitur.\";\n\t\t$args->short_description = \"short_description\";\n\t\t$args->sku = \"SKU1\";\n\t\t$args->status = '1';\n\t\t$args->friendly_url = \"product1\";\n\t\t$args->price = 10.5;\n\t\t$args->qty = 0;\n\t\t$args->in_stock = \"Y\";\n\n\t\t$shopModel = getModel('shop');\n\t\t$repository = $shopModel->getProductRepository();\n\t\ttry\n\t\t{\n\t\t\t// Try to insert the new Product\n\n\t\t\t$product_srl = $repository->insertProduct($args);\n\n\t\t\t// Check that a srl was returned\n\t\t\t$this->assertNotNull($product_srl);\n\n\t\t\t// Read the newly created object from the database, to compare it with the source object\n\t\t\t$output = Database::executeQuery(\"SELECT * FROM xe_shop_products WHERE product_srl = $product_srl\");\n\t\t\t$this->assertEquals(1, count($output));\n\n\t\t\t$product = $output[0];\n\t\t\t$this->assertEquals($args->module_srl, $product->module_srl);\n\t\t\t$this->assertEquals($args->member_srl, $product->member_srl);\n\t\t\t$this->assertEquals($args->product_type, $product->product_type);\n\t\t\t$this->assertEquals($args->title, $product->title);\n\t\t\t$this->assertEquals($args->description, $product->description);\n\t\t\t$this->assertEquals($args->short_description, $product->short_description);\n\t\t\t$this->assertEquals($args->sku, $product->sku);\n\t\t\t$this->assertEquals($args->status, $product->status);\n\t\t\t$this->assertEquals($args->friendly_url, $product->friendly_url);\n\t\t\t$this->assertEquals($args->price, $product->price);\n\t\t\t$this->assertEquals($args->qty, $product->qty);\n\t\t\t$this->assertEquals($args->in_stock, $product->in_stock);\n\t\t\t$this->assertNotNull($product->regdate);\n\t\t\t$this->assertNotNull($product->last_update);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\t$this->fail($e->getMessage());\n\t\t}\n\t}", "public function product(){\n\n }", "public function newProduct($options = array())\n {\n return $this->newItem(\"product\", \"products\", $options);\n }", "public function definition()\n {\n return [\n 'name' => 'product'.$this->faker->name(),\n 'alias'\t=> 'product',\n 'full_path'\t=> $this->faker->filePath(),\n 'category_id' => $this->faker->numberBetween(1,20),\n 'product_code' => $this->faker->randomNumber(9),\n 'id_1c' => $this->faker->randomNumber(9),\n 'description' => $this->faker->text(50),\n 'weight' => $this->faker->numberBetween(100,300),\n 'length' => $this->faker->numberBetween(100,300),\n 'width' => $this->faker->numberBetween(100,300),\n 'height' => $this->faker->numberBetween(100,300),\n 'volume' => $this->faker->randomNumber(2),\n 'order' => 99,\n 'price' => $this->faker->numberBetween(400,3000),\n 'old_price' => 3000 + $this->faker->randomNumber(3),\n 'discount_percent' => NULL,\n 'image_id' => $this->faker->numberBetween(1,100),\n 'sale' => $this->faker->numberBetween(0,1),\n 'recommended' => $this->faker->numberBetween(0,1),\n 'active' => $this->faker->numberBetween(0,1),\n 'seo_text' => $this->faker->text(10),\n 'seo_description' => $this->faker->text(10),\n 'seo_keywords' => $this->faker->text(10),\n 'seo_title' => $this->faker->text(10),\n 'seo_h1' => $this->faker->text(10),\n ];\n }", "public function testGetSuperfundProducts()\n {\n }", "static function create(PONIpar\\Product $onix){\n $libriProduct = new LibriProduct;\n $controller = new LibriProductFactory();\n $controller->product = $onix;\n\n $recordReference = $controller->getRecordReference();\n\n /* ---------------- required data -------------- */\n $libriProduct->RecordReference = $recordReference;\n $libriProduct->ProductForm = $controller->getProductForm();\n $libriProduct->DistinctiveTitle = $controller->getDistinctiveTitle();\n\n $tmpReference = $controller->getProductReference();\n if(!$tmpReference) return null; // if no valid reference was found, this product is invalid\n\n $libriProduct->ProductReference = (String) $tmpReference[0];\n $libriProduct->ProductReferenceType = (String) $tmpReference[1];\n\n // test required fields\n $requiredFields = [\n 'RecordReference',\n 'ProductReference',\n 'DistinctiveTitle',\n 'ProductForm'\n ];\n\n foreach ($requiredFields as $field) {\n if ($libriProduct->$field === false) throw new MissingDataException(\"Content of `$field` not found or empty.\", $recordReference);\n }\n\n /* ---------------- optional data -------------- */\n $libriProduct->OrderTime = (Integer) $controller->getOrderTime();\n $libriProduct->QuantityOnHand = (Integer) $controller->getQuantityOnHand();\n $libriProduct->AvailabilityStatus = (Integer) $controller->getAvailabilityStatus();\n $libriProduct->NumberOfPages = (Integer) $controller->getNumberOfPages();\n $libriProduct->VLBSchemeOld = (Integer) $controller->getVLBSchemeOld();\n $libriProduct->ProductWeight = (Integer) $controller->getProductWeight();\n $libriProduct->ProductWidth = (Integer) $controller->getProductWidth();\n $libriProduct->ProductThickness = (Integer) $controller->getProductThickness();\n $libriProduct->AudienceCodeValue = (Integer) $controller->getAudienceCodeValue();\n\n $libriProduct->Author = (String) $controller->getAuthor();\n $libriProduct->CoverLink = (String) $controller->getCoverLink();\n $libriProduct->ProductLanguage = (String) $controller->getProductLanguage();\n $libriProduct->PublisherName = (String) $controller->getPublisherName();\n $libriProduct->PublicationDate = (String) $controller->getPublicationDate();\n $libriProduct->Blurb = (String) $controller->getBlurb();\n\n $controller->CurrentPrice = $controller->getPriceDeCurrent();\n $libriProduct->PriceAmount = (float) $controller->getPriceAmount();\n $libriProduct->PriceTypeCode = (Integer) $controller->getPriceTypeCode();\n $libriProduct->DiscountPercent = (Integer) $controller->getDiscountPercent();\n $libriProduct->TaxRateCode1 = (String) $controller->getTaxRateCode1();\n $libriProduct->NotificationType = $controller->getNotificationType();\n $libriProduct->Lib_MSNo = $controller->getLibriNotificationKey();\n $libriProduct->AvailabilityCode = $controller->getAvailabilityCode();\n $libriProduct->PublishingStatus = $controller->getPublishingStatus();\n\n return $libriProduct;\n }", "public function testGetAllProducts()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(2, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n $this->assertNull($product->parent_product_srl);\n\n\t\t\tif($product->isConfigurable())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\t\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t\t{\n\t\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($product->isSimple())\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\t}", "function get_product( $the_product = false, $args = array() ) {\n\tglobal $carton;\n\treturn $carton->product_factory->get_product( $the_product, $args );\n}", "public function testGetProductsUsingPOST()\n {\n }", "public function createProduct($data) {\r\n //get authorisation from headers\r\n $headers = getallheaders();\r\n $auth = $headers[\"Authorization\"];\r\n\r\n //check authorization\r\n $role = $this->authenticate($auth);\r\n if ($role !== 'trader') {\r\n throw new RestException(401, \"Unauthorized\");\r\n }\r\n $product = new Product();\r\n if (isset($data->productkey)) {\r\n $product->productkey = $data->productkey;\r\n } else {\r\n throw new RestException(400, \"product key not supplied\");\r\n }\r\n if (isset($data->description)) {\r\n $product->description = $data->description;\r\n } else {\r\n throw new RestException(400, \"description not supplied\");\r\n }\r\n $product->price = isset($data->price) ? $data->price : NULL;\r\n $product->misc = isset($data->misc) ? $data->misc : NULL;\r\n $product->traderid = $this->getTraderID($auth);\r\n\r\n if ($product->save()) {\r\n return $product;\r\n } else {\r\n throw new RestException(400, \"Unknown error - cannot create product\");\r\n }\r\n }", "public function testStore()\n {\n $cart = $this -> fakeUser -> carts() -> create();\n $product = Product::create([\n 'title' => 'test',\n 'content' => 'try',\n 'price' => 30,\n 'quantity' => 10\n ]);\n //ˇˇˇ結構 ˇˇˇ method, route, data\n $response = $this->call(\n 'POST',\n 'cart-items',\n ['cart_id' => $cart -> id,'product_id' => $product->id, 'quantity' => 3]\n );\n $response -> assertOk();\n\n }", "private function generateStock()\n {\n $user = factory(App\\User::class)->create();\n\n /*\n * Arôme vanille crème brûlée\n * Café amer\n * Cappuccino\n * Caprice de caramel\n * Délice de fruits des îles\n * Douceur de cacao\n * Mix fraise franboise\n * Noir de cacao\n * Crème de champignons\n * Jardinière de légumes\n * Mouliné de légumes\n * Suprême de crustacés\n * Tomate provençale\n * Velouté d'aperges\n * Arôme pomme vanille\n * Café\n * Fruits exotiques\n * Mix orange grenade\n * Pamplemousse rose\n * Thé au citron\n * Caramel noisette\n * Noix de coco citron\n * Idée délice chocolat\n */\n $quantities = [2, 0, 0, 1, 3, 2, 0, 0, 1, 1, 1, 2, 0, 0, 1, 3, 2, 0, 0, 1, 1, 1, 0];\n\n foreach (\\App\\Product::orderBy('id')->get() as $product) {\n $user->products()->attach($product->id, [\n 'optimal_quantity' => 2,\n 'quantity' => $quantities[$product->id - 1],\n ]);\n }\n\n return $user->products;\n }", "public function testProductHasMealVoucher()\n {\n $foundProduct = new ProductEntity();\n $foundProduct->setId('ID-123');\n $foundProduct->setCustomFields([\n 'mollie_payments_product_voucher_type' => VoucherType::TYPE_MEAL,\n ]);\n\n # build a repo that would return nothing...just in case ;)\n $fakeRepoProducts = new FakeProductRepository(null, $foundProduct);\n\n $item = $this->buildProductLineItem('10001');\n\n $vouchers = new VoucherService($fakeRepoProducts, new NullLogger());\n $voucherType = $vouchers->getFinalVoucherType($item, $this->salesChannelContext);\n\n $this->assertEquals(VoucherType::TYPE_MEAL, $voucherType);\n }", "public function testCheckProduct()\n {\n $response = $this->get('product');\n\n $response->assertStatus(200);\n }", "protected function _prepareProductForResponse(Mage_Catalog_Model_Product $product) {\n $websiteId = ( int ) $this->getRequest ()->getParam ( static::WEBSITE_ID );\n if ($websiteId <= 0) {\n $websiteId = Mage::app ()->getWebsite ( 'base' )->getId ();\n }\n // get store id from request\n $storeId = ( int ) $this->getRequest ()->getParam ( static::STORE_ID );\n if ($storeId <= 0) {\n $storeId = Mage::app ()->getWebsite ( $websiteId )->getDefaultGroup ()->getDefaultStoreId ();\n }\n // get customer id from request\n $customerId = ( int ) $this->getRequest ()->getParam ( 'customer_id' );\n // get image size for resize\n $imageSize = ( int ) $this->getRequest ()->getParam ( 'image_size' );\n \n /**\n *\n * @var $productHelper Mage_Catalog_Helper_Product\n */\n $productHelper = Mage::helper ( static::CAT_PRO );\n \n $productData [static::ENTITYID] = $product->getEntity_id ();\n $productData [static::NAME] = $product->getName ();\n $productData ['type_id'] = $product->getTypeId ();\n $product->setWebsiteId ( $websiteId );\n // customer group is required in product for correct prices calculation\n $product->setCustomerGroupId ( $this->_getCustomerGroupId () );\n // calculate prices\n $finalPrice = $product->getFinalPrice ();\n if ($product->getTypeId () == 'grouped') {\n $productData ['regular_price_with_tax'] = number_format ( $product->getMinimalPrice (), 2, '.', '' );\n $productData ['final_price_with_tax'] = number_format ( $product->getMinimalPrice (), 2, '.', '' );\n } else {\n $productData ['regular_price_with_tax'] = number_format ( $this->_applyTaxToPrice ( $product->getPrice (), true ), 2, '.', '' );\n $productData ['regular_price_without_tax'] = number_format ( $this->_applyTaxToPrice ( $product->getPrice (), false ), 2, '.', '' );\n $productData ['final_price_with_tax'] = number_format ( $this->_applyTaxToPrice ( $finalPrice, true ), 2, '.', '' );\n $productData ['final_price_without_tax'] = number_format ( $this->_applyTaxToPrice ( $finalPrice, false ), 2, '.', '' );\n }\n // get product stock details\n $stockDetail = Mage::getModel ( static::LOGIN_TOKEN )->getStockDetail ( $product );\n $productData [static::IS_SALEABLE] = $stockDetail [static::IS_SALEABLE];\n $productData [static::ISSTOCK] = $stockDetail ['is_stock'];\n // get product image\n if ($imageSize <= 0) {\n $productData [static::IMGURL] = ( string ) Mage::helper ( static::CATIMG )->init ( $product, static::SMALLIMG );\n } else {\n $productData [static::IMGURL] = ( string ) Mage::helper ( static::CATIMG )->init ( $product, static::SMALLIMG )->constrainOnly ( TRUE )->keepAspectRatio ( TRUE )->keepFrame ( FALSE )->resize ( $imageSize, null );\n }\n // get rating\n $productData ['summary_rating'] = Mage::getModel ( static::LOGIN_TOKEN )->rateSummary ( $product->getId (), $storeId ) ? Mage::getModel ( static::LOGIN_TOKEN )->rateSummary ( $product->getId (), $storeId ) : '0';\n // get wishlisted products by customer\n $wishListIds = array ();\n if ($customerId > 0) {\n $wishListIds = Mage::getModel ( static::LOGIN_TOKEN )->getWishlistByCustomer ( $customerId );\n }\n // Check to see the product is in wishlist\n if (in_array ( $product->getId (), $wishListIds )) {\n $productData [static::ISWISHLIST] = true;\n } else {\n $productData [static::ISWISHLIST] = false;\n }\n // get product stock details\n $inventoryDetail = Mage::getModel ( static::LOGIN_FUNCTIONS )->getinventoryDetail ( $product, $storeId );\n // get stock qty\n $productData [static::STOCK_QTY] = $inventoryDetail [static::STOCK_QTY];\n $productData [static::MIN_SALE_QTY] = $inventoryDetail [static::MIN_SALE_QTY];\n $productData [static::MAX_SALE_QTY] = $inventoryDetail [static::MAX_SALE_QTY];\n $productData [static::QTY_INCR] = $inventoryDetail [static::QTY_INCR];\n $productData [static::IS_QTY_DECIMAL] = $inventoryDetail [static::IS_QTY_DECIMAL];\n \n if ($this->getActionType () == static::ACTION_TYPE_ENTITY) {\n // define URLs\n $productData ['url'] = $productHelper->getProductUrl ( $product->getId () );\n if ($imageSize <= 0) {\n $productData [static::IMGURL] = ( string ) Mage::helper ( static::CATIMG )->init ( $product, 'image' );\n } else {\n $productData [static::IMGURL] = ( string ) Mage::helper ( static::CATIMG )->init ( $product, 'image' )->constrainOnly ( TRUE )->keepAspectRatio ( TRUE )->keepFrame ( FALSE )->resize ( $imageSize, null );\n }\n \n // @var $cartHelper Mage_Checkout_Helper_Cart\n $cartHelper = Mage::helper ( 'checkout/cart' );\n $productData ['buy_now_url'] = $cartHelper->getAddUrl ( $product );\n \n /**\n *\n * @var $reviewModel Mage_Review_Model_Review\n */\n $reviewModel = Mage::getModel ( 'review/review' );\n $productData ['total_reviews_count'] = $reviewModel->getTotalReviews ( $product->getId (), true, $storeId );\n $productData [static::TIERPRICE] = number_format ( $this->_getTierPrices (), 2, '.', '' );\n // get product has custom options or not\n $productData ['has_custom_options'] = count ( $product->getOptions () ) > 0;\n } else {\n // remove tier price from response\n $product->unsetData ( static::TIERPRICE );\n unset ( $productData [static::TIERPRICE] );\n }\n return $productData;\n }", "public function testRetrieveTheProductList(): void\n {\n $response = $this->request('GET', '/api/products');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(10, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('name', $json[$key]);\n $this->assertArrayHasKey('description', $json[$key]);\n $this->assertArrayHasKey('price', $json[$key]);\n $this->assertArrayHasKey('priceWithTax', $json[$key]);\n $this->assertArrayHasKey('category', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['category']);\n $this->assertArrayHasKey('name', $json[$key]['category']);\n $this->assertArrayHasKey('tax', $json[$key]);\n $this->assertArrayHasKey('id', $json[$key]['tax']);\n $this->assertArrayHasKey('name', $json[$key]['tax']);\n $this->assertArrayHasKey('value', $json[$key]['tax']);\n $this->assertArrayHasKey('images', $json[$key]);\n foreach ($json[$key]['images'] as $image) {\n $this->assertArrayHasKey('id', $image);\n $this->assertArrayHasKey('fileName', $image);\n $this->assertArrayHasKey('mimeType', $image);\n }\n $this->assertArrayHasKey('updatedAt', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]);\n } \n }", "public function prepare(User $customer, Product $product, User $seller, Order $draftOrder): OrderProduct;" ]
[ "0.72306854", "0.7151779", "0.6959459", "0.6777078", "0.6727734", "0.6713494", "0.66957635", "0.6599329", "0.6547196", "0.648236", "0.64207035", "0.6392028", "0.6365746", "0.6347231", "0.62924725", "0.6171232", "0.61645776", "0.6159639", "0.61459064", "0.6077128", "0.6076915", "0.6055326", "0.60542315", "0.604702", "0.60362506", "0.60340273", "0.6030878", "0.6025753", "0.6024892", "0.60015166", "0.59946287", "0.5963723", "0.59371674", "0.5931261", "0.5919624", "0.59155905", "0.5915549", "0.5908504", "0.5896878", "0.5892876", "0.58919287", "0.5874657", "0.5845693", "0.5843502", "0.5834493", "0.5832772", "0.5825042", "0.58166057", "0.58118933", "0.5809687", "0.58049566", "0.5800653", "0.5800653", "0.5800653", "0.57927006", "0.57851034", "0.5776506", "0.57616466", "0.5759187", "0.575628", "0.57419014", "0.571539", "0.5707521", "0.57054543", "0.5692316", "0.56837296", "0.5679274", "0.5674658", "0.56738156", "0.5667685", "0.5662279", "0.5660657", "0.56553525", "0.56522745", "0.5650411", "0.5640123", "0.56312627", "0.56286824", "0.5626848", "0.5625588", "0.5622038", "0.5615229", "0.5614354", "0.5608173", "0.56058556", "0.5591164", "0.5587902", "0.55877095", "0.5585579", "0.5584069", "0.5581524", "0.5576994", "0.5576497", "0.5571357", "0.556569", "0.55460924", "0.55431145", "0.55412626", "0.5539961", "0.5538334" ]
0.66215503
7
Copy existing Annotation Urls from old to new product, since they are usually not included in the catalog update.
private static function copyAnnotationUrls($existing_product, $new_product) { foreach(["AntCbildUrl","AntAbildUrl","AntRueckUrl"] as $ant) { if(isset($existing_product->$ant) && !property_exists($new_product,$ant)) { $new_product->$ant = $existing_product->$ant; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function mapMagentoAttributes(ProductInterface $newProduct)\n {\n try {\n $originalProduct = $this->baseMagentoProductRepository->get($newProduct->getSku());\n $newProduct->setMediaGalleryEntries($originalProduct->getMediaGalleryEntries());\n } catch (NoSuchEntityException $e) {\n $this->logger->debug('We tried to copy attribute data from the existing product in Magento,\n but the product could not be found.',\n ['Product SKU' => $newProduct->getSku()]\n );\n }\n }", "private function renameOldAttributes()\n {\n if ($this->mageVersion < '2.2.5') {\n $attributes = $this->attrNames;\n foreach ($attributes as $key => $attr) {\n $isExist = $this->eavConfig->getAttribute('catalog_product', 'wwe_'.$attr.'')->getAttributeId();\n if ($isExist != null) {\n $updateSql = \"UPDATE \".$this->tableNames['eav_attribute'].\" \"\n . \"SET attribute_code = 'en_\".$attr.\"', is_required = 0 \"\n . \"WHERE attribute_code = 'wwe_\".$attr.\"'\";\n $this->connection->query($updateSql);\n }\n }\n }\n }", "protected function _getProductEnterpriseUrlRewrites(Mage_Catalog_Model_Product $product)\n {\n $requestPath = $this->_connection->getIfNullSql('url_rewrite.request_path', 'default_ur.request_path');\n $targetPath = $this->_connection->getIfNullSql('url_rewrite.target_path', 'default_ur.target_path');\n\n $select = $this->_connection->select()\n ->from(array('e' => $this->_resource->getTableName('catalog/product')),\n array('product_id' => 'entity_id')\n )\n ->where('e.entity_id = ?', $product->getId())\n ->joinLeft(array('url_rewrite_product' => $this->_resource->getTableName('enterprise_catalog/product')),\n 'url_rewrite_product.product_id = e.entity_id',\n array(''))\n ->joinLeft(array('url_rewrite' => $this->_resource->getTableName('enterprise_urlrewrite/url_rewrite')),\n 'url_rewrite_product.url_rewrite_id = url_rewrite.url_rewrite_id AND url_rewrite.is_system = 1',\n array(''))\n ->joinLeft(array('default_urp' => $this->_resource->getTableName('enterprise_catalog/product')),\n 'default_urp.product_id = e.entity_id AND default_urp.store_id = 0',\n array(''))\n ->joinLeft(array('default_ur' => $this->_resource->getTableName('enterprise_urlrewrite/url_rewrite')),\n 'default_ur.url_rewrite_id = default_urp.url_rewrite_id',\n array('request_path' => $requestPath, 'target_path' => $targetPath, 'store_id')\n );\n\n $rewrites = array();\n foreach ($this->_connection->fetchAll($select) as $row) {\n $rewrites[] = $this->_fixRequestPathSuffix($row);\n }\n\n return $rewrites;\n }", "function emr_normalize_file_urls( $old, $new ) {\n\t$result = array();\n\n\tif ( empty( $new['guid'] ) ) {\n\t\treturn $result;\n\t}\n\n\t$guid = $new['guid'];\n\n\tforeach ( $old as $key => $value ) {\n\t\t$result[ $key ] = empty( $new[ $key ] ) ? $guid : $new[ $key ];\n\t}\n\n\treturn $result;\n}", "function upgrade_old_slugs()\n {\n }", "private function updateAttachmentUrls(string $sourceUrl, string $destinationUrl)\n {\n $tables = [\n $this->wpdb->comments => [\n 'comment_content',\n ],\n $this->wpdb->posts => [\n 'guid',\n 'post_content',\n 'post_content_filtered',\n 'post_excerpt',\n ],\n $this->wpdb->term_taxonomy => [\n 'description',\n ],\n ];\n\n foreach ($tables as $table => $columns) {\n $this->tableStringReplacer->replace($table, $columns, $sourceUrl, $destinationUrl);\n }\n }", "protected function saveMappingsSourceUris(): void\n {\n $columns = [\n 'source',\n 'items',\n 'uri',\n 'label',\n 'type',\n 'info',\n ];\n foreach ($this->mappingsSourceUris as $name => $mapper) {\n // Prepare the list of specific headers one time in order to save\n // the fetched data and the ones from the original file.\n $extraColumns = [];\n foreach ($mapper as $rows) {\n foreach ($rows as $row) {\n $extraColumns = array_unique(array_merge($extraColumns, array_keys($row)));\n }\n }\n $extraColumns = array_flip(array_diff($extraColumns, $columns));\n unset($extraColumns['_chk']);\n $extraColumns = array_keys($extraColumns);\n $this->saveMappingSourceUrisToOds($name, $mapper, $extraColumns);\n $this->saveMappingSourceUrisToHtml($name, $mapper, $extraColumns);\n }\n }", "function update( $new_instance, $old_instance ) {\n\t\n\t\t$instance['brand_logo_url'] = strip_tags( $new_instance['brand_logo_url'] );\n\n\t\treturn $instance;\n\t}", "protected function _saveLinks()\n {\n $resource = $this->_linkFactory->create();\n $mainTable = $resource->getMainTable();\n $positionAttrId = [];\n $nextLinkId = $this->_resourceHelper->getNextAutoincrement($mainTable);\n\n // pre-load 'position' attributes ID for each link type once\n foreach ($this->_linkNameToId as $linkName => $linkId) {\n $select = $this->_connection->select()->from(\n $resource->getTable('catalog_product_link_attribute'),\n ['id' => 'product_link_attribute_id']\n )->where(\n 'link_type_id = :link_id AND product_link_attribute_code = :position'\n );\n $bind = [':link_id' => $linkId, ':position' => 'position'];\n $positionAttrId[$linkId] = $this->_connection->fetchOne($select, $bind);\n }\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $productIds = [];\n $linkRows = [];\n $positionRows = [];\n\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n\n $sku = $rowData[self::COL_SKU];\n\n $productId = $this->skuProcessor->getNewSku($sku)[$this->getProductEntityLinkField()];\n $productLinkKeys = [];\n $select = $this->_connection->select()->from(\n $resource->getTable('catalog_product_link'),\n ['id' => 'link_id', 'linked_id' => 'linked_product_id', 'link_type_id' => 'link_type_id']\n )->where(\n 'product_id = :product_id'\n );\n $bind = [':product_id' => $productId];\n foreach ($this->_connection->fetchAll($select, $bind) as $linkData) {\n $linkKey = \"{$productId}-{$linkData['linked_id']}-{$linkData['link_type_id']}\";\n $productLinkKeys[$linkKey] = $linkData['id'];\n }\n foreach ($this->_linkNameToId as $linkName => $linkId) {\n $productIds[] = $productId;\n if (isset($rowData[$linkName . 'sku'])) {\n $linkSkus = explode($this->getMultipleValueSeparator(), $rowData[$linkName . 'sku']);\n $linkPositions = !empty($rowData[$linkName . 'position'])\n ? explode($this->getMultipleValueSeparator(), $rowData[$linkName . 'position'])\n : [];\n foreach ($linkSkus as $linkedKey => $linkedSku) {\n $linkedSku = trim($linkedSku);\n if (($this->skuProcessor->getNewSku($linkedSku) !== null || $this->isSkuExist($linkedSku))\n && strcasecmp($linkedSku, $sku) !== 0\n ) {\n $newSku = $this->skuProcessor->getNewSku($linkedSku);\n if (!empty($newSku)) {\n $linkedId = $newSku['entity_id'];\n } else {\n $linkedId = $this->getExistingSku($linkedSku)['entity_id'];\n }\n\n if ($linkedId == null) {\n // Import file links to a SKU which is skipped for some reason,\n // which leads to a \"NULL\"\n // link causing fatal errors.\n $this->_logger->critical(\n new \\Exception(\n sprintf(\n 'WARNING: Orphaned link skipped: From SKU %s (ID %d) to SKU %s, ' .\n 'Link type id: %d',\n $sku,\n $productId,\n $linkedSku,\n $linkId\n )\n )\n );\n continue;\n }\n\n $linkKey = \"{$productId}-{$linkedId}-{$linkId}\";\n if (empty($productLinkKeys[$linkKey])) {\n $productLinkKeys[$linkKey] = $nextLinkId;\n }\n if (!isset($linkRows[$linkKey])) {\n $linkRows[$linkKey] = [\n 'link_id' => $productLinkKeys[$linkKey],\n 'product_id' => $productId,\n 'linked_product_id' => $linkedId,\n 'link_type_id' => $linkId,\n ];\n }\n if (!empty($linkPositions[$linkedKey])) {\n $positionRows[] = [\n 'link_id' => $productLinkKeys[$linkKey],\n 'product_link_attribute_id' => $positionAttrId[$linkId],\n 'value' => $linkPositions[$linkedKey],\n ];\n }\n $nextLinkId++;\n }\n }\n }\n }\n }\n if (Import::BEHAVIOR_APPEND != $this->getBehavior() && $productIds) {\n $this->_connection->delete(\n $mainTable,\n $this->_connection->quoteInto('product_id IN (?)', array_unique($productIds))\n );\n }\n if ($linkRows) {\n $this->_connection->insertOnDuplicate($mainTable, $linkRows, ['link_id']);\n }\n if ($positionRows) {\n // process linked product positions\n $this->_connection->insertOnDuplicate(\n $resource->getAttributeTypeTable('int'),\n $positionRows,\n ['value']\n );\n }\n }\n return $this;\n }", "public function rewritePermalinks($old_options, $new_options)\n {\n if (isset($old_options['features']['Sitemaps']) && !isset($new_options['features']['Sitemaps'])) {\n // Disabled\n add_filter('rewrite_rules_array', function ($rules)\n {\n unset($rules['sitemap\\.xml$']);\n unset($rules['sitemap-([^/]+?)-?([0-9]+)?\\.xml$']);\n\n return $rules;\n });\n flush_rewrite_rules();\n }\n if (!isset($old_options['features']['Sitemaps']) && isset($new_options['features']['Sitemaps'])) {\n // Enabled\n add_rewrite_rule('sitemap\\.xml$', 'index.php?buzz_sitemap=1', 'top');\n add_rewrite_rule('sitemap-([^/]+?)-?([0-9]+)?\\.xml$', 'index.php?buzz_sitemap=$matches[1]&buzz_sitemap_page=$matches[2]', 'top');\n flush_rewrite_rules();\n }\n }", "private function generateChangedProductUrls(\n MergeDataProvider $mergeDataProvider,\n Category $category,\n int $storeId,\n bool $saveRewriteHistory\n ) {\n $this->isSkippedProduct[$category->getEntityId()] = $category->getAffectedProductIds();\n\n $categoryStoreIds = [$storeId];\n // If category is changed in the Global scope when need to regenerate product URL rewrites for all other scopes.\n if ($this->productScopeRewriteGenerator->isGlobalScope($storeId)) {\n $categoryStoreIds = $this->getCategoryStoreIds($category);\n }\n\n foreach ($categoryStoreIds as $categoryStoreId) {\n /* @var Collection $collection */\n $collection = $this->productCollectionFactory->create()\n ->setStoreId($categoryStoreId)\n ->addIdFilter($category->getAffectedProductIds())\n ->addAttributeToSelect('visibility')\n ->addAttributeToSelect('name')\n ->addAttributeToSelect('url_key')\n ->addAttributeToSelect('url_path');\n\n $collection->setPageSize(1000);\n $pageCount = $collection->getLastPageNumber();\n $currentPage = 1;\n while ($currentPage <= $pageCount) {\n $collection->setCurPage($currentPage);\n foreach ($collection as $product) {\n $product->setData('save_rewrites_history', $saveRewriteHistory);\n $product->setStoreId($categoryStoreId);\n $mergeDataProvider->merge(\n $this->productUrlRewriteGenerator->generate($product, $category->getEntityId())\n );\n }\n $collection->clear();\n $currentPage++;\n }\n }\n }", "abstract public function get_url_update();", "public function testInsertProductAttribute()\n\t{\n\t\t$repository = new ProductRepository();\n\t\t$product = $repository->getProduct(1);\n\n\t\t// Update a global attribute, just to check that update works\n\t\t// Global = applies to all categories\n\t\t$product->attributes[self::ATTRIBUTE_URL] = \"some-slug\";\n\t\t$repository->updateProduct($product);\n\n\t\t$new_product = $repository->getProduct(1);\n\n\t\t$this->assertEquals(1, count($new_product->attributes));\n\t\t$this->assertEquals(\"some-slug\", $new_product->attributes[self::ATTRIBUTE_URL]);\n\t}", "protected function applyUrl()\n\t{\n\t\t// CSS\n\t\t$nodes = $this->dom->getElementsByTagName('link');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t\t// JS\n\t\t$nodes = $this->dom->getElementsByTagName('script');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Image\n\t\t$nodes = $this->dom->getElementsByTagName('img');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Anchor\n\t\t$nodes = $this->dom->getElementsByTagName('a');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->base_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t}", "function call_logs_migration_tables_to_replace_old_links($tables)\n{\n $tables[] = [\n 'table' => db_prefix() . 'call_logs',\n 'field' => 'description',\n ];\n\n return $tables;\n}", "function setDestinationUrl ($newDestinationUrl) {\n // this by deleting and then re-creating the ad\n // update the google servers\n $soapClients = &APIlityClients::getClients();\n $someSoapClient = $soapClients->getAdClient();\n // then recreate it with the new destination url set\n $soapParameters = \"<addAds>\n <ads>\n <adGroupId>\".$this->getBelongsToAdGroupId().\"</adGroupId>\n <headline>\".utf8_decode($this->getHeadline()).\"</headline>\n <description1>\".utf8_decode($this->getDescription1()).\"</description1>\n <description2>\".utf8_decode($this->getDescription2()).\"</description2>\n <displayUrl>\".$this->getDisplayUrl().\"</displayUrl>\n <destinationUrl>\".$newDestinationUrl.\"</destinationUrl>\n <status>\".$this->getStatus().\"</status>\n <adType>TextAd</adType>\n </ads>\n </addAds>\";\n // add the ad to the google servers\n $someAd = $someSoapClient->call(\"addAds\", $soapParameters);\n $soapClients->updateSoapRelatedData(extractSoapHeaderInfo($someSoapClient->getHeaders()));\n if ($someSoapClient->fault) {\n pushFault($someSoapClient, $_SERVER['PHP_SELF'].\":setDestinationUrl()\", $soapParameters);\n return false;\n }\n // first delete the current ad\n $soapParameters = \"<updateAds>\n <ads>\n <adGroupId>\".$this->getBelongsToAdGroupId().\"</adGroupId>\n <id>\".$this->getId().\"</id>\n <status>Disabled</status>\n <adType>TextAd</adType>\n </ads>\n </updateAds>\";\n // delete the ad on the google servers\n $someSoapClient->call(\"updateAds\", $soapParameters);\n $soapClients->updateSoapRelatedData(extractSoapHeaderInfo($someSoapClient->getHeaders()));\n if ($someSoapClient->fault) {\n pushFault($someSoapClient, $_SERVER['PHP_SELF'].\":setDestinationUrl()\", $soapParameters);\n return false;\n }\n // update local object\n $this->destinationUrl = $someAd['addAdsReturn']['destinationUrl'];\n // changing the destination url of a ad will change its id so update local object\n $this->id = $someAd['addAdsReturn']['id'];\n return true;\n }", "public function fixRepositoryUrls() {\n\t\t$update_count = 0;\n\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'maintainer_id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\tforeach ($packages as $package) {\n\t\t\t$this->out(sprintf(\n\t\t\t\t__('Updating package id %s named %s'),\n\t\t\t\t$package['Package']['id'],\n\t\t\t\t$package['Package']['name']\n\t\t\t));\n\n\t\t\tif ($this->Package->fixRepositoryUrl($package)) $update_count++;\n\t\t}\n\n\t\t$this->out(sprintf(__('* Successfully updated %s out of %s package urls'), $update_count, count($packages)));\n\t\t$this->_stop();\n\t}", "public function automaticOldUrl($data)\n\t{\n\t\tif (substr($data['old_url'], 0, strlen('http')) != 'http')\n\t\t{\n\t\t\t$data['old_url'] = '/' . ltrim($data['old_url'], '/');\n\t\t}\n\t\treturn rtrim($data['old_url'], '/');\n\t}", "protected function cleanupCrawledUrl(Product $product)\n\t{\n\t\t$result = $this\n\t\t\t->format($product->getUrl())\n\t\t\t->result();\n\n\t\t$product->setUrl($result);\n\t}", "public function update_include_links(array $mapping)\n {\n if (count($this->get_includes()) == 0)\n {\n return;\n }\n\n $fields = static::get_html_editors();\n\n foreach ($mapping as $old_id => $new_object)\n {\n $pattern = '/core\\.php\\?go=document_downloader&amp;display=1&amp;object=' . $old_id .\n '(&amp;security_code=[^\\&]+)?&amp;application=repository/';\n\n $security_code = $new_object->calculate_security_code();\n\n $replacement_string = 'core.php?go=document_downloader&amp;display=1&amp;object=' . $new_object->get_id() .\n '&amp;security_code=' . $security_code . '&amp;application=repository';\n\n foreach ($fields as $field)\n {\n $value = $this->get_default_property($field);\n $value = preg_replace($pattern, $replacement_string, $value);\n $this->set_default_property($field, $value);\n }\n\n $this->process_additional_include_links($pattern, $replacement_string);\n }\n\n $this->update();\n }", "public function set_url_replacements($element_attribute = \\null)\n {\n }", "public function set_url_replacements($element_attribute = \\null)\n {\n }", "private function replace($old_xpath, $new_xml, $insert_ns = FALSE) {\n $hits = $this->xpath->query($old_xpath, null, false);\n if ($hits && count($hits) > 0) {\n if ($insert_ns) {\n $new_xml = XMLPatcher::insert_namespaces($new_xml, $this->namespaces);\n }\n foreach ($hits as $hit) {\n $parent = $hit->parentNode;\n //error_log('new_xml is ' . $new_xml);\n $replace = dom_import_simplexml(simplexml_load_string($new_xml));\n if ($replace !== FALSE) {\n $replace = $this->dom->importNode($replace, TRUE);\n $parent->replaceChild($replace, $hit);\n $this->changed = TRUE;\n }\n }\n }\n }", "public function saveProductRelations($product)\n {\n parent::saveProductRelations($product);\n\n $data = $product->getCustomOneLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMONE);\n }\n\n $data = $product->getCustomTwoLinkData();\n if (!is_null($data)) {\n $this->_getResource()->saveProductLinks($product, $data, self::LINK_TYPE_CUSTOMTWO);\n }\n }", "protected function importLayoutImages_processCopiedImages(){\n\t\t\n\t\t\n\t\tforeach($this->arrImportImages as $key=>$arrImage){\n\t\t\t\n\t\t\t//get image ID\n\t\t\t$imageID = $this->insertAttachmentByImage($arrImage);\n\t\t\tif(empty($imageID))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t//update image id\n\t\t\t$arrImage[\"imageid\"] = $imageID;\n\t\t\t$this->arrImportImages[$key] = $arrImage;\n\t\t}\n\t\t\n\t}", "function resetCopyInfos()\n {\n $this->dn = 'new';\n foreach ($this->plugins as &$plugin) {\n $plugin->resetCopyInfos();\n }\n unset($plugin);\n }", "function _postBuildSources() {\n foreach($this->sphinxConfig->default['sources'] as $modelName => &$source) {\n //insert database configuration\n if(isset($source['database'])) {\n $database = $source['database'];\n } else {\n $database = 'default';\n }\n $dbConfig = $this->cakeDbConfigToSphinx($this->DbConfig->{$source['database']});\n $source = Set::merge($dbConfig, $source);\n unset($source['database']);\n\n //move index\n if(isset($source['index'])) {\n $this->sphinxConfig->default['indexes'][$modelName] = $source['index'];\n unset($source['index']);\n }\n\n if(is_array($source['sql_query'])) {\n $source['sql_query']['log'] = true;\n $queryAndAttrs = $this->_getSQLQuery($modelName, $source['sql_query']);\n $source['sql_query'] = $queryAndAttrs['sql_query'];\n }\n\n if(is_array($source['attributes'])) {\n $this->getAttributes($modelName, $source['attributes']);\n }\n }\n }", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "public function rewriteEndpoints()\n {\n $this->addEndpoints();\n flush_rewrite_rules();\n }", "public function apply_config() {\n\t\tforeach ( $this->config as $dependency ) {\n\t\t\tif ( false == ( $download_link = $this->installer->get_download_link( $dependency ) ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->config[ $dependency['slug'] ]['download_link'] = $download_link;\n\t\t}\n\t}", "protected static function updatePagination(): void\n {\n (new Filesystem)->delete(resource_path('views/vendor/paginate'));\n\n (new Filesystem)->copyDirectory(__DIR__.'/ttall-stubs/resources/views/vendor/pagination', resource_path('views/vendor/pagination'));\n }", "function vip_remove_enhanced_feed_images() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}", "public static function update_1_0_1_image_url() {\n\t\tglobal $wpdb;\n\t\t$result = $wpdb->query(\n\t\t\t\"ALTER TABLE `{$wpdb->prefix}wc_postfinancecheckout_method_config` CHANGE `image` `image` VARCHAR(2047) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;\"\n\t\t);\n\t\tif ( false === $result ) {\n\t\t\tthrow new Exception( $wpdb->last_error );\n\t\t}\n\n\t\t$result = $wpdb->query(\n\t\t\t\"ALTER TABLE `{$wpdb->prefix}wc_postfinancecheckout_transaction_info` CHANGE `image` `image` VARCHAR(2047) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;\"\n\t\t);\n\t\tif ( false === $result ) {\n\t\t\tthrow new Exception( $wpdb->last_error );\n\t\t}\n\t}", "public function fixup_url_references($entry)\n\t\t{\n\t\t\t$entry->content = str_ireplace($this->_source_urls, $this->_target_urls, $entry->content);\n\t\t}", "public function catalogPostImportAfter(Varien_Event_Observer $observer)\n {\n Mage::getModel('catalog/url')->refreshRewrites();\n return $this;\n }", "function update( $new_instance, $old_instance ) {\n\t\t$instance = $old_instance;\n\n\t\t//Strip tags from title and name to remove HTML \n\t\t$instance['title'] \t\t\t\t= strip_tags( $new_instance['title'] );\n\t\t$instance['ads_img_link1'] \t\t= $new_instance['ads_img_link1'];\n\t\t$instance['ads_img_link2'] \t\t= $new_instance['ads_img_link2'];\n\t\t$instance['ads_img_link3'] \t\t= $new_instance['ads_img_link3'];\n\t\t$instance['ads_img_link4'] \t\t= $new_instance['ads_img_link4'];\n\t\t$instance['ads_img1'] \t\t\t= $new_instance['ads_img1'];\n\t\t$instance['ads_img2'] \t\t\t= $new_instance['ads_img2'];\n\t\t$instance['ads_img3'] \t\t\t= $new_instance['ads_img3'];\n\t\t$instance['ads_img4'] \t\t\t= $new_instance['ads_img4'];\n\t\n\n\t\treturn $instance;\n\t}", "public function genConfigs($old, $over, $new)\n {\n //remove the override configs from the new configs\n $diffArray = deepArrayDiff($new, $over);\n $saveArray = sugarArrayMergeRecursive($old, $diffArray);\n return $saveArray;\n }", "function copyProperties($dest, $orig) {\r\n\r\n\r\n\t}", "public function setup()\n\t{\n\t\t$this->addRule('old_url', function($data)\n\t\t{\n\t\t\t$entries = Link::blank()\n\t\t\t\t->whereEquals('old_url', substr($data['old_url'], 0, 255));\n\n\t\t\tif (isset($data['id']))\n\t\t\t{\n\t\t\t\t$entries->where('id', '!=', $data['id']);\n\t\t\t}\n\n\t\t\t$row = $entries->row();\n\n\t\t\treturn !$row->get('id') ? false : Lang::txt('COM_REDIRECT_ERROR_DUPLICATE_OLD_URL');\n\t\t});\n\t}", "function saveUrl($product, $slug) {\n\ttry {\n\t\tMage::getSingleton('catalog/product_action')->updateAttributes(\n\t\t\t[$product->getId()], \t // Products to update\n\t\t\t['url_key' => $slug], // Attributes to update\n\t\t\t0 \t\t\t\t\t\t // Store to update. 0 means global values\n\t\t);\n\t\treturn true;\n\t} catch (Exception $e) {\n\t\tif (strstr($e->getMessage(), 'Duplicate entry'))\n\t\t\treturn false;\n\t\telse\n\t\t\techo $e->getMessage();exit;\n\t}\n}", "public function generateUrl(): void\n {\n $this->load('urls');\n $createRecords = [];\n\n $existingLanguages = $this->urls->keyBy('language');\n\n foreach (config('unique-urls.languages') as $locale => $lang) {\n $uniqueUrl = Url::makeSlug($this->urlStrategy($lang, $locale), $this);\n $newUrl = $this->urlHandler();\n\n $this->handleExistingUrl($existingLanguages, $lang, $uniqueUrl);\n\n if (! $existingLanguages->has($lang)) {\n $newUrl['language'] = $lang;\n $newUrl['slug'] = $uniqueUrl;\n $createRecords[] = $newUrl;\n }\n }\n\n if (count($createRecords)) {\n $this->urls()->createMany($createRecords);\n }\n }", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "function add_catalog_url( $args ) {\n\t\t$args['section_urls']['wc_catalog_designer'] = get_permalink( wc_get_page_id( 'shop' ) );\n\n\t\treturn $args;\n\t}", "private function mapNewMagentoProduct(ProductInterface $magentoProduct, SkyLinkProduct $skyLinkProduct)\n {\n // Set the attribute set according to what is mapped for the given product type\n $magentoProduct->setAttributeSetId(\n $this\n ->attributeSetRepository\n ->getAttributeSetForProductType($skyLinkProduct->getProductType())->getId()\n );\n\n $magentoProduct->unsetData('skylink_product_id');\n $magentoProduct->setCustomAttribute('skylink_product_id', (string) $skyLinkProduct->getId());\n }", "function update( $new_instance, $old_instance ) {\n\t\t$new_instance['rss_link'] = ( empty( $new_instance['rss_link'] ) ) ? 'no' : 'yes';\n return $new_instance;\n }", "public function duplicate($attributeId, $newFiles, $originalProductId, $newProductId)\n {\n $linkField = $this->metadata->getLinkField();\n\n $select = $this->getConnection()->select()->from(\n [$this->getMainTableAlias() => $this->getMainTable()],\n ['value_id', 'value']\n )->joinInner(\n ['entity' => $this->getTable(self::GALLERY_VALUE_TO_ENTITY_TABLE)],\n $this->getMainTableAlias() . '.value_id = entity.value_id',\n [$linkField]\n )->where(\n 'attribute_id = ?',\n $attributeId\n )->where(\n 'entity.' . $linkField . ' = ?',\n $originalProductId\n );\n\n $valueIdMap = [];\n\n // Duplicate main entries of gallery\n foreach ($this->getConnection()->fetchAll($select) as $row) {\n $data = [\n 'attribute_id' => $attributeId,\n 'value' => isset($newFiles[$row['value_id']]) ? $newFiles[$row['value_id']] : $row['value'],\n ];\n\n $valueIdMap[$row['value_id']] = $this->insertGallery($data);\n $this->bindValueToEntity($valueIdMap[$row['value_id']], $newProductId);\n }\n\n if (count($valueIdMap) == 0) {\n return [];\n }\n\n // Duplicate per store gallery values\n $select = $this->getConnection()->select()->from(\n $this->getTable(self::GALLERY_VALUE_TABLE)\n )->where(\n 'value_id IN(?)',\n array_keys($valueIdMap)\n );\n\n foreach ($this->getConnection()->fetchAll($select) as $row) {\n unset($row['record_id']);\n\n $row[$linkField] = $newProductId;\n $row['value_id'] = $valueIdMap[$row['value_id']];\n\n $this->insertGalleryValueInStore($row);\n }\n\n return $valueIdMap;\n }", "private function updateAttributeImages($psImageIds)\n {\n //====================================================================//\n // Not in Combination Mode => Skip\n if (!$this->AttributeId) {\n return;\n }\n //====================================================================//\n // Compute Current Images Array\n $current = array();\n $currentImages = $this->Attribute->getWsImages();\n if (is_array($currentImages)) {\n foreach ($currentImages as $value) {\n $current[] = (int) $value['id'];\n }\n }\n //====================================================================//\n // Compare & Update Images Array\n if ($current != $psImageIds) {\n $this->attrImageIds = $psImageIds;\n $this->Attribute->setImages($psImageIds);\n $this->needUpdate(\"Attribute\");\n }\n }", "public function saveData()\n {\n $newSku = $this->_entityModel->getNewSku();\n while ($bunch = $this->_entityModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->_entityModel->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n\n if (version_compare($this->_entityModel->getProductMetadata()->getVersion(), '2.2.0', '>=')) {\n $rowSku = strtolower($rowData[ImportProduct::COL_SKU]);\n } else {\n $rowSku = $rowData[ImportProduct::COL_SKU];\n }\n $productData = $newSku[$rowSku];\n $this->parseOptions($rowData, $productData[$this->getProductEntityLinkField()]);\n }\n if (!empty($this->cachedOptions['sample']) || !empty($this->cachedOptions['link'])) {\n $this->saveOptions();\n $this->clear();\n }\n }\n return $this;\n }", "function clone_to_category($newParentCatId)\n {\n global $application;\n\n\n /*\n If creating an object the incorrect id was passed, then\n this method will not do anything.\n */\n if ($this->_fProductIDIsIncorrect == true)\n {\n return ($this->debugmode ? 'Product ID is incorrect' : null);\n }\n\n if ($this->_fProductAttributesInfo == null)\n {\n $this->_loadProductAttributesInfo();\n }\n\n # check $newParentCatId\n\n # First create a new product in the table products\n modApiFunc('Catalog', 'insertNewProduct',\n $this->_fBaseProductInfo[0]['p_type_id'],\n $this->_fBaseProductInfo[0]['p_name']);\n $new_product_id = $application->db->DB_Insert_Id();\n\n // copy multilang product names\n $p_ml = modApiFunc('MultiLang', 'getMLTableData', 'Catalog', 'products', $this->_fBaseProductInfo[0]['p_id']);\n modApiFunc('MultiLang', 'addMLTableData', 'Catalog', 'products', $new_product_id, $p_ml);\n\n //<add_link>\n modApiFunc('Catalog','addProductLinkToCategory',$new_product_id,$newParentCatId);\n //</add_link>\n\n # Copies all the current product attributes\n # to the created product\n foreach ($this->_fProductAttributesInfo as $attribute)\n {\n // - , $this->_fProductAttributesInfo\n // , ,\n // product_attributes.\n if ($attribute['pa_id'] === null)\n {\n continue;\n }\n\n modApiFunc('Catalog', 'insertNewProductAttribute', $new_product_id, $attribute['a_id'], $attribute['pa_value']);\n $new_pa_id = $application->db->DB_Insert_Id();\n\n // copy multilang attribute values\n $pa_ml = modApiFunc('MultiLang', 'getMLTableData', 'Catalog', 'product_attributes', $attribute['pa_id']);\n modApiFunc('MultiLang', 'addMLTableData', 'Catalog', 'product_attributes', $new_pa_id, $pa_ml);\n\n // if it is an image, save it to the separate table\n if (strtoupper($attribute['a_input_type_name']) == 'IMAGE')\n {\n if ($attribute['image_name'] &&\n is_readable($application->getAppIni('PATH_IMAGES_DIR').$attribute['image_name']))\n {\n # a temporary image name\n $source_name = $attribute['image_name'];\n $clone_name = basename($application->getUploadImageName($source_name));\n # copy the current imge to the temporary file\n $cr = copy($application->_img_path($source_name), $application->_img_path($clone_name));\n\n # Clone the image (and delete a temporary one)\n $image_info = $application->saveUploadImage(\"\", $clone_name);\n\n # create image info\n modApiFunc('Catalog', 'insertNewProductImage', $new_pa_id, $image_info['name'], $image_info['width'], $image_info['height']);\n }\n }\n }\n modApiFunc('EventsManager','throwEvent','ProductCloned', array('pid'=>$this->_fProductID, 'new_pid'=>$new_product_id, 'cid'=>$newParentCatId));\n return $new_product_id;\n }", "protected function auditCreatedAttributes(array &$old, array &$new)\n {\n foreach ($this->attributes as $attribute => $value) {\n if ($this->isAttributeAuditable($attribute)) {\n $new[$attribute] = $value;\n }\n }\n\n if ($this->shouldDynamicTableExist()) {\n foreach ($this->properties->getAttributes() as $attribute => $value) {\n if (! in_array($attribute, $this->auditableExclusions)) {\n $new[$this->type->identifier][$attribute] = $value;\n }\n }\n }\n }", "protected function _importAttributes()\r\n {\r\n $fileName = $_FILES['import_attribute_file']['tmp_name'];\r\n $csvObject = new Varien_File_Csv();\r\n $csvProducts = $csvObject->getData($fileName);\r\n $header = $csvProducts[0];\r\n unset($csvProducts[0]);\r\n if (!$this->_getHelper()->isValidAttributeList($header)) {\r\n Mage::getSingleton('adminhtml/session')->addError($this->_getHelper()->__('Invalid Attribute code in the file.'));\r\n return false;\r\n }\r\n $englishStoreIdsToUpdate = explode(',', Mage::getStoreConfig('products_updator/products_attribute_updator/english_stores_to_update'));\r\n $arabicStoreIdsToUpdate = explode(',', Mage::getStoreConfig('products_updator/products_attribute_updator/arabic_stores_to_update'));\r\n // if sku present as key then in this case replace all skus with corresponding entity_id\r\n if ($header[0] == 'sku') {\r\n $productSkus = array();\r\n $key = 0;\r\n $productSkus = array_map(function ($item) use ($key) {\r\n return $item[$key];\r\n }, $csvProducts);\r\n $this->setProductCollection('sku', $productSkus);\r\n foreach($csvProducts as $key=>$csvProduct){\r\n $updated = 1;\r\n foreach ($this->getProductCollection() as $product) {\r\n if ($product->getSku() != $csvProduct[0]) continue;\r\n $csvProducts[$key][0] = (integer)$product->getId();\r\n $updated = 2;break;\r\n }\r\n // remove those entries having wrong sku in the file\r\n if($updated==1){\r\n unset($csvProducts[$key]);\r\n }\r\n }\r\n } else {\r\n $productIds = array();\r\n $key = 0;\r\n $productIds = array_map(function ($item) use ($key) {\r\n return $item[$key];\r\n }, $csvProducts);\r\n $this->setProductCollection('entity_id', $productIds);\r\n // remove those entries having wrong ids in the file\r\n foreach($csvProducts as $key=>$csvProduct){\r\n $updated = 1;\r\n foreach ($this->getProductCollection() as $product) {\r\n if ($product->getId() != $csvProduct[0]) continue;\r\n $updated = 2;break;\r\n }\r\n // remove those entries having wrong sku\r\n if($updated==1){\r\n unset($csvProducts[$key]);\r\n }\r\n }\r\n }\r\n $productActionModel = Mage::getSingleton('catalog/product_action');\r\n foreach ($csvProducts as $csvProduct) {\r\n //for admin\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array($header[1] => $csvProduct[1]), Mage_Core_Model_App::ADMIN_STORE_ID);\r\n\r\n // No need update in eng store as it will use the same as default\r\n // Note: I Leave this code intentionally for future use\r\n /*foreach($englishStoreIdsToUpdate as $id) {\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array($header[1] => $csvProduct[1]), (integer)$id);\r\n }*/\r\n\r\n // update in arabic store\r\n foreach ($arabicStoreIdsToUpdate as $id) {\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array($header[1] => $csvProduct[2]), (integer)$id);\r\n }\r\n // if name or manufacturer changed then in this case url also need to be changed\r\n if ($header[1] == 'name' or $header[1] == 'manufacturer') {\r\n foreach ($this->getProductCollection() as $product) {\r\n if ($product->getId() != $csvProduct[0]) continue;\r\n\r\n $seoUrl = \"buy \" . $product->getAttributeText('manufacturer') . \" \" . $csvProduct[1] . \" \";\r\n $cats = $product->getResource()->getCategoryIds($product);\r\n sort($cats);\r\n // here get the parent category ids which need to exclude from product url\r\n // also get all the child categories from above to remove\r\n $excludedCategories = explode(',', Mage::getModel('core/variable')->setStoreId(Mage::app()->getStore()->getId())->loadByCode('exclude_categories_from_product_url')->getValue('text'));\r\n $toExclude = array();\r\n foreach ($excludedCategories as $excludedCategory) {\r\n $toExclude = Mage::helper('mirasvitseo')->retrieveAllChildCategories($excludedCategory);\r\n $toExclude = Mage::helper('mirasvitseo')->getAllKeysForMultiLevelArrays($toExclude);\r\n $cats = array_diff($cats, $toExclude);\r\n }\r\n $cats = array_diff($cats, $excludedCategories);\r\n $targetedCat = array();\r\n if (count($cats) > 0) {\r\n $targetedCat[] = reset($cats);\r\n $targetedCat[] = end($cats);\r\n $categories = Mage::getResourceModel('catalog/category_collection')\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToFilter('entity_id', array('in' => $targetedCat));\r\n $seoUrl .= \"for \";\r\n foreach ($categories as $category)\r\n $seoUrl .= $category->getName() . \" \";\r\n }\r\n $seoUrl .= $product->getId() . \" \";\r\n $seoUrl = preg_replace('#[^0-9a-z]+#i', '-', Mage::helper('catalog/product_url')->format($seoUrl));\r\n $seoUrl = strtolower($seoUrl);\r\n $seoUrl = trim($seoUrl, '-');\r\n }\r\n\r\n // save url ad admin store\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array('url_key' => $seoUrl), Mage_Core_Model_App::ADMIN_STORE_ID);\r\n // url need to update on all store\r\n foreach ($englishStoreIdsToUpdate as $id) {\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array('url_key' => $seoUrl), (integer)$id);\r\n }\r\n foreach ($arabicStoreIdsToUpdate as $id) {\r\n $productActionModel->updateAttributes(array($csvProduct[0]), array('url_key' => $seoUrl), (integer)$id);\r\n }\r\n }\r\n }\r\n return true;\r\n }", "function migrate_books_build_new_image($source_repository, $destination_repository, $source_pid, $destination_dir_pid) {\n\n $source_image_object = $source_repository->getObject($source_pid);\n $new_image_object = $destination_repository->constructObject('islandora');\n $new_image_object->label = $source_image_object->label;\n foreach ($source_image_object as $dsid => $content) {\n $new_image_object->ingestDatastream($content);\n }\n $new_image_object->relationships->changeObjectID($new_image_object->id);\n $new_image_object->relationships->remove(FEDORA_RELS_EXT_URI, 'isMemberOfCollection', NULL);\n $new_image_object->relationships->add(FEDORA_RELS_EXT_URI, 'isMemberOfCollection', $destination_dir_pid);\n $ingested_object = islandora_add_object($new_image_object);\n return $ingested_object->id;\n}", "function update( $new_instance, $old_instance ) {\n\t\n\t$instance = $old_instance;\n\n\t$instance['title'] = strip_tags( $new_instance['title'] );\n\t$instance['image1'] = strip_tags( $new_instance['image1'] );\n\t$instance['image2'] = strip_tags( $new_instance['image2'] );\n\t$instance['image3'] = strip_tags( $new_instance['image3'] );\n\t$instance['image4'] = strip_tags( $new_instance['image4'] );\n\t$instance['image5'] = strip_tags( $new_instance['image5'] );\n\t\n\t$instance['link1'] = strip_tags( $new_instance['link1'] );\n\t$instance['link2'] = strip_tags( $new_instance['link2'] );\n\t$instance['link3'] = strip_tags( $new_instance['link3'] );\n\t$instance['link4'] = strip_tags( $new_instance['link4'] );\n\t$instance['link5'] = strip_tags( $new_instance['link5'] );\n\t\n\t$instance['client1'] = strip_tags( $new_instance['client1'] );\n\t$instance['client2'] = strip_tags( $new_instance['client2'] );\n\t$instance['client3'] = strip_tags( $new_instance['client3'] );\n\t$instance['client4'] = strip_tags( $new_instance['client4'] );\n\t$instance['client5'] = strip_tags( $new_instance['client5'] );\n\n\treturn $instance;\n}", "public function updateClassAliasesDataProvider()\n {\n return [\n 'plain text replace model' => include __DIR__ . '/_files/data_content_plain_model.php',\n 'plain text replace resource' => include __DIR__ . '/_files/data_content_plain_resource.php',\n 'plain text replace with pk field' => include __DIR__ . '/_files/data_content_plain_pk_fields.php',\n 'xml replace' => include __DIR__ . '/_files/data_content_xml.php',\n 'wiki markup replace' => include __DIR__ . '/_files/data_content_wiki.php',\n 'serialized php replace' => include __DIR__ . '/_files/data_content_serialized.php'\n ];\n }", "protected function setUpInstanceCoreLinks() {}", "function cleanup_theme_images($old_url)\n{\n\t$files_referenced=collapse_1d_complexity('path',$GLOBALS['SITE_DB']->query_select('theme_images',array('DISTINCT path')));\n\n\t$themes=find_all_themes();\n\tforeach (array_keys($themes) as $theme)\n\t{\n\t\t$files_existing=get_image_paths(get_custom_base_url().'/themes/'.rawurlencode($theme).'/images_custom/',get_custom_file_base().'/themes/'.$theme.'/images_custom/');\n\n\t\tforeach (array_keys($files_existing) as $path)\n\t\t{\n\t\t\t$path=str_replace(get_custom_file_base().'/','',filter_naughty($path));\n\t\t\t$encoded_path=substr($path,0,strrpos($path,'/')+1).rawurlencode(substr($path,strrpos($path,'/')+1));\n\t\t\tif ((!in_array($path,$files_referenced)) && (!in_array($encoded_path,$files_referenced)) && (($old_url==$path) || ($old_url==$encoded_path)))\n\t\t\t{\n\t\t\t\t@unlink(get_custom_file_base().'/'.$path);\n\t\t\t\tsync_file($path);\n\t\t\t}\n\t\t}\n\t}\n}", "private function updateAttributeImages(array $psImageIds)\n {\n //====================================================================//\n // Not in Combination Mode => Skip\n if (!$this->Attribute) {\n return;\n }\n //====================================================================//\n // Compute Current Images Array\n $current = array();\n $currentImages = $this->Attribute->getWsImages();\n if (is_array($currentImages)) {\n foreach ($currentImages as $value) {\n $current[] = (int) $value['id'];\n }\n }\n //====================================================================//\n // Compare & Update Images Array\n if ($current != $psImageIds) {\n $this->attrImageIds = $psImageIds;\n $this->Attribute->setImages($psImageIds);\n $this->needUpdate(\"Attribute\");\n }\n }", "public function reassignFeaturedImage()\n {\n\n }", "function update($new_instance, $old_instance) {\n $instance['user_image'] = strip_tags($new_instance['user_image']);\n $instance['url'] = esc_url($new_instance['url']);\n $instance['label'] = strip_tags($new_instance['label']);\n $instance['desc'] = strip_tags($new_instance['desc']);\n $instance['twitter_url'] = esc_url($new_instance['twitter_url']);\n $instance['facebook_url'] = esc_url($new_instance['facebook_url']);\n $instance['insta_url'] = esc_url($new_instance['insta_url']);\n $instance['pint_url'] = esc_url($new_instance['pint_url']);\n $instance['mail_url'] = esc_url($new_instance['mail_url']);\n return $instance;\n }", "public function removeUrlsFromReferences()\n {\n foreach ($this->findAll() as $doc) {\n $ref = $doc->getReference();\n if (strpos($ref, 'http://esmeree.fr')) {\n $ref = preg_replace('#'.preg_quote('http://esmeree.fr', '#').'[^\\s]+#', '', $ref);\n $doc->setReference($ref);\n }\n }\n }", "public function onAfterWrite() {\n\n\t\tparent::onAfterWrite();\n\n\t\t// Determine whether the default automated URL handling has been replaced.\n\n\t\tif(Config::inst()->get(MisdirectionRequestFilter::class, 'replace_default')) {\n\n\t\t\t// Determine whether the URL segment or parent ID has been updated.\n\n\t\t\t$changed = $this->owner->getChangedFields();\n\t\t\tif((isset($changed['URLSegment']['before']) && isset($changed['URLSegment']['after']) && ($changed['URLSegment']['before'] != $changed['URLSegment']['after'])) || (isset($changed['ParentID']['before']) && isset($changed['ParentID']['after']) && ($changed['ParentID']['before'] != $changed['ParentID']['after']))) {\n\n\t\t\t\t// The link mappings should only be created for existing pages.\n\n\t\t\t\t$URL = (isset($changed['URLSegment']['before']) ? $changed['URLSegment']['before'] : $this->owner->URLSegment);\n\t\t\t\tif(strpos($URL, 'new-') !== 0) {\n\n\t\t\t\t\t// Determine the page URL.\n\n\t\t\t\t\t$parentID = (isset($changed['ParentID']['before']) ? $changed['ParentID']['before'] : $this->owner->ParentID);\n\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parentID}\");\n\t\t\t\t\twhile($parent) {\n\t\t\t\t\t\t$URL = Controller::join_links($parent->URLSegment, $URL);\n\t\t\t\t\t\t$parent = SiteTree::get_one(SiteTree::class, \"SiteTree.ID = {$parent->ParentID}\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// Instantiate a link mapping for this page.\n\n\t\t\t\t\tsingleton(MisdirectionService::class)->createPageMapping($URL, $this->owner->ID);\n\n\t\t\t\t\t// Purge any link mappings that point back to the same page.\n\n\t\t\t\t\t$this->owner->regulateMappings(($this->owner->Link() === Director::baseURL()) ? Controller::join_links(Director::baseURL(), 'home/') : $this->owner->Link(), $this->owner->ID);\n\n\t\t\t\t\t// Recursively create link mappings for any children.\n\n\t\t\t\t\t$children = $this->owner->AllChildrenIncludingDeleted();\n\t\t\t\t\tif($children->count()) {\n\t\t\t\t\t\t$this->owner->recursiveMapping($URL, $children);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function auditUpdatedAttributes(array &$old, array &$new)\n {\n foreach ($this->getDirty() as $attribute => $value) {\n if ($this->isAttributeAuditable($attribute)) {\n $old[$attribute] = array_get($this->original, $attribute);\n $new[$attribute] = array_get($this->attributes, $attribute);\n }\n }\n\n if ($this->shouldDynamicTableExist()) {\n foreach ($this->properties->getDirty() as $attribute => $value) {\n if (! in_array($attribute, $this->auditableExclusions)) {\n $old[$this->type->identifier][$attribute] = array_get($this->properties->getOriginal(), $attribute);\n $new[$this->type->identifier][$attribute] = array_get($this->properties->getAttributes(), $attribute);\n }\n }\n }\n }", "public function checkout2duplicateAction()\n {\n $checkout_config_path = wa('shop')->getConfig()->getConfigPath('checkout2.php', true, 'shop');\n if (!file_exists($checkout_config_path) || !is_writable($checkout_config_path)) {\n echo 'unable to read or write '.$checkout_config_path;\n return false;\n }\n $checkout_config = include($checkout_config_path);\n\n $routing_config_path = wa()->getConfig()->getPath('config', 'routing');\n if (!file_exists($routing_config_path) || !is_writable($routing_config_path)) {\n echo 'unable to read or write '.$routing_config_path;\n return false;\n }\n $all_domains_routes = include($routing_config_path);\n\n $shop_checkout_config_ids = [];\n $something_changed = false;\n foreach($all_domains_routes as $domain => $domain_routes) {\n if (!is_array($domain_routes)) {\n continue;\n }\n foreach($domain_routes as $route_index => $route) {\n $app = ifset($route, 'app', null);\n $checkout_version = ifset($route, 'checkout_version', null);\n $checkout_storefront_id = ifset($route, 'checkout_storefront_id', null);\n\n if ($app != 'shop' || $checkout_version != 2 || !$checkout_storefront_id || !isset($checkout_config[$checkout_storefront_id])) {\n continue;\n }\n\n if (empty($shop_checkout_config_ids[$checkout_storefront_id])) {\n $shop_checkout_config_ids[$checkout_storefront_id] = true;\n continue;\n }\n\n $something_changed = true;\n $new_checkout_storefront_id = shopCheckoutConfig::generateStorefrontId($domain, ifset($route, 'url', ''));\n\n $checkout_config[$new_checkout_storefront_id] = $checkout_config[$checkout_storefront_id];\n $all_domains_routes[$domain][$route_index]['checkout_storefront_id'] = $new_checkout_storefront_id;\n }\n }\n\n if ($something_changed) {\n waUtils::varExportToFile($all_domains_routes, $routing_config_path);\n waUtils::varExportToFile($checkout_config, $checkout_config_path);\n echo 'done';\n } else {\n echo 'nothing changed';\n }\n\n return $something_changed;\n }", "private function updateUrl(){\n $this->url->status_code = $this->response['status_code'];\n $this->url->reason_phrase = $this->response['reason_phrase'];\n $this->url->location = $this->response['location'];\n $this->url->content_type = $this->response['content_type'];\n $this->url->content_length = $this->response['content_length'];\n $this->url->save();\n }", "function afterSave($isInsert, $changedOldAttributes) {\n\t$oldValues = array_merge($this->toArray(), $changedOldAttributes);\n\n\treturn parent::afterSave($isInsert, $changedOldAttributes);\n}", "public function updateImageNews($aImageOld, $oImageNew, $iUserId, $iShopId, $sUserName) {\n $this->load->library('link_library');\n // Lưu thông tin input\n foreach ($aImageOld as $key => $Image) {\n if($oImageNew->{$key} != '') {\n $aImageOld[$key] = $this->filter->injection_html($oImageNew->{$key});\n }\n }\n if($oImageNew->tags != '' && $aImageOld['tags'] != 'null') {\n $aImageOld['tags'] = strip_tags(json_encode($oImageNew->tags));\n }\n if($aImageOld['style_show'] != '') {\n $aImageOld['style_show'] = (array) @json_decode($aImageOld['style_show']);\n }\n if(isset($oImageNew->text_list) && !empty($oImageNew->text_list)) {\n $aImageOld['style_show']['display'] = 1;\n if(isset($aImageOld['style_show']['text_list'])) {\n $aImageOld['style_show']['text_list'] = (array) $aImageOld['style_show']['text_list'];\n }\n foreach ($oImageNew->text_list as $k => $oText) {\n if($k == 'list_text_content') {\n $aImageOld['style_show']['text_list'][$k] = (array) $oText;\n }else {\n $aImageOld['style_show']['text_list'][$k] = $oText;\n }\n }\n }\n\n if(isset($oImageNew->show) && !empty($oImageNew->show)) {\n $show = $oImageNew->show;\n\n if(isset($show->backgroud_color) && $show->backgroud_color != '') {\n $aImageOld['style_show']['background'] = $show->backgroud_color;\n }\n\n if(isset($show->backgroud_image) && $show->backgroud_image != '') {\n \n $aImageOld['style_show']['background_image'] = $show->backgroud_image;\n }\n\n if(isset($show->color_text) && $show->color_text != '') {\n $aImageOld['style_show']['color'] = $show->color_text;\n }\n\n if(isset($show->overlay_bg) && $show->overlay_bg != '') {\n $aImageOld['style_show']['overlay_bg'] = $show->overlay_bg;\n }\n\n if(isset($show->type_show) && $show->type_show != '') {\n $aImageOld['style_show']['type_show'] = $show->type_show;\n }\n }\n\n if(isset($oImageNew->imgeffect) && $oImageNew->imgeffect != '') {\n $aImageOld['style_show']['imgeffect'] = $oImageNew->imgeffect;\n }\n\n if(isset($oImageNew->texteffect) && $oImageNew->texteffect != '') {\n $aImageOld['style_show']['texteffect'] = $oImageNew->texteffect;\n }\n\n if(isset($oImageNew->audio) && $oImageNew->audio != '') {\n $aImageOld['style_show']['audio'] = $oImageNew->audio;\n }\n \n if(isset($oImageNew->icon_list) && !empty($oImageNew->icon_list)) {\n\n foreach ($oImageNew->icon_list as $k => $oIcon) {\n $aImageOld['style_show']['caption2'][$k] = array(\n 'icon' => $oIcon->icon,\n 'icon_url' => $oIcon->icon_url,\n 'position' => $oIcon->position,\n 'effect' => $oIcon->effect,\n 'title' => $oIcon->title,\n 'desc' => $oIcon->desc,\n );\n }\n $aImageOld['style_show']['caption2'] = $aImageOld['style_show']['caption2'];\n }\n\n if(isset($oImageNew->link_product) && !empty($oImageNew->link_product)) {\n $oProduct = $oImageNew->link_product;\n $aImageOld['product_id'] = $oProduct->pro_id;\n }\n \n $aImageOld['style_show'] = json_encode($aImageOld['style_show']);\n\n if($oImageNew->list_link != '') {\n $aLinkContentNew = array();\n\n foreach ($oImageNew->list_link as $iKeyLinkImg => $oLinkImg) {\n if(!property_exists($oLinkImg, 'id')){\n $aLinkContentNew[$oLinkImg->save_link] = $oLinkImg;\n }\n unset($oLinkImg);\n }\n\n if(!empty($aLinkContentNew)) {\n foreach ($aLinkContentNew as $iKeyLinkImg => $oLinkImg) {\n $link_info = $this->link_library->add_if_not_exist($oLinkImg->save_link);\n if($link_info) {\n $this->content_image_link_model->add_new([\n 'link_id' => $link_info['id'],\n 'user_id' => (int)$iUserId,\n 'sho_id' => (int)$iShopId,\n 'content_id' => $aImageOld['not_id'],\n 'content_image_id' => $aImageOld['id'],\n 'is_public' => 1,// chưa có\n 'created_at' => date('Y-m-d H:i:s'),\n ]);\n }\n }\n }\n }\n \n // Update image\n $this->images_model->update($aImageOld, 'id = ' . (int)$aImageOld['id']);\n \n }", "protected function _getProductCoreUrlRewrites(Mage_Catalog_Model_Product $product)\n {\n $select = $this->_connection->select()\n ->from($this->_resource->getTableName('core/url_rewrite'))\n ->where('product_id = ?', $product->getId());\n\n $rewrites = array();\n foreach ($this->_connection->fetchAll($select) as $row) {\n $rewrites[] = $row;\n }\n\n return $rewrites;\n }", "public function routeUrlForAutodetect2(Get $request, Html $response)\n {\n echo $response->urlFor('Products::routeUrlDestinationAutodetect');\n\n }", "protected function saveNewProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// create new product in catalog\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t \r\n\t\t\t $result = $this->client->catalogProductCreate($this->sessionid, $product->getProductType(), $product->getAttributeSet(), $product->sku, $product);\r\n\t\t\t \r\n\t\t\t\t$this->log->addInfo('created', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\t\t\r\n\t}", "function sitemap_endpoints() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n\n return null;\n}", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function replace_icon() {\r\n\t\tglobal $wpdb;\r\n\t\t$db = Maps_Marker_Pro::get_instance('MMP\\DB');\r\n\r\n\t\tif (!isset($_POST['nonce']) || wp_verify_nonce($_POST['nonce'], 'mmp-tools-replace-icon') === false) {\r\n\t\t\twp_send_json(array(\r\n\t\t\t\t'success' => false,\r\n\t\t\t\t'message' => esc_html__('Security check failed', 'mmp')\r\n\t\t\t));\r\n\t\t}\r\n\t\tif (!isset($_POST['source']) || !isset($_POST['target'])) {\r\n\t\t\twp_send_json(array(\r\n\t\t\t\t'success' => false,\r\n\t\t\t\t'message' => esc_html__('Source or target missing', 'mmp')\r\n\t\t\t));\r\n\t\t}\r\n\t\t$source = ($_POST['source'] === plugins_url('images/leaflet/marker.png', __DIR__)) ? '' : basename($_POST['source']);\r\n\t\t$target = ($_POST['target'] === plugins_url('images/leaflet/marker.png', __DIR__)) ? '' : basename($_POST['target']);\r\n\r\n\t\t$wpdb->update(\r\n\t\t\t$db->markers,\r\n\t\t\tarray('icon' => $target),\r\n\t\t\tarray('icon' => $source),\r\n\t\t\tarray('%s'),\r\n\t\t\tarray('%s')\r\n\t\t);\r\n\r\n\t\twp_send_json(array(\r\n\t\t\t'success' => true,\r\n\t\t\t'message' => esc_html__('Icon replaced successfully', 'mmp')\r\n\t\t));\r\n\t}", "public function updateAttributes(&$attributes)\n {\n $anchors = array();\n //$page = $this->owner->getForm()->getRecord();\n $page = \\Page::create();\n\n $config = $page->config()->anchors;\n if ($config) {\n $anchors = $config;\n }\n\n if ($page->hasMethod('getAnchors')) {\n $anchors = $page->getAnchors();\n }\n\n if (count($anchors) > 0) {\n $attributes['data-anchors'] = \\Convert::array2json($anchors);\n }\n }", "public function update( $new_instance, $old_instance ) { \n\t\t$instance = $old_instance; \n\t\t$instance['target_url'] = strip_tags( $new_instance['target_url'] ); \n\t\t$instance['target_url_custom'] = strip_tags( $new_instance['target_url_custom'] ); \n\t\t$instance['alignment'] = $new_instance['alignment'];\n\t\t$instance['left_offset'] = $new_instance['left_offset'];\n\t\t$instance['right_offset'] = $new_instance['right_offset'];\n\t\t$instance['top_offset'] = $new_instance['top_offset'];\n\t\t$instance['vertical_bg'] = $new_instance['vertical_bg'];\n\t\t$instance['hide_for_logged_in'] = $new_instance['hide_for_logged_in'];\n\n\t\treturn $instance; \n\t}", "public function createLinksFromAttributes(Metadata $operation): array;", "function the_champ_update_old_blogs($oldConfig){\r\n\t\t$optionParts = explode('_', current_filter());\r\n\t\t$option = $optionParts[2].'_'.$optionParts[3].'_'.$optionParts[4];\r\n\t\t$newConfig = get_option($option);\r\n\t\tif(isset($newConfig['config_multisite']) && $newConfig['config_multisite'] == 1){\r\n\t\t\t$blogs = get_blog_list(0, 'all');\r\n\t\t\tforeach($blogs as $blog){\r\n\t\t\t\tupdate_blog_option($blog['blog_id'], $option, $newConfig);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function auditDeletedAttributes(array &$old, array &$new)\n {\n foreach ($this->attributes as $attribute => $value) {\n if ($this->isAttributeAuditable($attribute)) {\n $old[$attribute] = $value;\n }\n }\n\n if ($this->shouldDynamicTableExist()) {\n foreach ($this->properties->getAttributes() as $attribute => $value) {\n if (! in_array($attribute, $this->auditableExclusions)) {\n $old[$this->type->identifier][$attribute] = $value;\n }\n }\n }\n }", "function restoreUrlParameters() {\n $this->CI->config->set_item('parm_segment', $this->parameterSegment);\n $this->CI->uri->router->segments = $this->routerSegments;\n }", "function layout_builder_post_update_discover_new_contextual_links() {\n // Empty post-update hook.\n}", "private function downgradeConfig(): void\n\t{\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->update(['type_range' => 'id|taken_at|title|description|public|star|type']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'created_at')\n\t\t\t->update(['value' => 'id']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'is_public')\n\t\t\t->update(['value' => 'public']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'is_starred')\n\t\t\t->update(['value' => 'star']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->update(['type_range' => 'id|title|description|public|max_taken_at|min_taken_at']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->where('value', '=', 'created_at')\n\t\t\t->update(['value' => 'id']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->where('value', '=', 'is_public')\n\t\t\t->update(['value' => 'public']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'legacy_id_redirection')\n\t\t\t->delete();\n\t}", "public function explodeUrl2ArrayDataProvider() {}", "function save()\n {\n $this->setAttribute(\"updated\", time());\n\n foreach($this->attributes AS $attribute)\n {\n\n if($attribute->name=='title')\n {\n //if the user has changed the datasource's title then we need to update the datsources slug based on that title;\n $this->setSlug($attribute->value);\n }\n\n if ($attribute->dirty)\n {\n\n if ($attribute->core)\n {\n $theUpdate=array();\n $theUpdate[$attribute->name] =$attribute->value;\n $this->db->where(\"data_source_id\", $this->id);\n $this->db->update(\"data_sources\", $theUpdate);\n $attribute->dirty = FALSE;\n }\n else\n {\n\n if ($attribute->value !== NULL)\n {\n if ($attribute->new)\n {\n $this->db->insert(\"data_source_attributes\", array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name, \"value\"=>$attribute->value));\n $attribute->dirty = FALSE;\n $attribute->new = FALSE;\n }\n else\n {\n $this->db->where(array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name));\n $this->db->update(\"data_source_attributes\", array(\"value\"=>$attribute->value));\n $attribute->dirty = FALSE;\n }\n }\n else\n {\n $this->db->where(array(\"data_source_id\" => $this->id, \"attribute\" => $attribute->name));\n $this->db->delete(\"data_source_attributes\");\n unset($this->attributes[$attribute->name]);\n }\n }\n\n\n }\n }\n return $this;\n }", "function revert_theme_base_url()\n{\n $front = Zend_Controller_Front::getInstance();\n if (($previous = $front->getParam('previousBaseUrls'))) {\n $front->setBaseUrl(array_pop($previous));\n $front->setParam('previousBaseUrls', $previous);\n }\n}", "public static function merge($new, $old)\n {\n $new = array_merge(static::formatAs($new, $old), [\n 'namespace' => static::formatNamespace($new, $old),\n ]);\n\n return array_merge_recursive(Arr::except(\n $old, ['namespace', 'as']\n ), $new);\n }", "private function completeImportProduct()\n {\n if (!empty($this->data['new_features'])) {\n $feature_types_model = $this->getModel('typeFeatures');\n /**\n * @var shopTypeFeaturesModel $feature_types_model\n */\n foreach ($this->data['new_features'] as $feature) {\n if (!empty($feature['types'])) {\n $feature_types_model->updateByFeature($feature['id'], $feature['types'], false);\n }\n }\n }\n $this->fixSkuName();\n }", "public function override(array &$return)\n\t{\n\t\tforeach (self::VARIANT_2_SYM_PATH_FIELD as $variant => $field) {\n\t\t\tif ($this->$field != '') {\n\t\t\t\t// TODO: This could be avoided, if the original variant was also serialized into the sub-array 'sizeVariants', see comment in PhotoCast#toReturnArray\n\t\t\t\tif ($variant == Photo::VARIANT_ORIGINAL) {\n\t\t\t\t\t$return['url'] = Storage::drive('symbolic')->url($this->$field);\n\t\t\t\t} else {\n\t\t\t\t\t$return['sizeVariants'][$variant]['url'] = Storage::drive('symbolic')->url($this->$field);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "private function upgradeConfig(): void\n\t{\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->update(['type_range' => 'created_at|taken_at|title|description|is_public|is_starred|type']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'id')\n\t\t\t->update(['value' => 'created_at']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'public')\n\t\t\t->update(['value' => 'is_public']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Photos_col')\n\t\t\t->where('value', '=', 'star')\n\t\t\t->update(['value' => 'is_starred']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->update(['type_range' => 'created_at|title|description|is_public|max_taken_at|min_taken_at']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->where('value', '=', 'id')\n\t\t\t->update(['value' => 'created_at']);\n\t\tDB::table('configs')\n\t\t\t->where('key', '=', 'sorting_Albums_col')\n\t\t\t->where('value', '=', 'public')\n\t\t\t->update(['value' => 'is_public']);\n\t\tDB::table('configs')\n\t\t\t->insert([\n\t\t\t\t'key' => 'legacy_id_redirection',\n\t\t\t\t'value' => '1',\n\t\t\t\t'cat' => 'config',\n\t\t\t\t'confidentiality' => 0,\n\t\t\t\t'type_range' => '0|1',\n\t\t\t\t'description' => 'Enables/disables the redirection support for legacy IDs',\n\t\t\t]);\n\t}", "private function restorePagesets() {\n foreach ($this->oldPagesetMappingDatabase as $pageSet) {\n if ($pageSet['page_set_id'] < CP_FIRST_CUSTOM_PAGESET_ID && !($pageSet['attr'] & UA_ATTR_ENABLED)) {\n // since the page set was previously NOT enabled, update the database without the enabled flag\n \\RightNow\\Api::cp_ua_mapping_update(array(\n 'page_set_id' => $pageSet['page_set_id'],\n 'attr' => $pageSet['attr'] | !UA_ATTR_ENABLED\n ));\n }\n }\n if(!$this->skipDeploy) {\n if ($this->oldPagesetMapping !== false) {\n try {\n FileSystem::filePutContentsOrThrowExceptionOnFailure($pageSetMappingPath, $pageSetMapping);\n }\n catch (\\Exception $e) {\n //Don't throw error during unit tests\n }\n }\n else {\n @unlink($pageSetMappingPath);\n }\n }\n }", "public function updateSource() {\n if (!empty($this->imported)) {\n $data = $this->source->data;\n if (empty($data)) {\n $data = array();\n }\n foreach ($this->imported as $key) {\n $data[] = $key;\n }\n $this->source->data = $data;\n $this->source->last_updated = date('Y-m-d H:i:s', strtotime('now'));\n $this->source->save();\n $this->imported = array();\n }\n }", "protected function _getUrlsForProduct(Mage_Catalog_Model_Product $product)\n {\n $urls = array();\n $urls[] = Mage::getUrl('catalog/product/view',\n array(\n 'id' => $product->getId(),\n 's' => $product->getUrlKey(),\n '_store' => $product->getStoreId() ? : $this->_defaultStoreId\n )\n );\n\n // collect all rewrites\n $coreUrlRewrites = $this->_getProductCoreUrlRewrites($product);\n\n /** @var Magneto_Varnish_Helper_Data $helper */\n $helper = Mage::helper('varnish');\n $enterpriseUrlRewrites = array();\n $enterpriseUrlRedirects = array();\n if ($helper->isModuleEnabled('Enterprise_Catalog')) {\n $enterpriseUrlRewrites = $this->_getProductEnterpriseUrlRewrites($product);\n $enterpriseUrlRedirects = $this->_getProductEnterpriseUrlRedirects($product);\n }\n\n $rewrites = array_merge($coreUrlRewrites, $enterpriseUrlRewrites, $enterpriseUrlRedirects);\n foreach ($rewrites as $r) {\n $urls[] = Mage::getUrl('',\n array(\n '_direct' => $r['request_path'],\n '_store' => $r['store_id'] ? : $this->_defaultStoreId\n )\n );\n $urls[] = Mage::getUrl('',\n array(\n '_direct' => $r['target_path'],\n '_store' => $r['store_id'] ? : $this->_defaultStoreId\n )\n );\n }\n\n return $urls;\n }", "public function postImport() {\n parent::postImport();\n\n // i18n Translation Set.\n $result = db_query('SELECT n.sourceid1, n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n');\n foreach ($result as $record) {\n $sourceid_tmp = preg_replace('#_fra_#', '_eng_', $record->sourceid1);\n $source_mlid = 0;\n $translated_mlid = 0;\n if (preg_match('/_fra_/i', $record->sourceid1)) {\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $record->sourceid1));\n foreach ($result as $result_row) {\n $translated_mlid = $result_row->destid1;\n $result = db_query('SELECT n.destid1\n FROM {migrate_map_wetkitmigratesitemenulinks} n WHERE n.sourceid1 = :sourceid', array(':sourceid' => $sourceid_tmp));\n foreach ($result as $result_row) {\n $source_mlid = $result_row->destid1;\n break;\n }\n break;\n }\n if (($source_mlid != 0) && ($translated_mlid != 0)) {\n $translation_set = i18n_translation_set_create('menu_link');\n $translation_set->reset_translations();\n $item = menu_link_load($source_mlid);\n $translation_set->add_item($item, 'en');\n $item = menu_link_load($translated_mlid);\n $translation_set->add_item($item, 'fr');\n $translation_set->save(TRUE);\n }\n }\n }\n }", "public function editDeleteRelatedUpSellCrossSellProductsProvider(): array\n {\n return [\n 'update' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'delete' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => []\n ],\n ],\n 'same' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => $this->existingProducts,\n ],\n ],\n 'change_position' => [\n 'data' => [\n 'defaultLinks' => $this->existingProducts,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 4],\n ['position' => 5],\n ['position' => 6],\n ]\n ),\n ],\n ],\n 'without_position' => [\n 'data' => [\n 'defaultLinks' => $this->defaultDataFixture,\n 'productLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => null],\n ['position' => null],\n ['position' => null],\n ]\n ),\n 'expectedProductLinks' => array_replace_recursive(\n $this->existingProducts,\n [\n ['position' => 1],\n ['position' => 2],\n ['position' => 3],\n ]\n ),\n ],\n ],\n ];\n }", "protected function getImportsReplace()\n {\n\n // build up import lines\n $importLines = [\n config('pxlcms.generator.repositories.extend_class')\n ];\n\n // model classname\n $importLines[] = $this->context->makeFqnForModelName( studly_case($this->data->name) );;\n\n\n\n // set them in the right order\n if (config('pxlcms.generator.aesthetics.sort_imports_by_string_length')) {\n\n // sort from shortest to longest\n usort($importLines, function ($a, $b) {\n return strlen($a) - strlen($b);\n });\n\n } else {\n sort($importLines);\n }\n\n\n // build the actual replacement string\n $replace = \"\\n\";\n\n foreach ($importLines as $line) {\n $replace .= \"use \" . $line . \";\\n\";\n }\n\n $replace .= \"\\n\";\n\n return $replace;\n }", "function jigoshop_upgrade_99() {\n\tglobal $wpdb;\n\n\t$q = $wpdb->get_results(\"SELECT *\n\t\tFROM $wpdb->term_taxonomy\n\t\tWHERE taxonomy LIKE 'product_attribute_%'\n\t\");\n\n\tforeach($q as $item) {\n\t\t$taxonomy = str_replace('product_attribute_', 'pa_', $item->taxonomy);\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->term_taxonomy,\n\t\t\tarray('taxonomy' => $taxonomy),\n\t\t\tarray('term_taxonomy_id' => $item->term_taxonomy_id)\n\t\t);\n\t}\n}", "private function regenerateSitemap() {\n\t\tif (\n\t\t\tisset( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_rewrite'] ) &&\n\t\t\tempty( $this->oldOptions['modules']['aiosp_sitemap_options']['aiosp_sitemap_rewrite'] )\n\t\t) {\n\t\t\t$files = aioseo()->sitemap->file->files();\n\t\t\t$detectedFiles = [];\n\t\t\tforeach ( $files as $filename ) {\n\t\t\t\t// We don't want to delete the video sitemap here at all.\n\t\t\t\t$isVideoSitemap = preg_match( '#.*video.*#', $filename ) ? true : false;\n\t\t\t\tif ( ! $isVideoSitemap ) {\n\t\t\t\t\t$detectedFiles[] = $filename;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$wpfs = aioseo()->helpers->wpfs();\n\t\t\tif ( count( $detectedFiles ) && is_object( $wpfs ) ) {\n\t\t\t\tforeach ( $detectedFiles as $file ) {\n\t\t\t\t\t@$wpfs->delete( $file, false, 'f' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\taioseo()->sitemap->file->generate( true );\n\t\t}\n\t}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "function cdn_html_alter_image_urls(&$html) {\n $url_prefix_regex = _cdn_generate_url_prefix_regex();\n $pattern = \"#((<img\\s+|<img\\s+[^>]*\\s+)src\\s*=\\s*[\\\"|\\'])($url_prefix_regex)([^\\\"|^\\']*)([\\\"|\\'])#i\";\n _cdn_html_alter_file_url($html, $pattern, 0, 4, 5, 1, '');\n}", "public function addProductToFeed ($args)\n\t{\n\t\t$product = Mage::getModel('catalog/product')->setData($args['row']);\n\t\t/* @var $product Mage_Catalog_Model_Product */\n\n\t\t// price\n\t\t$taxHelper = Mage::helper('tax');\n\t\tif ($product->getData($this->getAttributeMapping('rakuten_feed_price'))) {\n\t\t\t$finalPrice = $taxHelper->getPrice($product, $product->getData($this->getAttributeMapping('rakuten_feed_price')));\n\t\t}\n\t\telse {\n\t\t\t$finalPrice = $taxHelper->getPrice($product, $product->getFinalPrice());\n\t\t}\n\n\t\t// required atts\n\t\t$name = trim($product->getData($this->getAttributeMapping('name')));\n\t\t$shortDescription = trim(strip_tags($product->getData($this->getAttributeMapping('short_description'))));\n\t\t$categoryId = $product->getData($this->getAttributeMapping('rakuten_category_id'));\n\n\t\tif (!$finalPrice || !$name || !$shortDescription || !$categoryId) {\n\t\t\treturn;\n\t\t}\n\n\t\t// images\n\t\t$imageFile = $product->getData($this->getAttributeMapping('image'));\n\t\tif ($imageFile && $imageFile != 'no_selection') {\n\t\t\t$mainImage = $this->getAttributeMapping('image');\n\t\t}\n\t\telse {\n\t\t\t$mainImage = $this->getAttributeMapping('image2');\n\t\t}\n\t\t$additionalImages = array();\n\t\t$product->loadMediaGallery();\n\t\tforeach ($product->getMediaGalleryImages(false) as $imageInfo) {\n\t\t\t$file = $imageInfo->getFile();\n\t\t\tif ($file != $product->getData($mainImage) && $file != $product->getData($this->getAttributeMapping('image_exclude'))) {\n\t\t\t\t$product->setAdditionalImage($file);\n\t\t\t\ttry {\n\t\t\t\t\t$additionalImages[] = $this->getImageUrl($product, 'additional_image', false);\n\t\t\t\t} catch (Exception $e) {}\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t$row = array(\n\t\t\t'gtin' => (string)$product->getData($this->getAttributeMapping('upc')),\n\t\t\t'isbn' => (string)$product->getData($this->getAttributeMapping('isbn')),\n\t\t\t'mfg_name' => $product->getAttributeText($this->getAttributeMapping('manufacturer_name')),\n\t\t\t'mfg_part_number' => (string)$product->getData($this->getAttributeMapping('manufacturer_part_number')),\n\t\t\t'asin' => (string)$product->getData($this->getAttributeMapping('asin')),\n\t\t\t'merchant_sku' => (string)$product->getData($this->getAttributeMapping('sku')),\n\t\t\t'title' => $name,\n\t\t\t'description' => $shortDescription,\n\t\t\t'main_image' => $this->getImageUrl($product, $mainImage),\n\t\t\t'additional_images' => implode(self::SEPARATOR, $additionalImages),\n\t\t\t'weight' => round($product->getData($this->getAttributeMapping('weight')), 2),\n\t\t\t'features' => (string)$product->getData($this->getAttributeMapping('features')),\n\t\t\t'listing_price' => $finalPrice,\n\t\t\t'msrp' => (string)$product->getData($this->getAttributeMapping('msrp')),\n\t\t\t'category_id' => $categoryId,\n\t\t\t'keywords' => (string)$product->getData($this->getAttributeMapping('meta_keyword')),\n\t\t\t'product_set_id' => ''\n\t\t);\n\n\t\t// ability to overwrite stock fields with category fields\n\t\t$categoryFields = $this->_processCategoryFields($product->getData($this->getAttributeMapping('rakuten_category_fields')));\n\t\tforeach ($categoryFields as $field => $value) {\n\t\t\tif (isset($row[$field])) {\n\t\t\t\t$row[$field] = $value;\n\t\t\t\tunset($categoryFields[$field]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$map = str_replace('-', '_', $field); // so product-set-id and product_set_id are both accounted for\n\t\t\t\tif (isset($row[$map])) {\n\t\t\t\t\t$row[$map] = $value;\n\t\t\t\t\tunset($categoryFields[$field]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$row['category_fields'] = $categoryFields;\n\n\t\t$this->sanitizeRow($row);\n\n\t\t$row = new Varien_Object($row);\n\t\tMage::dispatchEvent('productfeed_addproducttofeed', array('vendor' => $this, 'row' => $row));\n\t\t\n\t\t$this->addCategoryFields($product->getId(), $row->getCategoryFields());\n\t\t$row->unsCategoryFields();\n\n\t\t$args['products'][$product->getId()] = $row->getData();\n\t}", "public function afterCreate($product)\n {\n $this->indexer->refreshFlat($product);\n }" ]
[ "0.5510585", "0.5038295", "0.497977", "0.49260625", "0.49137515", "0.48702252", "0.48362923", "0.48355854", "0.48096398", "0.4760752", "0.47297874", "0.4719762", "0.4659986", "0.46197754", "0.45372865", "0.45190895", "0.45028773", "0.44517055", "0.44405726", "0.4438688", "0.4435172", "0.4432782", "0.44293526", "0.4422784", "0.4418211", "0.43977672", "0.43957976", "0.4344308", "0.43435484", "0.43430293", "0.43338025", "0.43327582", "0.43159333", "0.4311053", "0.4308916", "0.43036887", "0.42863798", "0.42837265", "0.42798847", "0.42787963", "0.42787477", "0.42748702", "0.4273833", "0.4259489", "0.42594656", "0.4253647", "0.42479554", "0.4239043", "0.42388916", "0.42337018", "0.42290455", "0.42241165", "0.4220201", "0.4220042", "0.42191327", "0.42182577", "0.42099896", "0.42073974", "0.4202215", "0.42007518", "0.4198828", "0.41984904", "0.4189198", "0.4178274", "0.4174463", "0.4171731", "0.416764", "0.41629854", "0.4160758", "0.4159859", "0.41591966", "0.41577795", "0.4155526", "0.4154303", "0.4149253", "0.41455367", "0.41446838", "0.41413933", "0.41399488", "0.4138", "0.41323873", "0.4121744", "0.4120336", "0.41179305", "0.4113712", "0.4112639", "0.41066766", "0.4102729", "0.4100602", "0.4092329", "0.40920475", "0.40883455", "0.40840274", "0.40839514", "0.40693536", "0.4063627", "0.4060917", "0.4060832", "0.40597686", "0.40577573" ]
0.76536757
0
Store products to database.
public static function store(array $products): bool { $progress = ConsoleOutput::progress(count($products)); foreach ($products as $product) { $existingProduct = LibriProduct::find($product->RecordReference); // if this product doesn't exists, save it if(!$existingProduct) $product->save(); // if this product already exists and comes from an older CatalogUpdate // delete existing product and save the new one elseif( is_null($existingProduct->DateOfData) || is_null($product->DateOfData) || $existingProduct->DateOfData < $product->DateOfData) { self::copyAnnotationUrls($existingProduct,$product); $existingProduct->delete(); $product->save(); } ConsoleOutput::advance($progress); } // complete the progress bar ConsoleOutput::finish($progress); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeProduct();", "public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }", "public function store(StoreProductRequest $request)\n {\n $product = new Product();\n $product->product_type_id = 0;\n $product->title = $request->input('title');\n $product->description = $request->input('description');\n $product->price = $request->input('price');\n $product->sku = $request->input('sku');\n $product->save();\n\n foreach ($request->input('options') as $option) {\n $product->options()->sync($option);\n }\n }", "public function save() \r\n\t{\r\n\t\t$this->saveNewProducts();\r\n\t\t$this->saveUpdateProducts();\r\n\t\t$this->saveRemoveProducts();\t\t\t\r\n\t\t$this->destroyCache(); \r\n\t}", "public function store() { \n\t\t$name = $this->post('name');\n\t\t$price = $this->post('price'); \n\t\t$description = $this->post('description'); \n\n\t\tif ($name && $description && $price) {\n\t\t\t$this->product->name = $name;\n\t\t\t$this->product->price = $price;\n\t\t\t$this->product->is_deleted = false;\n\t\t\t$this->product->description = $description;\n\t\t\t$this->product->created_at = date(\"Y-m-d h:i:s\");\n\t\t\t$this->product->updated_at = date(\"Y-m-d h:i:s\");\n\n\t\t\t$create = $this->product->addProduct($this->product);\n\t\t\tif ($create) { \n\t\t\t\t$data = [ \"message\" => \"product has been created!\"];\n\t\t\t\t$statusCode = 201; \n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data = [ \"message\" => \"product cannot create\"];\n\t\t\t\t$statusCode = 500; \n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$data = [ \"message\" => \"required missinng fields\"];\n\t\t\t$statusCode = 400; \n\t\t}\n\t\treturn $this->response($data, $statusCode);\n\t}", "public function store()\n {\n $this->product->name = $_POST['name'];\n $this->product->price = $_POST['price'];\n $this->product->description = $_POST['description'];\n $this->product->category_id = $_POST['category_id'];\n\n // create the product\n if($this->product->create()){\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Product was created.\";\n echo \"</div>\";\n }\n\n // if unable to create the product, tell the user\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Unable to create product.\";\n echo \"</div>\";\n }\n }", "public function insertProduct(Product $product);", "function save_product(array $product)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n INSERT INTO products\n (name, slug, price, brand, description, categories)\n VALUES\n (:name, :slug, :price, :brand, :description, :categories)\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':name' => $product['name'],\n ':slug' => slugfy($product['name']),\n ':price' => $product['price'],\n ':brand' => $product['brand'],\n ':description' => $product['description'],\n ':categories' => $product['categories'],\n ]);\n}", "protected function saveUpdateProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// inserir as novas\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t\t$result = $this->client->catalogProductUpdate($this->sessionid, $product->sku, $product);\r\n\t\t\t\t$this->log->addInfo('updated', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\r\n\t}", "protected function saveNewProducts()\r\n\t{\r\n\t\tif (count($this->newProducts) > 0) {\r\n\t\t\t// create new product in catalog\r\n\t\t\tforeach ($this->newProducts as $product) {\r\n\t\t\t \r\n\t\t\t $result = $this->client->catalogProductCreate($this->sessionid, $product->getProductType(), $product->getAttributeSet(), $product->sku, $product);\r\n\t\t\t \r\n\t\t\t\t$this->log->addInfo('created', array(\"sku\" => $product->sku, \"result\" => $result));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->newProducts = array();\t\t\r\n\t}", "public function store()\n {\n $validator = Validator::make(Input::all(), Products::$rules);\n\n if ($validator->passes()) {\n $product = new Products;\n $product->name = addslashes(Input::get('name'));\n $product->color_id = Input::get('color');\n $product->product_code = 0;\n $product->sp = Input::get('sp');\n $product->cp = Input::get('cp');\n $product->quantity = Input::get('quantity');\n $product->type_id = Input::get('type_id');\n $product->unit_id = Input::get('unit_id');\n $product->save();\n $product->setProductCode($product);\n $stock = new Stocks();\n $stock->supplier_id = Input::get('supplier_id');\n $stock->product_id = $product->id;\n $stock->quantity = Input::get('quantity');\n $stock->save();\n\n return Redirect::route('products.index')\n ->with('success', 'Product created successfully');\n } else {\n return Redirect::route('products.create')\n ->withErrors($validator)\n ->withInput(Input::all());\n }\n }", "public function run()\n {\n $data = [\n [\n 'description' => 'Pop',\n 'value' => 5.00,\n 'merchant' => 1\n ],\n [\n 'description' => 'Burguer',\n 'value' => 25.00,\n 'merchant' => 2\n ]\n ];\n\n $this->table('products')\n ->insert($data)\n ->save();\n }", "public function store($productId)\n\t{\n\t\tProduct::findOrFail($productId)->suppliers()->sync(Input::all());\n\t}", "public function store(ProductRequest $request)\n {\n// $data = $request->all();\n// foreach ($checkboxes as $checkbox) {\n// if(!isset($data[$checkbox]) {\n// $data[$checkbox] = 0;\n// }\n// }\n $data = $request->all();\n\n if(!isset($data['featured'])) {\n $data['featured'] = 0;\n }\n if(!isset($data['recommended'])) {\n $data['recommended'] = 0;\n }\n\n $tagsIDs = $this->getTagsIDs($data['tags']);\n unset($data['tags']);\n $this->product->fill($data);\n $this->product->save();\n $this->product->tags()->sync($tagsIDs);\n\n //\\Session::flash('product_added', 'Product has been successfully added in the database.');\n\n return redirect()->route('products');\n }", "public function run()\n {\n $rows = [\n [\n 'category_id' => 1,\n 'name' => 'MacBook Pro',\n 'description' => 'Tela Retina 13,3 polegadas, Processador Até Intel Core i7 com quatro núcleos',\n 'quantity_per_unit' => 1,\n 'quantity_stock' => 20,\n 'discontinued' => 0,\n 'created_at' => Chronos::now(),\n 'updated_at' => Chronos::now()\n ]\n ];\n\n $products = $this->table('products');\n $products->insert($rows)->saveData();\n }", "public function store(StoreOrderProductRequest $request)\n {\n $orderId = $request->get('order_id');\n $order = $this->order->newQuery()->with('user')->findOrFail($orderId);\n\n $this->authorize('update', $order);\n\n $productId = $request->get('product_id');\n $product = $this->product->newQuery()->findOrFail($productId);\n\n $userPriceColumn = 'price' . $order->user->price_group;\n\n $count = 1;\n $price = $product->$userPriceColumn * $this->exchangeRates->getRate();\n\n if (!$price){\n return back()->withErrors([trans('validation.product_has_not_price')]);\n }\n\n DB::beginTransaction();\n $order->products()->attach($productId, compact('count', 'price'));\n $this->updateOrder($order, $count * $price);\n DB::commit();\n\n event(new OrderUpdatedByManager($order));\n\n return redirect(route('admin.order.show', ['order_id' => $orderId]));\n }", "public function store(Request $request)\n\t{\n\t\t// validate request\n\t\t$validateProduct = Validator::make($request->get('Product'), Product::$rules);\n\t\t$validationMessages = [];\n\n\t\tif ($validateProduct->fails() OR count($validationMessages) > 0) {\n\t\t\t$validationMessages = array_merge_recursive($validateProduct->messages()->toArray(), $validationMessages);\n\t\t\treturn redirect()->back()->withErrors($validationMessages)->withInput();\n\t\t}\n\n\t\t// sure execute success, if not success rollback\n\t\tDB::transaction(function () use ($request) {\n\t\t\t$user = $request->user();\n\n\t\t\t// insert Product\n\t\t\t$product = new Product;\n\t\t\t$product->key = Common::createKeyURL($request->input('Product.title'));\n\n\t\t\t$product->title = $request->input('Product.title');\n\t\t\t$product->product_type_id = $request->input('Product.product_type_id');\n\t\t\t$product->province_id = $request->input('Product.province_id');\n\t\t\t$product->district_id = $request->input('Product.district_id');\n\t\t\t$product->ward_id = $request->input('Product.ward_id');\n\t\t\t$product->street_id = $request->input('Product.street_id');\n\t\t\t$product->project_id = $request->input('Product.project_id');\n\n\t\t\t$product->price_range_id = $request->input('Product.price_range_id');\n\t\t\t$product->area_range_id = $request->input('Product.area_range_id');\n\t\t\t$product->incense_type_id = $request->input('Product.incense_type_id');\n\n\t\t\t$product->area = $request->input('Product.area');\n\t\t\t$product->price = $request->input('Product.price');\n\t\t\t$product->price_type_id = $request->input('Product.price_type_id');\n\t\t\t$product->total_price = $request->input('Product.total_price');\n\t\t\t$product->address = $request->input('Product.address');\n\t\t\tif($request->input('Product.expire_at') != null && $request->input('Product.expire_at') !='')\n\t\t\t{\n\t\t\t\t$expire_at = Carbon::createFromFormat('d/m/Y', $request->input('Product.expire_at'))->toDateString();\n\t\t\t\t$product->expire_at = $expire_at;\n\t\t\t}\n\t\t\t$product->summary = $request->input('Product.summary');\n\t\t\t\n\t\t\t$product->description = $request->input('Product.description');\n\t\t\t$product->home_direction = $request->input('Product.home_direction');\n\t\t\t$product->rooms = $request->input('Product.rooms');\n\t\t\t$product->toilets = $request->input('Product.toilets');\n\t\t\t$product->interior = $request->input('Product.interior');\n\t\t\t$product->main_image = $request->input('Product.main_image');\n\n\t\t\t$product->br_name = $request->input('Product.br_name');\n\t\t\t$product->br_address = $request->input('Product.br_address');\n\t\t\t$product->br_phone = $request->input('Product.br_phone');\n\t\t\t$product->br_email = $request->input('Product.br_email');\n\n\t\t\t$product->map_latitude = $request->input('Product.map_latitude');\n\t\t\t$product->map_longitude = $request->input('Product.map_longitude');\n\t\t\t$product->meta_description = $request->input('Product.meta_description');\n\t\t\t$product->meta_keywords = $request->input('Product.meta_keywords');\n\n\t\t\t$product->priority = $request->input('Product.priority');\n\t\t\t$product->active = $request->input('Product.active');\n\t\t\t$product->user_id = $user->id;\n\t\t\t$product->created_by = $user->name;\n\t\t\t$product->updated_by = $user->name;\n\t\t\t$product->save();\n\n\t\t\t// save attachments\n\t\t\tif ($request->input('Product.attachments') != \"\") {\n\t\t\t\t$requestAttachments = explode(',', $request->input('Product.attachments'));\n\t\t\t\t$attachments = [];\n\t\t\t\tforeach ($requestAttachments as $key => $value) {\n\t\t\t\t\tif($key == 0 && !isset($product->main_image))\n\t\t\t\t\t\t$product->main_image = $value;\n\t\t\t\t\tarray_push($attachments, new Attachment([\n\t\t\t\t\t\t'entry_id' => $product->id,\n\t\t\t\t\t\t'table_name' => 'products',\n\t\t\t\t\t\t'path' => $value,\n\t\t\t\t\t\t'priority' => 0,\n\t\t\t\t\t\t'is_publish' => 1\n\t\t\t\t\t\t]));\n\t\t\t\t}\n\t\t\t\tif (count($attachments) > 0) {\n\t\t\t\t\t$product->attachments()->saveMany($attachments);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product->save();\n\n\t\t});\n\n\t\treturn redirect()->route('admin.products.index');\n\t}", "public function save()\n {\n\t\t\tforeach($this->items as $index=>$data)\n\t\t\t{\n\t \t//if exists, update\n\t\t\t\tif($data[\"object\"])\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]->update(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$data[\"producttype\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]=MyModel::create(\"Product\",array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$data[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$this->main->producttypedata->items[$data[\"producttypename\"]][\"object\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\n\t\t\t}\n }", "public function store(ProductInsertFormRequest $request)\n {\n \n $id=Product::insertGetId([\n 'name'=>$request->product_name,\n 'cat_id'=>$request->cat_id,\n 'price'=>$request->price,\n 'package_id'=>$request->package_id,\n 'foc_id'=>$request->foc_id,\n 'description'=>$request->description, \n 'img'=>$request->photo,\n 'status'=>1,\n ]);\n \n Stock::create([\n 'product_id'=>$id,\n 'balance'=>0\n ]);\n return redirect('admin/product/create')->with('status','new product has been inserted.');\n }", "public function run(): void\n {\n $products = [\n [\n 'id' => 1,\n 'name' => 'Coffee',\n 'slug' => 'coffee',\n 'description' => 'Coffee test description',\n 'price' => 1000,\n 'created_at' => now(),\n 'updated_at' => now(),\n ],\n ];\n\n Product::insert($products);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required|string',\n 'sku' => 'required|string|unique:products',\n 'description' => 'required|string',\n 'product_image' => 'required|array|min:1',\n 'product_image.*.file' => 'required|string|min:1',\n 'product_variant' => 'required|array|min:1',\n 'product_variant.*.tags' => 'required|array|min:1',\n 'product_variant_prices' => 'required|array|min:1',\n ]);\n\n DB::beginTransaction();\n try {\n $product = Product::create([\n 'title' => $request->title,\n 'sku' => $request->sku,\n 'description' => $request->description,\n ]);\n\n /*+++++++++++++++++++++++ Product Image Insert Into DB +++++++++++++++++++++++*/\n $product_images = [];\n foreach ($request->product_image as $image) {\n Storage::move(\"products/tmp/\" . $image['folder'] . \"/\" . $image['file'], \"products/$product->id/\" . $image['file']);\n $product_images[] = [\n 'product_id' => $product->id,\n 'file_path' => \"storage/products/$product->id/\" . $image['file'],\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n Storage::deleteDirectory(\"products/tmp/\" . $image['folder']);\n }\n ProductImage::insert($product_images);\n\n /*+++++++++++++++++++++++ Product Variant Insert Into DB +++++++++++++++++++++++*/\n $product_variants = [];\n foreach ($request->product_variant as $variant) {\n foreach ($variant['tags'] as $tag) {\n $prodVariant = ProductVariant::create([\n 'variant' => $tag,\n 'variant_id' => $variant['option'],\n 'product_id' => $product->id\n ]);\n\n $product_variants[] = ['product_variant' => $prodVariant->id, 'variant' => $prodVariant->variant];\n }\n }\n\n /*+++++++++++++++++++++++ Product Variant Price Insert Into DB +++++++++++++++++++++++*/\n $product_variant_prices = [];\n foreach ($request->product_variant_prices as $price) {\n $variants = explode('/', $price['title']);\n\n $product_variant_prices[] = [\n 'product_variant_one' => collect($product_variants)->where('variant', $variants[0])->first()['product_variant'],\n 'product_variant_two' => isset($variants[1]) && !empty($variants[1]) ? collect($product_variants)->where('variant', $variants[1])->first()['product_variant'] : null,\n 'product_variant_three' => isset($variants[2]) && !empty($variants[2]) ? collect($product_variants)->where('variant', $variants[2])->first()['product_variant'] : null,\n 'price' => $price['price'],\n 'stock' => $price['stock'],\n 'product_id' => $product->id,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ];\n }\n ProductVariantPrice::insert($product_variant_prices);\n\n DB::commit();\n return response()->json(['message' => 'Successfully added product.'], 200);\n } catch (\\Exception $e) {\n DB::rollback();\n return response()->json(['error' => true, 'message' => $e->getMessage()], 500);\n }\n }", "public function store()\n\t{\n\t\tInput::merge(array_map('trim', Input::except('product_attribute', 'product_tag', 'product_category')));\n\n\t\t$entryValidator = Validator::make(Input::all(), ProductService::$store_rules);\n\t\t\n\t\tif ($entryValidator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_validating_entry'))->withErrors($entryValidator)->withInput();\n\t\t}\n\n\t\t$store = $this->repo->store(\n\t\t\tInput::get('title'),\n\t\t\tInput::get('intro'),\n\t\t\tInput::get('permalink'),\n\t\t\tInput::get('product_id'),\n\t\t\tInput::get('sku'),\n\t\t\tInput::get('price'),\n\t\t\tInput::get('sale_price'),\n\t\t\tInput::get('stock'),\n\t\t\tInput::get('total_sales'),\n\t\t\tInput::get('stock_status'),\n\t\t\tInput::get('sold_individually'),\n\t\t\tInput::get('weight'),\n\t\t\tInput::get('length'),\n\t\t\tInput::get('width'),\n\t\t\tInput::get('height'),\n\t\t\tInput::get('status'),\n\t\t\tInput::get('product_type'),\n\t\t\tInput::get('content'),\n\t\t\tInput::get('visibility'),\n\t\t\tInput::get('downloadable'),\n\t\t\tInput::get('featured'),\n\t\t\tInput::get('virtual'),\n\t\t\tInput::get('purchase_note'),\n\t\t\tInput::get('manage_stock'),\n\t\t\tInput::get('backorders'),\n\t\t\tInput::get('product_attribute'),\n\t\t\tInput::get('product_category'),\n\t\t\tInput::get('product_tag'),\n\t\t\tInput::file('image')\n\n\t\t);\n\n\t\tif ($store['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::back()->with('error_message', Lang::get('core.msg_error_adding_entry'))->withErrors($entryValidator)->withInput();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::route('ProductIndex')->with('success_message', Lang::get('core.msg_success_entry_added', array('name' => Input::get('name'))));\n\t\t}\n\t}", "public function store(ProductStoreRequest $request)\n {\n //\n $product = new Product(); \n $product->name = $request->name; \n $product->description = $request->description; \n $product->category_id = $request->category_id; \n $product->save(); \n\n $price = new Price(); \n $price->price = $request->price; \n $price->effdate = Carbon::now(); \n $price->product_id = $product->id; \n $price ->save(); \n\n return redirect()->route('products.index')->with('status', 'Product Toegevoegd'); \n }", "public function insert()\n {\n $products = [];\n \n // Add products to array\n $products[] = ['name' => 'Ball', 'price' => 2];\n $products[] = ['name' => 'Glove', 'price' => 20];\n \n // Insert products one by one\n foreach ($products as $product) {\n $result = $this->db->insert('products', $product);\n if ($result) {\n echo 'Inserted product: ' . $product['name'];\n } else {\n echo 'Problem inserting product: ' . $product['name'];\n }\n }\n }", "public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }", "public function store(StoreProduct $request)\n {\n\t\t$validated = $request->validated();\n\n\t\t$pages = $validated['pages'];\n\n\t\tunset($validated['pages']);\n\n\t\tif($request->has('image')){\n\t\t\t$path = Storage::putFile('products/images', $request->image);\n\t\t\t$validated['image'] = $path;\n\t\t}\n\n\t\t$product = Product::create($validated);\n\n\t\t$product->pages()->sync($pages);\n\n\t\treturn redirect()->route('admin.products.index')\n\t\t\t->with('status', 'Product Added');\n }", "public function store(ProductStoreRequest $request)\n {\n \n $product = new Product();\n $this->saveProduct($product, $request);\n $product->save();\n Session::put('success', 'Produit ' . $product->name . ' ajouté avec succès.');\n return redirect('/admin/products');\n }", "public function saveProduct(Request $r){\n \t$name = $r->input('name');\n \t$shortDes = $r->input('short_des');\n \t$longDes = $r->input('long_des');\n \t$price = $r->input('price');\n \t$platform = $r->input('platform');\n \t$charas = $r->input('charas');\n \t$frontImage = $r->input('front_image');\n \t$p_url = $r->input('product_url');\n \t$p_owner = $r->input('product_owner');\n \t$p_creator = $r->input('product_creator');\n $type = $r->input('type');\n $youtube = $r->input('youtube_url');\n $image02 = $r->input('image_02');\n $image03 = $r->input('image_03');\n \t\n \t//Create the Associative array\n \t$product = new Product([\n \t\t'name'=> $name,\n \t\t'short_des' => $shortDes,\n \t\t'long_des' => $longDes,\n \t\t'price' => $price,\n \t\t'platform' => $platform,\n \t\t'characteristics' => $charas,\n \t\t'front_image' => $frontImage,\n \t\t'product_url' => $p_url,\n \t\t'product_owner' => $p_owner,\n \t\t'product_creator' => $p_creator,\n 'type' => $type,\n 'youtube_url' => $youtube\n \t]);\n\n \t//Add prodcut to DataBase\n \t$product->save();\n\n //If optional images are not null or not empty, then added to the 'images' table related each one with the product just created\n if($image02 != null || $image02 != ''){\n $img1 = new Images([\n 'url' => $image02,\n 'alt' => $name,\n 'description' => $shortDes\n ]);\n $product->images()->save($img1);\n }\n if($image03 != null || $image03 != ''){\n $img2 = new Images([\n 'url' => $image03,\n 'alt' => $name,\n 'description' => $shortDes\n ]);\n $product->images()->save($img2);\n }\n\n //Retreive all products\n $p = Product::orderBy('created_at', 'desc')->get();\n\n \treturn redirect()->route('portafolio', ['products' => $p]);\n\n }", "public function store(Request $request)\n {\n $product = new Product($request->except('color_id', 'size_id'));\n $product->user_id=Auth::id();\n\n $medias= $request->file('media');\n foreach($medias as $media){\n $upload[] = '/storage/'.$media->store('/uploads/products', 'public');\n }\n if ($upload){\n $product->media=implode(';', array_diff( $upload, array('')));\n }\n\n $product->save();\n\n $sizes=array_diff( $request['size_id'], array(''));\n $colors=array_diff( $request['color_id'], array(''));\n $i=0;\n foreach ($sizes as $size){\n $isert[]=['color_id' => $colors[$i], 'size_id' => $size, 'product_id' => $product->id];\n $i++;\n };\n DB::table('attributeables')->insert($isert);\n // Categories\n if($request->input('categories')) :\n $product->categories()->attach($request->input('categories'));\n endif;\n return redirect()->route('admin.products.index');\n }", "public function store()\n {\n $this->authorize('create', Product::class);\n\n $this->validate(request(), [\n 'supplier_id' => 'required|exists:suppliers,id',\n 'sku' => 'required|unique:products|string|alpha_dash',\n 'description' => 'required|string',\n 'cost_price' => 'required|numeric|min:0',\n 'retail_price' => 'required|numeric|min:0',\n 'recommended_selling_price' => 'required|numeric|min:0',\n ], [\n 'supplier_id.required' => 'The supplier field is required.',\n 'supplier_id.exists' => 'The supplier field is required.',\n ]);\n\n $product = Product::create(request()->all());\n\n notify()->flash('Product has been created!', 'success');\n return redirect()->action('ProductsController@show', $product);\n }", "public function save()\n {\n $lastInsertedId = $this->executeQuery(\"INSERT INTO eav_products \n (sku,name, price, type, custom_attributes) \n VALUES \n (?,?,?,?,?)\", array(\n $this->getSku(),\n $this->getName(),\n $this->getPrice(),\n $this->getType(),\n \"{\\\"size\\\":{$this->getSize()}}\"\n ));\n\n if ($lastInsertedId > 0) {\n $this->setId($lastInsertedId);\n return $lastInsertedId;\n }\n return null;\n }", "public function store(Request $request)\n {\n\n\n\n $product = Product::create($request->all());\n $attributes = request('attributes');\n $categories = request('categories');\n\n\n\n $product->saveFiles($request);\n\n $product->attributes()->sync($attributes);\n $product->categories()->sync($categories);\n\n return redirect()->route('products.create');\n }", "public function store(Request $request)\n {\n try{\n\n DB::beginTransaction();\n\n $slug = Str::slug($request->input('product.title'), '-');\n\n $hasSlug = Product::where('slug', $slug)->first();\n\n if($hasSlug) $slug = $slug . Str::random(3);\n\n $product = Product::create([\n 'title' => $request->input('product.title'),\n 'slug' => $slug,\n 'short_description' => $request->input('product.short_description'),\n 'description' => $request->input('product.description'),\n 'installments' => $request->input('product.installments'),\n 'width' => $request->input('product.width'),\n 'depth' => $request->input('product.depth'),\n 'heigth' => $request->input('product.heigth'),\n 'enabled' => $request->input('product.enabled'),\n 'self_delivery' => $request->input('product.self_delivery'),\n ]);\n\n if($request->input('product.variants')){\n\n foreach($request->input('product.variants') as $variant){\n\n $v = Variant::create([\n 'product_id' => $product->id,\n \"sku\" => $variant['sku'],\n \"weight\" => $variant['weight'],\n ]);\n\n foreach($variant['values'] as $variantValue){\n\n $value = VariantValue::create([\n 'variant_id' => $v->id,\n 'option_value_id' => $variantValue['value_id']\n ]);\n\n }\n\n foreach($variant['stocks'] as $stock){\n\n if($stock['quantity'] > 0){\n\n $variantStock = ProductStock::create([\n 'stock_id' => $stock['id'],\n 'product_id' => $product->id,\n 'variant_id' => $v->id,\n 'quantity' => $stock['quantity'],\n 'price' => $stock['price'],\n 'promote_price' => isset($stock['promote_price']) ? $stock['promote_price'] : 0 ,\n 'factory_price' => isset($stock['factory_price']) ? $stock['factory_price'] : 0 ,\n 'reserved' => 0,\n ]);\n\n }\n }\n\n if($variant['images']){\n\n foreach($variant['images'] as $image){\n $randNumber = rand();\n\n $name = $slug.$randNumber;\n\n $path = public_path('images/variants/'.$v->id.'/');\n\n if(!File::exists($path)) {\n File::makeDirectory($path, $mode = 0777, true, true);\n }\n\n Image::make($image['url'])->save($path.$name);\n\n $variantImage = VariantImage::create([\n 'variant_id' => $v->id,\n 'product_id' => $product->id,\n 'url' => url('images/variants/'.$v->id.'/'.$name),\n ]);\n }\n }\n }\n }\n\n if($request->input('product.categories')){\n\n foreach($request->input('product.categories') as $category){\n\n $category = ProductCategory::create([\n 'product_id' => $product->id,\n 'category_id' => $category['id']\n ]);\n\n }\n }\n\n if(count($request->input('product.coupons')) == 0){\n\n ProductCoupon::where('product_id', $product->id)->delete();\n\n } else {\n\n foreach($request->input('product.coupons') as $coupon){\n\n ProductCoupon::create([\n 'product_id' => $product->id,\n 'coupon_id' => $coupon['id']\n ]);\n\n }\n\n }\n\n DB::commit();\n\n return response()->json([\n 'success' => true\n ], 200);\n\n }catch(\\Exception $e){\n\n $errorLog = ErrorsLog::create([\n 'description' => $e->getMessage(),\n ]);\n\n return response()->json([\n 'message' => 'Não foi possivel cadastrar o produto.',\n 'errors' => [\n 'message' => $e->getMessage(),\n 'line' => $e->getLine(),\n ]\n ], 500);\n }\n }", "public function save() {\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_orders_products_attributes set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_orders_products_attributes set ';\n\t\t}\n\t\tif (!is_null($this->getOrderid())) {\n\t\t\t$sql .= '`orders_id`=\"' . e($this->getOrderid()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProductid())) {\n\t\t\t$sql .= '`orders_products_id`=\"' . e($this->getProductid()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_options())) {\n\t\t\t$sql .= '`products_options`=\"' . e($this->getProducts_options()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_options_values())) {\n\t\t\t$sql .= '`products_options_values`=\"' . e($this->getProducts_options_values()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getOptions_values_price())) {\n\t\t\t$sql .= '`options_values_price`=\"' . e($this->getOptions_values_price()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getPrice_prefix())) {\n\t\t\t$sql .= '`price_prefix`=\"' . e($this->getPrice_prefix()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProduct_attribute_is_free())) {\n\t\t\t$sql .= '`product_attribute_is_free`=\"' . e($this->getProduct_attribute_is_free()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_attributes_weight())) {\n\t\t\t$sql .= '`products_attributes_weight`=\"' . e($this->getProducts_attributes_weight()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_attributes_weight_prefix())) {\n\t\t\t$sql .= '`products_attributes_weight_prefix`=\"' . e($this->getProducts_attributes_weight_prefix()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_discounted())) {\n\t\t\t$sql .= '`attributes_discounted`=\"' . e($this->getAttributes_discounted()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_base_included())) {\n\t\t\t$sql .= '`attributes_price_base_included`=\"' . e($this->getAttributes_price_base_included()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_onetime())) {\n\t\t\t$sql .= '`attributes_price_onetime`=\"' . e($this->getAttributes_price_onetime()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_factor())) {\n\t\t\t$sql .= '`attributes_price_factor`=\"' . e($this->getAttributes_price_factor()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_factor_offset())) {\n\t\t\t$sql .= '`attributes_price_factor_offset`=\"' . e($this->getAttributes_price_factor_offset()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_factor_onetime())) {\n\t\t\t$sql .= '`attributes_price_factor_onetime`=\"' . e($this->getAttributes_price_factor_onetime()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_factor_onetime_offset())) {\n\t\t\t$sql .= '`attributes_price_factor_onetime_offset`=\"' . e($this->getAttributes_price_factor_onetime_offset()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_qty_prices())) {\n\t\t\t$sql .= '`attributes_qty_prices`=\"' . e($this->getAttributes_qty_prices()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_qty_prices_onetime())) {\n\t\t\t$sql .= '`attributes_qty_prices_onetime`=\"' . e($this->getAttributes_qty_prices_onetime()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_words())) {\n\t\t\t$sql .= '`attributes_price_words`=\"' . e($this->getAttributes_price_words()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_words_free())) {\n\t\t\t$sql .= '`attributes_price_words_free`=\"' . e($this->getAttributes_price_words_free()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_letters())) {\n\t\t\t$sql .= '`attributes_price_letters`=\"' . e($this->getAttributes_price_letters()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getAttributes_price_letters_free())) {\n\t\t\t$sql .= '`attributes_price_letters_free`=\"' . e($this->getAttributes_price_letters_free()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_options_id())) {\n\t\t\t$sql .= '`products_options_id`=\"' . e($this->getProducts_options_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_options_values_id())) {\n\t\t\t$sql .= '`products_options_values_id`=\"' . e($this->getProducts_options_values_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getProducts_prid())) {\n\t\t\t$sql .= '`products_prid`=\"' . e($this->getProducts_prid()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'orders_products_attributes_id=\"' . e($this->getId()) . '\" where orders_products_attributes_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId(Database::singleton()->lastInsertedID());\n\t\t\tself::__construct($this->getId());\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\n\t\t$producto = new Producto();\n\t\t$producto->fill($data);\n\t\t$producto->save();\n\n\t\treturn Redirect::route('productos.index');\n\t}", "public function store(ProductStoreRequest $request)\n {\n /* Product Store */\n if(auth()->user()->can('create_product')){\n DB::beginTransaction();\n try{\n $product = Product::create([\n 'subcategory_id' => $request->input('sub_category'),\n 'product_name' => $request->input('product_name'),\n 'company_id' => $request->input('company_id'),\n 'sku' => $request->input('sku'),\n 'barcode' => $request->input('barcode'),\n 'base_unit_id' => $request->input('unit_id'),\n 'description' => $request->input('description'),\n 'size' => $request->input('size'),\n 'created_at' => Carbon::now('+6'),\n 'updated_at' => Carbon::now('+6')\n// 'cost_price' => $request->cost_price,\n// 'selling_price' => $request->selling_price,\n// 'quantity' => $request->quantity,\n ]);\n }catch (\\Exception $e)\n {\n\n DB::rollback();\n Toastr::success('Something Went Wrong 1', 'Error');\n return redirect()->route('admin.product.create');\n }\n\n /*\n * Process Batch No\n * */\n\n try{\n $batch = new ProductPrice([\n 'product_id' => $product->id,\n 'branch_id' => auth()->user()->branch_id,\n 'batch_no' => date('Y'). '-'.random_int(1,50000),\n 'quantity' => $request->quantity,\n 'sold' => 0,\n 'cost_price' => $request->cost_price,\n 'selling_price' => $request->selling_price,\n 'mfg_date' => Carbon::now('+6'),\n 'exp_date' => Carbon::now('+6'),\n 'created_at' => Carbon::now('+6'),\n 'updated_at' => Carbon::now('+6'),\n\n ]);\n $product->productprices()->save($batch);\n }catch (\\Exception $e)\n {\n DB::rollback();\n Toastr::success('Something Went Wrong 2', 'Error');\n return redirect()->route('admin.product.create');\n }\n\n /*\n * Inventories Process\n * */\n\n try\n {\n $inventories = Inventory::create([\n 'product_id' => $product->id,\n 'user_id' => auth()->user()->id,\n 'branch_id' => auth()->user()->branch_id,\n// 'batch_no' => $batch->batch_no,\n 'unit_id' => $request->unit_id,\n 'in_out_qty' => $request->quantity,\n 'remarks' => 'OpeningStock',\n 'created_at' => Carbon::now('+6.30'),\n 'updated_at' => Carbon::now('+6.30'),\n ]);\n }catch (\\Exception $e)\n {\n DB::rollback();\n Toastr::success('Something Went Wrong 3', 'Error');\n return redirect()->route('admin.product.create');\n }\n\n DB::commit();\n\n /* Check Product store and toastr message */\n if($product && $batch && $inventories){\n\n Toastr::success('Product Successfully Added', 'Success');\n return redirect()->route('admin.product.index');\n }\n abort(404);\n } else{\n return redirect('login');\n }\n }", "public function store(ProductFormRequest $request)\n {\n $dataForm = $request->all();\n\n $dataForm['active'] = (!isset($dataForm['active']) ) ? 0 : $dataForm['active'];\n\n $insert = $this->product->create($dataForm);\n \n if($insert)\n return redirect()->route('produtos.index');\n else\n return redirect()->back();\n }", "public function run()\n {\n Product::insert([\n ['code' => '43763','name' => 'Molho de Buteco', 'size' => '150.00', 'quantity' => '60', 'measure_id' => '2', 'type_id' => '5'],\n ]);\n }", "public function store(ProductStoreRequest $request)\n {\n $this->productService->store($request);\n }", "private function saveItem()\n {\n DB::beginTransaction();\n try\n {\n $product = !empty(request()->json('id')) ? Product::find(request()->json('id')) : new Product();\n $product->client_id = auth()->user()->current_client_id;\n $product->warehouse_id = auth()->user()->current_warehouse_id;\n $product->sku = request()->json('sku');\n $product->sku_client = request()->json('sku_client', null);\n $product->name = request()->json('name');\n $product->barcode = request()->json('barcode', null);\n $product->barcode_client = request()->json('barcode_client', null);\n $product->rfid = request()->json('rfid', null);\n $product->reorder_level = request()->json('reorder_level');\n $product->product_type_id = request()->json('product_type_id');\n\n /* HARDCODE IT TO BE THE DEFAULT FOR THE PRODUCT TYPE FOR NOW. CHANGE IT TO BE PER PRODUCT LATER */\n $product->default_uom = request()->json('product_type')['default_uom'];\n\n $product->uom1 = request()->json('uom1');\n $product->uom2 = request()->json('uom2', null);\n $product->uom3 = request()->json('uom3', null);\n $product->uom4 = request()->json('uom4', null);\n $product->uom5 = request()->json('uom5', null);\n $product->uom6 = request()->json('uom6', null);\n $product->uom7 = request()->json('uom7', null);\n $product->uom8 = request()->json('uom8', null);\n $product->oversized_pallet = (!empty(request()->json('oversized_pallet'))) ? true : false;\n $product->active = (!empty(request()->json('active'))) ? true : false;\n\n $product->save();\n\n //check for default bin and add it\n if( empty(request()->json('id')) )\n {\n $aisle = request()->json('aisle');\n $section = request()->json('section');\n $tier = request()->json('tier');\n $position = request()->json('position');\n\n //part of default bin data is missing\n if( empty($aisle) || empty($section) || empty($tier) || empty($position) )\n {\n throw new Exception('Default bin data is missing');\n }\n\n //add the bin\n else\n {\n $bin = new Bin();\n $bin->product_id = $product->id;\n $bin->default = true;\n $bin->active = true;\n $bin->aisle = $aisle;\n $bin->section = $section;\n $bin->tier = $tier;\n $bin->position = $position;\n $bin->save();\n }\n }\n }\n catch(\\Exception $e)\n {\n //rollback since something failed\n DB::rollback();\n\n //log error so we can trace it if need be later\n Log::info(auth()->user());\n Log::error($e);\n\n //set error message. Don't send verbose error if not in debug mode\n $err_msg = ( env('APP_DEBUG') === true ) ? $e->getMessage() : 'SQL error. Please try again or report the issue to the admin.';\n\n //send back error\n $error_message = array('errorMsg' => 'The product was not saved. Error: ' . $err_msg);\n return response()->json($error_message);\n }\n\n //if we got here, then everything worked!\n DB::commit();\n\n return $product->id;\n }", "public function store(Request $request)\n {\n \n // DB::transaction(function () {\n \n // });\n\n $product = $this->product->create($request->except('features'));\n $product->syncFeatures($request->input('features'));\n\n return redirect(route('product.edit', ['id' => $product->id]));\n }", "public function store(SaveProductRequest $request)\n { \n $product = Product::create($request->validated());\n\n if($request['usa_empaque']):\n $request->validate([\n 'fraccion' => 'required',\n 'medida_paq' => 'required',\n 'min_paq' => 'required'\n ]);\n \n $product->usa_empaque = $request['usa_empaque'];\n $product->medida_paq = $request['medida_paq'];\n $product->fraccion = $request['fraccion'];\n $product->min_paq = $request['min_paq'];\n $product->save();\n endif;\n if($request['usa_impuesto']):\n $request->validate([\n 'impuesto' => 'required'\n ]);\n \n $product->impuesto = $request['impuesto'];\n $product->save(); \n endif;\n\n //insertar los proveedores de productos\n $contador = count($request['proveedor']);\n for($i=0;$i<$contador;$i++){\n product_provider::create([\n 'product_id' => $product->id,\n 'provider_id' => $request['proveedor'][$i]\n ]);\n }\n\n return true;\n // Product::create($request->validated());\n // return true;\n }", "public function store(ProductRequest $request)\n {\n $data = $request->except('product_prices', 'product_pictures');\n $product = Product::create($data);\n\n // Save product prices\n foreach ($request->product_prices as $price) {\n $prices[] = new ProductPrice([\n 'productid' => $product->productid,\n 'min_qty' => $price['min_qty'],\n 'max_qty' => $price['max_qty'],\n 'price' => $price['price'],\n ]);\n }\n $prices = $product->productPrice()->saveMany($prices);\n $product['product_prices'] = $prices;\n\n // Save product images\n foreach ($request->product_pictures as $picture) {\n $pictures[] = new ProductPicture([\n 'productid' => $product->productid,\n 'filepath' => $picture->store('assets/product', 'public'),\n ]);\n }\n $pictures = $product->productPicture()->saveMany($pictures);\n $product['product_pictures'] = $pictures;\n\n return ResponseFormatter::success($product, 'Success create data');\n }", "public function store(StoreProductRequest $request)\n {\n //Input received from the request\n $input = $request->except(['_token']);\n //Create the model using repository create method\n $this->repository->create($input);\n //return with successfull message\n return redirect()->route('admin.products.index')->withFlashSuccess(trans('alerts.backend.products.created'));\n }", "public function store(ProductFormRequest $request)\n {\n $dataForm = $request->all();\n\n $dataForm['active'] = (!isset($dataForm['active'])) ? 0: 1;\n\n $insert = $this->product->create($dataForm);\n\n if ($insert)\n return redirect()->route('produtos.index');\n else\n return redirect()->back();\n\n //dd($request->except('_token'));\n }", "public function store(ProductRequest $request)\n {\n $this->objProduct->create([\n 'produto'=>$request->produto,\n 'preco'=>$request->preco,\n 'id_user'=>$request->id_user\n ]);\n }", "public function store(Request $request): RedirectResponse\n {\n $params = $request->only([\n 'code',\n 'visible',\n 'category_id',\n 'length',\n 'width',\n 'thickness',\n ]);\n\n \\DB::transaction(function () use ($request, $params) {\n if ($request->hasFile('image')) {\n // Storing Product\n $params['image'] = \\Storage::putFile('products', $request->file('image'));\n throw new \\Exception(\"Required Image Wasn't Provided\");\n }\n $product = Product::create($params);\n\n // Storing Product's Translations\n $translations = language_data_collector(['color', 'title', 'description'], ['product_id' => $product->id]);\n $translations = $translations->map(function ($translation) {\n $translation['slug'] = Str::slug($translation['title']);\n return $translation;\n });\n\n ProductTranslation::insert($translations->toArray());\n\n // Storing Product's Features\n $features = collect($request->get('feature_ids'));\n\n $features = $features->map(function ($feature) use ($product) {\n return [\n 'product_id' => $product->id,\n 'feature_id' => $feature,\n ];\n });\n\n ProductFeature::insert($features->toArray());\n\n // Storing Product Compatibility\n $product_compatibilities = collect($request->get('product_compatibilities'));\n $product_compatibilities = $product_compatibilities->map(function ($product_compatibility) use ($product) {\n return [\n 'product_id' => $product->id,\n 'blade_id' => $product_compatibility,\n ];\n });\n\n ProductCompatible::insert($product_compatibilities->toArray());\n\n // Storing Product's Package Type\n if (count($request->get('packages')) > 0) {\n $package_images = $request->file('package_images');\n $packages = $request->get('packages');\n\n foreach ($packages as $index => $package) {\n $image = null;\n if (isset($package_images[$index]) && !is_null($package_images[$index])) {\n $image = \\Storage::putFile(ProductPackageType::BASE_LOCATIONS, $package_images[$index]);\n }\n ProductPackageType::create([\n 'product_id' => $product->id,\n 'package_type_id' => $package,\n 'amount' => $request->get('amounts')[$index],\n 'image' => $image\n ]);\n }\n }\n\n // Storing Product's Images\n $images = $request->file('images');\n $thumbnails = $request->file('thumbnails');\n\n foreach ($images as $index => $image) {\n ProductImage::create([\n 'product_id' => $product->id,\n 'image' => Storage::putFile(ProductImage::BASE_LOCATION, $image),\n 'thumbnail' => Storage::putFile(ProductImage::BASE_LOCATION, $thumbnails[$index]),\n ]);\n }\n\n return true;\n });\n\n return redirect()->route('admin.product.index')->with('success', __(\"Successfully Created\"));\n }", "public function store(CreateProductRequest $request)\n {\n $input = $request->all();\n\n $provider = Provider::find($input[\"provider_id\"]);\n\n $product = Product::create([\n \"code\" => Product::generateUniqueCode(implode(\" \", $input[\"title\"]) , $provider->sku_suffix ),\n \"provider_id\" => $provider->id,\n\t\t\t'publish_id'\t=> $input[\"publish_id\"],\n\t\t\t'publish_at'\t=> $input[\"publish_date\"],\n ]);\n\n if (!$product) {\n return Redirect::back()->withErrors([\"El producto no pudo ser creado\"]);\n }\n\n foreach ($this->languages as $language) {\n $product->updateTranslationByIso($language->iso6391,[\n 'title' => $input[\"title\"][$language->iso6391],\n 'description' => $input[\"description\"][$language->iso6391],\n 'slug' => Product::generateUniqueSlug($input[\"title\"][$language->iso6391])\n ]);\n }\n\n updateMYSQLTimestamp();\n\n return Redirect::route('admin::products.edit',$product->id)->with('status', \"El producto fue correctamente creado\");\n }", "public function store(Request $request)\n {\n $product = Product::create($request->get('product'));\n\n $categories = $request->get('categories');\n $productCategoryArr = [];\n foreach($categories as $category) {\n array_push($productCategoryArr, ['product_id' => $product->id, 'category_id' => $category]);\n }\n print_r($productCategoryArr);\n ProductCategory::insert($productCategoryArr);\n \n $data = $request->get('attr');\n $attrArray = [];\n $numOfVariants = count($data) / 4;\n for($i = 0; $i < $numOfVariants; $i++) {\n array_push($attrArray, [\n 'product_id' => $product->id,\n 'size_id' => $data[4*$i], \n 'color_id' => $data[4*$i+1], \n 'buying_price' => $data[4*$i+2], \n 'selling_price' => $data[4*$i+3]\n ]);\n }\n Stock::insert($attrArray);\n\n $imageArray = [];\n $images = $request->images ? $request->images : [];\n \n foreach($images as $image) {\n // $extension = $image->getClientOriginalExtension();\n $file = Storage::disk('local')->put('public/images', $image);\n\n array_push($imageArray, [\n 'product_id' => $product->id,\n 'source' => 'storage/images/'.baseName($file)\n ]);\n }\n DB::table('product_images')->insert($imageArray);\n\n return redirect('/admin/products');\n }", "public function store(ProductRequest $request)\n {\n Product::create($request->validated());\n return;\n }", "public function store(Request $request, Product $product)\n {\n //TODO GET USER\n\n //TODO GET SELLER\n\n //TODO INSERT NEW CART\n\n //TODO INSERT CART PRODUCTS AT NEW CART\n\n //TODO INSERT CART PRODUCTS AT OLD CART\n\n\n //TODO UPDATE CART PRODUCTS\n\n\n return back();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'img-file' => ['required'],\n 'costs.*' => ['required', 'numeric'],\n 'prices.*' => ['required', 'numeric'],\n 'productName' => ['required', 'max:255', 'unique:products,product_name'],\n 'category' => ['required', 'exists:categories,category_id'],\n 'productVariantSkus.*' => ['required', 'string', 'distinct'],\n ]);\n\n try {\n $category = App\\Category::findOrFail($request->input('category'));\n } catch (ModelNotFoundException $e) {\n return abort(403, 'cant find model');\n }\n\n DB::beginTransaction();\n\n //create product\n $productName = $request->input('productName');\n $description = $request->input('description');\n\n $product = new Product([\n 'product_name' => $productName,\n 'description' => $description\n ]);\n\n // save product\n $product = $category->products()->save($product);\n if (!$product) {\n return back()->with('error', 'Something went wrong while trying to save the product');\n }\n\n try {\n //store img\n $images = $request->file('img-file');\n if (!$request->hasFile('img-file') && !$images->isValid()) {\n throw new InvalidFileException('Invalid uploaded Image file.');\n }\n\n $tempImages = $this->storeProductImgs($images, $product);\n\n $thumbnail = reset($tempImages);\n $thumbnailFile = reset($images);\n\n $thumbnail->update(['is_thumbnail' => true]);\n\n $thumbnailName = basename($thumbnail->path);\n\n $product->thumbnail = $this->storeThumbnail($thumbnailFile, $thumbnailName);\n $product->update();\n } catch (InvalidFileException | ErrorException $e) {\n DB::rollBack();\n return back()->with('error', ' ERROR SAVING PRODUCT : ' . $e->getMessage());\n }\n\n //save images\n $imageResult = $product->images()->saveMany($tempImages);\n if (!$imageResult) {\n return back()->with('error', 'Something went wrong while trying to save the Images');\n }\n\n // save product variant\n try {\n $productVariants = new Collection();\n foreach ($request->input('productVariantRows') as $key) {\n\n //check for duplicate entry of product variant\n $duplicate = false;\n $attributeValuesId = $request->input(\"attributeValues\")[$key];\n foreach ($productVariants as $pv) {\n $pvAttrValsId = $pv->attributeValues()->pluck('attribute_values.attribute_value_id')->toArray();\n \n //update qty if duplicate\n if (ArrayCompare::array_equals($pvAttrValsId, $attributeValuesId)) {\n $pv->update(['quantity' => $pv->quantity + $request->input(\"quantities\")[$key]]);\n $duplicate = true;\n break;\n }\n }\n\n //add new productvariant if not duplicate\n if (!$duplicate) {\n $productVariant = new ProductVariant([\n 'product_variant_sku' => $productName,\n 'cost' => $request->input(\"costs\")[$key],\n 'price' => $request->input(\"prices\")[$key],\n 'quantity' => $request->input(\"quantities\")[$key],\n 'created_by' => auth()->user()->staff->staff_id,\n ]);\n $productVariant->product()->associate($product);\n $product->productVariants()->save($productVariant);\n\n //attach foreign keys\n $productVariant->attributeValues()->attach($attributeValuesId);\n\n $productVariant->update([\n 'product_variant_sku' => $productName . $productVariant->getAttributeValuesName()\n ]);\n $productVariants->add($productVariant);\n }\n }\n } catch (Exception | Throwable $e) {\n DB::rollBack();\n return back()->with('error', ' ERROR PRODUCT VARIANT : ' . $e->getMessage());\n }\n\n //save records\n DB::commit();\n return redirect('dashboard/products?_token=' . csrf_token() . '&created_at-sort=desc')->with('success', 'Product has been added successfully');\n }", "public function store(ProductRequest $request)\n {\n Product::create($request->all());\n\n return redirect()->route('productos.index');\n }", "function product_put()\n {\n $this->form_validation->set_data($this->put());\n\n if($this->form_validation->run('product_put') != false){\n\n $product = $this->put();\n\n $product_id = $this->api_model->insert_product($product);\n\n if(!$product_id)\n {\n $this->response(array('status' => 'failure', 'message' => 'An unexpected error occured while trying to create the product'), REST_CONTROLLER::HTTP_INTERNAL_SERVER_ERROR);\n }\n else\n {\n $this->response(array('status' => 'success', 'message' => 'created'));\n }\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => $this->form_validation->get_errors_as_array()), REST_Controller::HTTP_BAD_REQUEST);\n }\n }", "public function store()\n\t{\n\t\t$id = Request::input('cart');\n\t\t$cart = Cart::where('id', $id)->first();\n\n\t\t$cart_products = $cart->products;\n\n\t\t$order = new Order;\n\t\t\\Auth::user()->orders()->save($order);\n\n\t\tif (!$cart_products->isEmpty()) {\n\n\t\t\tforeach ($cart_products as $product){\n\t\t\t\tif($product->stock < $product->pivot->quantity ) {\n\t\t\t\t\t$order->delete();\n\t\t\t\t\tflash()->error('Cannot fulfill order as insufficient ' . $product->title. ' stock');\n\t\t\t\t\treturn redirect('orders/create');\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($cart_products as $product) {\n\t\t\t\t$order->products()->attach([$product->id], [ 'quantity' => $product->pivot->quantity ]);\n\t\t\t}\n\t\t}\n\n\t\tflash()->success('Order successfully created');\n\t\treturn redirect('orders');\n\t\t\n\t}", "public function InsertProductData(){\n\t \n $sReqProd = \"INSERT INTO products (name, description, id_cat) VALUES (:name, :description, :id_cat)\";\n $name = $_SESSION['products']['name'];\n $desc = $_SESSION['products']['desc'];\n $id_cat = $_SESSION['products']['cat'] ;\n\n $sReqPrice = \"INSERT INTO products_prices (name, incl_tax, id_product) VALUES (:pricename, :incl, :id_prod)\";\n $iNbPrices = count($_SESSION['prices']['name_prices']);\n\n // begin transaction\n SPDO::getInstance()->beginTransaction();\n try{\n\n // Insert product\n $insert_prod = SPDO::getInstance()->prepare($sReqProd);\n $insert_prod->bindParam(':name', $name);\n $insert_prod->bindParam(':description', $desc);\n $insert_prod->bindParam('id_cat', $id_cat);\n $insert_prod->execute();\n\n // Insert prices\n $lastIdProd = SPDO::getInstance()->lastInsertId();\n $insert_prices = SPDO::getInstance()->prepare($sReqPrice);\n for ($i=0 ; $i < $iNbPrices ; $i++){\n $insert_prices->bindParam(':pricename', $_SESSION['prices']['name_prices'][$i]);\n $insert_prices->bindParam(':incl', $_SESSION['prices']['prices'][$i]);\n $insert_prices->bindParam(':id_prod', $lastIdProd);\n $insert_prices->execute();\n }\n\n //commit\n SPDO::getInstance()->commit(); \n\n } catch(Excption $e){\n SPDO::getInstance()->rollback();\n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n $this->DisplayResultRqt(false, 'admin.php?p=product&a=create_prod', '', '');\n }\t\t\n \n $this->DisplayResultRqt(true, 'admin.php?p=product&a=create_prod', '', ''); \n unset($_SESSION['products']);\n unset($_SESSION['prices']);\n\n\t}", "public function store($Product)\n {\n $newProduct = new SimpleProduct();\n $newProduct->ProductName= $Product->ProductName;\n $newProduct->ProductPrice = $Product->ProductPrice;\n $newProduct->ProductCategory = $Product->ProductCategory;\n $newProduct->ProductTaxClass = $Product->ProductTaxClass;\n $newProduct->ProductPriceList = $Product->ProductPriceList;\n $newProduct->ProductMeasureUnit = $Product->ProductMeasureUnit;\n $newProduct->ProductDescription = $Product->ProductDescription;\n //$newProduct->ProductProductionDate = date(\"Y-m-d\",$Product->ProductProductionDate);\n //$newProduct->ProductExpireyDate = date(\"Y-m-d\",strtotime($Product->ProductExpireyDate));\n $newProduct->ProductSKU = $Product->ProductSKU;\n $newProduct->ProductBrand = $Product->ProductBrand;\n $newProduct->ProductManufacturer = $Product->ProductManufacturer;\n $newProduct->save();\n }", "public function store(AddProductRequest $request)\n {\n\n $image_one = $request->image_one->store('products');\n $image_two = $request->image_two->store('products');\n $image_three = $request->image_three->store('products');\n $image_four = $request->image_four->store('products');\n\n\n Product::create([\n\n 'name'=> $request->name,\n 'price'=> $request->price,\n 'category'=> $request->category,\n 'img1'=> $image_one,\n 'img2'=> $image_two,\n 'img3'=> $image_three,\n 'img4'=> $image_four,\n 'description'=> $request->description\n\n ]);\n\n Session::flash('success', 'Product Added Successfully');\n return redirect(route('product.index'));\n\n }", "public function run(){\n //\n DB::table('products')->insert([\n \t'name' => 'Harina Pan',\n 'price' => '4000',\n 'weight' => '4',\n 'type' => 'physical',\n\n ]);\n Products::factory()->count(3)->create();\n \n\n }", "public function store(StoreProductRequest $request)\n {\n $product = Product::create($request->validated());\n $product->images()->createMany($request->images ?? []);\n\n return success(route('products.index'));\n }", "public function store(Request $request)\n {\n //\n Product::storeProduct($request);\n return redirect('my_admin/products/');\n }", "public function store(Request $request)\n {\n Product::create($request->all());\n }", "public function store(CreateProductRequest $request)\n {\n $product = $this->productRepository->saveRecord($request);\n\n $details = [];\n $details['product_id'] = $product->id;\n $details['description'] = $request->description;\n $details['price'] = $request->price;\n ProductDetails::create($details);\n\n $slot = [];\n $slot['product_id'] = $product->id;\n $slot['title'] = 'Slot 1';\n $done = Slot::create($slot);\n\n $slotBooking = [];\n $slotBooking['slot_id'] = $done->id;\n $slotBooking['user_id'] = Auth::id();\n $slotBooking['status'] = 1;\n SlotBookings::create($slotBooking);\n\n Flash::success($this->BreadCrumbName . ' saved successfully.');\n if (isset($request->continue)) {\n $redirect_to = redirect(route('admin.products.create'));\n } elseif (isset($request->translation)) {\n $redirect_to = redirect(route('admin.products.edit', $product->id));\n } else {\n $redirect_to = redirect(route('admin.products.index'));\n }\n return $redirect_to->with([\n 'title' => $this->BreadCrumbName\n ]);\n }", "public function store(Product $product, Request $request)\n {\n $this->validate($request, [\n 'lense_id' => 'required',\n 'addmore.*.mirror_id' => 'required',\n 'addmore.*.price' => 'required'\n ]);\n\n $prod_var = Productvariant::create([\n 'product_id' => $product->id,\n 'lense_id' => $request->lense_id,\n ]);\n\n foreach ($request->addmore as $key => $value) {\n Productmirrors::create([\n 'prod_var' => $prod_var->id,\n 'mirror_id' => $value['mirror_id'],\n 'price' => $value['price']\n ]);\n }\n\n return redirect(route('admin.productvariant.index', $product->id));\n }", "public function store()\n\t{\t$input = Input::all();\n\n\n\t\ttry{\n\t\t\t$p = new Product();\n\n\t\t\t$p->code \t\t\t= $input['code'];\n\t\t\t$p->cat_id \t\t= $input['cat_id'];\n\t\t\t$p->description = $input['description'];\n\t\t\t//$p->image \t\t\t= $input['image'];\n\t\t\t$p->price \t\t\t= $input['price'];\n\t\t\t$p->tax \t\t\t= $input['tax'];\n\t\t\t\n\t\t\t$p->cogs \t\t\t= $input['cogs'];\n\t\t\t$p->ner \t\t\t= $input['ner'];\n\t\t\t$p->hider \t\t\t= $input['hider'];\n\t\t\t\n\t\t\t$p->linked_product\t= @serialize($input['linked_product']);\n\t\t\t$p->created_at \t\t= time();\n\t\t\t$p->updated_at \t\t= time();\n\n\n\t\t\t\tif($p->save())\n\t\t\t\t\treturn Response::json(array('success' => true,'id'=>$p->id,'message'=>\"Product saved successfully!\"));\n\t\t\t\telse\n\t\t\t\t\tthrow new \\Exception(\"Couldnot save the product\");\n\n\t\t} catch(\\Exception $e){\n\t\t\treturn Response::json(array('success' => false,'message'=>$e->getMessage()));\n\t\t}\n\n\t}", "public function store()\n {\n $this->storeKeys();\n }", "public function store()\n\t{\n\t\t$product = new \\App\\Models\\Product(\\Input::all());\n\n\t\t//validate\n\t\t$file = array('name' => $product->name, 'price' => $product->price);\n\t\t$rules = array('name' => 'required', 'price' => 'required'); //mimes:jpeg,bmp,png and for max size max:10000\n\t\t$validator = \\Validator::make($file, $rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn \\Redirect::back()->withInput()->withErrors($validator);\n\t\t}\n\n\t\t//try save\n\t\ttry{\n\t\t\t$product->save();\n\t\t}\n\t\tcatch(\\Exception $e)\n\t\t{\n\t\t\treturn \\Redirect::back()->withInput()->withErrors(new MessageBag(array($e->getMessage())));\n\t\t}\n\n\t\t\\Session::flash('success', 'מוצר הוסף בהצלחה');\n\t\treturn \\Redirect::back();\n\t}", "public function store(ProductRequest $request)\n {\n Product::create($request->all());\n return redirect()->route('products.index')->with('info', 'Product addes successfully');\n }", "public function store(Request $request , StoreProductRequest $storeProductRequest)\n {\n // all = > built in method in request class retrieve data as array & convert object data to array\n\n // check validation before insert data in db\n // redirect automitcally to direction\n //upload image\n $photoName = $this->uploadMedia($request->image,'products'); // take image name that return in request object\n // insert product into database\n $data = $request->except('_token', 'image', 'page'); //not upload image beacuse it reurn file not image name\n $data['image'] = $photoName;\n // insert into db\n DB::table('products')->insert($data);\n // determin which button is clicked , return to according to button -> with success message\n return $this->returnAccordingButton($request);\n\n }", "public function store(CreateProductRequest $request)\n\t{\n\t\t$this->product->create($request->all());\n\t\t\n\t\treturn redirect()->route('product.index');\n\t}", "public function store(ProductRequest $request)\n\t{\n\t\t$product = new Product();\n $this->saveProduct($request, $product);\n\t\treturn redirect()->route('products.index')->with('message', 'Product created successfully.');\n\t}", "protected function _saveProducts()\n {\n $priceIsGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n $entityLinkField = $this->getProductEntityLinkField();\n\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = [];\n $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = [];\n $this->categoriesCache = [];\n $tierPrices = [];\n $mediaGallery = [];\n $labelsForUpdate = [];\n $imagesForChangeVisibility = [];\n $uploadedImages = [];\n $previousType = null;\n $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($bunch);\n\n foreach ($bunch as $rowNum => $rowData) {\n // reset category processor's failed categories array\n $this->categoryProcessor->clearFailedCategories();\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n $rowScope = $this->getRowScope($rowData);\n\n $rowData[self::URL_KEY] = $this->getUrlKey($rowData);\n\n $rowSku = $rowData[self::COL_SKU];\n\n if (null === $rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($rowSku)['attr_set_code'];\n }\n\n // 1. Entity phase\n if ($this->isSkuExist($rowSku)) {\n // existing row\n if (isset($rowData['attribute_set_code'])) {\n $attributeSetId = $this->catalogConfig->getAttributeSetId(\n $this->getEntityTypeId(),\n $rowData['attribute_set_code']\n );\n\n // wrong attribute_set_code was received\n if (!$attributeSetId) {\n throw new LocalizedException(\n __(\n 'Wrong attribute set code \"%1\", please correct it and try again.',\n $rowData['attribute_set_code']\n )\n );\n }\n } else {\n $attributeSetId = $this->skuProcessor->getNewSku($rowSku)['attr_set_id'];\n }\n\n $entityRowsUp[] = [\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'attribute_set_id' => $attributeSetId,\n $entityLinkField => $this->getExistingSku($rowSku)[$entityLinkField]\n ];\n } else {\n if (!$productLimit || $productsQty < $productLimit) {\n $entityRowsIn[strtolower($rowSku)] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($rowSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($rowSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => isset($rowData['has_options']) ? $rowData['has_options'] : 0,\n 'created_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => (new \\DateTime())->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n }\n\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n // 2. Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // 3. Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->processRowCategories($rowData);\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n unset($rowData['rowNum']);\n\n // 4.1. Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => $rowData['_tier_price_price'],\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] ||\n $priceIsGlobal ? 0 : $this->storeResolver->getWebsiteCodeToId($rowData['_tier_price_website']),\n ];\n }\n\n if (!$this->validateRow($rowData, $rowNum)) {\n continue;\n }\n\n // 5. Media gallery phase\n list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);\n $storeId = !empty($rowData[self::COL_STORE])\n ? $this->getStoreIdByCode($rowData[self::COL_STORE])\n : Store::DEFAULT_STORE_ID;\n $imageHiddenStates = $this->getImagesHiddenStates($rowData);\n foreach (array_keys($imageHiddenStates) as $image) {\n if (array_key_exists($rowSku, $existingImages)\n && array_key_exists($image, $existingImages[$rowSku])\n ) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n $uploadedImages[$image] = $image;\n }\n\n if (empty($rowImages)) {\n $rowImages[self::COL_MEDIA_IMAGE][] = $image;\n }\n }\n\n $rowData[self::COL_MEDIA_IMAGE] = [];\n\n /*\n * Note: to avoid problems with undefined sorting, the value of media gallery items positions\n * must be unique in scope of one product.\n */\n $position = 0;\n foreach ($rowImages as $column => $columnImages) {\n foreach ($columnImages as $columnImageKey => $columnImage) {\n if (!isset($uploadedImages[$columnImage])) {\n $uploadedFile = $this->uploadMediaFiles($columnImage);\n $uploadedFile = $uploadedFile ?: $this->getSystemFile($columnImage);\n if ($uploadedFile) {\n $uploadedImages[$columnImage] = $uploadedFile;\n } else {\n $this->addRowError(\n ValidatorInterface::ERROR_MEDIA_URL_NOT_ACCESSIBLE,\n $rowNum,\n null,\n null,\n ProcessingError::ERROR_LEVEL_NOT_CRITICAL\n );\n }\n } else {\n $uploadedFile = $uploadedImages[$columnImage];\n }\n\n if ($uploadedFile && $column !== self::COL_MEDIA_IMAGE) {\n $rowData[$column] = $uploadedFile;\n }\n\n if ($uploadedFile && !isset($mediaGallery[$storeId][$rowSku][$uploadedFile])) {\n if (isset($existingImages[$rowSku][$uploadedFile])) {\n $currentFileData = $existingImages[$rowSku][$uploadedFile];\n if (isset($rowLabels[$column][$columnImageKey])\n && $rowLabels[$column][$columnImageKey] !=\n $currentFileData['label']\n ) {\n $labelsForUpdate[] = [\n 'label' => $rowLabels[$column][$columnImageKey],\n 'imageData' => $currentFileData\n ];\n }\n\n if (array_key_exists($uploadedFile, $imageHiddenStates)\n && $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]\n ) {\n $imagesForChangeVisibility[] = [\n 'disabled' => $imageHiddenStates[$uploadedFile],\n 'imageData' => $currentFileData\n ];\n }\n } else {\n if ($column == self::COL_MEDIA_IMAGE) {\n $rowData[$column][] = $uploadedFile;\n }\n $mediaGallery[$storeId][$rowSku][$uploadedFile] = [\n 'attribute_id' => $this->getMediaGalleryAttributeId(),\n 'label' => isset($rowLabels[$column][$columnImageKey])\n ? $rowLabels[$column][$columnImageKey]\n : '',\n 'position' => ++$position,\n 'disabled' => isset($imageHiddenStates[$columnImage])\n ? $imageHiddenStates[$columnImage] : '0',\n 'value' => $uploadedFile,\n ];\n }\n }\n }\n }\n\n // 6. Attributes phase\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n $productType = isset($rowData[self::COL_TYPE]) ? $rowData[self::COL_TYPE] : null;\n if ($productType !== null) {\n $previousType = $productType;\n }\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if ($prevAttributeSet !== null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && $previousType !== null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n\n $productTypeModel = $this->_productTypeModels[$productType];\n if (!empty($rowData['tax_class_name'])) {\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($rowData[self::COL_SKU])\n ) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !$this->isSkuExist($rowSku)\n );\n $product = $this->_proxyProdFactory->create(['data' => $rowData]);\n\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType()\n && (\n in_array($attribute->getAttributeCode(), $this->dateAttrCodes)\n || $attribute->getIsUserDefined()\n )\n ) {\n $attrValue = $this->dateTime->formatDate($attrValue, false);\n } elseif ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = gmdate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n } elseif ($backModel) {\n $attribute->getBackend()->beforeSave($product);\n $attrValue = $product->getData($attribute->getAttributeCode());\n }\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$rowStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($rowStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$rowStore];\n }\n if (!$this->isSkuExist($rowSku)) {\n $storeIds[] = 0;\n }\n }\n foreach ($storeIds as $storeId) {\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$storeId])) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n }\n\n foreach ($bunch as $rowNum => $rowData) {\n if ($this->getErrorAggregator()->isRowInvalid($rowNum)) {\n unset($bunch[$rowNum]);\n }\n }\n\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n )->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->updateMediaGalleryVisibility(\n $imagesForChangeVisibility\n )->updateMediaGalleryLabels(\n $labelsForUpdate\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $bunch]\n );\n }\n\n return $this;\n }", "public function store(ProductRequest $request)\n {\n $size = [];\n foreach ((array)$request->size as $var => $val) {\n $size[] = $val;\n }\n $count = [];\n foreach ((array)$request->count as $var => $val) {\n $count[] = $val;\n }\n try{\n DB::beginTransaction();\n //save product\n $productID = Product::insertGetId([\n 'product_name' => $request->product_name,\n 'category_id' => $request->category_id\n ]);\n //save color\n $countColor = count($request->colour_name);\n for ($i=0; $i<$countColor; $i++)\n {\n $color_ID = Product_color::insertGetId([\n 'productimage' => saveImage('products',$request->productimage[$i]),\n 'after' => saveImage('products',$request->after[$i]),\n 'product_color_name'=> $request->colour_name[$i],\n 'product_color_hash'=> $request->colour_hash[$i],\n 'product_barcode'=> $request->product_barcode[$i],\n 'product_id' => $productID,\n ]);\n //save size\n $countSize = count($size[$i]);\n for($l=0; $l<$countSize; $l++)\n {\n $productColorSize = new Product_color_size();\n $productColorSize->product_size_name = $size[$i][$l];\n $productColorSize->count = $count[$i][$l];\n $productColorSize->product_color_id = $color_ID;\n $productColorSize->save();\n }\n }\n DB::commit();\n return redirect()->route('product.index')->with(['success'=>'This product created successfully']);\n }catch (\\Exception $ex){\n DB::rollBack();\n return redirect()->route('product.index')->with(['error'=>'Error, Try again later']);\n }\n }", "public function run() {\n $this->insertProductCategories();\n\n $this->insertProducts();\n }", "public function store(Request $request)\n {\n // Add new product\n $product = new Product();\n $product->name = $request->name;\n $product->description = $request->description;\n $categories = $request->categories;\n \n // Save product\n $product->save();\n \n // Attach categories to product\n $product->categories()->attach($categories);\n\n // Save product & categories to table relationship\n $product->save();\n\n // Redirect to product list\n return redirect()->route('products.index');\n }", "public function store(Request $request)\n {\n try {\n $item = Product::create([\n 'user_id' => Auth::id(),\n 'category_id' => $request->category_id,\n 'name' => $request->name,\n 'short_text' => $request->short_text,\n 'description' => $request->description,\n 'img' => (isset($request->img) ? file_store($request->img, 'assets/uploads/photos/product_img/', 'photo_') : null),\n ]);\n\n if (isset($request->property_value)) {\n foreach ($request->property_value as $key => $property_value) {\n if ($property_value) {\n $pp = ProductProperty::create([\n 'product_id' => $item->id,\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }\n }\n }\n\n if (isset($request->photo)) {\n foreach ($request->photo as $key => $photo) {\n if (isset($photo) and $photo) {\n $ph = new Photo();\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $item->photo()->save($ph);\n }\n }\n }\n\n return redirect()->route('product.index')->with('flash_message', 'با موفقیت انجام شد');\n }catch (\\Exception $e){\n return redirect()->back()->withInput()->with('err_message', 'خطایی رخ داده است، لطفا مجددا تلاش نمایید');\n }\n }", "public function store( Request $request ) {\n\t\tif ( Auth::user()->user_role != 1 ) {\n\t\t\treturn redirect( '/' );\n\t\t}\n\t\t$exist_product = Product::where( 'category_id', $request->get( 'category_id' ) )->where( 'product_name', $request->get( 'product_name' ) )->first();\n\n\t\tif ( ! $exist_product ) {\n\t\t\t$product = new Product();\n\t\t\t$product->product_name = $request->get( 'product_name' );\n\t\t\t$product->product_description = $request->get( 'product_des' );\n\t\t\t$product->category_id = $request->get( 'category_id' );\n\t\t\t$product->save();\n\n\t\t}\n\n\t\treturn redirect( '/products' );\n\t}", "public function store(Request $request)\n {\n // Product input validation\n \t$request->validate([\n \t\t'product_name'\t\t=>\t'required|unique:products,product_name',\n \t\t'product_code'\t\t=>\t'required',\n \t\t'product_price'\t\t=>\t'required',\n \t\t'product_quantity'\t=>\t'required',\n \t\t'category'\t\t\t=>\t'required',\n \t\t'brand'\t\t\t\t=>\t'required',\n \t\t'short_description'\t=>\t'required',\n \t\t'long_description'\t=>\t'required',\n \t\t'image_thumbnail'\t=>\t'required|mimes:jpg,png,jpeg',\n \t\t'image_gallery_one'\t=>\t'required|mimes:jpg,png,jpeg',\n \t\t'image_gallery_two'\t=>\t'required|mimes:jpg,png,jpeg'\n ]);\n \n \n // Product image upload file\n \t$thumbnail = $request->file('image_thumbnail');\n \t$img = md5(time().uniqid()).'.'.$thumbnail->getClientOriginalExtension();\n \tImage::make($thumbnail)->resize(270,270)->save(public_path('backend/img/product/').$img);\n\n \t$img_gallery = $request->file('image_gallery_one');\n \t$image = md5(time().uniqid()).'.'.$img_gallery->getClientOriginalExtension();\n \tImage::make($img_gallery)->resize(270,270)->save(public_path('backend/img/product/').$image);\n\n \t$image_gallerys = $request->file('image_gallery_two');\n \t$images = md5(time().uniqid()).'.'.$image_gallerys->getClientOriginalExtension();\n \tImage::make($image_gallerys)->resize(270,270)->save(public_path('backend/img/product/').$images);\n\n // Product Create in database\n if(isset($request->publish)){\n $status = 1;\n }\n else{\n $status = 0;\n }\n\n \t$Product = Product::create([\n 'user_id' => Auth::user()->id,\n \t\t'category_id'\t\t=> $request->category,\n\t\t\t'brand_id'\t\t\t=> $request->brand,\n\t\t\t'product_name'\t\t=> $request->product_name,\n\t\t\t'product_slug'\t\t=> Str::of($request->product_name)->slug('-'),\n\t\t\t'product_code'\t\t=> $request->product_code,\n\t\t\t'product_qty'\t => $request->product_quantity,\n\t\t\t'product_price'\t\t=> $request->product_price,\n\t\t\t'short_description'\t=> $request->short_description,\n\t\t\t'long_description'\t=> $request->long_description,\n\t\t\t'thumbnail_image'\t=> $img,\n\t\t\t'image_one'\t\t\t=> $image,\n 'image_two'\t\t => $images,\n 'status' => $status\n \t]);\n\n \t// Confirm Message\n \tif ($Product) {\n $notification = array(\n 'message' => 'Product created successfull !',\n 'alert-type' => 'success'\n );\n return redirect()->route('admin.product.index')->with($notification);\n }\n }", "public function store(ProductStoreRequest $request)\n {\n // dd($request);\n\n $Product = new Product; // اضافة منتج جديد\n $Product = $this->persist($Product);// اضافه للمنتج\n return response()->json([\n 'status' => true,\n 'message' => trans('admin.response_message_add')\n ]);\n }", "public function store(Request $request)\n {\n //recupero i dati attraverso all() e li assegno a $data\n $data = $request->all();\n //creo una nuova istanza\n $product = new Product();\n $product->fill($data);\n // utilizzo il metodo fill() oppure le creo manualmente\n //$product->name = $data[\"name\"];\n //$product->price = $data[\"price\"];\n //$product->description = $data[\"description\"];\n\n $product->save(); //salva i dati inseriti nel form\n\n //i dati si devono ridirezionare alla rotta dove si vogliono visualizzare\n return redirect()->route('products.show', ['product' => $product->id])->with('success', 'Salvataggio avvenuto correttamente');\n }", "public function store(Request $request)\n {\n $mobile = new Mobile;\n $mobile->title = $request->get(\"title\");\n $mobile->brand = $request->get(\"brand\");\n $mobile->image = $request->get(\"image\");\n $mobile->description = $request->get(\"description\");\n $mobile->price = $request->get(\"price\");\n $mobile->save();\n\n /* $product_id = DB::connection()->getPdo()->lastInsertId();\n foreach ($request->get(\"stores\") as $store) {\n DB::table('product_id')->insert(\n [\n \"product_id\" => $product_id,\n \"store_id\" => $store\n ]\n );\n }\n\n*/\n\n return redirect()-> action('MobilesController@index')->with('status', 'Mobile saved');\n\n }", "public function run()\n {\n DB::table('products') -> insert ([\n\t\t\t'cat_id' => '2',\n\t\t\t'name' => 'Krosachi',\n\t\t\t'description' => 'ochen krutye krossovki',\n\t\t\t'price' => '120$',\n\t\t\t'picture' => 'C:\\OpenServer\\domains\\laravel\\database\\seeds\\1380705314_1.jpg'\n\t\t]);\t\n }", "function add_product($product){\n if($this->_check_product_in_db($product)){\n return False; // Product already in database\n }else{\n array_push($this->db, $product);\n return True;\n }\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function store(StoreProductRequest $request)\n {\n $product = self::storeProduct($request->all());\n\n return redirect()->route('product.index');\n }", "public function store(ProductStoreOrUpdateRequest $request)\n {\n $this->products->create($request);\n return redirect()->route(env('APP_BACKEND_PREFIX').'.products.index')->withFlashSuccess('新闻添加成功');\n }", "public function store(ProductRequest $request)\n {\n $product = $request->all();\n \n $insert = $this->p->insert($product);\n if($insert) {\n\t \treturn response()->json([\n\t\t\t\t\t\t \t\t\t'STATUS'=> true,\n\t\t\t\t\t\t \t\t\t'MESSAGE'=>'Product was inserted',\n\t\t\t\t\t\t \t\t\t'CODE' => 200\n\t\t\t\t\t\t \t], 200);\n }else{\n \treturn response()->json([\n\t\t\t\t \t\t\t'STATUS'=> false ,\n\t\t\t\t \t\t\t'MESSAGE' => 'Product not insert', \n\t\t\t\t \t\t\t'CODE'=> 400\r\n\t\t\t\t \t\t\t], 200);\n }\n }", "public function run()\n {\n $product = new Product();\n $product->name = 'Ca phe sua';\n $product->description = 'ca phe chat luon cao';\n $product->price = '50000';\n $product->img = '12321234123';\n $product->category_id = 1;\n $product->save();\n\n $product = new Product();\n $product->name = 'Ca phe kem';\n $product->description = 'ca phe chat luon cao';\n $product->price = '100000';\n $product->img = 'df1231sdf';\n $product->category_id = 3;\n $product->save();\n\n }", "public function save($product)\n {\n $params = get_object_vars($product);\n unset($params['stock']);\n unset($params['categoryIds']);\n $db = $this->db->getConnection();\n $db->beginTransaction();\n if ($product->id) {\n $num = $this->db->update('UPDATE ' . self::TABLE . ' SET name = :name, price = :price, image = :image, description = :description, available = :available WHERE id = :id;', $params);\n } else {\n unset($params['id']);\n $num = $this->db->update('INSERT INTO ' . self::TABLE . ' (name, price, image, description, available) VALUES (:name, :price, :image, :description, :available);', $params);\n if ($num) {\n $product->id = $this->db->getInsertId();\n } else {\n $db->rollBack();\n return false;\n }\n }\n if (!$this->saveCategories($product)) {\n $db->rollBack();\n return false;\n }\n return $db->commit();\n }", "public function run()\n {\n DB::table('products')->insert([\n [\n 'name' => 'Product1',\n ],\n [\n 'name' => 'Product2',\n ],\n [\n 'name' => 'Product3',\n ]\n ]);\n }", "public function saveProducts(): bool\n {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n if ($this->type == self::TYPE_UPDATE) {\n //Mark products as deleted\n $deleteProductQuery = Product::find()\n ->andWhere(['shopId' => $this->shop->getId()])\n ->andWhere(['NOT IN', Product::EXTERNAL_ID, array_keys($this->products)])\n ->andWhere(['<>', 'status', Product::STATUS_DELETED]);\n foreach ($deleteProductQuery->each() as $product) {\n if (!$product->delete()) {\n $transaction->rollBack();\n $this->addErrors($product->getErrors());\n return false;\n }\n }\n }\n\n //Save new Products\n foreach ($this->products as $product) {\n if (!$product->save()) {\n $transaction->rollBack();\n $this->addErrors($product->getErrors());\n return false;\n }\n }\n $transaction->commit();\n } catch (Throwable $e) {\n $transaction->rollBack();\n throw $e;\n }\n return true;\n }", "public function store(Request $request)\n {\n\n // try {\n // DB::beginTransaction();\n\n $catalogo = new Catalogo();\n\n $catalogo->id_usuario = Auth::user()->id;\n $catalogo->nombre_catalogo = $request->nombre_catalogo;\n $catalogo->estado_catalogo = '1';\n $catalogo->save();\n \n \n $productos = json_decode( preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $request->productos), true);\n \n foreach ($productos as $key => $valor) {\n $imagen = $request[\"image{$key}\"];\n \n $producto = new Producto();\n $producto->id_categoria = $valor['id_categoria'];\n $producto->id_catalogo = $catalogo->id;\n $producto->nombre_producto = $valor['nombre_producto'];\n $ruta = $imagen->store('upload-productos', 'public');\n $img = Image::make( public_path(\"storage/{$ruta}\"))->fit(300, 200);\n $img->save();\n $producto->imagen_producto = $ruta;\n $producto->stock_producto = $valor['stock_producto'];\n $producto->precio_venta = $valor['precio_venta'];\n $producto->precio_compra = $valor['precio_compra'];\n $producto->estado_producto = '1';\n $producto->save();\n \n }\n\n // DB::commit();\n // return 'ok';\n\n // } catch (\\Throwable $th) {\n // DB::rollBack();\n // }\n }", "public function store(Request $request) {\n $rules = [\n 'name' => 'required|max:100',\n 'description' => 'required|max:500',\n 'stock' => 'required|integer|max:500|min:1',\n 'price' => 'required|numeric|min:1',\n 'type' => 'required'\n ];\n\n $this->validate($request, $rules);\n /**\n * inserts to the product table if validation clears\n */\n $product = new Product([\n 'name' => $request->get('name'),\n 'description' => $request->get('description'),\n 'stock' => $request->get('stock'),\n 'price' => $request->get('price'),\n 'type' => $request->get('type')\n ]);\n\n $product->save();\n \n Session::flash('message', 'Successfully created product!');\n /**\n * on completing the cycle returns to the products index page\n */\n return redirect('/product');\n }", "public function save_products($data)\n {\n $this->db->insert('productos_categorias', $data);\n }", "private function createProducts()\n {\n $chicken = $this->newProduct(self::PRODUCT_CHICKEN_EAN, self::PRODUCT_CHICKEN_NAME);\n $turkey = $this->newProduct(self::PRODUCT_TURKEY_EAN, self::PRODUCT_TURKEY_NAME);\n \n try\n {\n $isChickenCreated = $this->productDao->create($chicken);\n $isTurkeyCreated = $this->productDao->create($turkey);\n\n echo self::PRODUCT_CHICKEN_NAME . ' created ' . \n (($isChickenCreated) ? '' : 'un') .\n 'successfuly!' . PHP_EOL;\n\n echo self::PRODUCT_TURKEY_NAME . ' created ' . \n (($isTurkeyCreated) ? '' : 'un') . \n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n \n }", "public function insertQuotedProducts()\n\t{\n\t\t// Insert each product into the database.\n\t\t$i = 0;\n\t\twhile ($i < $_POST['itemCount'])\n\t\t{\n\t\t\t/*\n\t\t\t * Here we will decode the json and create each product and insert it into the\n\t\t\t * product orders database.\n\t\t\t */\n\t\t\t$post_product = json_decode($_POST['product'.$i], true);\n\t\t\t$new_product = new Product($post_product['id']);\n\t\t\t$new_product->setProductQuantity($post_product['qty']);\n\t\t\t$new_product->setProductCost($post_product['cost']);\n\t\t\t$i++;\n\n\t\t\t// Insert the data into the database.\n\t\t\t$this->getDB()->insert('product_orders',array('quote_id'=>$this->id,\n\t\t\t\t\t\t\t'product_type'=>$new_product->getItemType(),\n\t\t\t\t\t\t\t'product_msn'=>$new_product->getModShortName(),\n\t\t\t\t\t\t\t'product_cost'=>$new_product->getProductCost(),\n\t\t\t\t\t\t\t'product_qty'=>$new_product->getProductQuantity(),\n\t\t\t\t\t\t\t'product_name'=>$new_product->getModName(),\n\t\t\t\t\t\t\t'product_id'=>$new_product->getId()));\n\n\t\t\t// Check to see if the data was inserted into the db properly, else throw exception.\n\t\t\tif($this->getDB()->lastId() == null)\n\t\t\t{\n\t\t\t\tthrow new Exception('The database did not insert products properly.');\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n foreach ($this->getProducts() as $product) {\n App\\Product::create($product);\n }\n }", "public function store(CreateProductsRequest $request)\n {\n //dd($image = $request->image->store('product'));\n $image = $request->image->store('products');\n\n Products::create([\n\n 'name' => $request->name,\n 'price' => $request->price,\n 'image' => $request->image,\n 'discription' => $request->discription\n\n ]);\n \n session()->flash('success','New Product Added.');\n\n return redirect(route('products.index'));\n }", "public function bulkproducts() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){\n //insert products\n $requestjson = file_get_contents('php://input');\n\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n\n $this->addProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }else if ( $_SERVER['REQUEST_METHOD'] === 'PUT' ){\n //update products\n $requestjson = file_get_contents('php://input');\n $requestjson = json_decode($requestjson, true);\n\n if (!empty($requestjson) && count($requestjson) > 0) {\n $this->updateProducts($requestjson);\n }else {\n $this->response->setOutput(json_encode(array('success' => false)));\n }\n\n }\n }", "public function store(CreateProductRequest $request)\n {\n $product = $this->product->create($request->all());\n\n if ($brand_id = $request->get('brand_id')) {\n $brand = $this->brand->find($brand_id);\n $product->brand()->associate($brand);\n $product->save();\n }\n\n if ($request->get('categories')) {\n $product->categories()->sync($request->categories);\n }\n\n if ($request->get('related_products')) {\n $product->related()->sync($request->related_products);\n }\n\n return redirect()->route('admin.store.product.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('store::products.title.products')]));\n }" ]
[ "0.7943561", "0.7219085", "0.71159554", "0.71088636", "0.6981453", "0.69717765", "0.69511795", "0.6907708", "0.6906198", "0.68788123", "0.68465865", "0.6840182", "0.68113804", "0.67545354", "0.6735662", "0.66833144", "0.66826963", "0.66770035", "0.6676164", "0.6666605", "0.66329944", "0.6619647", "0.6615563", "0.6615301", "0.6598328", "0.6590433", "0.6585135", "0.6583143", "0.6582156", "0.6581357", "0.65766853", "0.65753", "0.6568373", "0.6559176", "0.65583235", "0.65420395", "0.653236", "0.6522115", "0.6517475", "0.6506312", "0.6502643", "0.6499073", "0.6485181", "0.6472027", "0.6471507", "0.646664", "0.6465733", "0.64593947", "0.6454371", "0.6453289", "0.64391637", "0.6437217", "0.64358073", "0.6432759", "0.6419041", "0.64173585", "0.6400334", "0.63988835", "0.63977116", "0.63972944", "0.6388891", "0.63786274", "0.63758713", "0.63702995", "0.6368366", "0.6365695", "0.63639736", "0.6360314", "0.6352377", "0.63446134", "0.6343479", "0.6341115", "0.6328208", "0.6325985", "0.6325102", "0.63240296", "0.6322897", "0.6317884", "0.6313477", "0.6310519", "0.63098085", "0.63095653", "0.63091713", "0.6307755", "0.6306948", "0.6303071", "0.630064", "0.62881696", "0.6287844", "0.6286873", "0.6286772", "0.6285982", "0.6284999", "0.6281502", "0.6280774", "0.6277168", "0.6271061", "0.6266512", "0.62629855", "0.6256144", "0.6251862" ]
0.0
-1
todo: implement memory friendly version of this Builds LibriProduct from ONIX object.
static function create(PONIpar\Product $onix){ $libriProduct = new LibriProduct; $controller = new LibriProductFactory(); $controller->product = $onix; $recordReference = $controller->getRecordReference(); /* ---------------- required data -------------- */ $libriProduct->RecordReference = $recordReference; $libriProduct->ProductForm = $controller->getProductForm(); $libriProduct->DistinctiveTitle = $controller->getDistinctiveTitle(); $tmpReference = $controller->getProductReference(); if(!$tmpReference) return null; // if no valid reference was found, this product is invalid $libriProduct->ProductReference = (String) $tmpReference[0]; $libriProduct->ProductReferenceType = (String) $tmpReference[1]; // test required fields $requiredFields = [ 'RecordReference', 'ProductReference', 'DistinctiveTitle', 'ProductForm' ]; foreach ($requiredFields as $field) { if ($libriProduct->$field === false) throw new MissingDataException("Content of `$field` not found or empty.", $recordReference); } /* ---------------- optional data -------------- */ $libriProduct->OrderTime = (Integer) $controller->getOrderTime(); $libriProduct->QuantityOnHand = (Integer) $controller->getQuantityOnHand(); $libriProduct->AvailabilityStatus = (Integer) $controller->getAvailabilityStatus(); $libriProduct->NumberOfPages = (Integer) $controller->getNumberOfPages(); $libriProduct->VLBSchemeOld = (Integer) $controller->getVLBSchemeOld(); $libriProduct->ProductWeight = (Integer) $controller->getProductWeight(); $libriProduct->ProductWidth = (Integer) $controller->getProductWidth(); $libriProduct->ProductThickness = (Integer) $controller->getProductThickness(); $libriProduct->AudienceCodeValue = (Integer) $controller->getAudienceCodeValue(); $libriProduct->Author = (String) $controller->getAuthor(); $libriProduct->CoverLink = (String) $controller->getCoverLink(); $libriProduct->ProductLanguage = (String) $controller->getProductLanguage(); $libriProduct->PublisherName = (String) $controller->getPublisherName(); $libriProduct->PublicationDate = (String) $controller->getPublicationDate(); $libriProduct->Blurb = (String) $controller->getBlurb(); $controller->CurrentPrice = $controller->getPriceDeCurrent(); $libriProduct->PriceAmount = (float) $controller->getPriceAmount(); $libriProduct->PriceTypeCode = (Integer) $controller->getPriceTypeCode(); $libriProduct->DiscountPercent = (Integer) $controller->getDiscountPercent(); $libriProduct->TaxRateCode1 = (String) $controller->getTaxRateCode1(); $libriProduct->NotificationType = $controller->getNotificationType(); $libriProduct->Lib_MSNo = $controller->getLibriNotificationKey(); $libriProduct->AvailabilityCode = $controller->getAvailabilityCode(); $libriProduct->PublishingStatus = $controller->getPublishingStatus(); return $libriProduct; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function build();", "abstract public function build();", "abstract function build();", "public abstract function build();", "public abstract function build();", "abstract public function factoryMethod(): Product;", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "function makeProduct($productcode) {\n\t$product = new Product();\n \t$product->category = substr($productcode, 0, 1);\n \t$i = strpos($productcode, '-', 1) + 1;\n \t$product->style = substr($productcode, 1, $i - 2);\n \t$j = strpos($productcode, '-', $i) + 1;\n \t$product->type = substr($productcode, $i, $j - 1 - $i);\n \t$product->material = substr($productcode, $j);\n\treturn $product;\n}", "public static function build($type) {\n $product = $type;\n if (class_exists($product)) {\n return new $product();\n }\n else {\n throw new Exception(\"Invalid product type given.\");\n }\n }", "function ciniki_products_typeObjectDefUpdate($ciniki, $object_def, $args) {\n\n if( $object_def == NULL ) {\n $object_def = array(\n 'name'=>array('name_s'=>'', 'name_p'=>''),\n );\n }\n if( !isset($object['parent']) ) {\n $object['parent'] = array('products'=>array());\n }\n if( !isset($object['parent']['products']) ) {\n $object['parent']['products'] = array();\n }\n\n $product_fields = array(\n 'name',\n 'code',\n 'sequence',\n 'category',\n 'source',\n 'flags',\n 'status',\n 'barcode',\n 'supplier_tnid',\n 'supplier_product_id',\n 'price',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'cost',\n 'msrp',\n 'sell_unit',\n 'supplier_id',\n 'supplier_item_number',\n 'supplier_minimum_order',\n 'supplier_order_multiple',\n 'manufacture_min_time',\n 'manufacture_max_time',\n 'inventory_flags',\n 'inventory_current_num',\n 'inventory_reorder_num',\n 'inventory_reorder_quantity',\n 'shipping_flags',\n 'shipping_weight',\n 'shipping_weight_units',\n 'shipping_length',\n 'shipping_width',\n 'shipping_height',\n 'shipping_size_units',\n 'primary_image_id',\n 'short_description',\n 'long_description',\n 'description',\n 'start_date',\n 'end_date',\n 'webflags',\n 'detail01',\n 'detail02',\n 'detail03',\n 'detail04',\n 'detail05',\n 'detail06',\n 'detail07',\n 'detail08',\n 'detail09',\n );\n foreach($product_fields as $field) {\n if( isset($args['parent_product_' . $field]) ) {\n if( $args['parent_product_' . $field] == 'on' ) {\n $object_def['parent']['products'][$field] = array();\n } elseif( $args['parent_product_' . $field] == 'off' \n && isset($object_def['parent']['products'][$field]) ) {\n unset($object_def['parent']['products'][$field]);\n }\n }\n if( (!isset($args['parent_product_' . $field . '-name']) || $args['parent_product_' . $field . '-name'])\n && isset($args['parent_product_' . $field . '-name']) ) {\n if( isset($object_def['parent']['products']) ) {\n $object_def['parent']['products'][$field]['name'] = $args['parent_product_' . $field . '-name'];\n }\n }\n if( isset($args['child_product_' . $field]) ) {\n if( $args['child_product_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) {\n $object_def['child'] = array('products'=>array());\n }\n $object_def['child']['products'][$field] = array();\n } elseif( $args['child_product_' . $field] == 'off' \n && isset($object_def['child']['products'][$field]) ) {\n unset($object_def['child']['products'][$field]);\n }\n }\n if( (!isset($args['child_product_' . $field . '-name']) || $args['child_product_' . $field . '-name'])\n && isset($args['child_product_' . $field . '-name']) ) {\n if( isset($object_def['child']['products']) ) {\n $object_def['child']['products'][$field]['name'] = $args['child_product_' . $field . '-name'];\n }\n }\n }\n\n $price_fields = array(\n 'name',\n 'pricepoint_id',\n 'available_to',\n 'min_quantity',\n 'unit_amount',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'start_date',\n 'end_date',\n 'webflags',\n );\n\n foreach($price_fields as $field) {\n if( isset($args['parent_price_' . $field]) ) {\n if( $args['parent_price_' . $field] == 'on' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array();\n } elseif( $args['parent_price_' . $field] == 'hidden' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array('ui-hide'=>'yes');\n } elseif( $args['parent_price_' . $field] == 'off' \n && isset($object_def['parent']['prices'][$field]) ) {\n unset($object_def['parent']['prices'][$field]);\n }\n if( $args['parent_price_' . $field] != 'off' ) {\n if( isset($args['parent_price_' . $field . '-default']) \n && $args['parent_price_' . $field . '-default'] != '' ) {\n $object_def['parent']['prices'][$field]['default'] = $args['parent_price_' . $field . '-default'];\n }\n }\n }\n if( isset($args['child_price_' . $field]) ) {\n if( $args['child_price_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) { $object_def['child'] = array('products'=>array()); }\n if( !isset($object_def['child']['prices']) ) { $object_def['child']['prices'] = array(); }\n $object_def['child']['prices'][$field] = array();\n } elseif( $args['child_price_' . $field] == 'off' \n && isset($object_def['child']['prices'][$field]) ) {\n unset($object_def['child']['prices'][$field]);\n }\n }\n }\n\n //\n // Remove old ones\n //\n if( isset($object_def['parent']['subcategories']) ) { unset($object_def['parent']['subcategories']); }\n\n// $args['object_def'] = serialize($object_def);\n\n //\n // Check for subcategories\n //\n for($i=11;$i<30;$i++) {\n $field = 'parent_subcategories-' . $i;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent']['subcategories-' . $i] = array();\n if( isset($args[$field . '-sname']) ) {\n $object_def['parent']['subcategories-' . $i]['sname'] = $args[$field . '-sname'];\n }\n if( isset($args[$field . '-pname']) ) {\n $object_def['parent']['subcategories-' . $i]['pname'] = $args[$field . '-pname'];\n }\n } elseif( $args[$field] == 'off' && isset($object_def['parent']['subcategories-' . $i]) ) {\n unset($object_def['parent']['subcategories-' . $i]);\n }\n }\n }\n\n $extras = array('categories', \n// 'subcategories-11', 'subcategories-12', 'subcategories-13', 'subcategories-14', 'subcategories-15', \n 'tags', 'images', 'audio', 'files', 'similar', 'recipes');\n foreach($extras as $extra) {\n $field = 'parent_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['parent'][$extra]) ) {\n unset($object_def['parent'][$extra]);\n }\n }\n $field = 'child_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['child'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['child'][$extra]) ) {\n unset($object_def['child'][$extra]);\n }\n }\n }\n\n return array('stat'=>'ok', 'object_def'=>$object_def);\n}", "abstract function build($result);", "public function getTargetType($type) {\n $retObj = array();\n switch ($type) {\n case 'Brand':\n $retObj[] = new ProductBrand($this->targetData);\n $retObj[] = new ProductBrand();\n \n return $retObj;\n break;\n case 'Condition':\n $retObj[] = new ProductCanonicalCondition($this->targetData);\n $retObj[] = new ProductCanonicalCondition();\n \n return $retObj;\n break;\n case 'Category':\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1', $this->targetData);\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1');\n \n return $retObj;\n break;\n case 'Channel':\n $retObj[] = new ProductChannel($this->targetData);\n $retObj[] = new ProductChannel();\n \n return $retObj;\n break;\n case 'Item ID':\n $retObj[] = new ProductOfferId($this->targetData);\n $retObj[] = new ProductOfferId();\n \n return $retObj;\n break;\n case 'Product type':\n $retObj[] = new ProductType('PRODUCT_TYPE_L1', $this->targetData);\n $retObj[] = new ProductType('PRODUCT_TYPE_L1');\n \n return $retObj;\n break;\n case 'Channel exclusivity':\n $retObj[] = new ProductChannelExclusivity($this->targetData);\n $retObj[] = new ProductChannelExclusivity();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_0':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_1':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_2':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_3':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_4':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n \n default:\n break;\n }\n }", "public function Build() {\n $this->XaoThrow(\n \"_EntBase::Build(): This entity does not implement it's \" .\n \"creation in the RDBMS.\"\n , debug_backtrace()\n );\n }", "function product( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $ret = new eZProduct( $this->ProductID );\n \n return $ret;\n }", "public function buildObject()\n {\n $object = $this->instanciator->build($this->class, $this->properties);\n $parameters = $this->instanciator->getParameters($this->class);\n\n //avoid injecting the properties already used in the constructor\n $properties = $this\n ->properties\n ->filter(function($value, $property) use ($parameters) {\n return !$parameters->contains($property);\n });\n $refl = new ReflectionObject(\n $object,\n $properties,\n $this->injectionStrategies\n );\n\n return $refl->buildObject();\n }", "public function getBaseProduct($languageId = null) \n\t{\t\n\t\t$baseProduct = $this->getTableFields('product');\n\t\tunset($baseProduct['product_id']);\t\t\n\n\t\t$baseProductDescription = $this->getTableFields('product_description');\n\t\tunset($baseProductDescription['product_id']);\n\t\t\n\t\tif ($languageId == null) {\n\t\t\t$languageId = $this->config->get('config_language_id');\n\t\t}\n\t\t$baseProduct['product_description'] = array();\n\t\t$baseProduct['product_description'][$languageId] = $baseProductDescription;\n\t\t\n\t\treturn $baseProduct;\t\n\t}", "function getProductInfos($oid){\n if (!isset($this->products[$oid])){\n $r = array('pool'=>NULL, 'ticket'=>NULL, 'person'=>NULL, 'taarticleno'=>NULL);\n $selectedfields = array('tapool', 'taperson', 'taticket', 'prdconf');\n if ($this->xwtscatalog->fieldExists('taarticleno')){\n $selectedfields[] = 'taarticleno';\n }\n $dp = $this->xwtscatalog->display(array('oid'=>$oid,\n 'selectedfields'=>$selectedfields,\n 'options'=>array('tapool'=>array('target_fields'=>array('prjno', 'poolno')),\n 'taperson'=>array('target_fields'=>array('ptno')),\n 'prdconf'=>array('target_fields'=>array('calendar')),\n 'taticket'=>array('target_fields'=>array('tapool', 'ttno'))\n )\n )\n );\n $r['project'] = $dp['otapool']->link['oprjno']->raw;\n $r['pool'] = $dp['otapool']->link['opoolno']->raw;\n $r['ticket'] = $dp['otaticket']->link['ottno']->raw;\n $r['person'] = $dp['otaperson']->link['optno']->raw;\n $r['calendartype'] = $dp['oprdconf']->link['ocalendar']->link['otype']->raw;\n if (isset($dp['otaarticleno']))\n $r['taarticleno'] = $dp['otaarticleno']->raw;\n $this->products[$oid] = $r;\n }\n return $this->products[$oid];\n }", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function build();", "public function createAddonProduct()\n {\n ++$this->productCount;\n\n // Create basic product.\n $product = $this->productFactory->createEntity();\n $this->entityManager->persist($product);\n $product->setNumber('AddonProductNumber-' . $this->productCount);\n $product->setManufacturer('EnglishManufacturer-' . $this->productCount);\n $product->setType($this->addonProductType);\n $product->setStatus($this->productStatus);\n $product->setCreated(new DateTime());\n $product->setChanged(new DateTime());\n $product->setSupplier($this->contactTestData->accountSupplier);\n $product->setOrderUnit($this->orderUnit);\n $product->setContentUnit($this->contentUnit);\n $product->setOrderContentRatio(2.0);\n $product->setTaxClass($this->taxClass);\n\n // Add prices\n $this->addPrice($product, 5.99);\n $this->addPrice($product, 3.85, 4.0);\n\n // Product translation\n $this->addProductTranslation($product);\n\n return $product;\n }", "public function build()\n {\n if(($document = $this->getDocument()) === null) {\n $document = $this->loader->getInstance(NodeLoader::DOCUMENT_NODE);\n $this->setDocument($document);\n }\n\n if(($header = $document->getHeader()) === null) {\n $header = $this->loader->getInstance(NodeLoader::HEADER_NODE);\n $document->setHeader($header);\n }\n\n if(($supplier = $header->getSupplier()) === null) {\n $supplier = $this->loader->getInstance(NodeLoader::SUPPLIER_NODE);\n $header->setSupplier($supplier);\n }\n\n if(($catalog = $header->getCatalog()) === null) {\n $catalog = $this->loader->getInstance(NodeLoader::CATALOG_NODE);\n $header->setCatalog($catalog);\n }\n\n if(($datetime = $catalog->getDateTime()) === null) {\n $datetime = $this->loader->getInstance(NodeLoader::DATE_TIME_NODE);\n $catalog->setDateTime($datetime);\n }\n\n if(($newCatalog = $document->getNewCatalog()) === null) {\n $newCatalog = $this->loader->getInstance(NodeLoader::NEW_CATALOG_NODE);\n $document->setNewCatalog($newCatalog);\n }\n\n return $document;\n }", "public function build() {}", "public function build() {}", "public function build() {}", "public function build()\n {\n return new EntityDataObject(\n $this->name,\n $this->type,\n $this->data,\n $this->linkedEntities,\n null,\n $this->vars\n );\n }", "function clone_to_category($newParentCatId)\n {\n global $application;\n\n\n /*\n If creating an object the incorrect id was passed, then\n this method will not do anything.\n */\n if ($this->_fProductIDIsIncorrect == true)\n {\n return ($this->debugmode ? 'Product ID is incorrect' : null);\n }\n\n if ($this->_fProductAttributesInfo == null)\n {\n $this->_loadProductAttributesInfo();\n }\n\n # check $newParentCatId\n\n # First create a new product in the table products\n modApiFunc('Catalog', 'insertNewProduct',\n $this->_fBaseProductInfo[0]['p_type_id'],\n $this->_fBaseProductInfo[0]['p_name']);\n $new_product_id = $application->db->DB_Insert_Id();\n\n // copy multilang product names\n $p_ml = modApiFunc('MultiLang', 'getMLTableData', 'Catalog', 'products', $this->_fBaseProductInfo[0]['p_id']);\n modApiFunc('MultiLang', 'addMLTableData', 'Catalog', 'products', $new_product_id, $p_ml);\n\n //<add_link>\n modApiFunc('Catalog','addProductLinkToCategory',$new_product_id,$newParentCatId);\n //</add_link>\n\n # Copies all the current product attributes\n # to the created product\n foreach ($this->_fProductAttributesInfo as $attribute)\n {\n // - , $this->_fProductAttributesInfo\n // , ,\n // product_attributes.\n if ($attribute['pa_id'] === null)\n {\n continue;\n }\n\n modApiFunc('Catalog', 'insertNewProductAttribute', $new_product_id, $attribute['a_id'], $attribute['pa_value']);\n $new_pa_id = $application->db->DB_Insert_Id();\n\n // copy multilang attribute values\n $pa_ml = modApiFunc('MultiLang', 'getMLTableData', 'Catalog', 'product_attributes', $attribute['pa_id']);\n modApiFunc('MultiLang', 'addMLTableData', 'Catalog', 'product_attributes', $new_pa_id, $pa_ml);\n\n // if it is an image, save it to the separate table\n if (strtoupper($attribute['a_input_type_name']) == 'IMAGE')\n {\n if ($attribute['image_name'] &&\n is_readable($application->getAppIni('PATH_IMAGES_DIR').$attribute['image_name']))\n {\n # a temporary image name\n $source_name = $attribute['image_name'];\n $clone_name = basename($application->getUploadImageName($source_name));\n # copy the current imge to the temporary file\n $cr = copy($application->_img_path($source_name), $application->_img_path($clone_name));\n\n # Clone the image (and delete a temporary one)\n $image_info = $application->saveUploadImage(\"\", $clone_name);\n\n # create image info\n modApiFunc('Catalog', 'insertNewProductImage', $new_pa_id, $image_info['name'], $image_info['width'], $image_info['height']);\n }\n }\n }\n modApiFunc('EventsManager','throwEvent','ProductCloned', array('pid'=>$this->_fProductID, 'new_pid'=>$new_product_id, 'cid'=>$newParentCatId));\n return $new_product_id;\n }", "protected function build()\n\t{\n\t}", "function Build_create($product_id, $name, $description = NULL, $milestone = NULL, $isactive = TRUE) {\n\t$varray = array(\"product_id\" => \"int\", \"name\" => \"string\", \"description\" => \"string\", \"milestone\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('Build.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function factoryMethod(): Product\n {\n return new ConcreteProduct1;\n }", "public function build_product_data( $item=array(), $old_item=array() ) {\n\n // summarize product details\n $retProd = array(\n 'ASIN' => isset($item['ASIN']) ? $item['ASIN'] : '',\n 'ParentASIN' => isset($item['ParentASIN']) ? $item['ParentASIN'] : '',\n \n 'ItemAttributes' => isset($item['ItemAttributes']) ? $item['ItemAttributes'] : array(),\n 'Title' => isset($item['ItemAttributes']['Title']) ? stripslashes($item['ItemAttributes']['Title']) : '',\n 'SKU' => isset($item['ItemAttributes']['SKU']) ? $item['ItemAttributes']['SKU'] : '',\n 'Feature' => isset($item['ItemAttributes']['Feature']) ? $item['ItemAttributes']['Feature'] : '',\n 'Brand' => isset($item['ItemAttributes']['Brand']) ? $item['ItemAttributes']['Brand'] : '',\n 'Binding' => isset($item['ItemAttributes']['Binding']) ? $item['ItemAttributes']['Binding'] : '',\n //'ListPrice' => isset($item['ItemAttributes']['ListPrice']['FormattedPrice']) ? $item['ItemAttributes']['ListPrice']['FormattedPrice'] : '',\n \n 'Variations' => isset($item['Variations']) ? $item['Variations'] : array(),\n 'VariationSummary' => isset($item['VariationSummary']) ? $item['VariationSummary'] : array(),\n 'BrowseNodes' => isset($item['BrowseNodes']) ? $item['BrowseNodes'] : array(),\n 'DetailPageURL' => isset($item['DetailPageURL']) ? $item['DetailPageURL'] : '',\n 'SalesRank' => isset($item['SalesRank']) ? $item['SalesRank'] : 999999,\n\n 'SmallImage' => isset($item['SmallImage']['URL']) ? trim( $item['SmallImage']['URL'] ) : '',\n 'LargeImage' => isset($item['LargeImage']['URL']) ? trim( $item['LargeImage']['URL'] ) : '',\n\n 'Offers' => isset($item['Offers']) ? $item['Offers'] : '',\n 'OfferSummary' => isset($item['OfferSummary']) ? $item['OfferSummary'] : '',\n 'EditorialReviews' => isset($item['EditorialReviews']['EditorialReview']['Content'])\n ? $item['EditorialReviews']['EditorialReview']['Content'] : '',\n \n\t\t\t\t'hasGallery'\t\t\t=> 'false',\n );\n\t\t\t\n\t\t\t// try to rebuid the description if is empty\n\t\t\tif( trim($retProd[\"EditorialReviews\"]) == \"\" ){\n\t\t\t\tif( isset($item['EditorialReviews']['EditorialReview']) && count($item['EditorialReviews']['EditorialReview']) > 0 ){\n\t\t\t\t\t\n\t\t\t\t\t$new_description = array();\n\t\t\t\t\tforeach ($item['EditorialReviews']['EditorialReview'] as $desc) {\n\t\t\t\t\t\tif( isset($desc['Content']) && isset($desc['Source']) ){\n\t\t\t\t\t\t\t//$new_description[] = '<h3>' . ( $desc['Source'] ) . ':</h3>';\n\t\t\t\t\t\t\t$new_description[] = $desc['Content'] . '<br />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( isset($new_description) && count($new_description) > 0 ){\n\t\t\t\t\t$retProd[\"EditorialReviews\"] = implode( \"\\n\", $new_description );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n // CustomerReviews url\n if ( isset($item['CustomerReviews'], $item['CustomerReviews']['HasReviews'])\n && $item['CustomerReviews']['HasReviews'] ) {\n $retProd['CustomerReviewsURL'] = $item['CustomerReviews']['IFrameURL'];\n }\n\n // Images\n $retProd['images'] = $this->build_images_data( $item );\n if ( empty($retProd['images']['large']) ) {\n // no images found - if has variations, try to find first image from variations\n $retProd['images'] = $this->get_first_variation_image( $item );\n }\n \n if ( empty($retProd['SmallImage']) ) {\n if ( isset($retProd['images']['small']) && !empty($retProd['images']['small']) ) {\n $retProd['SmallImage'] = $retProd['images']['small'][0];\n }\n }\n if ( empty($retProd['LargeImage']) ) {\n if ( isset($retProd['images']['large']) && !empty($retProd['images']['large']) ) {\n $retProd['LargeImage'] = $retProd['images']['large'][0];\n }\n }\n\n\t\t\t// has gallery: get gallery images\n\t\t\tif ( isset($item['ImageSets']) && count($item['ImageSets']) > 0 ) {\n\t\t\t\tforeach ( $item['ImageSets'][\"ImageSet\"] as $key => $value ) {\n\t\t\t\t\tif ( isset($value['LargeImage']['URL']) ) {\n\t\t\t\t\t\t$retProd['hasGallery'] = 'true';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n return $retProd;\n }", "function add_new_product($product_info) {\r\n try {\r\n $params = array(\r\n array('name' => ':product_name', 'value' => $product_info['product_name']),\r\n array('name' => ':product_number', 'value' => &$product_info['product_number']),\r\n array('name' => ':product_type', 'value' => &$product_info['product_type']),\r\n array('name' => ':notes', 'value' => &$product_info['notes']),\r\n array('name' => ':category_id', 'value' => &$product_info['category_id']),\r\n array('name' => ':width', 'value' => &$product_info['width']),\r\n array('name' => ':height', 'value' => &$product_info['height']),\r\n array('name' => ':h_length', 'value' => &$product_info['h_length']),\r\n array('name' => ':re_demand_border', 'value' => &$product_info['re_demand_border']),\r\n array('name' => ':primary_unit_name', 'value' => &$product_info['primary_unit_name']),\r\n array('name' => ':secondary_unit_name', 'value' => &$product_info['secondary_unit_name']),\r\n array('name' => ':primary_unit_quantity', 'value' => &$product_info['primary_unit_quantity']),\r\n array('name' => ':secondary_unit_quantity', 'value' => &$product_info['secondary_unit_quantity']),\r\n array('name' => ':quantity_status', 'value' => &$product_info['quantity_status']),\r\n array('name' => ':res', 'value' => &$result)\r\n );\r\n\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"begin :res := product_actions.add_new_product(:product_name,:product_number,:product_type,:notes,:category_id,:width,:height,:h_length,:re_demand_border,:primary_unit_name,:secondary_unit_name,:primary_unit_quantity,:secondary_unit_quantity,:quantity_status); end;\");\r\n foreach ($params as $variable) {\r\n oci_bind_by_name($stmt, $variable[\"name\"], $variable[\"value\"]);\r\n }\r\n oci_execute($stmt);\r\n return $result;\r\n } catch (Exception $ex) {\r\n return $ex;\r\n }\r\n }", "protected function _productFromArray($arr)\n\t{\n\t\tswitch ($this->_config['push_products_as'])\n\t\t{\n\t\t\tcase QUICKBOOKS_OBJECT_OTHERCHARGEITEM:\n\t\t\t\t\n\t\t\t\t$OtherChargeItem = new QuickBooks_Object_OtherChargeItem();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn $OtherChargeItem;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase QUICKBOOKS_OBJECT_INVENTORYITEM:\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase QUICKBOOKS_OBJECT_NONINVENTORYITEM:\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase QUICKBOOKS_OBJECT_SERVICEITEM:\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t$ServiceItem = new QuickBooks_Object_ServiceItem();\n\n\t\t\t\t$map = array(\n\t\t\t\t\t'Name' => \t\t\t\t\tarray( 'setName', 'Name' ),\n\t\t\t\t\t'IsActive' => \t\t\t\tarray( 'setIsActive', 'IsActive' ), \n\t\t\t\t\t'ParentID' => \t\t\t\tarray( 'setParentApplicationID', 'ParentRef ' . QUICKBOOKS_API_APPLICATIONID, 'setParentListID' ),\n\t\t\t\t\t'ParentListID' => \t\t\tarray( 'setParentListID', 'ParentRef ListID' ),\n\t\t\t\t\t'ParentName' => \t\t\tarray( 'setParentName', 'ParentRef FullName' ),\n\t\t\t\t\t'SalesTaxCodeID' => \t\tarray( 'setSalesTaxCodeApplicationID', 'SalesTaxCodeRef ' . QUICKBOOKS_API_APPLICATIONID, 'setSalesTaxCodeListID' ), \n\t\t\t\t\t'SalesTaxCodeListID' => \tarray( 'setSalesTaxCodeListID', 'SalesTaxCodeRef ListID' ),\n\t\t\t\t\t'SalesTaxCodeName' =>\t\tarray( 'setSalesTaxCodeName', 'SalesTaxCodeRef FullName' ), \n\t\t\t\t\t); \n\n\t\t\t\t\n\t\t\t\tif (!empty($arr['SalesAndPurchase_PurchaseCost']) and !empty($arr['SalesAndPurchase_SalesPrice']))\n\t\t\t\t{\n\t\t\t\t\t$map = array_merge($map, array(\n\t\t\t\t\t\t'SalesAndPurchase_SalesDesc' => array( 'setSalesDescription', 'SalesAndPurchase SalesDesc'), \n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$map = array_merge($map, array(\n\t\t\t\t\t\t'SalesOrPurchase_Desc' => \t\t\tarray( 'setDescription', 'SalesOrPurchase Desc' ), \n\t\t\t\t\t\t'SalesOrPurchase_Price' => \t\t\tarray( 'setPrice', 'SalesOrPurchase Price' ),\n\t\t\t\t\t\t'SalesOrPurchase_AccountID' => \t\tarray( 'setAccountApplicationID', 'AccountRef ' . QUICKBOOKS_API_APPLICATIONID, 'setAccountListID' ),\n\t\t\t\t\t\t'SalesOrPurchase_AccountListID' => \tarray( 'setAccountListID', 'AccountRef ListID' ), \n\t\t\t\t\t\t'SalesOrPurchase_AccountName' => \tarray( 'setAccountName', 'AccountRef FullName' ), \n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_applyBaseMap($arr, $map, $ServiceItem, QUICKBOOKS_OBJECT_SERVICEITEM);\n\t\t\t\t\n\t\t\t\treturn $ServiceItem;\n\t\t}\n\t}", "static function newobj($type /* ... */){\n if(is_null($type)) return;\n\n $ar = func_get_args();\n $type = array_shift($ar); // remove type/object\n \n try{\n // get the asked class\n if(is_string($type)) $cls = defnz(self::$decode_table,$type,'opc_item_' . $type);\n else if (is_object($type)) $cls = get_class($type);\n else throw new Exception('invalid type: ' . strval($type));\n \n // check this class 8exists, implements opi_item\n if(!class_exists($cls)) \n\tthrow new Exception('unknown class: ' . $cls);\n else if(!in_array('opi_item',class_implements($cls)))\n\tthrow new Exception('not able to handle: ' . $cls);\n \n } catch (Exception $ex) {\n trigger_error('error creating a opc_item: ' . $ex->getMessage(),E_USER_WARNING);\n return NULL;\n }\n \n // crate and call init with the other arguments\n $res = new $cls();\n call_user_func_array(array(&$res,'init'),$ar);\n return $res;\n }", "public function prepareDataForIndex(OnlineShop_Framework_ProductInterfaces_IIndexable $object) {\n $subObjectIds = $this->tenantConfig->createSubIdsForObject($object);\n\n foreach($subObjectIds as $subObjectId => $object) {\n /**\n * @var OnlineShop_Framework_ProductInterfaces_IIndexable $object\n */\n if($object->getOSDoIndexProduct() && $this->tenantConfig->inIndex($object)) {\n $a = Pimcore::inAdmin();\n $b = \\Pimcore\\Model\\Object\\AbstractObject::doGetInheritedValues();\n Pimcore::unsetAdminMode();\n \\Pimcore\\Model\\Object\\AbstractObject::setGetInheritedValues(true);\n $hidePublishedMemory = \\Pimcore\\Model\\Object\\AbstractObject::doHideUnpublished();\n \\Pimcore\\Model\\Object\\AbstractObject::setHideUnpublished(false);\n $categories = $object->getCategories();\n $categoryIds = array();\n $parentCategoryIds = array();\n if($categories) {\n foreach($categories as $c) {\n $parent = $c;\n\n if ($parent != null) {\n if($parent->getOSProductsInParentCategoryVisible()) {\n while($parent && $parent instanceof OnlineShop_Framework_AbstractCategory) {\n $parentCategoryIds[$parent->getId()] = $parent->getId();\n $parent = $parent->getParent();\n }\n } else {\n $parentCategoryIds[$parent->getId()] = $parent->getId();\n }\n\n $categoryIds[$c->getId()] = $c->getId();\n }\n }\n }\n\n ksort($categoryIds);\n\n $virtualProductId = $subObjectId;\n $virtualProductActive = $object->isActive();\n if($object->getOSIndexType() == \"variant\") {\n $virtualProductId = $this->tenantConfig->createVirtualParentIdForSubId($object, $subObjectId);\n }\n\n $virtualProduct = \\Pimcore\\Model\\Object\\AbstractObject::getById($virtualProductId);\n if($virtualProduct && method_exists($virtualProduct, \"isActive\")) {\n $virtualProductActive = $virtualProduct->isActive();\n }\n\n $data = array(\n \"o_id\" => $subObjectId,\n \"o_classId\" => $object->getClassId(),\n \"o_virtualProductId\" => $virtualProductId,\n \"o_virtualProductActive\" => $virtualProductActive,\n \"o_parentId\" => $object->getOSParentId(),\n \"o_type\" => $object->getOSIndexType(),\n \"categoryIds\" => ',' . implode(\",\", $categoryIds) . \",\",\n \"parentCategoryIds\" => ',' . implode(\",\", $parentCategoryIds) . \",\",\n \"priceSystemName\" => $object->getPriceSystemName(),\n \"active\" => $object->isActive(),\n \"inProductList\" => $object->isActive(true)\n );\n\n $relationData = array();\n\n $columnConfig = $this->columnConfig->column;\n if(!empty($columnConfig->name)) {\n $columnConfig = array($columnConfig);\n }\n else if(empty($columnConfig))\n {\n $columnConfig = array();\n }\n foreach($columnConfig as $column) {\n try {\n //$data[$column->name] = null;\n $value = null;\n if(!empty($column->getter)) {\n $getter = $column->getter;\n $value = $getter::get($object, $column->config, $subObjectId, $this->tenantConfig);\n } else {\n if(!empty($column->fieldname)) {\n $getter = \"get\" . ucfirst($column->fieldname);\n } else {\n $getter = \"get\" . ucfirst($column->name);\n }\n\n if(method_exists($object, $getter)) {\n $value = $object->$getter($column->locale);\n }\n }\n\n if(!empty($column->interpreter)) {\n $interpreter = $column->interpreter;\n $value = $interpreter::interpret($value, $column->config);\n $interpreterObject = new $interpreter();\n if($interpreterObject instanceof OnlineShop_Framework_IndexService_RelationInterpreter) {\n foreach($value as $v) {\n $relData = array();\n $relData['src'] = $subObjectId;\n $relData['src_virtualProductId'] = $virtualProductId;\n $relData['dest'] = $v['dest'];\n $relData['fieldname'] = $column->name;\n $relData['type'] = $v['type'];\n $relationData[] = $relData;\n }\n } else {\n $data[$column->name] = $value;\n }\n } else {\n $data[$column->name] = $value;\n }\n\n if(is_array($data[$column->name])) {\n $data[$column->name] = OnlineShop_Framework_IndexService_Tenant_IWorker::MULTISELECT_DELIMITER . implode($data[$column->name], OnlineShop_Framework_IndexService_Tenant_IWorker::MULTISELECT_DELIMITER) . OnlineShop_Framework_IndexService_Tenant_IWorker::MULTISELECT_DELIMITER;\n }\n\n } catch(Exception $e) {\n Logger::err(\"Exception in IndexService: \" . $e->getMessage(), $e);\n }\n\n }\n if($a) {\n Pimcore::setAdminMode();\n }\n \\Pimcore\\Model\\Object\\AbstractObject::setGetInheritedValues($b);\n \\Pimcore\\Model\\Object\\AbstractObject::setHideUnpublished($hidePublishedMemory);\n\n\n $subTenantData = $this->tenantConfig->prepareSubTenantEntries($object, $subObjectId);\n $jsonData = json_encode(array(\n \"data\" => $data,\n \"relations\" => ($relationData ? $relationData : []),\n \"subtenants\" => ($subTenantData ? $subTenantData : [])\n ));\n\n $crc = crc32($jsonData);\n $insertData = array(\n \"id\" => $subObjectId,\n \"tenant\" => $this->name,\n \"data\" => $jsonData,\n \"crc_current\" => $crc,\n \"preparation_worker_timestamp\" => 0,\n \"preparation_worker_id\" => $this->db->quote(null),\n \"in_preparation_queue\" => 0\n );\n\n $currentEntry = $this->db->fetchRow(\"SELECT crc_current, in_preparation_queue FROM \" . $this->getStoreTableName() . \" WHERE id = ? AND tenant = ?\", array($subObjectId, $this->name));\n if(!$currentEntry) {\n $this->db->insert($this->getStoreTableName(), $insertData);\n } else if($currentEntry['crc_current'] != $crc) {\n $this->db->update($this->getStoreTableName(), $insertData, \"id = \" . $this->db->quote((string)$subObjectId) . \" AND tenant = \" . $this->db->quote($this->name));\n } else if($currentEntry['in_preparation_queue']) {\n $this->db->query(\"UPDATE \" . $this->getStoreTableName() . \" SET in_preparation_queue = 0, preparation_worker_timestamp = 0, preparation_worker_id = null WHERE id = ? AND tenant = ?\", array($subObjectId, $this->name));\n }\n\n } else {\n Logger::info(\"Don't adding product \" . $subObjectId . \" to index \" . $this->name . \".\");\n $this->doDeleteFromIndex($subObjectId);\n }\n }\n\n //cleans up all old zombie data\n $this->doCleanupOldZombieData($object, $subObjectIds);\n\n }", "function getProductObjectFromId( $id, $productname ) {\r\n\treturn new Product ($id, $productname );\r\n}", "public static function makeFromFile(string $file): array {\n\n // get catalog update identifier\n list($catalogUpdateIdentifier,$suffix) = explode('.',basename($file));\n\n // get date of catalog update (don't use simplexml, the file might be very large)\n $dateOfCatalogUpdate = new Carbon(self::getDateOfCatalogUpdate($file));\n\n // get number of items in file to make a progress bar\n $numberOfItems = substr_count(file_get_contents($file),'<product>');\n $progress = ConsoleOutput::progress($numberOfItems);\n\n // holds all products\n $products = [];\n $productHandler = function($product) use ($progress,&$products,$dateOfCatalogUpdate, $catalogUpdateIdentifier) {\n\n ConsoleOutput::advance($progress);\n\n try {\n // create Object from ONIX message\n $libriProduct = self::create($product);\n\n if(!is_null($libriProduct)) {\n $libriProduct->DateOfData = $dateOfCatalogUpdate;\n $libriProduct->LibriUpdate = $catalogUpdateIdentifier;\n $products[] = $libriProduct;\n }\n\n } catch (MissingDataException $e) {\n ConsoleOutput::error($e->getMessage());\n Log::warning($e->getMessage());\n }\n };\n\n try {\n\n $parser = new Parser(); // create instance of PINOpar Parser\n $parser->setProductHandler($productHandler); // define a product handler which will be called for each <product> tag\n $parser->useFile($file);\n $parser->parse();\n ConsoleOutput::finish($progress);\n\n } catch(PONIpar\\XMLException $e) {\n\n // error in ONIXMessage, e.g. missing <ProductIdentifier>\n // todo: find a way to continue parsing the onixmessage\n ConsoleOutput::error($e->getMessage());\n Log::warning($e->getMessage());\n\n } catch(Exception $e) {\n\n ConsoleOutput::error($e->getMessage());\n Log::error($e->getMessage());\n // todo: find a way to continue parsing after caught exception\n\n }\n\n // clear $products from null values\n $products = array_filter($products, function($item) {\n return !is_null($item);\n });\n\n return $products;\n }", "abstract protected function extractProductDetail();", "public function initProduct($values = array(), $includeDescription = false, $languageId = null) \n\t{\t\n\t\t$product = $this->_baseProduct;\n\t\tforeach ($values as $key => $value) {\n\t\t\tif (array_key_exists($key, $product)) {\n\t\t\t\t$product[$key] = $value;\n\t\t\t}\n\t\t}\t\n\t\tif ($includeDescription) {\n\t\t\tif ($languageId && isset($product['product_description']) && array_key_exists($languageId, $product['product_description'])) {\n\t\t\t\tforeach ($values as $key => $value) {\n\t\t\t\t\tif (array_key_exists($key, $product['product_description'][$languageId])) {\n\t\t\t\t\t\t$product['product_description'][$languageId][$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif (isset($product['product_description']) && !empty($product['product_description'])) {\n\t\t\t\tforeach ($product['product_description'] as $languageId => $description) {\n\t\t\t\t\tforeach ($values as $key => $value) {\n\t\t\t\t\t\tif (array_key_exists($key, $product['product_description'][$languageId])) {\n\t\t\t\t\t\t\t$product['product_description'][$languageId][$key] = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\treturn $product;\n\t}", "abstract protected function createObject();", "public function product_action()\n\t{\n\t\t// shut up php\n\t\terror_reporting(0);\n\t\tee()->load->helper('xml');\n\n\t\t$output = new Oxymel;\n\n\t\t// create our structure\n\t\t$output->xml->products->contains;\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t$query = ee()->sync_db\n\t\t\t->where('processed', 0)\n\t\t\t->get('products', 500);\n\n\t\t$ids_processed = array();\n\n\t\tforeach($query->result() as $row)\n\t\t{\n\n\t\t\tif($row->tax_exempt == 0)\n\t\t\t{\n\t\t\t\t$tax_exempt = \"Taxable\";\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tax_exempt = \"\";\n\t\t\t}\n\n\t\t\tif(!empty($row->product_category_3))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_3;\n\t\t\t}\t\n\t\t\telseif(!empty($row->product_category_2))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_1;\n\t\t\t}\n\n\t\t\t// append a product\n\t\t\t$output\n\t\t\t\t->product->contains\n\t\t\t\t \t->title->contains->cdata($row->sku .' - ' . $row->name)->end\n\t\t\t\t \t->sku($row->sku)\n\t\t\t\t \t->name->contains->cdata($row->name)->end\n\t\t\t\t \t->price($row->price)\n\t\t\t\t \t->weight($row->weight)\n\t\t\t\t \t->length($row->length)\n\t\t\t\t \t->width($row->width)\n\t\t\t\t \t->height($row->height)\n\t\t\t\t \t->handling($row->handling)\n\t\t\t\t \t->free_shipping($row->free_shipping)\n\t\t\t\t \t->tax_exempt($tax_exempt)\n\t\t\t\t \t->category->contains->cdata($product_category)->end\n\t\t\t\t \t->product_number($row->product_number)\n\t\t\t\t \t->manufacturer->contains->cdata($row->product_manufacturer)->end\n\t\t\t\t \t->container($row->product_container)\n\t\t\t\t \t->condition($row->product_condition)\n\t\t\t\t \t->listed($row->product_listed)\n\t\t\t\t \t->location($row->product_location)\n\t\t\t\t \t->tested($row->product_tested)\n\t\t\t\t \t->cosmetic_condition->contains->cdata($row->product_cosmetic_condition)->end\n\t\t\t\t \t->keywords->contains->cdata($row->product_keywords)->end\n\t\t\t\t \t->natural_search->contains->cdata($row->product_natural_search)->end\n\t\t\t\t \t->description->contains->cdata($row->product_description)->end\n\t\t\t\t \t->image($row->product_image_filename)\n\t\t\t\t \t->stock_level($row->product_stock_level)\n\t\t\t\t \t->sell_online($row->product_sell_online)\n\t\t\t\t \t->timestamp($row->timestamp)\n\t\t\t\t->end;\t\n\n\t\t\t$ids_processed[] = $row->id;\n\n\t\t}\t\n\n\t\t// close our structure\n\t\t$output->end;\t\n\t\t\t \t\n\t\t// update processed flag on records\t\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('products');\n\t\t}\n\n\t\theader('Content-Type: text/xml');\n\t\texit($output->to_string());\n\n\t}", "public function build(): CatalogSubscriptionPlan\n {\n return CoreHelper::clone($this->instance);\n }", "abstract public function buildByInfo($info);", "function __CONSTRUCT($product_id=0){\n\t\t$this->db = new Database;\n\t\tif($product_id!=0){\n\t\t\t$this->load($product_id);\n\t\t}\n\t}", "protected function buildProducts($vtexBaseProduct)\n {\n $baseProduct = [\n 'brand' => $vtexBaseProduct->brand,\n 'description' => $vtexBaseProduct->description,\n 'url' => preg_replace('/https?:\\/\\/.*\\.vtexcommercestable\\.com\\.br/si', $this->vtexConnector->getStoreUrl(), $vtexBaseProduct->link),\n 'base_name' => $vtexBaseProduct->productName,\n 'release_date' => $vtexBaseProduct->releaseDate\n ];\n\n $categories = $this->vtexConnector->getCategories();\n if ($this->hasCategory($categories, $vtexBaseProduct)) {\n $baseProduct['category'] = $categories[$vtexBaseProduct->categoryId];\n }\n\n if ($customAttributes = $this->getCustomAttributes($vtexBaseProduct)) {\n $baseProduct['custom_attributes'] = $customAttributes;\n }\n\n foreach ($vtexBaseProduct->items as $vtexProduct) {\n if (!$this->hasSku($vtexProduct)) {\n continue;\n }\n $sku = $vtexProduct->referenceId[0]->Value;\n\n yield $baseProduct + [\n 'image_url' => $this->getImageUrl($vtexProduct),\n 'thumbnail_url' => $this->getImageUrl($vtexProduct),\n 'sku' => $sku,\n 'name' => $vtexProduct->name,\n 'price' => $this->getItemListPrice($vtexProduct),\n 'offer_price' => $this->getItemPrice($vtexProduct),\n 'stock' => $this->getItemStock($vtexProduct),\n 'available' => true,\n ];\n }\n }", "function LoadProduct($orderid) {\n\t$proids = array();\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"orderproduct\",array('id','orderid','proid','number','price','returnnow','modlcharge'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$idobj = $factory->getIdentityObject()->field('orderid')->eq($orderid);\n\t$order_pro = $finder->find($idobj);\n\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"product\",array('id','classid','length','width','think','unitlen','unitwid','unitthi','unit','sharp','note'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$pro = $order_pro->next();\n\t$i = 0;\n\t$data = array();\n\twhile($pro){\n\t\t$data[$i][0] = $i+1;\n\t\t$idobj = $factory->getIdentityObject()->field('id')->eq($pro->getProid());\n\t\t$collection = $finder->find($idobj);\n\t\t$product = $collection->current();\n\t\t$data[$i][1] = $product->getSize();\n\t\t$data[$i][2] = $pro->getNumber();\n\t\t$price = $pro->getPrice()-$pro->getReturnnow();\n\t\t$data[$i][3] = sprintf(\"%.2f\",$price);\n\t\t$data[$i][4] = sprintf(\"%.2f\",$price*$data[$i][2]);\n\t\t$i++;\n\t\t$pro = $order_pro->next();\n\t}\n\treturn $data;\n}", "function createCatalog($ar){\n $rs = selectQueryGetAll('select count(distinct categ) as nb from '.$this->wtscatalog);\n $p= new XParam($ar, array('prdconf'=>NULL,\n 'categ'=>'Lot '.($rs[0]['nb']+1),\n 'wtspool'=>NULL, 'wtsticket'=>NULL, 'wtsperson'=>NULL));\n $added = 0;\n $prdconf = $p->get('prdconf');\n $categ = $p->get('categ');\n $tapool = $p->get('tapool');\n $wtspool = $p->get('wtspool');\n $tatickets = $p->get('ticket');\n $tapersons = $p->get('person');\n $wtstickets = $p->get('wtsticket');\n $wtspersons = $p->get('wtsperson');\n $lar = array('_options'=>array('local'=>true),\n 'tplentry'=>TZR_RETURN_DATA,\n 'tapool'=>$tapool,\n 'wtspool'=>$wtspool,\n 'categ'=>$categ,\n 'prdconf'=>$prdconf,\n );\n // on génère les produits pour les combinaison selectionnées de valeurs tatickets/tapools\n foreach($tatickets as $it=>$taticketoid){\n $lar['wtsticket'] = NULL;\n $lar['taticket'] = $taticketoid;\n if (isset($wtstickets[$it]))\n $lar['wtsticket']= $wtstickets[$it];\n foreach($tapersons as $ip=>$tapersonoid){\n $lar['wtsperson'] = NULL;\n $lar['taperson'] = $tapersonoid;\n if (isset($wtspersons[$ip]))\n $lar['wtsperson'] = $wtspersons[$ip];\n // creation de la ligne\n $added+=1;\n $this->dswtscatalog->procInput($lar);\n }\n }\n $mess = $added.' produits ajoutés';\n XShell::setNextData('message', $mess);\n }", "protected function createCsConvObject() {}", "public function __construct(){\n\t\t\t$this->productoDetalleModelo = new productoDetalleModelo;\n\t\t\t$this->productoFavoritoControlador = new productoFavoritoControlador();\n\t\t\t$this->productoEstrellaControlador = new productoEstrellaControlador();\n\t\t\t$this->productoCarritoControlador = new productoCarritoControlador();\n\t\t}", "private function initBuilder()\n {\n $this->modx->loadClass('transport.modPackageBuilder', '', false, true);\n $this->builder = new \\modPackageBuilder($this->modx);\n }", "function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}", "function m_packageBuild()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_PACKAGE_FILE\",$this->packageTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_DEPARTMENT_BLK\", \"dept_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_ITEMS_BLK\", \"items_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_PACKAGE_FILE\",\"TPL_MAIN_BLK\", \"main_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_MAIN_BLK\",\"TPL_ATTACHED_BLK\", \"attached_blk\");\n\t\t#INTIALIZING VARIABLES\n\t\tif(!isset($this->request['owner']))\n\t\t{\n\t\t\t$this->request['owner']=\"0\";\n\t\t}\n\t\tif(!isset($this->request['type']))\n\t\t{\n\t\t\t$this->request['type']=\"product\";\n\t\t}\n\t\tif(!isset($this->request['otype']))\n\t\t{\n\t\t\t$this->request['otype']=\"department\";\n\t\t}\n\t\tif(!isset($this->request['kitid']))\n\t\t{\n\t\t\t$this->request['kitid']=\"\";\n\t\t}\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_SHOPURL\",SITE_URL.\"ecom/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OWNER\",$this->request['owner']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_TYPE\",$this->request['type']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_OTYPE\",$this->request['otype']);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\t\n\t\t//defining language variables\n\t\t$this->ObTpl->set_var(\"LANG_VAR_BUILDPACKAGE\",LANG_BUILDPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CURRENTPACKAGE\",LANG_CURRENTPACKAGE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CODE\",LANG_CODE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PRODUCT\",LANG_PRODUCTSTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_QTY\",LANG_QTYTXT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SORT\",LANG_SORT);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_REMOVE\",LANG_REMOVE);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_HOME\",LANG_HOME);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_ALLORPHAN\",LANG_ALLORPHAN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_RETURNPACK\",LANG_RETURNTOPACK);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_VIEWITEMS\",LANG_VIEWITEMS);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_UPDATEPACKAGE\",LANG_UPDATEPACKAGE);\n\t\t#START DISPLAY DEPARETMENT BLOCK\n\t\t$this->obDb->query = \"SELECT vTitle,iDeptId_PK FROM \".DEPARTMENTS.\", \".FUSIONS.\" WHERE iDeptId_PK=iSubId_FK AND vType='department'\";\n\t\t$deptResult = $this->obDb->fetchQuery();\n\t\t $recordCount=$this->obDb->record_count;\n\t\t#PARSING DEPARTMENT BLOCK\n\t\t$this->ObTpl->set_var(\"SELECTED1\",\"selected\");\n\t\t\n\t\t\n\t\tif($recordCount>0)\n\t\t{\n\t\t\tfor($i=0;$i<$recordCount;$i++)\n\t\t\t{\n\t\t\t\t$_SESSION['dspTitle']=\"\";\t\t\n\t\t\t\t $this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->m_getTitle($deptResult[$i]->iDeptId_PK,'department'));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$deptResult[$i]->iDeptId_PK);\n\t\t\t\tif(isset($this->request['postOwner']) && $this->request['postOwner'] == $deptResult[$i]->iDeptId_PK)\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED1\",\"\");\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"selected\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"SELECTED2\",\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ObTpl->parse(\"dept_blk\",\"TPL_DEPARTMENT_BLK\",true);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"dept_blk\",\"\");\n\t\t}\n\t\t#END DISPLAY DEPARETMENT BLOCK\n\n\t\t#START DISPLAY PRODUCT BLOCK\n\t\t#IF TYPE IS CONTENT\n\t\tif(isset($this->request['postOwner']))#PRODUCT\n\t\t{#FOR ORPHAN PRODUCT\n\t\t\tif($this->request['postOwner']==\"orphan\")\n\t\t\t{\n\t\t\t\t $this->obDb->query= \"SELECT vTitle,fusionid,iProdId_PK FROM \".PRODUCTS.\" LEFT JOIN \".FUSIONS.\" ON iProdId_PK = iSubId_FK \" ;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\t\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($queryResult[$j]->fusionid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{#IF OTHER THAN ORPHAN\n\t\t\t\t$query = \"SELECT vTitle,iProdId_PK FROM \".PRODUCTS.\", \".FUSIONS.\" WHERE iProdId_PK=iSubId_FK AND iOwner_FK='\".$this->request['postOwner'].\"' AND vOwnerType='department' AND vType='\".$this->request['type'].\"'\";\n\t\t\t\t$this->obDb->query=$query;\n\t\t\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t\t\t$recordCount=$this->obDb->record_count;\n\t\t\t\tif($recordCount>0)\n\t\t\t\t{\n\t\t\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t\t$this->ObTpl->parse(\"items_blk\",\"TPL_ITEMS_BLK\",true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",$this->request['postOwner']);\n\t\t}\n\t\telse#POST OWNER NOT SET\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"items_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_POSTOWNER\",\"\");\n\t\t}\n\n\t\t$this->obDb->query=\"SELECT vTitle FROM \".PRODUCTS.\" WHERE iProdId_PK='\".$this->request['kitid'].\"'\";\n\t\t$rs = $this->obDb->fetchQuery();\n\t\tif(!empty($rs[0]->vTitle))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",$this->libFunc->m_displayContent($rs[0]->vTitle));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_HEADTITLE\",\"\");\n\t\t}\n\t\t\t\n\t\t#TO DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$query1 = \"SELECT vSku,vTitle,iProdId_PK,iKitId_PK,iSort,iQty FROM \".PRODUCTS.\", \".PRODUCTKITS.\" WHERE iProdId_PK=iProdId_FK AND iKitId='\".$this->request['kitid'].\"' order by iSort\";\n\t\t$this->obDb->query=$query1;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$recordCount=$this->obDb->record_count;\n\t\tif($recordCount>0)\n\t\t{\n\t\t\t#PARSING TPL_ITEMS_BLK\n\t\t\tfor($j=0;$j<$recordCount;$j++)\n\t\t\t{\n\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_QTY\",$queryResult[$j]->iQty);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SORT\",$queryResult[$j]->iSort);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SKU\",$this->libFunc->m_displayContent($queryResult[$j]->vSku));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$str=str_replace(\"'\",\"\\'\",$this->libFunc->m_displayContent($queryResult[$j]->vTitle));\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TITLE1\",$str);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PID\",$queryResult[$j]->iProdId_PK);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_KID\",$queryResult[$j]->iKitId_PK);\n\t\t\t\t\t$this->ObTpl->parse(\"attached_blk\",\"TPL_ATTACHED_BLK\",true);\n\t\t\t\n\t\t\t}\n\n\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"attached_blk\",\"\");\n\t\t\t\t$this->ObTpl->parse(\"main_blk\",\"TPL_MAIN_BLK\");\n\t\t}\n\t\t#END DISPLAY CURRENTLY ATTACHED ITEMS\n\t\t$this->ObTpl->set_var(\"TPL_VAR_KITID\",$this->request['kitid']);\n\t\tif(empty($this->request['kitid']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"main_blk\",\"\");\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_BUILDPACK);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_BTNLBL\",LBL_ADDTOPACK);\n\t\t}\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_PACKAGE_FILE\"));\n\t}", "abstract public function bundle();", "function &fromArray($arr)\n {\n if (isset($arr['xsdversion'])) {\n $obj = &$this->factory($arr['xsdversion']);\n if ($this->_logger) {\n $obj->setLogger($this->_logger);\n }\n\n $obj->setConfig($this->_config);\n $obj->fromArray($arr);\n return $obj;\n }\n\n if (isset($arr['package']['attribs']['version'])) {\n $obj = &$this->factory($arr['package']['attribs']['version']);\n } else {\n $obj = &$this->factory('1.0');\n }\n\n if ($this->_logger) {\n $obj->setLogger($this->_logger);\n }\n\n $obj->setConfig($this->_config);\n $obj->fromArray($arr);\n return $obj;\n }", "private function internalizeProduct($product_json) {\n $tmp = new PsApiProduct($this);\n foreach ($product_json as $attribute=>$value) {\n switch ($attribute) { // This switch is meant to allow processing of special-case attributes\n case 'offers':\n\t $offers_array = $value['offer'];\n\t foreach ($offers_array as $offer) {\n\t $this->internalize($offer, (new PsApiOffer($this)), $this->offers);\n\t $this->offers[$offer['id']]->setProduct($tmp); // Set the internalized offer's parent product to the currently internalized product\n\t $tmp->addOffer($this->offers[$offer['id']]); // Add the offer we just internalized to the new (currently being internalized) product\n\t }\n\t break;\n default: // If there's no special case processing to do\n\t if (is_numeric($value) or is_string($value)) { // Don't include any arrays or attributes that aren't just strings or numbers\n\t $tmp->setAttr($attribute, $value);\n\t }\n }\n }\n $this->products[$tmp->attr('id')] = $tmp;\n }", "protected function buildModel(array $data)\n {\n return (new Product())\n ->setId($data['id'])\n ->setName($data['name'])\n ->setCost($data['cost']);\n }", "private function buildFromOrm($result) {\n\t\t$GLOBALS[\"logger\"]->debug('buildFromOrm');\n\t\t$this->id = $result->id;\n\t\t$clipId = $result->clip_id;\n\t\t$this->clip = Clip::findById($clipId);\n\t\t\n\t\t$userId = $result->user_id;\n\t\t$GLOBALS[\"logger\"]->debug(\"User id = $userId\");\n\t\tif ($userId) {\n\t\t\t$this->user = User::findById($userId);\n\t\t\tif ($this->user) {\n\t\t\t\t$GLOBALS[\"logger\"]->debug(\"Got user: \" . $this->user->name);\n\t\t\t}\n\t\t}\n\t\t$this->soundType = $result->sound_type;\n\t\t$this->soundSubtype = $result->sound_subtype;\n\t\t$this->performerType = $result->performer_type;\n\t\t$songId = $result->song_id;\n\t\tif (!is_null($songId)) {\n\t\t\t$GLOBALS[\"logger\"]->debug (\"Finding song by ID $songId\");\n\t\t\t$this->song = Song::findById($songId);\n\t\t}\n\t\t$this->singalong = ($result->singalong == 1) ? true : false;\n\t\t$this->date = $result->date;\n\t\t$this->masterId = $result->master_id;\n\t\t$this->seqNum = $result->seq_num;\n\t\t$this->flagged = $result->flagged;\n\t\t$this->addPerformers();\n\t\t$this->addInstruments();\n\t}", "public function build()\n {\n }", "static function createLibraryObj()\r\n\t{\r\n\t\tglobal $user;\r\n\r\n\t\t$library = new DocumentLibrary();\r\n\t\t$library->owner_id = $user->user_id;\r\n\t\t$library->create_date = now();\r\n\t\t$defaultRole = DocumentLibrary::getDefaultRole();\r\n\t\tif($defaultRole)\r\n\t\t{\r\n\t\t\t$library->allow_access = $defaultRole;\r\n\t\t\t$library->manage_folders = $defaultRole;\r\n\t\t\t$library->upload_files = $defaultRole;\r\n\t\t\t$library->delete_files = $defaultRole;\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\t$library->filter = new InclusionFilter(\"document_library_id\", \"name\", \r\n\t\t\"identifier\", \"description\", \"owner_id\", \"last_modified\",\r\n\t\t\"allow_access\", \"manage_folders\", \"upload_files\", \"delete_files\", \"create_date\");\r\n\t\t\r\n\t\treturn $library;\r\n\t}", "function dbInstall($data) {\r\n/*\r\nproducts - Products\r\nproduct_categories - Categories\r\nshopping_list_items - Shopping List\r\n*/\r\n $data = <<<EOD\r\n\r\n products: ID int(10) unsigned NOT NULL auto_increment\r\n products: TITLE varchar(255) NOT NULL DEFAULT ''\r\n products: CATEGORY_ID int(10) NOT NULL DEFAULT '0'\r\n products: IMAGE varchar(70) NOT NULL DEFAULT ''\r\n products: WILL_EXPIRE int(3) NOT NULL DEFAULT '0'\r\n products: EXPIRE_DATE date\r\n products: EXPIRE_DEFAULT int(10) NOT NULL DEFAULT '0'\r\n products: UPDATED datetime\r\n products: QTY int(10) NOT NULL DEFAULT '0'\r\n products: MIN_QTY int(10) NOT NULL DEFAULT '0'\r\n products: DETAILS text\r\n products: DEFAULT_PRICE float DEFAULT '0' NOT NULL\r\n\r\n product_categories: ID int(10) unsigned NOT NULL auto_increment\r\n product_categories: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_categories: PRIORITY int(10) NOT NULL DEFAULT '0'\r\n product_categories: PARENT_ID int(10) NOT NULL DEFAULT '0'\r\n product_categories: SUB_LIST text\r\n product_categories: PARENT_LIST text\r\n\r\n shopping_list_items: ID int(10) unsigned NOT NULL auto_increment\r\n shopping_list_items: TITLE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n shopping_list_items: PRICE float DEFAULT '0' NOT NULL\r\n shopping_list_items: CODE varchar(255) NOT NULL DEFAULT ''\r\n shopping_list_items: IN_CART int(3) NOT NULL DEFAULT '0'\r\n\r\n product_log: ID int(10) unsigned NOT NULL auto_increment\r\n product_log: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_log: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: CODE_ID int(10) NOT NULL DEFAULT '0'\r\n product_log: QTY int(10) NOT NULL DEFAULT '0'\r\n product_log: ACTION char(10) NOT NULL DEFAULT ''\r\n product_log: UPDATED datetime\r\n\r\n product_codes: ID int(10) unsigned NOT NULL auto_increment\r\n product_codes: TITLE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: CODE varchar(255) NOT NULL DEFAULT ''\r\n product_codes: PRODUCT_ID int(10) NOT NULL DEFAULT '0'\r\n\r\n\r\nEOD;\r\n parent::dbInstall($data);\r\n }", "public function build($requestData, $store = 0)\n {\n if (!empty($requestData['id'])) {\n $mageProductId = (int) $requestData['id'];\n } else {\n $mageProductId = '';\n }\n /** @var $mageProduct \\Magento\\Catalog\\Model\\Product */\n $mageProduct = $this->_productFactory->create();\n if (!empty($requestData['set'])) {\n $mageProduct->setAttributeSetId($requestData['set']);\n }\n if (!empty($requestData['type'])) {\n $mageProduct->setTypeId($requestData['type']);\n }\n $mageProduct->setStoreId($store);\n if ($mageProductId) {\n try {\n $isPartner = $this->_helper->isSeller();\n $flag = false;\n if ($isPartner == 1) {\n $rightseller = $this->_helper->isRightSeller($mageProductId);\n if ($rightseller == 1) {\n $flag = true;\n }\n }\n if ($flag) {\n $mageProduct->load($mageProductId);\n }\n } catch (\\Exception $e) {\n $this->_logger->critical($e);\n }\n }\n if (!$this->_registry->registry('product')) {\n $this->_registry->register('product', $mageProduct);\n }\n if (!$this->_registry->registry('current_product')) {\n $this->_registry->register('current_product', $mageProduct);\n }\n return $mageProduct;\n }", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public abstract function make();", "public function build(): CreateInvoiceRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function _construct()\n {\n parent::_construct();\n $this->_init('wholesale/product');\n }", "public function getProductById($id){\n $prodDB=$this->promodel->getProductById($id);\n // create a new product\n $product = new Product();\n $product->id=$prodDB->id;\n $product->name=$prodDB->name;\n $product->category=$prodDB->category;\n $product->price=$prodDB->price;\n $product->qty=0;\n return $product;\n }", "private function mapSqlToObject($rs)\n {\n $temp_prod = new temp_prod();\n $temp_prod->_id = $rs[\"id\"];\n $temp_prod->_session_id = $rs[\"session_id\"];\n $temp_prod->_base64_image = $rs[\"base64_image\"];\n $temp_prod->_bonrepli = $rs[\"bonrepli\"];\n $temp_prod->_commentaire = $rs[\"commentaire\"];\n $temp_prod->_dimension = $rs[\"dimension\"];\n $temp_prod->_escargot = $rs[\"escargot\"];\n $temp_prod->_idn_key = $rs[\"idn_key\"];\n $temp_prod->_idmodelmetier = $rs[\"idmodelmetier\"];\n $temp_prod->_idproduit = $rs[\"idproduit\"];\n $temp_prod->_opt = $rs[\"opt\"];\n $temp_prod->_prix = $rs[\"prix\"];\n $temp_prod->_unitprix = $rs[\"unitprix\"];\n $temp_prod->_idsupport = $rs[\"idsupport\"];\n $temp_prod->_support = $rs[\"idsupport\"];\n $temp_prod->_qte = $rs[\"qte\"];\n $temp_prod->_title = $rs[\"title\"];\n $temp_prod->_data = ($rs[\"data\"]);\n $temp_prod->_random_str = json_decode($rs[\"random_str\"]);\n $temp_prod->_escargot_val = json_decode($rs[\"escargot_val\"]);\n $temp_prod->_contours = json_decode($rs[\"contours\"]);\n $temp_prod->_liserai = json_decode($rs[\"liserai\"]);\n $temp_prod->_id_dimension = $rs[\"id_dimension\"];\n $temp_prod->_id_qte = $rs[\"id_qte\"];\n return $temp_prod;\n }", "public function __construct(AbstractProductBuilder $builder) {\n $this->builder = $builder;\n }", "function ciniki_products_processPDFCatalog(&$ciniki, $tnid, $catalog_id) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUUID');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'images', 'hooks', 'insertFromImagick');\n\n //\n // Load the pdf catalog\n //\n $strsql = \"SELECT id, uuid, status, permalink \"\n . \"FROM ciniki_product_pdfcatalogs \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $catalog_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 10 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.products', 'catalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['catalog']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.33', 'msg'=>'Catalog does not exist'));\n }\n $catalog = $rc['catalog'];\n \n //\n // Update the pdf catalog status to lock\n //\n $strsql = \"UPDATE ciniki_product_pdfcatalogs SET status = 20 \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $catalog_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND status = 10 \"\n . \"\";\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.products');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_affected_rows'] < 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.34', 'msg'=>'Unable to lock catalog for processing.'));\n }\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n //\n // Check the file exists\n $storage_filename = $tenant_storage_dir . '/ciniki.products/pdfcatalogs/' . $catalog['uuid'][0] . '/' . $catalog['uuid'];\n if( !file_exists($storage_filename) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.35', 'msg'=>'Unable to open pdf.'));\n }\n\n //\n // Copy to tmp directory so it's local for processing. Remove files take too long to open over and over for each page.\n //\n if( isset($ciniki['config']['ciniki.core']['tmp_dir']) ) {\n $tmp_filename = $ciniki['config']['ciniki.core']['tmp_dir'] . '/' . $catalog['uuid'];\n } else {\n $tmp_filename = '/tmp/' . $catalog['uuid'];\n }\n\n if( !copy($storage_filename, $tmp_filename) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.36', 'msg'=>'Unable to copy pdf.'));\n }\n\n ini_set('memory_limit', '4096M');\n\n $imagick = new Imagick();\n $imagick->setResolution(300, 300);\n\n $imagick->pingImage($tmp_filename);\n $num_pages = $imagick->getNumberImages();\n $imagick->clear();\n $imagick->destroy();\n\n $imagick = new Imagick();\n $imagick->setResolution(300, 300);\n\n $page_number = 0;\n for($page_number = 0; $page_number < $num_pages; $page_number++) {\n $imagick->readImage($tmp_filename . '[' . $page_number . ']');\n $imagick = $imagick->flattenImages();\n $imagick->setImageFormat('jpeg');\n \n //\n // Add the image\n //\n $rc = ciniki_images_hooks_insertFromImagick($ciniki, $tnid, array(\n 'image'=>$imagick,\n 'original_filename'=>$catalog['permalink'] . '-' . ($page_number+1) . '.jpg',\n 'name'=>'',\n 'force_duplicate'=>'no',\n 'perms'=>1,\n ));\n if( $rc['stat'] != 'ok' && $rc['stat'] != 'exists' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.37', 'msg'=>\"Unable to save image for page $page_number.\", 'err'=>$rc['err']));\n }\n $image_id = $rc['id'];\n\n //\n // Add the pdfcatalog image\n //\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.products.pdfcatalogimage', array(\n 'catalog_id'=>$catalog_id,\n 'page_number'=>($page_number+1),\n 'image_id'=>$image_id,\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.products.38', 'msg'=>\"Unable to save image for page $page_number.\"));\n }\n }\n\n unlink($tmp_filename);\n\n //\n // Update the pdf catalog status to lock\n //\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.products.pdfcatalog', $catalog_id, array(\n 'status'=>30,\n 'num_pages'=>$num_pages,\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n return array('stat'=>'ok');\n}", "public function build ()\n {\n }", "function _buildXML() {\r\n\r\n\t\t$db = &FabrikWorker::getDbo();\r\n\t\t$this->clearExportBuffer();\r\n\t\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\\n\";\r\n\t\t$strXML .= \"<install type=\\\"fabrik\\\" version=\\\"2.0\\\">\\n\";\r\n\r\n\t\t$strXML .= \"<creationDate>\" . JRequest::getVar('creationDate', '', 'post') . \"</creationDate>\\n\";\r\n\t \t$strXML .= \"<author>\" . JRequest::getVar('creationDate', '', 'author') . \"</author>\\n\";\r\n\t \t$strXML .= \"<copyright>\" . JRequest::getVar('creationDate', '', 'copyright') . \"</copyright>\\n\";\r\n\t \t$strXML .= \"<authorEmail>\" . JRequest::getVar('creationDate', '', 'authoremail') . \"</authorEmail>\\n\";\r\n\t \t$strXML .= \"<authorUrl>\" . JRequest::getVar('creationDate', '', 'authorurl') . \"</authorUrl>\\n\";\r\n\t \t$strXML .= \"<version>\" . JRequest::getVar('creationDate', '', 'version') . \"</version>\\n\";\r\n\t \t$strXML .= \"<liscence>\" . JRequest::getVar('creationDate', '', 'license') . \"</liscence>\\n\";\r\n\t \t$strXML .= \"<description>\" . JRequest::getVar('creationDate', '', 'description') . \"</description>\\n\";\r\n\r\n\t\t$aTableObjs = array();\r\n\r\n\t\t$tables = $this->packageModel->_tables;\r\n\t\t$forms = $this->packageModel->_forms;\r\n\t\tif ($this->fabrikData) {\r\n\r\n\t\t\t$strXML .= \"<tables>\\n\";\r\n\t\t\tif (is_array($this->tableIds)) {\r\n\r\n\t\t\t\tforeach ($tables as $table) {\r\n\t\t\t\t\t$vars = get_object_vars($table);\r\n\t\t\t\t\t$strXML .= \"\\t<table>\\n\";\r\n\t\t\t\t\tforeach( $vars as $key=>$val ) {\r\n\t\t\t\t\t\tif (substr($key, 0, 1) != '_' ) {\r\n\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</tables>\\n\\n\";\r\n\r\n\t\t\t$strXML .= \"<forms>\\n\";\r\n\r\n\t\t\tforeach ($forms as $form) {\r\n\t\t\t\t$vars = get_object_vars($form);\r\n\t\t\t\t$strXML .= \"\\t<form>\\n\";\r\n\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$strXML .= \"\\t</form>\\n\";\r\n\t\t\t}\r\n\t\t\t$strXML .= \"</forms>\\n\\n\";\r\n\r\n\t\t\t$strElementXML \t\t= \"<elements>\\n\";\r\n\t\t\t$strXML \t\t\t.= \"<groups>\\n\";\r\n\t\t\t$strValidationXML \t= \"<validations>\\n\";\r\n\t\t\tforeach ($this->_aTables as $listModel) {\r\n\t\t\t\t$groups = $listModel->_oForm->getGroupsHiarachy();\r\n\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tforeach ($groups as $groupModel) {\r\n\t\t\t\t\t$group = $groupModel->getGroup();\r\n\t\t\t\t\t$vars = get_object_vars($group);\r\n\t\t\t\t\t$strXML .= \"\\t<group form_id=\\\"\".$listModel->getFormModel()->getId().\"\\\" ordering=\\\"\" . $i .\"\\\">\\n\";\r\n\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t//dont insert join_id as this isnt in the group table\r\n\t\t\t\t\t\tif ($key != \"join_id\") {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$strXML .= \"\\t</group>\\n\";\r\n\t\t\t\t\t$elementModels = $groupModel->getPublishedElements();\r\n\t\t\t\t\tforeach ($elementModels as $elementModel) {\r\n\t\t\t\t\t\t$element = $elementModel->getElement();\r\n\t\t\t\t\t\t$vars = get_object_vars($element);\r\n\t\t\t\t\t\t$strElementXML .= \"\\t<element>\\n\";\r\n\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t$strElementXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$strElementXML .= \"\\t</element>\\n\\n\";\r\n\r\n\t\t\t\t\t\tforeach ($elementModel->_aValidations as $oValidation) {\r\n\t\t\t\t\t\t\t$vars = get_object_vars($oValidation);\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t<validation>\\n\";\r\n\t\t\t\t\t\t\tforeach ($vars as $key=>$val) {\r\n\t\t\t\t\t\t\t\tif (substr($key, 0, 1) != '_') {\r\n\t\t\t\t\t\t\t\t\t$strValidationXML .= \"\\t\\t<$key><![CDATA[$val]]></$key>\\n\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$strValidationXML .= \"\\t</validation>\\n\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$strXML \t\t\t.= \"</groups>\\n\";\r\n\t\t\t$strElementXML \t\t.= \"</elements>\\n\\n\";\r\n\t\t\t$strValidationXML \t.= \"</validations>\\n\\n\";\r\n\t\t\t$strXML .= $strElementXML . $strValidationXML;\r\n\r\n\t\t}\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t\tif ($this->incTableStructure) {\r\n\t\t\t$strXML = $this->_createTablesXML($strXML);\r\n\t\t}\r\n\t\t$strXML .= $this->getTemplateFiles();\r\n\t\t$strXML .= \"</install>\";\r\n\t\t$this->writeExportBuffer($strXML);\r\n\t}", "public function _construct()\n {\n $this->_init('configbox_magento_xref_mprod_cbprod', 'id');\n }", "function create_product()\n{\ninclude(\"authheaders.php\");\n$createProductURL='http://api.spreadshirt.net/api/v1/shops/'.get_option('spreadshop_shop_id').'/products';\n$productData = new SimpleXmlElement('<product xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns=\"http://api.spreadshirt.net\">\n<productType id=\"6\"/>\n<appearance id=\"1\"/>\n<size id=\"12\"/>\n<restrictions>\n<freeColorSelection>false</freeColorSelection>\n<example>false</example>\n</restrictions>\n</product>');\n\t$header = array();\n\t$header[] = createSprdAuthHeader(\"POST\", $createProductURL);\n\t$header[] = \"Content-Type: application/xml\";\n\t$ch = curl_init($createProductURL);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $productData->asXML());\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n\t$result = parseHttpHeaders(curl_exec($ch),\"Location\");\n\tcurl_close($ch);\n\t$result = explode('products/', $result);\n\treturn $result[1];\t\t\n\tdie();\n\t}", "function ciniki_merchandise_web_productLoad($ciniki, $tnid, $args) {\n \n $strsql = \"SELECT ciniki_merchandise.id, \"\n . \"ciniki_merchandise.uuid, \"\n . \"ciniki_merchandise.name, \"\n . \"ciniki_merchandise.permalink, \"\n . \"ciniki_merchandise.flags, \"\n . \"ciniki_merchandise.primary_image_id, \"\n . \"'' AS primary_image_caption, \"\n . \"ciniki_merchandise.synopsis, \"\n . \"ciniki_merchandise.description \"\n . \"FROM ciniki_merchandise \"\n . \"WHERE ciniki_merchandise.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n if( isset($args['permalink']) && $args['permalink'] != '' ) {\n $strsql .= \"AND ciniki_merchandise.permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \";\n } elseif( isset($args['id']) && $args['id'] > 0 ) {\n $strsql .= \"AND ciniki_merchandise.id = '\" . ciniki_core_dbQuote($ciniki, $args['id']) . \"' \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.27', 'msg'=>'No product specified'));\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'product');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.28', 'msg'=>'Product not found', 'err'=>$rc['err']));\n }\n if( !isset($rc['product']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.29', 'msg'=>'Unable to find Product'));\n }\n $product = $rc['product'];\n\n //\n // Get the images\n //\n if( isset($args['images']) && $args['images'] == 'yes' ) {\n $strsql = \"SELECT id, \"\n . \"name AS title, \"\n . \"permalink, \"\n . \"flags, \"\n . \"image_id, \"\n . \"description \"\n . \"FROM ciniki_merchandise_images \"\n . \"WHERE product_id = '\" . ciniki_core_dbQuote($ciniki, $product['id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(\n array('container'=>'images', 'fname'=>'id', 'fields'=>array('id', 'title', 'permalink', 'flags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['images']) ) {\n $product['images'] = $rc['images'];\n } else {\n $product['images'] = array();\n }\n if( $product['primary_image_id'] > 0 ) {\n $found = 'no';\n foreach($product['images'] as $image) {\n if( $image['image_id'] == $product['primary_image_id'] ) {\n $found = 'yes';\n }\n }\n if( $found == 'no' ) {\n array_unshift($product['images'], array('title'=>'', 'flags'=>1, 'permalink'=>$product['uuid'], 'image_id'=>$product['primary_image_id'], 'description'=>''));\n }\n }\n }\n\n return array('stat'=>'ok', 'product'=>$product);\n}", "function createProduct($parent = null);", "public function populateProduct($req)\n {\n $product = new Product();\n $id = trim($req->getPost('id'));\n if ($id !== '') {\n $product->id = $id;\n }\n $product->name = trim($req->getPost('name'));\n $product->price = (int)trim($req->getPost('price'));\n $image = trim($req->getPost('image'));\n $product->image = (!empty($image) ? $image : null);\n $product->description = trim($req->getPost('description'));\n $product->available = (bool)$req->getPost('available');\n $product->categoryIds = $req->getPost('category', []);\n return $product;\n }", "function tx_commerce_product() {\n\t\tif ((func_num_args()>0) && (func_num_args()<=2)){\n\t\t\t$uid = func_get_arg(0); \n\t\t\tif (func_num_args()==2){\n\t\t\t\t$lang_uid=func_get_arg(1);\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$lang_uid=0;\n\t\t\t}\n\t\t\treturn $this->init($uid,$lang_uid);\n\t\t}\n\t}", "protected function _buildMerge($product)\n {\n $import = $this->_root->appendChild($this->_doc->createElement('import'));\n\n $import->setAttribute('type', 'product');\n $import->setAttribute('operation', 'merge');\n $import->setAttribute('externalReference', $product->getExternalReference());\n\n $content = \"\";\n\n foreach ($product->toArray(true) as $key => $value) {\n $content .= $key.\"=\".$value.\"\\n\";\n }\n\n $import->appendChild($import->ownerDocument->createCDATASection(substr($content, 0, -1)));\n }", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "private function construct_xml_contain(){\r\n global $CFG;\r\n $xml = new SimpleXMLElement('<?xml version=\"1.0\" encoding=\"UTF-8\"?>'.'<!DOCTYPE root [<!ENTITY nbsp \"&#160;\">]>'.'<catalogue/>');\r\n\r\n foreach($this->offers as $offer){\r\n $resource_link = '';\r\n if (OfferCourse::isCentralizedRessourcesAvailable()) {\r\n if(isset($offer->thumbnailid) && $offer->thumbnailid != null){\r\n $DBC = get_centralized_db_connection();\r\n $cr_resource = $DBC->get_record('cr_resources', array('resourceid'=>$offer->thumbnailid));\r\n $resource_link = \"\";\r\n if($cr_resource){\r\n $url_resource = '/'.$CFG->centralizedresources_media_types['indexthumb'].'/'.$cr_resource->cleanname;\r\n $resource_link = get_resource_centralized_secure_url($url_resource, $cr_resource->hashname.$cr_resource->createdate, $CFG->secure_link_timestamp_image);\r\n }\r\n }\r\n }\r\n $formation = $xml->addChild('formation');\r\n if (isset($resource_link)){\r\n $formation->addChild('image', htmlspecialchars($resource_link));\r\n }\r\n $formation->addChild('nom_parcours', htmlspecialchars($offer->fullname));\r\n if (isset($offer->domain_name)){\r\n $formation->addChild('domaine', htmlspecialchars($offer->domain_name));\r\n }\r\n if (isset($offer->publics)){\r\n $formation->addChild('public', htmlspecialchars($offer->publics));\r\n }\r\n if (isset($offer->col_name)){\r\n $formation->addChild('collection', htmlspecialchars($offer->col_name));\r\n }\r\n if (isset($offer->authors)){\r\n $formation->addChild('formateur', htmlspecialchars($offer->authors));\r\n }\r\n if (isset($offer->summary)){\r\n $description = strip_tags($offer->summary,'');\r\n $formation->addChild('description', htmlspecialchars($description));\r\n }\r\n if (isset($offer->objectif)){\r\n $objectif = strip_tags($offer->objectif,'');\r\n $formation->addChild('objectifs', htmlspecialchars($objectif));\r\n }\r\n if (isset($offer->tps_en_presence)){\r\n $temps_presence = OfferCourse::string_format_time($offer->tps_en_presence);\r\n if($temps_presence == null){\r\n $temps_presence = get_string('no_lead_time_attendance', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_presence', htmlspecialchars($temps_presence));\r\n }\r\n if (isset($offer->tps_a_distance)){\r\n $temps_distance = OfferCourse::string_format_time($offer->tps_a_distance);\r\n if($temps_distance == null){\r\n $temps_distance = get_string('no_lead_time_remote', 'local_magistere_offers');\r\n }\r\n $formation->addChild('duree_distance', htmlspecialchars($temps_distance));\r\n }\r\n if (isset($offer->validateby)){\r\n $formation->addChild('validation', htmlspecialchars($offer->validateby));\r\n }\r\n if (isset($offer->aca_name)){\r\n $formation->addChild('origine', OfferCourse::string_format_origine_offers($offer->aca_name));\r\n }\r\n if (isset($offer->timepublished)){\r\n $updatedate = (isset($offer->timepublished)?date('YmdHis',$offer->timepublished):date('YmdHis',$offer->updatedate));\r\n $formation->addChild('date_publication', $updatedate);\r\n }\r\n $formation->addChild('url', $offer->courseurl);\r\n }\r\n\r\n $this->xml_structure = $xml->asXML();\r\n }", "public function createProduct($item)\n\t{\n\t\t\t\n\t\t\t\n\t\t\t$productSku = $item->LITM;\n\t\t\t$productLoad = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);\n\t\t\t \n\t\t\t if(!$productLoad){\n\t\t\t\t$product = Mage::getModel('catalog/product');\n \n\t\t\t } else {\n\t\t\t\t $product = Mage::getModel('catalog/product')->load($productLoad->getId());\n\t\t\t }\n\t\t\t \n\t\t\t $product->setStoreId(1) //you can set data in store scope\n\t\t\t\t\t\t->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array\n\t\t\t\t\t\t->setAttributeSetId(4) //ID of a attribute set named 'default'\n\t\t\t\t\t\t->setTypeId('simple') //product type\n\t\t\t\t\t\t->setCreatedAt(strtotime('now')) //product creation time\n\t\t\t\t\t\t->setStatus(1) //product status (1 - enabled, 2 - disabled)\n\t\t\t\t\t\t->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n\t\t\t\t\t\t->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH); //catalog and search visibility\n\t\t\t\n\t\t\t $product->setGtin($item->part_number->EITM);\n\t\t\t $product->setMpn($item->part_number->MITM);\n\t\t\t $product->setName($item->part_description->WTXT);\n\t\t\t $product->setShortDescription($item->part_description->DES2);\n\t\t\t $product->setDescription($item->part_description->WTX2);\n\t\t\t $product->setWeight($item->additional_information->GWGH);\n\t\t\t \n\t\t\t\n\t\t\t $product->setManufacturer($this->retrieveOptionId('manufacturer',$item->additional_information->MAFT)); //option needs to be selected\n\t\t\t\n\t\t\t\n\t\t\t $product->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'\t\t\t => 1, //manage stock\n 'min_sale_qty'\t\t\t => 1, //Minimum Qty Allowed in Shopping Cart\n 'use_config_max_sale_qty' => 1, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' \t\t\t => 1, //Stock Availability\n 'qty' \t\t\t\t\t => $item->additional_information->STQU //qty\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$product->setSku($item->LITM);\n\t\t\t$product->setDistributor($this->retrieveOptionId(\"distributor\",\"Alltron\"));\n\t\t\t$product->setEstimatedShippingTime(\"1-2 Werktage\");\n\t\t\t$product->setQty($item->STQU);\n\t\t\t\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT1);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT2);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT3);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CATA);\t\t\t\n\t\t\t$product->setCategoryIds($categories);\n\n\t\t\t$product->save();\n\t}", "public function buildCoreFields(): void\n {\n //====================================================================//\n // Product SKU\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"identifier\")\n ->name(\"Product SKU\")\n ->microData(\"http://schema.org/Product\", \"model\")\n ->isListed()\n ->isReadOnly()\n ;\n //====================================================================//\n // Active => Product Is Enables & Visible\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->identifier(\"enabled\")\n ->name(\"Enabled\")\n ->microData(\"http://schema.org/Product\", \"offered\")\n ->isListed()\n ;\n //====================================================================//\n // Product Family\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_code\")\n ->name(\"Family Code\")\n ->group(\"Metadata\")\n ->addChoices($this->variants->getFamilyChoices())\n ->microData(\"http://schema.org/Product\", \"famillyCode\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Product Family Name\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_label\")\n ->name(\"Family Name\")\n ->group(\"Metadata\")\n ->microData(\"http://schema.org/Product\", \"famillyName\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Product Family Variant\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"family_variant_code\")\n ->name(\"Family Variant Code\")\n ->group(\"Metadata\")\n ->addChoices($this->variants->getFamilyChoices())\n ->microData(\"http://schema.org/Product\", \"famillyVariantCode\")\n ->isNotTested()\n ;\n //====================================================================//\n // PhpUnit/Travis Mode => Force Variation Types\n if (Splash::isTravisMode()) {\n $this->fieldsFactory()->addChoice(\"clothing_color\", \"Color\");\n }\n }", "public function newCObj() {}", "public function __construct()\n {\n $this->mapper = \\Lib\\DataMapper::instance();\n $this->product = new Product();\n }", "public function getProduct();", "public function build($extends=array())\n\t{\n\t\t$amount = $this->_amount * 100;\n\t\t$crumbs = md5(self::HASHSUM.$this->_invoice);\n\t\t$pass_parameters = array(\n\t\t\t'MERCHANT2' => $this->_merchantId,\n\t\t\t'TERM2' => $this->_terminalId,\n\t\t\t'INVMERCHANT' => $this->_invoice,\n\t\t\t'DETAIL2' => $this->_purpose,\n\t\t\t'AMOUNT2' => $amount,\n\t\t\t'URL2' => $this->_successUrl,\n\t\t\t'RESPURL' => $this->_backendUrl,\n\t\t\t'IPCUST2' => $_SERVER['REMOTE_ADDR'],\n\t\t\t'CHECKSUM' => $crumbs\n\t\t);\n\t\t$params = array_merge($pass_parameters, $extends);\n\t\t$build_data = array_merge($this->_defaults_params, $params);\n\t\treturn $build_data;\n\t}", "public function newProductRequest(): ProductRequest\n {\n return new ProductRequest($this->_apiKey);\n }", "protected function _construct()\n {\n $this->_init(\\MagentoCoders\\CustomCatalog\\Model\\Product::class, Product::class);\n }", "public static function builder();", "protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}", "function apptivo_ecommerce_product( $id) {\n\t\t\n\t\t$this->id = (int)$id;\t\t\n\t\t$app_item_id = get_post_meta($this->id,'_apptivo_item_id',true); \n\t\t$app_item_uom_id = get_post_meta($this->id,'_apptivo_item_uom_id',true);\n\t\t$app_item_manufactured_id = get_post_meta($this->id,'_apptivo_item_manufactured_id',true); \n\t\t$this->product_custom_fields = get_post_custom( $this->id );\t\t\n\t\t$this->exists = (sizeof($this->product_custom_fields)>0) ? true : false;\n\t\t// Define the data we're going to load: Key => Default value\n\t\t$load_data = array(\n\t\t\t'_apptivo_item_code'\t\t\t=> $this->id,\n\t\t '_apptivo_track_color' => '',\n\t\t '_apptivo_track_size' => '',\t\n\t\t\t'_apptivo_sale_price'\t=> '',\n\t\t\t'_apptivo_regular_price' => '',\t\t\t\n\t\t '_apptivo_item_id' => $awpItemId,//$app_item_id,\n\t\t '_apptivo_item_uom_id' => $awpItem_UOMId,//$_apptivo_item_uom_id\n\t\t\t'_apptivo_item_manufactured_id' => $app_item_manufactured_id\t \n\t\t);\n\t\t\n\t\t// Load the data from the custom fields\n\t\tforeach ($load_data as $key => $default) :\n\t\t\t$this->$key = (isset($this->product_custom_fields[$key][0]) && $this->product_custom_fields[$key][0]!=='') ? $this->product_custom_fields[$key][0] : $default;\n\t\tendforeach;\n\t\t\n\t\t// Load serialised data, unserialise twice to fix WP bug\n\t\tif (isset($this->product_custom_fields['product_attributes'][0])) $this->attributes = maybe_unserialize( maybe_unserialize( $this->product_custom_fields['product_attributes'][0] )); else $this->attributes = array();\t\t\n\t\t\t\t\t\t\n\t\t\n\t}", "public function generateOrderFromPayPal($payload) {\n $response = self::checkPayPalResponseForErrors($payload);\n\n $paypal_order_id = array_key_exists(\"id\", $response) ? $response->id : \"id\";\n $purchase_unit = $response->purchase_units[0];\n $order_reference = array_key_exists(\"reference_id\", $purchase_unit) ? $purchase_unit->reference_id : bin2hex(uniqid());\n\n $products_licenses = (object) array();\n // from separate product objects with the same product_code, each containing only 1 license, create one product object with all licenses\n foreach($purchase_unit->items as $item) {\n if (array_key_exists(\"sku\", $item)) {\n $items = explode(\";\", base64_decode($item->sku));\n if (count($items) == 2) {\n $product_code = $items[0];\n $license_key = $items[1];\n \n if (array_key_exists($product_code, $products_licenses)) {\n $licenses = array_merge($products_licenses->$product_code, array(array(\"key\" => $license_key)));\n } else {\n $licenses = array(array(\"key\" => $license_key));\n }\n $products_licenses->$product_code = $licenses;\n }\n }\n }\n // basic order data\n $order_data = (object) array();\n $order_data->id = $order_reference . \"_paypal_\" . $paypal_order_id;\n $order_data->created = array_key_exists(\"create_time\", $response) ? date(\"Y-m-j H:i:s\", strtotime($response->create_time)) : \"\";\n $order_data->append = true;\n\n // customer data\n if (array_key_exists(\"payer\", $response)) {\n $order_data->customer = (object) array();\n $order_data->customer->email = array_key_exists(\"email_address\", $response->payer) ? $response->payer->email_address : \"\";\n\n if (array_key_exists(\"name\", $response->payer)) {\n $order_data->customer->first_name = array_key_exists(\"given_name\", $response->payer->name) ? $response->payer->name->given_name : \"\";\n $order_data->customer->last_name = array_key_exists(\"surname\", $response->payer->name) ? $response->payer->name->surname : \"\";\n }\n }\n // order items\n $order_data->items = array();\n foreach($products_licenses as $key => $value) {\n array_push($order_data->items, array(\n \"product_code\" => $key,\n \"licenses\" => $value,\n ));\n }\n return json_encode($order_data);\n }", "public function build($prototype);", "function purchaseTicket($ar){\n\nif (isset($GLOBALS['RRTESTSTA'])){\n XLogs::critical(get_class($this), '::purchaseTicket RRTESTSTA');\n throw new Exception('Coucou');\n $ta = new StdClass();\n $ta->NPOSNO = 0;\n $ta->NJOURNALNO = sprintf('%05d', '1'.date('ms'));\n $ta->NSERIALNO = sprintf('%05d', '2'.date('ms'));\n $ta->NPROJECTNO = 444;\n return $ta;\n}\n\n $wtpsi = $this->getAWTPSI();\n $pt= $ar['tapt'];\n $pool = $ar['pool'];\n $tt = $ar['tatt'];\n $prj = $ar['projectno'];\n $firstname = $ar['firstname'];\n $lastname = $ar['lastname'];\n $dob = $ar['dob'];\n\n $pur = array();\n\n list($chipid, $crc, $accno) = explode('-', $ar['wtpno']);\n $pur[0]['NPERSONTYPENO'] = $pt;\n $pur[0]['NPOOLNO'] = $pool;\n $pur[0]['NTICKETTYPENO'] = $tt;\n $pur[0]['NPROJECTNO'] = $prj;\n $pur[0]['SZVALIDFROM'] = $ar['validfrom'];\n\n // jcp 28/12/11, preco support TA : ne transmettre que le CHIPID\n // $pur[1]['SZACCEPTANCENO'] = $accno;\n // $pur[1]['SZCHIPIDCRC'] = $crc;\n $pur[1]['SZCHIPID'] = $chipid;\n \n // person data\n $pur[2]['SZLASTNAME'] = $lastname;\n $pur[2]['SZFIRSTNAME'] = $firstname;\n $pur[2]['SZDATEOFBIRTH'] = $dob;\n $pur[2]['SZSEX'] = NULL;\n $pur[2]['SZTITLE'] = NULL;\n $pur[2]['SZSALUTATION'] = NULL;\n \n // pas d'adress data\n $pur[3] = NULL; // adress data\n \n // articles -> faire un purchaseProduct\n if (isset($ar['articlesData'])){\n $pur[4] = $ar['articlesData'];\n $soapfunc = 'doPurchaseProduct';\n } else {\n $soapfunc = 'doPurchaseTicket';\n }\n\n $cc = '';\n foreach($pur as $foo=>$block){\n $c = $foo . ' : ';\n if (isset($block)){\n foreach($block as $name=>$value){\n $c .= ' '.$name.'=>'.$value;\n }\n }\n $cc .= $c;\n XLogs::notice(get_class($this), get_class($this).\"::purchaseTicket $c\");\n }\n // purchaseProduct / purchaseTicket\n $r = $wtpsi->$soapfunc(array('purchasedata'=>$pur));\n\n return $r;\n }", "public function build(RequestInterface $request): ItemInterface\n {\n $menuItem = $this->getMenuItem($request);\n $store = $this->getStoreById($menuItem->getStoreId());\n\n $this->itemRegistry->set($menuItem);\n $this->storeRegistry->set($store);\n\n return $menuItem;\n }" ]
[ "0.567433", "0.567433", "0.5630675", "0.5624379", "0.5624379", "0.55156046", "0.5475541", "0.5378524", "0.53736424", "0.53120536", "0.5254839", "0.5251328", "0.5201675", "0.51764864", "0.51479137", "0.5127448", "0.51158357", "0.5112923", "0.5112923", "0.5112923", "0.5112923", "0.5112923", "0.5112923", "0.5112923", "0.51122165", "0.5099884", "0.5064306", "0.5064306", "0.50641406", "0.50594604", "0.50495017", "0.50161433", "0.50042886", "0.49964657", "0.4959579", "0.49428344", "0.49402386", "0.48840266", "0.48745868", "0.4857341", "0.48482388", "0.48471922", "0.4834515", "0.48133206", "0.48052198", "0.4796912", "0.4793728", "0.47783333", "0.47760636", "0.47667664", "0.47629476", "0.47558674", "0.47482473", "0.47421554", "0.4741163", "0.47371668", "0.4730816", "0.47284514", "0.47186413", "0.47172555", "0.4710858", "0.47060534", "0.46972886", "0.4691137", "0.46896923", "0.46807104", "0.46740934", "0.46720934", "0.46634528", "0.46582958", "0.46581084", "0.46573374", "0.4653935", "0.46448475", "0.46303704", "0.46145353", "0.46144447", "0.4611351", "0.46054363", "0.46040308", "0.46006477", "0.46004552", "0.45912728", "0.4586051", "0.45829517", "0.45775318", "0.45731208", "0.45699465", "0.45678014", "0.45581114", "0.45555678", "0.45534444", "0.45368552", "0.45321", "0.45279443", "0.45218685", "0.4521591", "0.45196187", "0.45190406", "0.45187724" ]
0.6952602
0
Converts ISBN10 to ISBN13 string. Taken from
private function isbn10to13($isbn10){ $isbnclean = preg_replace("/([^d])/", "",substr($isbn10,0,-1)); if (strlen($isbnclean) != 9) { return $isbn10; } $isbn="978".$isbnclean; $check=0; for ($i=0;$i<12;$i++) { $check+=(($i%2)*2+1)*$isbn[$i]; } $check=(10-($check%10))%10; return "978".substr($isbn10,0,-1).$check; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function convert10to13($isbn10)\n {\n $isbn13 = '978' . substr($isbn10, 0, 9);\n $sum = 0;\n for ($i = 0; $i < 12; $i ++) {\n if ($i % 2 == 0) {\n $sum += $isbn13{$i};\n } else {\n $sum += 3 * $isbn13{$i};\n }\n }\n $checksum = 10 - ($sum % 10);\n if ($checksum == 10) {\n $checksum = '0';\n }\n $isbn13 = $isbn13 . $checksum;\n\n $this->_isbn13 = $isbn13;\n return $this->_isbn13;\n }", "public function isbn13(): string\n {\n $code = '97' . mt_rand(8, 9) . Helper::numerify(str_repeat('#', 9));\n\n return sprintf('%s%s', $code, Ean::checksum($code));\n }", "public function isbn10(): string\n {\n $code = Helper::numerify(str_repeat('#', 9));\n\n return sprintf('%s%s', $code, Isbn::checksum($code));\n }", "public function getIsbn13()\n {\n return $this->isbn13;\n }", "function isbn13checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 12){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 13){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 1;\n\t\tfor ($i = 0; $i < 13 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t$multiplier = $multiplier == 3 ? 1 : 3;\n\t\t}\n\t\t$div = $runningTotal / 10;\n\t\t$remainder = $runningTotal % 10;\n\n\t\t$checksum = $remainder == 0 ? 0 : 10 - substr($div, -1);\n\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn13'] = substr($input, 0, 12) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn10'] = isbn13to10($output['isbn13']);\n\t\t}\n\t\tif (is_numeric($inputChecksum) && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "public function getIsbn10()\n {\n return $this->isbn10;\n }", "public function getIsbn13()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('identifiers', $this->data) || !array_key_exists('isbn_13', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['isbn_13'][0];\n\t\t}", "function isbn10checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 9){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 10){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 10;\n\t\tfor ($i = 0; $i < 10 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t//echo $value . 'x' . $multiplier . ' + ';\n\t\t\t$multiplier --;\n\t\t\tif ($multiplier === 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//echo ' = ' . $runningTotal;\n\t\t$remainder = $runningTotal % 11;\n\t\t$checksum = $remainder == 1 ? 'X' : 11 - $remainder;\n\t\t$checksum = $checksum == 11 ? 0 : $checksum;\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn10'] = substr($input, 0, 9) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn13'] = isbn10to13($output['isbn10']);\n\t\t}\n\t\tif ((is_numeric($inputChecksum) || $inputChecksum == 'X') && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "function isbn13Selector($isbn_id)\r\n\t{\r\n\t\tforeach($isbn_id as $iid) \r\n\t\t{\r\n\t\t\tif($iid->type=='ISBN_13')\r\n\t\t\t{\r\n\t\t\t\treturn $iid->identifier;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getIsbn10()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('identifiers', $this->data) || !array_key_exists('isbn_10', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['isbn_10'][0];\n\t\t}", "public function getIsbn13(): string|null;", "public function getIdentifiersISBN() {\n $fields = array('identifiersISBN' => array(\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "public function getIsbnNumber()\n {\n return $this->isbnNumber;\n }", "public function getByISBN(string $isbn): string\n {\n $subscription = $this->subscription;\n $this->subscription = null;\n $response = $this->apiClient->get(self::PATH . '/' . $isbn);\n $this->subscription = $subscription;\n \n return (string) $response->getBody();\n }", "public function getIsbn()\n {\n return $this->isbn;\n }", "public function getIsbn()\n {\n return $this->isbn;\n }", "public function getIsbn()\n {\n return $this->isbn;\n }", "static final public function modifyISBN($ISBN) {\n\t\t$url= @file_get_contents('http://toolserver.org/gradzeichen/IsbnTextFormat?Bot-Modus&Text='.$ISBN);\n\t\t$temp = explode(' ',$url);\n\t\tif ($temp[0])\n\t\t{\n\t\t\treturn $temp[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $ISBN;\n\t\t}\n\t}", "public function loadISBN(){\n $sqlQuery = 'SELECT I.val FROM identifiers I , books B WHERE I.type=\"ISBN\" AND B.id = I.book AND B.id='.$this->id;\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['val'];\n return \"\";\n }", "public function getDefaultIsbn13(): string|null;", "public function getISBN(): ?string\n {\n return isset($this->ISBN) ? $this->ISBN : null;\n }", "protected function _validateIsbn($isbnArray){\n \t\n \t$j = 0;\n \t$mess1 = ' is valid!';\n \t$mess2 = ' is not valid or not ISBN!';\n \tforeach ($isbnArray as $isbn){\n \t\t//13 digits isbsn\n \t\tif (strlen($isbn) == 13){\n \t\t\t$sum = 0;\n \t\t\t$res = 0;\n \t\t\tfor ($i = 0; $i < 12; $i++){\n \t\t\t\tif ($i%2 == 0){\n \t\t\t\t\t$sum += $isbn[$i]*1;\n \t\t\t\t} else {\n \t\t\t\t\t$sum += $isbn[$i]*3;\n \t\t\t\t}\n \t\t\t$res = (10 - $sum%10)%10;\n \t\t\t}\n \t\t\tif ($res == $isbn[12]){\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess1;\n \t\t\t\t$j++;\n \t\t\t} else {\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess2;\n \t\t\t\t$j++;\n \t\t\t\t}\n \t\t}\n \t\t// 10 digits isbns\n \t\tif (strlen($isbn) == 10){\n \t\t $sum = 0;\n \t\t $res = 0;\n \t\t\tfor ($k = 0; $k < 9; $k++){\n \t\t\t\t$sum += $isbn[$k]*($k+1);\n \t\t\t}\n \t\t$res = $sum%11;\n \t\tif ((($res < 10)&&($res == $isbn[9])) ||\n \t\t\t(($res == 10) &&($isbn[9]=='X')))\n \t\t\t{\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess1;\n \t\t\t\t$j++;\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess2;\n \t\t\t\t$j++;\n \t\t\t}\n \t\t}\n \t}\n }", "public function getInvoiceNumber(): string\n {\n return sprintf('R-%1$02d%2$03d', $this->getInvoiceYear(), $this->id);\n }", "public function setIsbn10($isbn10)\n {\n $this->isbn10 = $isbn10;\n\n return $this;\n }", "public function asString(): string\n {\n if (is_null($this->iban)) {\n $part1 = ord('C') - ord('A') + 10;\n $part2 = ord('Z') - ord('A') + 10;\n\n $accountPrefix = 0;\n $accountNumber = $this->accountNumber;\n if (strpos($accountNumber, '-') !== false) {\n $accountParts = explode('-', $accountNumber);\n $accountPrefix = $accountParts[0];\n $accountNumber = $accountParts[1];\n }\n\n $numeric = sprintf('%04d%06d%010d%d%d00', $this->bankCode, $accountPrefix, $accountNumber, $part1, $part2);\n\n $mod = '';\n foreach (str_split($numeric) as $n) {\n $mod = ($mod . $n) % 97;\n }\n $mod = intval($mod);\n\n $this->iban = sprintf('%.2s%02d%04d%06d%010d', 'CZ', 98 - $mod, $this->bankCode, $accountPrefix, $accountNumber);\n }\n\n return $this->iban;\n }", "public function setIsbn13($isbn13)\n {\n $this->isbn13 = $isbn13;\n\n return $this;\n }", "public function getTitle(){\n\t\treturn $this->ol[\"ISBN:\".$this->isbn][\"title\"];\t\n\t}", "public function getIsbn_issn()\n {\n return $this->isbn_issn;\n }", "private function sanitiseISBN($isbn) {\n\t\tpreg_match('/[^\\s]+/', trim($isbn), $match);\n\t\treturn (isset($match[0])) ? $match[0] : null;\n\t}", "function setISBN($book_isbn){\t\n\t\t$result = file_get_contents('http://openlibrary.org/api/books?bibkeys=ISBN:'.$book_isbn.'&format=json&jscmd=data');\n\t\t$this->ol = json_decode($result, TRUE);\t\t\t\n\t\t$this->isbn = $book_isbn;\n\t\t\n\t}", "protected function buildRomanNumber()\n {\n $result = '';\n $number = $this->value;\n\n foreach ($this->romanSymbols as $value => $symbol) {\n while ($number >= $value) {\n $result .= $symbol;\n $number -= $value;\n }\n }\n\n return $result;\n }", "public function create_invoice_number()\n\t{\n\t\t//select product code\n\t\t$this->db->from('invoice');\n\t\t$this->db->where(\"invoice_number LIKE 'IOD-INV-\".date('y').\"-%'\");\n\t\t$this->db->select('MAX(invoice_number) AS number');\n\t\t$query = $this->db->get();\n\t\t$preffix = \"IODk/\";\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result();\n\t\t\t$number = $result[0]->number;\n\t\t\t$real_number = str_replace($preffix, \"\", $number);\n\t\t\t$real_number++;//go to the next number\n\t\t\t$number = $preffix.sprintf('%04d', $real_number);\n\t\t}\n\t\telse{//start generating receipt numbers\n\t\t\t$number = $preffix.sprintf('%04d', 1);\n\t\t}\n\t\t\n\t\treturn $number.'/'.date('Y');\n\t}", "public function getBook($isbn);", "function boj_sc3_amazon( $attr, $content ) {\n \n // Get ISBN or set default\n if( isset( $attr['isbn'] ) ) {\n $isbn = preg_replace( '/[^\\d]/', '', $attr['isbn'] );\n } else {\n $isbn = '0470560541';\n }\n \n // Sanitize content, or set default\n if( !empty( $content ) ) {\n $content = esc_html( $content );\n } else {\n if( $isbn == '0470560541' ) {\n $content = 'Professional WordPress';\n } else {\n $content = 'this book';\n }\n }\n \n return \"<a href='http://www.amazon.com/dp/$isbn'>$content</a>\";\n}", "public function toBibTeX() // {{{\n {\n $out = \"\";\n $tab_pad = 15;\n foreach ($this->m_entries as $bibtex_name => $data)\n {\n $out .= \"@\".$data[\"bibtex_type\"].\"{\".$bibtex_name.\",\\n\";\n foreach ($data[\"raw\"] as $k => $v)\n {\n if ($k === \"bibtex_type\")\n continue; // We already processed it\n $out .= \" \".$k.str_repeat(\" \", $tab_pad - mb_strlen($k)).\"= {\";\n $out .= str_replace(\"\\n\", \"\\n\".str_repeat(\" \", $tab_pad + 5), wordwrap($v, 55, \"\\n\"));\n $out .= \"},\\n\";\n }\n $out = mb_substr($out, 0, mb_strlen($out) - 2); // Remove last comma\n $out .= \"\\n}\\n\\n\";\n }\n return $out;\n }", "function booklinkp($author,$isbn,$title=\"\",$pubyear=\"\",$adddate=\"\",$float=\"left\",$type=\"t\",$size=\"s\",$top=\"0\",$bordersize=\"0\",$bordercolor=\"000000\")\n {\n $type=strtolower($type);\n if ($float==\"l\") $float=\"left\";\n if ($float==\"r\") $float=\"right\";\n if (($float==\"left\")) $marg=\"right\"; else $marg=\"left\";\n\t$title=stripcslashes($title);\n\t$title=strtolower($title);\n\t$title=nomorexs($title);\n\t$author=nomorexs($author);\n\t$title=ucwords($title);\t\n\t$temptitle =explode(\":\",$title);\n\t$author=stripcslashes($author);\n $titleplus= str_replace(' ','+',$temptitle[0]);\n\t$titleplus= str_replace('&+','',$titleplus);\n $authorplus= str_replace(' ','+',$author);\n\t$authorplus= str_replace('&+','',$authorplus);\n if ($type==\"t\") { $type=\"TI%5ETITLE\"; $keywordsplus= $titleplus; }\n elseif ($type==\"a\") { $type=\"AU%5EAUTHOR\"; $keywordsplus= $authorplus; }\n elseif ($type==\"i\") { $type=\"ISBN\"; $keywordsplus= $isbn;}\n\t\n\t\t\t\t$adyear= (int) substr($adddate,2,2);\n\t\t\t\t$admonth= (int) substr($adddate,4,2);\n\t\t\t\t$adday= (int) substr($adddate,6,2);\n\t\t\t\t$adddate = $admonth.\"/\".$adday.\"/\".$adyear;\n $datedata =\" &copy; \".$pubyear.\" (Added: \".$adddate.\")\";\n // \"&amp;pubyear=\".$pubyear.\n\techo \"<a href=\\\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\".\n\t$keywordsplus.\"%22&amp;srchfield1=\".$type.\"&amp;searchoper1=AND&amp;searchdata2=%22\"\n\t.$authorplus.\"%22&amp;srchfield2=AU%5EAUTHOR\\\">\";\n\t$filename=\"images/isbn/\".$isbn.\"S.GIF\";\n\tif (file_exists($filename)) { echo \"<img src=\\\"/\".$filename.\"\\\"\";}\n\telse echo \"<img src=\\\"http://syndetics.com/index.aspx?isbn=\".$isbn.\"/\".$size.\"C.GIF\\\"\";\n\techo \" style=\\\"border:\".$bordersize.\"px solid #\".$bordercolor.\"; float:\".$float.\"; \".$yodaexception.\" margin-\".$marg.\":3px;\";\n\tif ($top!=\"0\") echo \" margin-top:\".$top.\"px;\";\n\tif ($title==\"\") {echo \"\\\" alt=\\\"\".$author.\"\\\" title=\\\"\".$author.\"\\\"></a>\";}\n\telse {echo \"\\\" alt=\\\"\".$title.\" by \".$author.$datedata.\"\\\" title=\\\"\".$title.\" by \".$author.$datedata.\"\\\"></a>\";}\n}", "public static function int2str(int $i): string\n {\n return base_convert(dechex($i), 16, 36);\n }", "function NumeroInscripcion($primerdigito,$id)\n {\n $numero = $primerdigito.str_pad($id, 4, '0', STR_PAD_LEFT);\n $letra = '';\n $suma = 0;\n for ($i = 0; $i < 5; $i++) {\n $suma += substr($numero, $i, 1) * ($i + 1);\n }\n $letra = chr($suma % 11 + 65);\n $codigo = $numero.$letra;\n\n return $codigo;\n }", "public function __toString() {\n return theme('commerce_invoice_number', ['invoice_number' => $this, 'sanitize' => FALSE]);\n }", "public function getNumberVoucher(){\n return str_replace('R','G',$this->number);\n }", "function format_item($item) //returns an item result with the proper formatting\n{\n\t$format_arr = array('Necessity', 'Title', 'Edition', 'Authors', 'Publisher');\n\t\n\tforeach ($format_arr as $name)\n\t{\n\t\tif (isset($item[$name]) && $item[$name])\n\t\t{\n\t\t\t$item[$name] = ucwords(strtolower(trim($item[$name], \" \\t\\n\\r\\0\\x0B\\xA0\")));\n\t\t}\n\t}\n\tif (isset($item['Year']) && $item['Year'])\n\t{\n\t\t$item['Year'] = date('Y', strtotime(trim($item['Year'])));\n\t}\n\tif (isset($item['ISBN']) && $item['ISBN'])\n\t{\n\t\t$item['ISBN'] = get_ISBN13(str_replace('&nbsp;', '', trim($item['ISBN'])));\n\t}\n\tif (isset($item['Bookstore_Price']) && $item['Bookstore_Price'])\n\t{\n\t\t$item['Bookstore_Price'] = priceFormat($item['Bookstore_Price']);\n\t}\n\t\n\tif (isset($item['New_Price']) && $item['New_Price'])\n\t{\n\t\t$item['New_Price'] = priceFormat($item['New_Price']);\n\t}\n\tif (isset($item['Used_Price']) && $item['Used_Price'])\n\t{\n\t\t$item['Used_Price'] = priceFormat($item['Used_Price']);\n\t}\n\tif (isset($item['New_Rental_Price']) && $item['New_Rental_Price'])\n\t{\n\t\t$item['New_Rental_Price'] = priceFormat($item['New_Rental_Price']);\n\t}\n\tif (isset($item['Used_Rental_Price']) && $item['Used_Rental_Price'])\n\t{\n\t\t$item['Used_Rental_Price'] = priceFormat($item['Used_Rental_Price']);\n\t}\n\n\treturn $item;\n}", "function convertToIndianCurrency($number) {\n $no = round($number);\n $decimal = round($number - ($no = floor($number)), 2) * 100; \n $digits_length = strlen($no); \n $i = 0;\n $str = array();\n $words = array(\n 0 => '',\n 1 => 'One',\n 2 => 'Two',\n 3 => 'Three',\n 4 => 'Four',\n 5 => 'Five',\n 6 => 'Six',\n 7 => 'Seven',\n 8 => 'Eight',\n 9 => 'Nine',\n 10 => 'Ten',\n 11 => 'Eleven',\n 12 => 'Twelve',\n 13 => 'Thirteen',\n 14 => 'Fourteen',\n 15 => 'Fifteen',\n 16 => 'Sixteen',\n 17 => 'Seventeen',\n 18 => 'Eighteen',\n 19 => 'Nineteen',\n 20 => 'Twenty',\n 30 => 'Thirty',\n 40 => 'Forty',\n 50 => 'Fifty',\n 60 => 'Sixty',\n 70 => 'Seventy',\n 80 => 'Eighty',\n 90 => 'Ninety');\n $digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');\n while ($i < $digits_length) {\n $divider = ($i == 2) ? 10 : 100;\n $number = floor($no % $divider);\n $no = floor($no / $divider);\n $i += $divider == 10 ? 1 : 2;\n if ($number) {\n $plural = (($counter = count($str)) && $number > 9) ? 's' : null; \n $str [] = ($number < 21) ? $words[$number] . ' ' . $digits[$counter] . $plural : $words[floor($number / 10) * 10] . ' ' . $words[$number % 10] . ' ' . $digits[$counter] . $plural;\n } else {\n $str [] = null;\n } \n }\n \n $Rupees = implode(' ', array_reverse($str));\n $paise = ($decimal) ? \"And Paise \" . ($words[$decimal - $decimal%10]) .\" \" .($words[$decimal%10]) : '';\n return ($Rupees ? 'Rupees ' . $Rupees : '') . $paise . \" Only\";\n }", "function _generate_nip($nip){\n\t\t$pnjNip = strlen($nip);\n\t\tif($pnjNip == 18){\n\t\t\t$tgl_lahir = substr($nip, 0,8);\n\t\t\t$bln_masuk = substr($nip, 8,6);\n\t\t\t$jk = substr($nip, 14,1);\n\t\t\t$no = substr($nip, 15,3);\n\t\t\treturn $tgl_lahir.' '.$bln_masuk.' '.$jk.' '.$no;\n\t\t}else{\n\t\t\treturn $nip;\n\t\t}\n\t}", "function MakeDIN5008()\n {\n $this->PhoneDurchwahl = preg_replace(\"/-+/\", '-', $this->PhoneDurchwahl);\n $this->Teilnehmerkennzahl = trim(eregi_replace(\"[^0-9]\", null, $this->Teilnehmerkennzahl));\n if ($this->Landesvorwahl) $this->Landesvorwahl = \"+\".trim(eregi_replace(\"[^0-9]\", null, $this->Landesvorwahl));\n return trim($this->Landesvorwahl.\" \".\n abs(trim(eregi_replace(\"\\(0)\", \"\", $this->Ortsnetzkennzahl))).\" \".\n $this->Teilnehmerkennzahl.\n $this->PhoneDurchwahl);\n }", "function ent2ncr($text)\n {\n }", "function newBookNumbers($aBooksLeft, $sBookNumberFile)\r\n{\r\n\t$newbookline = '';\r\n\tif (count($aBooksLeft) > 0) {\r\n\t\tforeach ($aBooksLeft as $itemnumber) {\r\n\t\t\t$newbookline .= $itemnumber . ',';\r\n\t\t}\r\n\t}\r\n\r\n\t$fh = fopen($sBookNumberFile, 'w');\r\n\tfwrite($fh, $newbookline);\r\n\tfclose($fh);\r\n\r\n\treturn 1;\r\n}", "function constructBookLink($id, $label) {\n $link = '<a href=\"single-book.php?ISBN10=' . $id . '\">';\n $link .=$label;\n $link .='</a>';\n return $link;\n}", "private function formatOrderNumber($year, $prefix, $number, $length, $charFormat){\n return $year . $prefix . str_pad($number, $length, $charFormat, STR_PAD_LEFT);\n }", "function arreglar_numero($numero)\n\t\t{\n\t\t\t// \t$numero = str_replace(\".\", \"\",$numero);\n\t\t\t$inicio_coma = strpos($numero, '.');\n\t\t\t//var_dump($inicio_coma);die();\n\t\t\t// if ( is_float($numero) && ($inicio_coma != false))\n\t\t\t// \t$numero .= \"00\";\n\t\t\t// else $numero .= \",00\";\n\t\t\tif( is_numeric( $inicio_coma) && ($inicio_coma >= 1) && ($inicio_coma < strlen($numero) ) )\n\t\t\t\t$numero = substr($numero, 0, ($inicio_coma+3)); \n\t\t\t//return str_replace(\".\", \",\",$numero);\n\t\t\treturn $numero;\n\t\t}", "private function findISBNwithBTRN($btrn){\n\t\t$db = $this->db;\n\n\t\t$query = \"SELECT isbn13, isbn10 FROM newstech_book WHERE bowker_title_record_number='$btrn'\";\n\t\t$successful = $result = $db->query($query);\t\t\n\t\tif (!$successful){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No ISBNs found for BTRN: %s, DB: %s\", __LINE__, $btrn, $db->error));\t\n\t\t}\n\t\treturn $result;\t//\treturn the tuples of isbn13s and isbn10s (some of these values -- for one or the other -- will be null)\n\t}", "private function findBTRN(){\n\t\t$db = $this->db;\n\t\t$isbn = $this->isbn;\n\n\t\t$btrnQuery = \"SELECT bowker_title_record_number as btrn FROM newstech_book WHERE isbn10='$isbn' OR isbn13='$isbn' \";\n \t$queryResult = $db->query($btrnQuery);\n\n if ($queryResult->num_rows == 0){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No BTRN found for isbn: %s\", __LINE__, $isbn));\n }\n\n\t\t$firstRow = $queryResult->fetch_assoc();\n $btrn = $firstRow['btrn'];\n\t\t\n\t\treturn $btrn;\n\t}", "function booklink($term,$type,$custom=\"\"){\n$texturl=\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\";\n$esc_term=str_replace(\" \", \"+\", $term);\n$esc_term= str_replace('&+','',$esc_term);\n$texturl.=$esc_term.\"%22&amp;srchfield1=\";\nif($type==\"t\") $texturl.=\"TI%5ETITLE\";\nif($type==\"texact\") $texturl.=\"TI%5ETITLE&amp;match_on=EXACT\";\nif($type==\"a\") $texturl.=\"AU%5EAUTHOR\";\nif($type==\"i\") $texturl.=\"ISBN\";\nif($type==\"s\") $texturl.=\"GENERAL%5ESUBJECT\";\nif($custom==\"\")$custom=$term;\nif(($type==\"t\")||($type==\"texact\")) $custom=\"<i>\".$custom.\"</i>\";\necho \"<a href=\\\"\".$texturl.\"\\\">\".$custom.\"</a>\";\n\n}", "public function e_book()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)(.+?.+)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\tif (preg_match('/^\\(Nora Roberts\\)\"(.+?)\\.(epub|mobi|html|pdf|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Doctor Who - Target Books [128/175] - \"DW125_ Terror of the Vervoids - Pip Baker.mobi\" yEnc\n\t\tif (preg_match('/^Doctor Who - Target Books \\[\\d+\\/(\\d+\\]) - \"DW[0-9]{0,3}[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(American Curves - Summer 2012) [01/10] - \"AMECURSUM12.par2\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9 -]+)\\) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(NordicAlbino) [01/10] - \"SWHQ_NA_675qe0033102suSmzSE.sfv\" yEnc\n\t\t//365 Sex Positions A New Way Every Day for a Steamy Erotic Year [eBook] - (1/5) \"365.Sex.Positions.A.New.Way.Every.Day.for.a.Steamy.Erotic.Year.eBook.nfo\" - yenc yEnc\n\t\tif (preg_match('/(.+)[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/8] - \"Robin Lane Fox - Travelling heroes.epub\" yEnc\n\t\t//(1/1) \"Unintended Consequences - John Ross.nzb\" - 8.67 kB - yEnc\n\t\tif (preg_match('/^[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ Mega Dating and Sex Advice Ebooks - Tips and Tricks for Men PDF ] - \"Vatsyayana - The Kama Sutra.pdf.rar\" - (54/58) yEnc\n\t\tif (preg_match('/^[\\(\\[] .+? [\\)\\][-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //WWII in Photos - \"WWII in Photos_05_Conflict Spreads Around the Globe - The Atlantic.epub\" yEnc\n\t\tif (preg_match('/^(WWII in Photos)[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Various ebooks on History pdf format \"Chelsea House Publishing Discovering U.S. History Vol. 8, World War I and the Roaring Twenties - 1914-1928 (2010).pdf\" [1 of 1] yEnc\n\t\tif (preg_match('/^.+?\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}\\[\\d+ of (\\d+\\])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //A few things - [4 of 13] \"Man From U.N.C.L.E. 08 - The Monster Wheel Affair - David McDaniel.epub\" yEnc\n\t\tif (preg_match('/.+[\\(\\[]\\d+ of \\d+[\\)\\]] \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //DDR Kochbuch 1968-wir kochen gut [1/1] - \"DDR Kochbuch 1968-wir kochen gut.pdf\" toby042002\n\t\tif (preg_match('/.+[\\(\\[]\\d+\\/\\d+[\\)\\]] - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") toby\\d+$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Pottermore UK retail - \"Harry Potter and the Goblet of Fire - J.K. Rowling.epub\" (05/14) - 907.57 kB - yEnc\n\t\tif (preg_match('/^.+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") [\\(\\[]\\d+\\/\\d+[\\)\\]] ([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_\\s]{0,3}\\d+\\/(\\d+[-_\\s]{0,3}\".+?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //04/63 Brave New World Revisited - Aldous Huxley.mobi yEnc\n\t\tif (preg_match('/\\d+\\/\\d+[-_\\s]{0,3}(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- Campbell, F.E. - Susan - HIT 125.rar BDSM Themed Adult Erotica - M/F F/F - Rtf & Pdf\n\t\tif (preg_match('/^- (.+?)\\.(par|vol|rar|nfo)[-_\\s]{0,3}(.+)/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 03 - Colossus and The Crab.epub\" (1/3)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw)\" \\(\\d+\\/(\\d+\\))/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 01 - Colossus.epub\" (note the space on the end)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\" $/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[01/19] - \"13_X_Panzer_Tracts_EBook.nfo \" yEnc\n\t\tif (preg_match('/^\\[\\d*+\\/(\\d+\\]) - \"(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4} \"|\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[09/14] Sven Hassel - Legion of the Damned 09, Reign of Hell.mobi sven hassel as requested (1/7) yEnc\n\t\t//[1/1] Alex Berenson - John Wells 05, The Secret Soldier.mobi (space at end)\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) (.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par).+?(yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/1] - \"Die Kunst der Fotografie Lehrbuch und Bildband f r ambitionierte Fotografen.rar\"\n\t\t//[1/1] - \"Demonic_ How the Liberal Mob Is Endanger - Coulter, Ann.mobi\" (note space at end)\n\t\t//[1/1] - \"Paris in Love_ A Memoir - Eloisa James.mobi\" 1861K\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) - \"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\"( \\d+K)?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //002/240 Swordships.of.Scorpio.(Dray.Prescot).-.Alan.Burt.Akers.epub\n\t\tif (preg_match('/^\\d+\\/(\\d+)[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Akers Alan Burt - Dray Prescot Saga 14 - Krozair von Kregen.rar yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9. ].+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\"|) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function get_string_number($num) {\n // TODO: Add simple hashing [check array, add if not already there]\n $this->load_tables();\n $meta = $this->ORIGINALS[$num];\n $length = $meta[0];\n $offset = $meta[1];\n $this->STREAM->seekto($offset);\n $data = $this->STREAM->read($length);\n return (string)$data;\n }", "function calculateRomanNumerals ($n) {\n $romanNumerals = '';\n\n if ($n > 1000) {\n $numberOfLetters = $n / 1000;\n\t\t$romanNumerals .= str_repeat('M', $numberOfLetters); \n\t\t$n = $n % 1000;\n\t}\n\t\n if ($n > 500) {\n $numberOfLetters = $n / 500;\n\t\t$romanNumerals .= str_repeat('D', $numberOfLetters); \n\t\t$n = $n % 500;\n\t}\n\n if ($n > 100) {\n $numberOfLetters = $n / 100;\n\t\t$romanNumerals .= str_repeat('C', $numberOfLetters); \n\t\t$n = $n % 100;\n\t}\t\n\n if ($n > 50) {\n $numberOfLetters = $n / 50;\n\t\t$romanNumerals .= str_repeat('L', $numberOfLetters); \n\t\t$n = $n % 50;\n\t}\t\n\n if ($n > 10) {\n $numberOfLetters = $n / 10;\n\t\t$romanNumerals .= str_repeat('X', $numberOfLetters); \n\t\t$n = $n % 10;\n\t}\t\n\t\n\tif ($n > 5) {\n $numberOfLetters = $n / 5;\n\t\t$romanNumerals .= str_repeat('V', $numberOfLetters); \n\t\t$n = $n % 5;\n\t}\t\n\t\n\tif ($n > 0) {\n $numberOfLetters = $n / 1;\n\t\t$romanNumerals .= str_repeat('I', $numberOfLetters); \n\t}\t\n \n \n\techo $romanNumerals;\n return $romanNumerals;\n\n}", "public function getEx13() {\n # Approach # 1\n # Get all the books that match the criteria\n $books = \\App\\Book::where('author','=','Bell Hooks')->get();\n # Loop through each book and update them\n foreach($books as $book) {\n $book->author = 'bell hooks';\n $book->save();\n }\n # Resulting SQL:\n # Always:\n # 1) select * from `books` where `author` = 'Bell Hooks'\n # Only if there's something to update:\n # 2) update `books` set `updated_at` = '2016-04-12 18:46:04', `author` = 'bell hooks' where `id` = '8'\n # Approach #2\n \\App\\Book::where('author', '=', 'Bell Hooks')->update(['author' => 'bell hooks']);\n # Resulting SQL:\n # Always:\n # 1) update `books` set `author` = 'bell hooks', `updated_at` = '2016-04-12 18:44:46' where `author` = 'Bell Hooks'\n return '\"Bell Hooks\" => \"bell hooks\"';\n\t}", "protected function getItoa64() {}", "protected function getItoa64() {}", "function nSmToBinIp($sn) {\n\n $snb = \"\";\n\n for($i=1;$i<=32;$i++) {\n\n if($i<=$sn) {\n $snb.=\"1\";\n }\n else {\n $snb.=\"0\";\n }\n\n if($i%8==0 && $i<32){\n $snb.=\".\";\n }\n }\n\n return $snb;\n}", "function nb2chiffres($nb){\n\treturn sprintf(\"%02d\", $nb);\n}", "public function hasIsbn13(): bool;", "public function setIsbn($isbn)\n {\n $this->isbn = $isbn;\n\n }", "protected function _getBookDOI()\n {\n return $this->mBook['doi'];\n }", "function encode_base_n($num,$n) {\n $table='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $table = substr($table,0,$n);\n $ret=\"\";\n while ($num) {\n $ret = $table[$num - $n*floor($num/$n)] . $ret; // fix $num % $n\n $num = floor($num/$n);\n }\n return $ret;\n }", "function encode($s,$key) {\r\n\r\n\t$o = \"\";\r\n\r\n\tfor ($i=0;$i<strlen($s);$i++) {\r\n\r\n\t\t$char = substr($s, $i, 1);\r\n\t\t$pos = alphabet_position($char);\r\n\r\n\t\tif ($pos !== false) {\r\n\t\t\t$key_char = substr($key, $i, 1);\r\n\t\t\t$char_pos = (alphabet_position($key_char) + $pos) % 52;\r\n\t\t\t$char = char_at_position($char_pos);\r\n\t\t}\r\n\r\n\t\t$o .= $char;\r\n\t}\r\n\treturn $o;\r\n}", "private function _toNumericString($iban)\n {\n assert(is_string($iban), 'Invalid argument $iban: string expected');\n\n $string = strtoupper(substr($iban, 4) . substr($iban, 0, 4));\n $number = \"\";\n\n // The string is treated as an array on purpose. This is NOT an accident. Unicode is NOT an issue here.\n for ($i = 0; $i < strlen($string); $i++)\n {\n $number .= is_numeric($string[$i]) ? (string) $string[$i] : (string) (ord($string[$i]) - 55);\n }\n unset($i, $string);\n\n return $number;\n }", "function getISBN($conn,$title) {\n $real_title = mysqli_real_escape_string($conn, $title);\n $ISBN = \"SELECT ISBN FROM audio_book WHERE title = '$real_title'\";\n $result = mysqli_query($conn, $ISBN);\n if(mysqli_num_rows($result) > 0) {\n return $result;\n } else {\n echo 'Nothing ISBN<br>';\n exit;\n }\n }", "function my_convert($int, $wishedlen = 9) {\n $map = array(\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23\n 'Y', 'Z');\n $map2 = array_merge(array(\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'), $map);\n //base_convert uses int chars as well, So the mapping set is 0-9 + a-q, so 15 maps to f and not to p. We correct for\n //that so that we do not have integers in the resulting code\n $start = str_split(strtoupper(base_convert($int, 10, 26)));\n $string = '';\n foreach ($start as $c) {\n $pos = array_search($c, $map2);\n $string .= $map2[$pos + 10];\n }\n\n $len = count($start);\n if ($len < $wishedlen) {\n $pad = $wishedlen - $len - 1; //Leave one position as pad number indicator\n if ($pad > 0) {\n for ($i = 1; $i <= $pad; $i++) {\n $string = $map[rand(0, 25)] . $string;\n }\n }\n $string = $map[max($pad, 0)] . \"$string\";\n } elseif ($len == $wishedlen) {\n $string = \"A$string\";\n }\n\n return $string;\n}", "function benc_int($i) {\n\treturn \"i\" . $i . \"e\";\n}", "public static function taxpayerIdentificationNumber()\n {\n $firstEightDigits = static::numerify(static::randomElement(static::$firstEightDigitsFormat));\n $lastDigit = static::dvCalcMod11($firstEightDigits);\n\n return $firstEightDigits.$lastDigit;\n }", "function make_bangla_number($str)\n{\n$engNumber = array(1,2,3,4,5,6,7,8,9,0);\n$bangNumber = array('১','২','৩','৪','৫','৬','৭','৮','৯','০');\n$engMonth = array(\"January\",\"February\",\"March\",\"April\",\"May\",\"Jun\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\");\n$bangMonth = array(\"জানুয়ারি\",\"ফেব্রুয়ারি\",\"মার্চ\",\"এপ্রিল\",\"মে\",\"জুন\",\"জুলাই\",\"আগস্ট\",\"সেপ্টেম্বর\",\"অক্টোবর\",\"নভেম্বর\",\"ডিসেম্বর\");\n$converted = str_replace($engNumber, $bangNumber, $str);\n$converted = str_replace($engMonth, $bangMonth, $converted);\n\nreturn $converted;\n}", "function int2vancode($i = 0) {\n\t\t$num = base_convert((int) $i, 10, 36);\n\t\t$length = strlen($num);\n\n\t\treturn chr($length + ord('0') - 1) . $num;\n\t}", "function buildCustNo($db_link){\n\t\t// Determine biggest customer ID\n\t\t$sql_maxID = \"SELECT MAX(cust_id) AS maxid FROM customer\";\n\t\t$query_maxID = mysqli_query($db_link, $sql_maxID);\n\t\tcheckSQL($db_link, $query_maxID);\n\t\t$result_maxID = mysqli_fetch_array($query_maxID);\n\n\t\t// Read customer number format\n\t\t$cnParts = explode(\"%\", $_SESSION['set_cno']);\n\t\t$cnCount = count($cnParts);\n\n\t\t// Build customer number\n\t\t$i = 0;\n\t\t$custNo = \"\";\n\t\tfor ($i = 1; $i < $cnCount; $i++) {\n\t\t\tswitch($cnParts[$i]){\n\t\t\t\tcase \"N\":\n\t\t\t\t\t$custNo = $custNo.($result_maxID['maxid'] + 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Y\":\n\t\t\t\t\t$custNo = $custNo.date(\"Y\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"M\":\n\t\t\t\t\t$custNo = $custNo.date(\"m\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"D\":\n\t\t\t\t\t$custNo = $custNo.date(\"d\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$custNo = $custNo.$cnParts[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Return customer number\n\t\treturn $custNo;\n\t}", "function generate_receipt_no()\n {\n return m_setting('evaluation.receipt_prefix') . date('dmyHis');\n }", "function code2utf($num){\n\tif($num<128)return chr($num);\n\tif($num<2048)return chr(($num>>6)+192).chr(($num&63)+128);\n\tif($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);\n\tif($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128);\n\treturn '';\n}", "public function convert($num)\n {\n if(strlen($num)>48) \n {\n $this->error=\"Number out of bounds\";\n return $this->error;\n }\n \n //check if first \n if(substr($num,0,1)==\"-\")\n {\n $this->sentence.='minus ';\n $num=substr($num,1,strlen($num)-1);\n }\n \n if(strlen($num)<=3)\n {\n $this->sentence.=$this->decider($num);\n }\n else\n {\n $k=strrev($num);\n for($i=0;$i<strlen($k);$i=$i+3){$arro[]=strrev(substr($k,$i,3));}\n //reverse again\n $arro=array_reverse($arro);\n //print_r($arro);\n $mool=ceil(strlen($num)/3);\n if((strlen($num)%3)==0){$mool--;}\n //return $this->decider($arro[0]);\n $this->sentence.=$this->decider($arro[0]).' '.$this->mool_array[$mool];\n $mool--;\n //leave the first one and prepare string of others\n $arrlen=count($arro);\n for($i=1;$i<$arrlen;$i++)\n {\n $this->sentence.=' '.$this->decider($arro[$i]);\n if($mool!=0)\n {\n $this->sentence=' '.$this->sentence.' '.$this->mool_array[$mool];\n }\n $mool--;\n }\n }\n return ucfirst(trim($this->sentence));\n }", "function b60to10($s)\n {\n $n = 0;\n for($i = 0; $i < strlen($s); $i++) // iterate from first to last char of $s\n {\n $c = ord($s[$i]); // put current ASCII of char into $c\n if ($c>=48 && $c<=57) { $c=bcsub($c,48); }\n else if ($c>=65 && $c<=72) { $c=bcsub($c,55); }\n else if ($c==73 || $c==108) { $c=1; } // typo capital I, lowercase l to 1\n else if ($c>=74 && $c<=78) { $c=bcsub($c,56); }\n else if ($c==79) { $c=0; } // error correct typo capital O to 0\n else if ($c>=80 && $c<=90) { $c=bcsub($c,57); }\n else if ($c==95) { $c=34; } // underscore\n else if ($c>=97 && $c<=107) { $c=bcsub($c,62); }\n else if ($c>=109 && $c<=122) { $c=bcsub($c,63); }\n else { $c = 0; } // treat all other noise as 0\n $n = bcadd(bcmul(60, $n), $c);\n }\n return $n;\n }", "abstract protected function getItoa64() ;", "public function getBookByISBN($isbn) {\n\t\t$this->xpp = new \\XMLReader();\n\t\t\n\t\tif ($this->xpp->open('http://books.google.com/books/feeds/volumes?q=' . urlencode($isbn))) {\n\t\t\t$this->moveToEntry();\n\t\t\t\n\t\t\t$found = false;\n\t\t\twhile ($this->xpp->name == \"entry\") {\n\t\t\t\t$book = $this->parseBook();\n\t\t\t\t\n\t\t\t\t// if book is found \n\t\t\t\tif (isset($book['identifier']) &&\n\t\t\t\t\t(strlen($isbn) == 10 && isset($book['identifier']['ISBN']) && $book['identifier']['ISBN'] == $isbn) || // ISBN\n\t\t\t\t\t(strlen($isbn) == 13 && isset($book['identifier']['ISBN2']) && $book['identifier']['ISBN2'] == $isbn)) // ISBN2\n\t\t\t\t{\n\t\t\t\t\t$found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn (!isset($book) || !$found) ? null : $book;\n\t}", "public function getCodeArticle10() {\n return $this->codeArticle10;\n }", "public function encode($barcode, $validate = true)\n {\n if ($validate && !$this->isValid($barcode)) {\n throw new InvalidLengthException(\"The barcode given must be EAN13 valid, $barcode given.\");\n }\n\n $use = intval($barcode[0]);\n $encoded = '';\n\n for ($i=0; $i<$this->getLength(); ++$i) {\n $x = $this->encodingTablesOrder()[$use][$i];\n $y = intval($barcode[$i]);\n $encoded .= $this->encodingTables()[$x][$y];\n }\n\n return $encoded;\n }", "public function getSubTitle(){\n\t\treturn $this->ol[\"ISBN:\".$this->isbn][\"subtitle\"];\t\n\t}", "public function create_order_number()\n\t{\n\t\t//select product code\n\t\t$this->db->from('orders');\n\t\t$this->db->where(\"order_number LIKE 'ORD\".date('y').\"/%'\");\n\t\t$this->db->select('MAX(order_number) AS number');\n\t\t$query = $this->db->get();\n\t\t$preffix = \"ORD\".date('y').'/';\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result();\n\t\t\t$number = $result[0]->number;\n\t\t\t$real_number = str_replace($preffix, \"\", $number);\n\t\t\t$real_number++;//go to the next number\n\t\t\t$number = $preffix.sprintf('%06d', $real_number);\n\t\t}\n\t\telse{//start generating receipt numbers\n\t\t\t$number = $preffix.sprintf('%06d', 1);\n\t\t}\n\t\t\n\t\treturn $number;\n\t}", "private function numberToRoman($num) \n\t{\n\t\t// Make sure that we only use the integer portion of the value\n\t\t$n = intval($num);\n\t\t$result = '';\n\n\t\t// Declare a lookup array that we will use to traverse the number:\n\t\t$lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,\n\t\t\t'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,\n\t\t\t'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);\n\n\t\tforeach ($lookup as $roman => $value) \n\t\t{\n\t\t\t// Determine the number of matches\n\t\t\t$matches = intval($n / $value);\n\n\t\t\t// Store that many characters\n\t\t\t$result .= str_repeat($roman, $matches);\n\n\t\t\t// Substract that from the number\n\t\t\t$n = $n % $value;\n\t\t}\n\n\t\t// The Roman numeral should be built, return it\n\t\treturn $result;\n\t}", "public function getEx15() {\n $books = Book::all();\n $this->printBooks($books);\n\t}", "public function getBookDetails($isbnnumber = NULL){\n\n define(\"API_KEY\",\"AIzaSyBWoCaww-UoB3VbN4QeCV2ESqqD5sD8PTA\");\n define(\"URL\", \"https://www.googleapis.com/books/v1/volumes?q=isbn:\");\n $details=array();\n $imageAvailable = false;\n $image=\"img/125x125.jpg\";\n $error=\"\";\n $description=base64_encode(\"No description available\");\n $publisher=\"No publisher available\";\n $isbn=trim($isbnnumber);\n if(!isset($isbn)||$isbn ==\"\")\n {\n $error=\"Please enter the 10 or 13 digit ISBN number located at the back of the book\";\n $valid = false;\n }\n else\n {\n $isbn= str_replace('-', '', $isbn); \n if(!is_numeric($isbn))\n {\n $error=\"ISBN number should be numeric. You entered \".$isbn.\" is not numeric\";\n $valid = false;\n } \n elseif(strlen($isbn)==13 && $isbn[0]!='9')\n {\n $error=\"ISBN should start with 978..Please review the ISBN entered and try again..\";\n $valid = false;\n } \n elseif (!(strlen($isbn)==10 || strlen($isbn)==13))\n {\n $error=\"ISBN should be atleast 10 or 13 digits...You entered only \".strlen($isbn).\" digits\";\n $valid= false;\n } \n \n }\n if(strlen($error)==\"\")\n {\n $url=URL.$isbn;\n //print_r($url);\n $bookDetails = @file_get_contents($url);\n $bookDetailsArray=json_decode($bookDetails, true);\n $totalItem=$bookDetailsArray['totalItems'];\n // print_r($bookDetailsArray);\n if($totalItem==1)\n {\n if(array_key_exists('imageLinks',$bookDetailsArray['items'][0]['volumeInfo'] ))$imageAvailable=true;\n $title= $bookDetailsArray['items'][0]['volumeInfo']['title'];\n $authors= @implode(\",\", $bookDetailsArray['items'][0]['volumeInfo']['authors']); \n\n if($imageAvailable)\n {\n $image=$bookDetailsArray['items'][0]['volumeInfo']['imageLinks']['smallThumbnail'];\n \n $description=$bookDetailsArray['items'][0]['volumeInfo']['description'];\n $publisher=$bookDetailsArray['items'][0]['volumeInfo']['publisher'];\n }\n $publishedDate=$bookDetailsArray['items'][0]['volumeInfo']['publishedDate']; \n $identifier=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][1]['identifier'];\n $identifierTen=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][0]['identifier'];\n // $categories=@implode(\",\",$bookDetailsArray['items'][0]['volumeInfo']['categories']);\n // Categories Add in DB and Return IDs\n $cat_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['categories'] as $value) {\n $result = ($this->books_model->batchAddCat($value));\n $cat_array = json_decode(json_encode($result), True);\n $cat_arr[] = $cat_array['id'];\n }\n $cat_arr = implode(',', $cat_arr);\n\n // Authors Add in DB and Return IDs\n $aut_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['authors'] as $value) {\n $result = ($this->books_model->batchAddAuthors($value));\n $aut_array = json_decode(json_encode($result), True);\n $aut_arr[] = $aut_array['id'];\n }\n $aut_arr = implode(',', $aut_arr);\n\n\n $details['category_name'] = $cat_arr;\n $details['author_name'] = $aut_arr;\n $details['book_title'] = $title;\n $details['image'] = $image;\n $details['description'] = $description;\n $details['book_pub'] = $publisher;\n $details['isbn_13'] = $identifier;\n $details['isbn'] = $identifierTen;\n $details['copyright_year'] = $publishedDate;\n \n $valid = true;\n }\n else\n {\n $error=\"No book found for entered ISBN\";\n $valid = false;\n }\n }\n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->data['authors'] = $this->books_model->getAllAuthors();\n $this->data['book_details'] = $details;\n\n $this->mPageTitle = \"Add Book\";\n\n \n $this->render('books/edit');\n }", "function cryptCCNumberCrypt( $cc_number, $key )\r\n{\r\n\treturn base64_encode($cc_number);\r\n}", "function currencyFormat($inputID)\n\t{\n\t\t\n\t\tsetlocale(LC_MONETARY,\"en_US\");\n\t\treturn money_format('%i', $inputID) .\"\\n\";\n\t}", "public static function gen_order_str()\n {\n\n $str = session_id();\n $str .= (string)time();\n $checksum = crc32($str);\n $date = date('Y-m-d');\n $order_number = $date . $checksum;\n\n return substr($order_number, 0, 19);\n }", "public function generateInvoiceNumber()\n {\n $orderRepo = EntityUtils::getRepository('Order');\n $orderCount = $orderRepo->getOrderCountBeforeDate($this->program->id, $this->order_date);\n $year = chr(date('Y') - 1913);\n $month = date('m');\n $day = date('d') + $orderCount;\n if ($day < 10) {\n $day = \"0\" . $day;\n }\n $monthDay = $month . $day;\n\n $invoiceNumber = $this->program->customer_id . $year . $monthDay;\n\n //Make sure the generated invoice number does not already exist, if it does, increment and try again\n while ($orderRepo->findOneBy(array(\"invoice_number\" => $invoiceNumber))) {\n $monthDay++;\n\n //Tack on a leading zero if we don't have 4 digits\n if ($monthDay < 1000) {\n $monthDay = \"0\" . $monthDay;\n }\n\n $invoiceNumber = $this->program->customer_id . $year . $monthDay;\n }\n\n $this->invoice_number = $invoiceNumber;\n return $this->invoice_number;\n }", "public function converterRomanNumber($number) : void\n {\n\n if ($number > 0 && $number < 5000)\n {\n $alphabet = [\n [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"],\n [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"],\n [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"],\n [\"\", \"M\", \"MM\", \"MMM\", \"MMMM\"]\n ];\n\n $chars = str_split($number);\n $result = \"\";\n for ($i = 0; $i < sizeof($chars); $i++)\n {\n $result = $result . $alphabet[sizeof($chars) - 1 - $i][intval($chars[$i])];\n }\n echo \"L'équivalent de \" . $number . \" en nombre romain est : \" . $result . ' ';\n }\n else\n {\n echo \"Votre nombre n'est pas compris dans la plage ]0;5000[\";\n }\n }", "public function getbookbyIsbn($isbn){\n\n\t\t\t$this->db->select('name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t->from('tbl_books')\n\t\t\t\t\t->where('ISBN', $isbn);\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() == 1){\n\t\t\t\treturn $query->row();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function prepareMobileNb($mobileNumber) {\n\t\t$parts = split ( \"-\", $mobileNumber );\n\t\t$countryCode = $parts [0];\n\t\t$extension = $parts [1];\n\t\t$phoneNumber = $parts [2];\n\t\t\n\t\tif ($extension == \"03\") {\n\t\t\t$finalFormat = $countryCode . \"3\" . $phoneNumber;\n\t\t\treturn $finalFormat;\n\t\t\n\t\t} else {\n\t\t\treturn $countryCode . $extension . $phoneNumber;\n\t\t}\n\t}", "function toChinese($number) {\n $wording = str_split((string)$number);\n\n $numberArray = ['十', '一', '二', '三', '四', '五', '六', '七', '八', '九'];\n $tenNumberArray = ['十', '廿', '卅', '四', '五', '六', '七', '八', '九'];\n\n if ($number > 10) {\n return $tenNumberArray[(int)$wording[0] - 1] . $numberArray[(int)$wording[1]];\n }\n if ($number == 10) {\n return '十' . '岁';\n }\n return $numberArray[(int)$wording[0]] . '岁';\n }", "function convertNumbersToFarsi($srting,$mode='html')\n\t{\n\t\tif ($mode=='html') {\n\t\t\t$num0=\"&#1776;\";\n\t\t\t$num1=\"&#1777;\";\n\t\t\t$num2=\"&#1778;\";\n\t\t\t$num3=\"&#1779;\";\n\t\t\t$num4=\"&#1780;\";\n\t\t\t$num5=\"&#1781;\";\n\t\t\t$num6=\"&#1782;\";\n\t\t\t$num7=\"&#1783;\";\n\t\t\t$num8=\"&#1784;\";\n\t\t\t$num9=\"&#1785;\";\n\t\t} elseif($mode=='plainText') {\n\t\t\t$num0=chr(hexdec('DB')).chr(hexdec('B0'));\n\t\t\t$num1=chr(hexdec('DB')).chr(hexdec('B1'));\n\t\t\t$num2=chr(hexdec('DB')).chr(hexdec('B2'));\n\t\t\t$num3=chr(hexdec('DB')).chr(hexdec('B3'));\n\t\t\t$num4=chr(hexdec('DB')).chr(hexdec('B4'));\n\t\t\t$num5=chr(hexdec('DB')).chr(hexdec('B5'));\n\t\t\t$num6=chr(hexdec('DB')).chr(hexdec('B6'));\n\t\t\t$num7=chr(hexdec('DB')).chr(hexdec('B7'));\n\t\t\t$num8=chr(hexdec('DB')).chr(hexdec('B8'));\n\t\t\t$num9=chr(hexdec('DB')).chr(hexdec('B9'));\n\t\t}\n\n\t\t$stringtemp=\"\";\n\t\t$len=strlen($srting);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif(substr($srting,$sub,1)==\"0\")$stringtemp.=$num0;\n\t\t\telseif(substr($srting,$sub,1)==\"1\")$stringtemp.=$num1;\n\t\t\telseif(substr($srting,$sub,1)==\"2\")$stringtemp.=$num2;\n\t\t\telseif(substr($srting,$sub,1)==\"3\")$stringtemp.=$num3;\n\t\t\telseif(substr($srting,$sub,1)==\"4\")$stringtemp.=$num4;\n\t\t\telseif(substr($srting,$sub,1)==\"5\")$stringtemp.=$num5;\n\t\t\telseif(substr($srting,$sub,1)==\"6\")$stringtemp.=$num6;\n\t\t\telseif(substr($srting,$sub,1)==\"7\")$stringtemp.=$num7;\n\t\t\telseif(substr($srting,$sub,1)==\"8\")$stringtemp.=$num8;\n\t\t\telseif(substr($srting,$sub,1)==\"9\")$stringtemp.=$num9;\n\t\t\telse $stringtemp.=substr($srting,$sub,1);\n\t\t}\n\t\treturn $stringtemp;\n\t}", "public static function genPhoneFormat($str) //from 0902244581 to 090-224-xxxx\n {\n $aNumbers = str_split($str);\n \n $result = '';\n $index = 0;\n for($i = count($aNumbers) - 1 ; $i >= 0; $i--)\n {\n $index++;\n \n if($index <= 4)\n {\n $result = 'x'.$result; \n if($index == 4)\n $result = '-'.$result;\n \n }else\n {\n $result = $aNumbers[$i].$result;\n if($index == 7)\n $result = '-'.$result; \n }\n }\n return $result;\n }", "function sid2str($sid)\n {\n\t\t// 1 byte for the revision level\n\t\t// 1 byte for the number n of variable sub-ids\n\t\t// 6 bytes for identifier authority value\n\t\t// n*4 bytes for n sub-ids\n\t\t//\n\t\t// Example: 010400000000000515000000a681e50e4d6c6c2bca32055f\n\t\t// Legend: RRNNAAAAAAAAAAAA11111111222222223333333344444444\n\t\t$revision = ord($sid[0]);\n\t\t$numberSubID = ord($sid[1]);\n\t\t$subIdStart = 8; // 1 + 1 + 6\n\t\t$subIdLength = 4;\n\t\tif (strlen($sid) !== $subIdStart + $subIdLength * $numberSubID) {\n\t\t\t// Incorrect number of bytes present.\n\t\t\treturn '';\n\t\t}\n\t\t// 6 bytes = 48 bits can be represented using floats without loss of\n\t\t// precision (see https://gist.github.com/bantu/886ac680b0aef5812f71)\n\t\t$iav = number_format(hexdec(bin2hex(substr($sid, 2, 6))), 0, '', '');\n\t\t$subIDs = array();\n\t\tfor ($i = 0; $i < $numberSubID; $i++) {\n\t\t\t$subID = unpack('V', substr($sid, $subIdStart + $subIdLength * $i, $subIdLength));\n\t\t\t$subIDs[] = sprintf('%u', $subID[1]);\n\t\t}\n\t\t// Result for example above: S-1-5-21-249921958-728525901-1594176202\n\t\treturn sprintf('S-%d-%s-%s', $revision, $iav, implode('-', $subIDs));\n }", "public static function genPhoneFormat($str) { //from 0902244581 to 090-224-xxxx\n $aNumbers = str_split($str);\n\n $result = '';\n $index = 0;\n for ($i = count($aNumbers) - 1; $i >= 0; $i--) {\n $index++;\n\n if ($index <= 4) {\n $result = 'x' . $result;\n if ($index == 4)\n $result = '-' . $result;\n }else {\n $result = $aNumbers[$i] . $result;\n if ($index == 7)\n $result = '-' . $result;\n }\n }\n return $result;\n }", "public function setISBN(?string $iSBN = null): self\n {\n // validation for constraint: string\n if (!is_null($iSBN) && !is_string($iSBN)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iSBN, true), gettype($iSBN)), __LINE__);\n }\n if (is_null($iSBN) || (is_array($iSBN) && empty($iSBN))) {\n unset($this->ISBN);\n } else {\n $this->ISBN = $iSBN;\n }\n \n return $this;\n }", "public function generateNomor6Seq()\n {\n $config = Config::model()->find(\"nama='toko.kode'\");\n $kodeCabang = $config->nilai;\n $kodeDokumen = KodeDokumen::PEMBELIAN;\n $kodeTahunBulan = date('ym');\n $sequence = substr('00000' . $this->cariNomorTahunan(), -6);\n return \"{$kodeCabang}{$kodeDokumen}{$kodeTahunBulan}{$sequence}\";\n }" ]
[ "0.7752301", "0.69664115", "0.683384", "0.65942186", "0.63080627", "0.6307712", "0.61868817", "0.61771363", "0.61431986", "0.5945208", "0.5832819", "0.5708205", "0.5654722", "0.5618333", "0.5520768", "0.5519655", "0.5519655", "0.55044407", "0.531368", "0.5266902", "0.5264451", "0.524977", "0.5235721", "0.51902837", "0.5160583", "0.5110362", "0.5052034", "0.50471807", "0.4980943", "0.4968428", "0.49388", "0.48988372", "0.488166", "0.48738828", "0.4841414", "0.4799995", "0.475911", "0.4748271", "0.47398826", "0.4723417", "0.47205803", "0.46303654", "0.46265638", "0.46109977", "0.45992836", "0.45935485", "0.45858064", "0.45773244", "0.45472148", "0.4541885", "0.45356545", "0.4535505", "0.45336497", "0.4525035", "0.45238417", "0.451153", "0.45087916", "0.45087916", "0.450806", "0.44956627", "0.44950175", "0.44931003", "0.4492864", "0.4483596", "0.4482008", "0.44779512", "0.44709343", "0.44503772", "0.44486174", "0.4447957", "0.44447932", "0.44436476", "0.44419497", "0.44416964", "0.44246587", "0.4420811", "0.44085574", "0.4405991", "0.4405227", "0.44050968", "0.4399782", "0.43884492", "0.43748456", "0.43743122", "0.4372487", "0.4365977", "0.4362858", "0.43613338", "0.43603137", "0.43565926", "0.43498933", "0.4348604", "0.43459627", "0.43391323", "0.43391016", "0.4335803", "0.43293315", "0.4325162", "0.4324979", "0.43242306" ]
0.8058322
0
Returns nodeValue of first match if query is successful.
private function _getFirstElement($query, $debug=false) { $result = $this->product->get($query); if($debug && env('APP_DEBUG')) var_dump($result); if($result) { return $result[0]->nodeValue; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function Search_Node($goal_value){\t\t\t\t\t\t\t\t\n\t\t\tforeach ($this->nodes as $key => $obj) {\n\t\t\t\tif ($obj->element==$goal_value) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function first()\n {\n return count($this->nodes)?$this->nodes[0]:null;\n }", "private function _findSingleNode($result)\n {\n if ($result->length) {\n return $result->item(0);\n }\n return false;\n }", "function getValNode(){\n\t\t$clase=$this->nmclass;\n\t\t$node=$this->anode;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "static function getXPathFirstNode($xPath, $contextNode = null, $query)\n {\n // XPath query\n if ($contextNode)\n $nodeList = @$xPath->query($query, $contextNode);\n else\n $nodeList = @$xPath->query($query);\n\n // Retrieve first value or else return default value\n if ($nodeList && $nodeList->length > 0)\n return $nodeList->item(0);\n else\n return null;\n }", "public function getValue(Node $node);", "public function firstValue()\n\t{\n\t\treturn $this->first()->value;\n\t}", "static function getXPathNodeValue($xPath, $contextNode = null, $query, $defaultValue = null)\n {\n // XPath query\n if ($contextNode)\n $nodeList = @$xPath->query($query, $contextNode);\n else\n $nodeList = @$xPath->query($query);\n\n // Retrieve first value or else return default value\n if ($nodeList && $nodeList->length > 0)\n return trim($nodeList->item(0)->nodeValue);\n else\n return $defaultValue;\n }", "public function getValue()\n {\n $result = $this->getResult();\n if (is_array($result) && (count($result) > 0)) {\n return $result[0];\n }\n if ($result instanceof \\Iterator) {\n list($key,$value) = each($result);\n $result->rewind();\n return $value;\n }\n return null;\n }", "public function first() {\n\n\t\treturn $this->search[0];\n\n\t}", "public function first(){\n $this->execute();\n if(count($this->results) > 0){\n return current($this->results);\n } else {\n return null;\n }\n }", "protected function Search_Node_obj($goal_value){\t\t\t\t\t\t\t\t\n\t\t\tforeach ($this->nodes as $key => $obj) {\n\t\t\t\tif ($obj==$goal_value) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "protected function first() {\n if (!$this->query_failed) {\n return $this->results[0] ?? null;\n }\n\n return false;\n }", "public function getFirst($xpathQuery, \\DOMNode $contextnode = null);", "public function getFirstNode()\n {\n return $this->firstNode;\n }", "public function first() {\n\t\treturn $this->valueForKey($this->firstKey());\n\t}", "protected function findNode($query)\n\t{\n\t\t$nodes = $this->xpath->query($query);\n\n\t\tif ($nodes->length > 0)\n\t\t{\n\t\t\treturn $nodes->item(0)->textContent;\n\t\t}\n\t\treturn NULL;\n\t}", "public function current()\n {\n if (!is_null($this->current) && isset($this->results[$this->current])) {\n return $this->results[$this->current];\n } else {\n return null;\n }\n }", "public function getValue($content, $key)\r\n {\r\n if(isset($content) && is_object($content)){\r\n $result = $content->xpath($key);\r\n if(!empty($result)){\r\n if(is_collection($result)){\r\n $result = $result[0];\r\n }\r\n return $result;\r\n }\r\n }\r\n elseif($key == XMLSimpleParser::SELF){\r\n return $content;\r\n }\r\n return null;\r\n }", "public function first()\n {\n if($this->_results) {\n return $this->_results[0];\n }\n return null;\n }", "public function first($selector, \\DOMNode $context = null)\n {\n $this->exceptionlevel = 4;\n\n $nodes = $this->query($selector, $context);\n\n $node = $nodes ? $nodes->item(0) : null;\n\n $nodes = null;\n\n return $node;\n }", "public function First()\n {\n return $this->Results()[0];\n }", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }", "public function value() {\n if ($this->_m_value !== null)\n return $this->_m_value;\n $this->_m_value = $this->lookupTable()[($this->tag() - 213)];\n return $this->_m_value;\n }", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function first(){\n\n //using the above (results) method here\n return $this->results()[0]; //depends on the version of your PHP server\n //return $this->results[0];\n }", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }", "private function Value()\n\t{\n\t\t$peek = $this->lexer->glimpse();\n\n\t\tif ( DocLexer::T_EQUALS === $peek['type'] )\n\t\t\treturn $this->FieldAssignment();\n\n\t\treturn $this->PlainValue();\n\t}", "public function currval() {\n\t\t\tif ($this->database->isConnected()) {\n\t\t\t\t$query = \"SELECT \" . $this->schema . \".\" . $this->name . \".CURRVAL FROM DUAL\";\n\t\t\t\t$stid = $this->database->executeRead($query);\n\t\t\t\t$results = $this->database->getResults($stid);\n\t\t\t\tforeach ($results as $row) {\n\t\t\t\t\treturn $row['NEXTVAL'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}", "function getValNode_dif($node){\n\t\t$clase=$this->nmclass;\n\t\t$valor=$this->nodos[$clase][$node];\n\n\t\tif($valor!=''){\n\t\t\treturn $valor;\n\t\t}\n\t\telse{\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getFirst()\n {\n if (is_array($this->rows)) {\n $rows = &$this->rows;\n } else {\n $query = clone $this->query;\n $query->setLimit(1);\n $rows = $query->getResult();\n }\n\n return (isset($rows[0])) ? $rows[0] : null;\n }", "public function first()\n {\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function get ($key) {\n\t\t$node = $this->root;\n\t\twhile ($node !== null) {\n\t\t\t$c = $this->compare($key, $node->key);\n\t\t\tif ($c === 0) {\n\t\t\t\treturn $node->value;\n\t\t\t}\n\t\t\tif ($c < 0) {\n\t\t\t\t$node = $node->left;\n\t\t\t} else {\n\t\t\t\t$node = $node->right;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getFirstItemValue()\n {\n $slab = $this->getFirstSlab();\n\n if (empty($slab)) {\n return false;\n }\n\n return $this->getFirstItemValueInSlab($slab);\n }", "private function findFirstIndex(SimpleNode $item): ?int\n {\n foreach ($this->elements as $key => $element) {\n if ($element !== null) {\n if ($item['value'] === $element['value']) {\n return $key;\n }\n }\n }\n\n return null;\n }", "function db_select_one_value( $statement ) {\n\n $this->db_run_query( $statement );\n\n if( $this->db_fetch_next_row( DB_FETCHMODE_ORDERED ) ) $this->db_fetch_next_col();\n\n return $this->curr_col_value;\n }", "public function first()\n {\n return $this->results()[0];\n }", "public function getTagValue()\r\n\t{\r\n\t\treturn $this->root->nodeValue;\r\n\t}", "public function findValue($key)\n\t{\n\t\treturn $this->find($key)->value;\n\t}", "public function get($key)\n {\n return (($e = $this->getNode($key)) == null) ? null : $e->getValue();\n }", "function dbFirstResult($query) {\n\t$result = dbQuery($query);\n\tif($result === false) { return(false); }\n\t$row = mysqli_fetch_array($result);\n\treturn $row[0];\n}", "public function getMatchFound()\n {\n return $this->get('MatchFound');\n }", "public function getFirstRootNode()\n {\n $qb = $this->_qbFactory\n ->getRootNodeQueryBuilder()\n ->setMaxResults(1);\n try {\n return $qb->getQuery()->getSingleResult();\n } catch (NoResultsException $e) {\n return null;\n }\n }", "public function findNode($query)\n {\n return $this->_findSingleNode($this->findNodes($query));\n }", "public function first()\n {\n return $this->results()[0];\n }", "public function result()\n\t{\n\t\tif ($this->executed)\n\t\t\treturn $this->result;\n\t\telse\n\t\t\treturn NULL;\n\t}", "public function retrieveFirstChild(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'left'), $node->getLeftValue() + 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "function xpath_one($xpath) {\r\n\t\t$items = $this->xpath($xpath);\r\n\t\treturn $items[0];\r\n\t}", "public function nextval() {\n\t\t\tif ($this->database->isConnected()) {\n\t\t\t\t$query = \"SELECT \" . $this->schema . \".\" . $this->name . \".NEXTVAL FROM DUAL\";\n\t\t\t\t$stid = $this->database->executeRead($query);\n\t\t\t\t$results = $this->database->getResults($stid);\n\t\t\t\tforeach ($results as $row) {\n\t\t\t\t\treturn $row['NEXTVAL'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function Find($value) {\n\t\t$crawler = $this->tail->Next();\n\n\t\tif ($this->tail->Value() === $value)\n\t\t\treturn $this->tail;\n\n\t\tif ($this->head->Value() === $value)\n\t\t\treturn $this->head;\n\n\t\tfor ($i = 1; $i < $this->count - 1; $i++) {\n\t\t\tif ($crawler->Value() === $value)\n\t\t\t\treturn $crawler;\n\t\t\t$crawler = $crawler->Next();\n\t\t}\n\n\t\treturn null;\n\t}", "public function getResults()\n {\n return $this->query->first() ?: $this->getDefaultFor($this->parent);\n }", "public function current()\n {\n if (($this->isvalid) and (!librdf_iterator_end($this->iterator))) {\n // the pointer returned is overwritten when the iterator is\n // advanced or closed, so make a copy of the node\n $ret = librdf_iterator_get_object($this->iterator);\n if ($ret) {\n return LibRDF_Node::makeNode(librdf_new_node_from_node($ret));\n } else {\n throw new LibRDF_Error(\"Unable to get current node\");\n }\n } else {\n return NULL;\n }\n }", "public function getFirstResult();", "public function getFirstResult();", "public function getFirst($query){\n\t\treturn $query[0];\n\t}", "static function getNodeValue($node)\n {\n if ($node == null) return null;\n\n // Stop at the first text node\n foreach($node->childNodes as $child)\n {\n if ($child->nodeType == XML_TEXT_NODE)\n return trim($child->nodeValue);\n }\n return trim($node->nodeValue);\n }", "protected function value()\n {\n $value = $this->keyVal();\n return reset($value);\n }", "public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }", "function query_value($sql, $parameters = null) {\n $query = $this->query($sql, $parameters);\n return $query->fetchColumn(0);\n }", "public function findOne($query)\n {\n $resultSet = $this->find($query);\n return $resultSet->current();\n }", "public function first()\n {\n $this->rewind();\n return $this->current();\n }", "public function getOne()\n\t{\n\t\tif ($this->count() > 0)\n\t\t{\n\t\t\t$this->seek(0);\n\t\t\treturn $this->current();\n\t\t} else\n\t\t\treturn null;\n\t}", "public function current()\n\t{\n\t\treturn $this->query->current();\n\t}", "function _findValue(&$values)\r\n {\r\n return $this->getValue();\r\n }", "static function select_value($sql, $params = array()) {\n $sth = static::execute($sql, $params);\n\n $result = $sth->fetch();\n\n if ($result === false) {\n return null;\n } else {\n return array_shift($result);\n }\n }", "public function fetch_value(): mixed\n {\n $sth = $this->query(func_get_args());\n if (is_object($sth)) {\n $ret = $sth->fetch();\n if ($ret) {\n return reset($ret);\n } else {\n return false;\n }\n } else {\n return $sth;\n }\n }", "public function first() {\n if (sizeof($this) < 1) return null;\n $keys = array_keys($this);\n return $this[$keys[0]];\n }", "function findone($key,$val) {\n\t\treturn ($data=$this->find($key,$val))?$data[0]:FALSE;\n\t}", "public function first()\n {\n return \\count($this->data) > 0 ? $this->data[0] : null;\n }", "public function getExpressionResult()\n {\n if (array_key_exists(\"expressionResult\", $this->_propDict)) {\n return $this->_propDict[\"expressionResult\"];\n } else {\n return null;\n }\n }", "protected function parseValue()\n {\n $expressions = array();\n while ($e = $this->parseExpression()) {\n $expressions[] = $e;\n if (!$this->matchChar(',')) {\n break;\n }\n }\n if (count($expressions) > 0) {\n return new ILess_Node_Value($expressions);\n }\n }", "public function getValue(): string\n {\n $value = '';\n \n if ($this->currentNode->childNodes !== NULL){\n foreach ($this->currentNode->childNodes as $node) {\n $value .= $this->doc->saveXML($node);\n }\n } else {\n $value = $this->currentNode->nodeValue;\n }\n \n return $value;\n }", "private function queryFetchAsValue(mysqli_result $result)\n\t{\n\t\t$element = $result->fetch_row();\n\t\treturn $element ? $element[$result->field_count - 1] : null;\n\t}", "public function first()\n {\n if (!empty($this->searchProducts)) {\n return $this->searchProducts[0];\n }\n\n return null;\n }", "public function first(): mixed\n {\n return Iterators::first($this->iterator);\n }", "public function fetchOne() {\r\n\t\t$data = $this->fetch();\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $data ? current($data) : null;\r\n\t}", "public function getResult($key): ?Result\n {\n return $this->results[$key] ?? null;\n }", "public function value()\r\n\t{\r\n\t\tif ($this->isFetched() && $this->isValid())\r\n\t\t{\r\n\t\t\treturn $this->normalizedValue;\r\n\t\t}\t\r\n\t\treturn null;\r\n\t}", "function query_value($sql) {\r\n\r\n\t\t$this->query($sql);\r\n\r\n\t\t$num_results = mysql_num_rows($this->result);\r\n\r\n\t\tif ($num_results == 0) {\r\n\t\t\treturn false;\r\n\r\n\t\t} elseif ($num_results == 1) {\r\n\t\t\tlist($return) = mysql_fetch_row($this->result);\r\n\r\n\t\t} else {\r\n\t\t\t$return = array();\r\n\r\n\t\t\twhile($row = mysql_fetch_row($this->result)) {\r\n\t\t\t\t$return[] = $row[0];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "protected function getOne()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetch($statement);\n }", "function findvalue($query)\n {\n $connect = mysqli_connect(\"localhost\", \"phearum\", \"123\", \"mydb\");\n $filter_Result = mysqli_query($connect, $query);\n return $filter_Result;\n }", "public function getOne($query) {\n $results = $this->getResults($query);\n $row = $results->fetch_row();\n return $row[0];\n }", "protected static function getFirst($query) {\n $db = Dispatch::getConnection();\n $query = $db->query($query)->fetch_row();\n return $query[0];\n\n }", "public function val ($value = null) {\r\n\t\t\r\n\t\tif (isset($value)) {\r\n\t\t\tforeach ($this as $node) $node->nodeValue = $value;\r\n\t\t} else return $this[0]->nodeValue;\r\n\t}", "protected function first()\n {\n foreach ($this->sortable as $key => $value) {\n if (is_numeric($key)) {\n return $value;\n }\n\n return $key;\n }\n\n return null;\n }", "function nextResult()\n {\n return $this->dbh->nextResult($this->result);\n }", "public function findFirst();", "function firstChild() {\n\t\t$children = $this->children();\n\t\tif (sizeof($children>0)) {\n\t\t\treturn $children[0];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getValue() {\n return $this->node->hasAttribute('value') ? iconv('utf-8', xp::ENCODING, $this->node->getAttribute('value')) : NULL;\n }", "public function first() {\n return $this->nth( 0 );\n }", "public function get_one($query)\n {\n \t$res=pg_query($this->connection,$query);\n \t$row=pg_fetch_array($res);\n \treturn $row[0];\n }", "public function first()\n {\n return (count($this->list) > 0 ?\n $this->list[0] : null\n );\n }", "public function current() {\n\t\treturn current($this->_value);\n\t}", "function first()\n{\n\t$this->rewind();\n\treturn $this->current();\n}", "public abstract function findFirst(): Optional;", "private static function getResultValue($result, $index=0)\n\t{\n\t\t$value = null;\n\t $row = is_numeric($index) ? $result->fetch_row() : $result->fetch_assoc();\n\t if($row)\n\t $value = $row[$index];\n\t\t$result->free();\n\t return $value;\n\t}", "public function getFirstItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->rewind()->current();\n }" ]
[ "0.63461655", "0.6221492", "0.6208125", "0.6108111", "0.61000395", "0.60435003", "0.6043364", "0.5942205", "0.5915367", "0.59103525", "0.59056735", "0.5860143", "0.5813632", "0.5689215", "0.5682624", "0.5644293", "0.5638928", "0.56200725", "0.55767846", "0.5561278", "0.55482453", "0.55380565", "0.55210257", "0.55164844", "0.5499071", "0.54618824", "0.543979", "0.54369867", "0.5415393", "0.54017854", "0.540091", "0.5378255", "0.5357395", "0.5341976", "0.5328147", "0.53231585", "0.5322386", "0.5317531", "0.53074044", "0.529528", "0.52774715", "0.52743196", "0.5271621", "0.5266399", "0.5263757", "0.52499807", "0.5236819", "0.52312756", "0.52181804", "0.5212391", "0.5204806", "0.51865673", "0.51830286", "0.51657784", "0.5148654", "0.51264614", "0.51264614", "0.51234096", "0.5081855", "0.50818145", "0.50793344", "0.5066753", "0.50412184", "0.50304663", "0.50222695", "0.50195587", "0.5019114", "0.5002456", "0.49996796", "0.49928305", "0.49909425", "0.49861935", "0.49715924", "0.49595356", "0.4957057", "0.49552092", "0.49503678", "0.4944728", "0.49413267", "0.49408457", "0.49376598", "0.49362844", "0.49336517", "0.4927091", "0.49255204", "0.49227017", "0.49155575", "0.4911974", "0.49058127", "0.4896173", "0.48893824", "0.48886722", "0.48868704", "0.4876872", "0.48756", "0.48719114", "0.4870578", "0.48647544", "0.486381", "0.48630437" ]
0.53108853
38
Returns an array of childNodes of DOMElement with nodeName as key and nodeValue as value.
private function _childNodes2Array(\DOMElement $DOMElement) { $childNodes = array(); foreach ($DOMElement->childNodes as $node) { $childNodes[$node->nodeName] = $node->nodeValue; } return $childNodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChildNodes() : array {\n return $this->childNodes;\n }", "protected function getChildrenByName(DOMNode $node, $name)\n {\n $nodes = array();\n foreach ($node->childNodes as $node) {\n if ($node->nodeName == $name) {\n array_push($nodes, $node);\n }\n }\n return $nodes;\n }", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "protected function getChildrenByTagName( DOMElement & $node, $elementTag = 'param' )\n {\n $nodeList = array();\n for ($child = $node->firstChild; $child != null; $child = $child->nextSibling){\n if ( $child->nodeType == 1 && $elementTag == $child->nodeName) {\n $nodeList[] = $child;\n }\n }\n return $nodeList;\n }", "public function getChildNodes();", "function getChildNodes() ;", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function getChildNodes()\n {\n return array_values($this->getChildNodesById());\n }", "protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }", "public function getAsArray() {\n if($this->xmldb->xml) {\n $vals = array();\n $nodeList = $this->xmldb->xml->documentElement->childNodes;\n foreach ($nodeList as $node) {\n if (is_a($node, \"DOMElement\")) {\n #extract the child text value from each node\n $vals[] = $node->firstChild->nodeValue;\n }\n }\n \n return $vals;\n }\n }", "public function toArray(DOMNode $oDomNode = null)\n {\n if (is_null($oDomNode) && !$this->hasChildNodes()) {\n return array();\n }\n $oDomNode = (is_null($oDomNode)) ? $this->documentElement : $oDomNode;\n if (!$oDomNode->hasChildNodes()) {\n $mResult = $oDomNode->nodeValue;\n } else {\n $mResult = array();\n foreach ($oDomNode->childNodes as $oChildNode) {\n // how many of these child nodes do we have?\n // this will give us a clue as to what the result structure should be\n $oChildNodeList = $oDomNode->getElementsByTagName($oChildNode->nodeName); \n $iChildCount = 0;\n // there are x number of childs in this node that have the same tag name\n // however, we are only interested in the # of siblings with the same tag name\n foreach ($oChildNodeList as $oNode) {\n if ($oNode->parentNode->isSameNode($oChildNode->parentNode)) {\n $iChildCount++;\n }\n }\n $mValue = $this->toArray($oChildNode);\n $sKey = ($oChildNode->nodeName{0} == '#') ? 0 : $oChildNode->nodeName;\n $mValue = is_array($mValue) ? $mValue[$oChildNode->nodeName] : $mValue;\n // how many of thse child nodes do we have?\n if ($iChildCount > 1) { // more than 1 child - make numeric array\n $mResult[$sKey][] = $mValue;\n } else {\n $mResult[$sKey] = $mValue;\n }\n }\n // if the child is <foo>bar</foo>, the result will be array(bar)\n // make the result just 'bar'\n if (count($mResult) == 1 && isset($mResult[0]) && !is_array($mResult[0])) {\n $mResult = $mResult[0];\n }\n }\n // get our attributes if we have any\n $arAttributes = array();\n if ($oDomNode->hasAttributes()) {\n foreach ($oDomNode->attributes as $sAttrName=>$oAttrNode) {\n // retain namespace prefixes\n $arAttributes[\"@{$oAttrNode->nodeName}\"] = $oAttrNode->nodeValue;\n }\n }\n // check for namespace attribute - Namespaces will not show up in the attributes list\n if ($oDomNode instanceof DOMElement && $oDomNode->getAttribute('xmlns')) {\n $arAttributes[\"@xmlns\"] = $oDomNode->getAttribute('xmlns');\n }\n if (count($arAttributes)) {\n if (!is_array($mResult)) {\n $mResult = (trim($mResult)) ? array($mResult) : array();\n }\n $mResult = array_merge($mResult, $arAttributes);\n }\n $arResult = array($oDomNode->nodeName=>$mResult);\n return $arResult;\n }", "public function getChildNodesById()\n {\n if (! $this->_allChildrenKnown) {\n $this->loadChildNodes();\n }\n return $this->_childNodesById;\n }", "public function getNullNodes(\\DOMElement $node) {\n\t\t$array = [];\n\t\tforeach ($node->childNodes as $domNode) {\n\t\t\tif ($domNode instanceof \\DOMElement && $this->isNodeNull($domNode)) {\n\t\t\t\t$array[] = $domNode->nodeName;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public function getNodesByAttr(string $key, $value = true): array\n\t{\n\t\treturn $this->nodeAttrIndex->getElements($key, $value);\n\t}", "public function getElementsNodes()\n {\n if (null === $this->elementNodes) {\n $this->elementNodes = $this->fetchElementNodes();\n }\n\n return $this->elementNodes;\n }", "protected function _getChildrenByName($name)\n {\n assert(is_string($name), 'Wrong type for argument 1. String expected');\n\n $nodes = array();\n\n foreach ($this->children() as $node)\n {\n if ($node->getName() === $name) {\n $nodes[] = $node;\n }\n }\n unset($node);\n\n return $nodes;\n }", "protected function getDirectElementsByTagName($node, $element_name)\n {\n $result = array();\n\n /** @var DOMElement $element */\n foreach ($node->childNodes as $element) {\n if ($element->nodeName != $element_name) {\n continue;\n }\n\n $result[] = $element;\n }\n\n return $result;\n }", "private function getContentAsArray(\\DOMDocument $domDocument, DOMElement $node): array\n {\n $xpath = new DOMXPath($domDocument);\n $content = $this->getSlideContent($xpath, $node);\n $childItem = $this->attributeProcessor->getAttributes($content);\n $childItem['value'] = $domDocument->saveHTML($content);\n\n return $childItem;\n }", "public function get_child_nodes_recursive() {\n\t\t$nodes = array();\n\n\t\tforeach ( $this->child_nodes as $node ) {\n\t\t\t$nodes[ $node->get_code() ] = $node;\n\n\t\t\t$nodes = array_merge( $nodes, $node->get_child_nodes_recursive() );\n\t\t}\n\n\t\treturn $nodes;\n\t}", "public function getIterator()\n {\n $elements = new NodeList();\n if ($this->node->hasChildNodes()) {\n foreach ($this->node->childNodes as $node) {\n $elements[] = new Element($node);\n }\n }\n\n return $elements;\n }", "private function getButtonAsArray(\\DOMDocument $domDocument, DOMElement $node): array\n {\n $childItem = [];\n $xpath = new DOMXPath($domDocument);\n $button = $this->getSlideButton($xpath, $node);\n\n if ($button) {\n $childItem = $this->attributeProcessor->getAttributes($button);\n $childItem['value'] = $button->nodeValue;\n }\n\n return $childItem;\n }", "public function getTraversableNode($node) {\n\t\tif (!($node instanceof \\DOMElement)) {\n\t\t\tthrow new ArgumentException($node, '\\DOMElement', 1);\n\t\t}\n\t\t$array = [];\n\t\tforeach ($node->childNodes as $domNode) {\n\t\t\tif ($domNode instanceof \\DOMElement) {\n\t\t\t\tif ($domNode->hasAttribute(self::ASSOCIATIVE_KEY)) {\n\t\t\t\t\tif (array_key_exists($domNode->getAttribute(self::ASSOCIATIVE_KEY), $array)) {\n\t\t\t\t\t\tthrow new ComhonException(\"duplicated key '{$domNode->getAttribute(self::ASSOCIATIVE_KEY)}'\");\n\t\t\t\t\t}\n\t\t\t\t\t$array[$domNode->getAttribute(self::ASSOCIATIVE_KEY)] = $domNode;\n\t\t\t\t} else {\n\t\t\t\t\t$array[] = $domNode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public static function getElementsByTagName($node, $tag_name) {\n $ret = array();\n $nodes = $node->getElementsByTagName($tag_name);\n foreach ($nodes as $node) {\n if ($node instanceof DOMElement) {\n array_push($ret, $node);\n }\n }\n return $ret;\n }", "public function getChildElements() {}", "public function getAllNodes(): array\n\t{\n\t\t/** @var Node[] $nodes */\n\t\t$nodes = $this->nodeAttrIndex->getAllElements();\n\t\treturn $nodes;\n\t}", "public function getKnownChildNodes()\n {\n return $this->_childNodesById;\n }", "public function get_children() : array\n {\n return $this->children;\n }", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "public function children ($selector = null) { \r\n\t\t\r\n\t\t$l = new XDTNodeList();\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tforeach ($node->childNodes as $child) $l->add($child);\r\n\t\t\t\r\n\t\tif (!isset($selector)) return $l;\r\n\t\t\r\n\t\t$this->xml_query = $l;\r\n\t\treturn $this->select($selector, null, XDT::SELECT_FILTER);\r\n\t}", "public function values () {\r\n\t\t\r\n\t\t$values = array();\r\n\t\tforeach ($this as $node) {\r\n\t\t\t$values[] = $node->nodeValue;\r\n\t\t}\r\n\t\t\r\n\t\treturn $values;\r\n\t}", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "function dom_node_to_array( $el ) {\n $arr = array(\n 'nodeType' => null,\n 'tagName' => null,\n 'textContent' => null,\n 'attributes' => array(),\n 'children' => array(),\n );\n\n if ( $el->nodeType == XML_ELEMENT_NODE ) {\n $arr['nodeType'] = 'XML_ELEMENT_NODE';\n } else if ( $el->nodeType == XML_TEXT_NODE ) {\n $arr['nodeType'] = 'XML_TEXT_NODE';\n } else if ( $el->nodeType == XML_HTML_DOCUMENT_NODE ) {\n $arr['nodeType'] = 'XML_HTML_DOCUMENT_NODE';\n } else {\n return array();\n }\n\n if ( $el->nodeType == XML_ELEMENT_NODE ) {\n $arr['tagName'] = $el->tagName;\n }\n\n if ( $el->textContent ) {\n $arr['textContent'] = $el->textContent;\n }\n\n $attributeNodes = $el->attributes;\n\n if ( $attributeNodes ) {\n for ( $i = 0; $i < $attributeNodes->length; $i++ ) {\n $arr['attributes'][] = array(\n 'name' => $attributeNodes->item($i)->nodeName,\n 'value' => $attributeNodes->item($i)->nodeValue,\n );\n }\n }\n\n $childNodes = $el->childNodes;\n\n if ( $childNodes ) {\n for ( $i = 0; $i < $childNodes->length; $i++ ) {\n $child_arr = dom_node_to_array( $childNodes->item($i) );\n if ( $child_arr ) {\n $arr['children'][] = $child_arr;\n }\n }\n }\n\n return $arr;\n}", "private function domnode_to_array($node) {\n\t\t$output = array();\n\t\tswitch ($node->nodeType) {\n\n\t\t\tcase XML_CDATA_SECTION_NODE:\n\t\t\tcase XML_TEXT_NODE:\n\t\t\t\t$output = trim($node->textContent);\n\t\t\t\tbreak;\n\n\t\t\tcase XML_ELEMENT_NODE:\n\t\t\t\tfor ($i=0, $m=$node->childNodes->length; $i<$m; $i++) {\n\t\t\t\t\t$child = $node->childNodes->item($i);\n\t\t\t\t\t$v = $this->domnode_to_array($child);\n\t\t\t\t\tif(isset($child->tagName)) {\n\t\t\t\t\t\t$t = $child->tagName;\n\t\t\t\t\t\tif(!isset($output[$t])) {\n\t\t\t\t\t\t\t$output[$t] = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output[$t][] = $v;\n\t\t\t\t\t}\n\t\t\t\t\telseif($v || $v === '0') {\n\t\t\t\t\t\t$output = (string) $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($node->attributes->length && !is_array($output)) { //Has attributes but isn't an array\n\t\t\t\t\t$output = array('@content'=>$output); //Change output into an array.\n\t\t\t\t}\n\t\t\t\tif (is_array($output)) {\n\t\t\t\t\tif ($node->attributes->length) {\n\t\t\t\t\t\t$a = array();\n\t\t\t\t\t\tforeach($node->attributes as $attrName => $attrNode) {\n\t\t\t\t\t\t\t$a[$attrName] = (string) $attrNode->value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output['@attributes'] = $a;\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($output as $t => $v) {\n\t\t\t\t\t\tif (is_array($v) && count($v)==1 && $t!='@attributes') {\n\t\t\t\t\t\t\t$output[$t] = $v[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $output;\n\t}", "public function childNodes($idx = -1)\n {\n $nodeList = $this->getIterator();\n\n if ($idx === -1) {\n return $nodeList;\n }\n\n if (isset($nodeList[$idx])) {\n return $nodeList[$idx];\n }\n\n return null;\n }", "public function toArray(\\DOMDocument $domDocument, \\DOMElement $node) : array;", "public function getChildren(): array\n {\n return $this->children->toArray();\n }", "public function get_children();", "final public function getChildren() {\n\t\treturn array();\n\t}", "#[\\ReturnTypeWillChange]\n public function getChildren()\n {\n $element = $this->current();\n $childContext = $this->elementProcessor->processElementChildren(\n $element,\n $this->contexts[$this->contextMap[$this->key()]]\n );\n return new static($element->childNodes, $childContext, $this->elementProcessor);\n }", "function sduconnect_nodelist_get_tree($node_list) {\n $tree = [];\n foreach ($node_list as $node) {\n $childNodes = $node->childNodes;\n if (!empty($childNodes)) {\n $id = $node->getAttribute('id');\n foreach ($childNodes as $item) {\n if (!empty($item->nodeValue)) {\n $tree[$id][$item->nodeName] = $item->nodeValue;\n }\n }\n }\n }\n\n return $tree;\n}", "public function getChildren($selector = 'all') {\r\n\t\tif ($selector == 'all') return $this->children;\r\n\t\t$rslt = array();\r\n\t\t$attrs = $this->parseSelector($selector);\r\n\t\tforeach($this->children as $child) {\r\n\t\t\tif ($child->matchAttrs($attrs)) {\r\n\t\t\t\t$rslt[] = $child;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $rslt;\r\n\t}", "function &getNodesByCriterium ($criterium, $value) {\r\n $nodes = array ();\r\n $node_ctr = 0;\r\n for ($i = 0; $i < count ($this->_children); $i++) {\r\n if ($this->_children[$i]->matchesCriterium ($criterium, $value)) {\r\n $nodes[$node_ctr++] =& $this->_children[$i];\r\n }\r\n $subnodes = $this->_children[$i]->getNodesByCriterium ($criterium, $value);\r\n if (count ($subnodes)) {\r\n $subnodes_count = count ($subnodes);\r\n for ($j = 0; $j < $subnodes_count; $j++) {\r\n $nodes[$node_ctr++] =& $subnodes[$j];\r\n unset ($subnodes[$j]);\r\n }\r\n }\r\n unset ($subnodes);\r\n }\r\n return $nodes;\r\n }", "public function element_get_childs($id) {\n global $db;\n $child_nodes = $db->fetch_table(\"SELECT ID_KAT, KAT_TABLE FROM `\".$this->table.\"`\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$id.\" ORDER BY ORDER_FIELD\");\n $childs = array();\n foreach ($child_nodes as $index => $data) {\n $childs[] = $this->element_read($data[\"ID_KAT\"]);\n }\n return $childs;\n }", "public static function getChildIds($node_id = 0)\n {\n return self::findOne($node_id)->children()->column();\n }", "public function getChildren(): array;", "protected function getXmlChildren(&$node, $var, $nodeName)\n\t{\n\t\t// Iterate over the object members.\n\t\tforeach ((array) $var as $k => $v)\n\t\t{\n\t\t\tif (is_scalar($v))\n\t\t\t{\n\t\t\t\t$n = $node->addChild($nodeName, $v);\n\t\t\t\t$n->addAttribute('name', $k);\n\t\t\t\t$n->addAttribute('type', gettype($v));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$n = $node->addChild($nodeName);\n\t\t\t\t$n->addAttribute('name', $k);\n\t\t\t\t$n->addAttribute('type', gettype($v));\n\n\t\t\t\t$this->getXmlChildren($n, $v, $nodeName);\n\t\t\t}\n\t\t}\n\t}", "public function toArray() {\n\t\t$array = [];\n\t\t$sorter = function($value, $key) use(&$array) {\n\t\t\tif($value instanceof NodeList) {\n\t\t\t\t$newValue = [];\n\t\t\t\tforeach($value as $node) {\n\t\t\t\t\t$newValue[] = $node->toArray();\n\t\t\t\t}\n\t\t\t\t$value = $newValue;\n\t\t\t}\n\t\t\telseif($value instanceof Icon) {\n\t\t\t\t$value = $value->toArray();\n\t\t\t}\n\t\t\telseif($value instanceof DOMElement) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$array[$key] = $value;\n\t\t};\n\t\t\n\t\tforeach(get_object_vars($this) as $key => $value) {\n\t\t\t$sorter($value, $key);\n\t\t}\n\t\t\n\t\treturn $array;\n\t}", "public function getValue(): array\n {\n return $this->nodeValue;\n }", "public function children()\n {\n $children = $this->getAttribute('children') ?: [];\n\n if ($children && ! is_array($children) && ! ($children instanceof Collection)) {\n return (array) $children;\n }\n\n return $children;\n }", "public function getSubNodeNames();", "public function children()\n {\n return (array) $this->children;\n }", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function allChildrenElements() {\n\t\treturn $this->childrenElements()->with('allChildrenElements');\n\t}", "public function getChildNodes($path, $isWatch = false)\n {\n $arr = [];\n if ($isWatch) {\n $childrenNodes = $this->getZk()->getchildren($path, [$this, 'watch']);\n } else {\n $childrenNodes = $this->getZk()->getchildren($path);\n }\n foreach ($childrenNodes as $node) {\n $nodePath = $path . '/' . $node;\n if($isWatch) {\n if(!isset($this->watchChildList[$nodePath])) {\n $this->watchChildList[$nodePath] = true;\n }\n $arr[$node] = $this->getNodeValue($nodePath, true);\n } else {\n $arr[$node] = $this->getNodeValue($nodePath);\n }\n }\n return $arr;\n }", "function _gatherChildren($nid) {\n\t$return = array();\n\t$node =& $this->_allNodes[$nid];\n\tif (is_array ($this->_allParent[$node->id])) {\n\t\tforeach ($this->_allParent[$node->id] as $nodeZ) {\n\t\t$z =& $this->_allNodes[$nodeZ];\n\t\t// We found a child\n\t\t$this->_nodeArrayizeData($z);\n\t\t// Check for references\n\t\t$this->_makeReferences($z);\n\t\t// Merge with the big array we're returning\n\t\t// The big array being all the data of the children of our parent node\n\t\t$return = $this->_array_kmerge($return,$z->data);\n\t\t}\n\t}\n\treturn $return;\n\t}", "public function get_all(): array\n {\n return $this->nodes;\n }", "public function elements()\r\n {\r\n return array(\r\n \r\n );\r\n }", "public function children (){\n\t\treturn array();\n\t}", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "private function getCaseNodes(): array\n {\n $caseNodes = $this->xml->xpath('//testcase');\n $cases = [];\n foreach ($caseNodes as $node) {\n $caseFilename = (string) $node['file'];\n if (! isset($cases[$caseFilename])) {\n $cases[$caseFilename] = [];\n }\n\n $cases[$caseFilename][] = $node;\n }\n\n return $cases;\n }", "protected function convertChildrenToArray(): array\n {\n return $this->children()->keys();\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "public function getNodes(): array\n {\n return $this->nodes;\n }", "function sduconnect_nodelist_to_array($node_list) {\n $output = [];\n foreach ($node_list as $node) {\n $output[] = $node->nodeValue;\n }\n return $output;\n}", "public function getElementsByTagName($qualifiedName): \\DOMNodeList {\n list($prefix, $localName) = QualifiedName::split($qualifiedName);\n $namespaceURI = (string)$this->namespaces()->resolveNamespace((string)$prefix);\n if ($namespaceURI !== '') {\n return $this->getElementsByTagNameNS($namespaceURI, $localName);\n }\n return parent::getElementsByTagName($localName);\n }", "function xml_to_array()\r\n {\r\n $output=array();\r\n \r\n foreach($this->xpath_map as $key=>$value)\r\n {\r\n $output[$key]=$value['data'];\r\n }\r\n \r\n return $output;\r\n }", "public function getPostChilds($a_node_id, $a_thr_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// init childs\n\t\t$childs = array();\n\n\t\t// number of childs\n\t\t$count = 0;\n\n\t\t$res = $ilDB->queryf('\n\t\t\tSELECT * FROM frm_posts_tree,frm_posts\n\t\t\tWHERE frm_posts.pos_pk = frm_posts_tree.pos_fk\n\t\t\tAND frm_posts_tree.parent_pos = %s\n\t\t\tAND frm_posts_tree.thr_fk = %s\n\t\t\tORDER BY frm_posts_tree.lft DESC',\n\t\t\tarray('integer', 'integer'),\n\t\t\tarray($a_node_id, $a_thr_id));\n\t\t\n\t\t$count = $res->numRows();\n\n\t\tif ($count > 0)\n\t\t{\n\t\t\twhile ($row = $res->fetchRow(DB_FETCHMODE_OBJECT))\n\t\t\t{\n\t\t\t\t$childs[] = $this->fetchPostNodeData($row);\n\t\t\t}\n\n\t\t\t// mark the last child node (important for display)\n\t\t\t$childs[$count - 1][\"last\"] = true;\n\n\t\t\treturn $childs;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $childs;\n\t\t}\n\t}", "public function elements()\n {\n return [];\n }", "private function get_node_children(midgard_page $node)\n {\n $children = array();\n $mc = midgard_page::new_collector('up', $node->id);\n $mc->set_key_property('name');\n $mc->add_value_property('title');\n $mc->execute(); \n $pages = $mc->list_keys();\n foreach ($pages as $name => $array)\n {\n if (empty($name))\n {\n continue;\n }\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}{$name}/\", // FIXME: dispatcher::generate_url\n 'title' => $mc->get_subkey($name, 'title'),\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n \n if ($_MIDCOM->context->page->id == $_MIDCOM->context->host->root)\n {\n // Additional \"special\" URLs\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__snippets/\", // FIXME: dispatcher::generate_url\n 'title' => 'Code Snippets',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__styles/\", // FIXME: dispatcher::generate_url\n 'title' => 'Style Templates',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n\n return $children;\n }", "public function & getNodesByCriterium($criterium, $value)\n {\n $nodes = array();\n $node_ctr = 0;\n for ($i = 0; $i < count($this->_children); $i++) {\n if ($this->_children[$i]->matchesCriterium($criterium, $value)) {\n $nodes[$node_ctr++] =& $this->_children[$i];\n }\n $subnodes = $this->_children[$i]->getNodesByCriterium($criterium, $value);\n if (count($subnodes)) {\n $subnodes_count = count($subnodes);\n for ($j = 0; $j < $subnodes_count; $j++) {\n $nodes[$node_ctr++] =& $subnodes[$j];\n unset($subnodes[$j]);\n }\n }\n unset($subnodes);\n }\n return $nodes;\n }", "private function getChildNodeArrayStringValues($containerNode, $childNodeName, $interfacer) {\n\t\tif ($interfacer->hasValue($containerNode, $childNodeName, true)) {\n\t\t\t$existingNode = $interfacer->getValue($containerNode, $childNodeName, true);\n\t\t\t\n\t\t\t$values = $interfacer->getTraversableNode($existingNode);\n\t\t\tif ($interfacer instanceof XMLInterfacer) {\n\t\t\t\tforeach ($values as $key => $domNode) {\n\t\t\t\t\t$values[$key] = $interfacer->extractNodeText($domNode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$values = [];\n\t\t}\n\t\treturn $values;\n\t}", "public function elements()\n {\n return array(\n \n );\n }", "public function children() {\n return $this->descendants(1);\n }", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function element_get_childs_cached($id) {\n $childs = array();\n foreach ($this->cache_nodes as $id_kat => $data) {\n if ($data[\"PARENT\"] == $id) {\n $childs[] = $data;\n }\n }\n return $childs;\n }", "public function getElements(): array\n {\n return $this->elements;\n }", "public function evaluateChildNodes();", "function GetChildren($vals, &$i) {\n\t$children = array();\n\twhile (++$i < sizeof($vals)) {\n\t\tswitch ($vals[$i]['type']) {\n\t\t\tcase 'cdata':\n\t\t\t\t$children[] = $vals[$i]['value'];\n\t\t\t\tbreak;\n\t\t\tcase 'complete':\n\t\t\t\t$temp = array(\n\t\t\t\t'tag' => $vals[$i]['tag'],\n\t\t\t\t'attributes' => $vals[$i]['attributes'],\n\t\t\t\t'value' => $vals[$i]['value']\n\t\t\t\t);\n\t\t\t\t$children[] = $temp;\n\t\t\t\tbreak;\n\t\t\tcase 'open':\n\t\t\t\t$temp = array(\n\t\t\t\t'tag' => $vals[$i]['tag'],\n\t\t\t\t'attributes' => $vals[$i]['attributes'],\n\t\t\t\t'value' => $vals[$i]['value'],\n\t\t\t\t'children' => GetChildren($vals, $i)\n\t\t\t\t);\n\t\t\t\t$children[] = $temp;\n\t\t\t\tbreak;\n\t\t\tcase 'close':\n\t\t\t\treturn $children;\n\t\t}\n\t}\n}", "public function getElementsByClassName($className, $tag = \"*\", $node = null) {\n $classNames = explode('|', str_replace(' ', '', $className));\n $nodes = array();\n $domNodeList = ($node == null) ? $this->getElementsByTagName($tag) : $node->getElementsByTagName($tag);\n\n for ($i = 0; $i < $domNodeList->length; $i++) {\n /** @var DOMElement $element */\n $element = $domNodeList->item($i);\n if ($element->hasAttributes() && $element->hasAttribute('class')) {\n for ($j = 0; $j < count($classNames); $j++) {\n if ($this->hasClass($element, $classNames[$j])) {\n $nodes[] = $domNodeList->item($i);\n break;\n }\n }\n }\n }\n\n return $nodes;\n }", "public static function getDomNodeAttributeMap($domNode)\n {\n $attrMap = array();\n for($i = 0; $i < $domNode->attributes->length; $i++) {\n $domNodeAttr = $domNode->attributes->item($i);\n $attrMap[$domNodeAttr->name] = $domNodeAttr->value;\n }\n return $attrMap;\n }", "public function getNodes();", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function getElements();", "protected function getIteratorArray()\n {\n return $this->getChildren();\n }", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\n {\n return $this->_children;\n }", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function elements(): array {\n\t\treturn $this->m_elements;\n\t}", "public static function toArray( $xml ) {\n if ( is_string( $xml ) ) $xml = new SimpleXMLElement( $xml );\n $children = $xml->children();\n if ( !$children ) return (string) $xml;\n $arr = array();\n foreach ( $children as $key => $node ) {\n $node = Vsb::toArray( $node );\n\n // support for 'anon' non-associative arrays\n if ( $key == 'anon' ) $key = count( $arr );\n\n // if the node is already set, put it into an array\n if ( isset( $arr[$key] ) ) {\n if ( !is_array( $arr[$key] ) || $arr[$key][0] == null ) $arr[$key] = array( $arr[$key] );\n $arr[$key][] = $node;\n } else {\n $arr[$key] = $node;\n }\n }\n return $arr;\n }", "public function __get(string $key) {\n\tswitch($key) {\n\tcase \"nodeList\":\n\t\t$frag = $this->_dom->createDocumentFragment();\n\t\tforeach ($this->_elArray as $el) {\n\t\t\t$frag->appendChild($el->node);\n\t\t}\n\t\treturn $frag->childNodes;\n\t\tbreak;\n\n\tcase \"length\":\n\t\t$this->checkElementsInDom();\n\t\treturn count($this->_elArray);\n\t\tbreak;\n\tdefault:\n\t\tif(count($this->_elArray) < 1) {\n\t\t\t// TODO: Properly log and throw error.\n\t\t\treturn;\n\t\t}\n\n\t\treturn $this->_elArray[0]->$key;\n\t\tbreak;\n\t}\n}", "public function getDeclaredChildNodeDefinitions()\n {\n return is_null($this->declaredNodeDefinitions) ? null : $this->declaredNodeDefinitions->getArrayCopy();\n }", "public function getChildren()\n {\n $query = 'SELECT category_id FROM '. \\rex::getTablePrefix() .'d2u_machinery_categories '\n .'WHERE parent_category_id = '. $this->category_id;\n $result = \\rex_sql::factory();\n $result->setQuery($query);\n\n $children = [];\n for ($i = 0; $i < $result->getRows(); ++$i) {\n $children[] = new self((int) $result->getValue('category_id'), $this->clang_id);\n $result->next();\n }\n return $children;\n }", "protected static function getLinksArray($xmlnode)\n {\n // Distinguishes between the two \"down\" links\n // -- the children link is put into the associative array with the \"down\" index\n // -- the descendants link is put into the associative array with the \"down-tree\" index\n // These links are distinquished by the mime type attribute, but these are probably the only two links that share the same rel ..\n // so this was done as a one off\n $links = array ();\n $link_nodes = $xmlnode->getElementsByTagName(\"link\");\n foreach ($link_nodes as $ln)\n {\n if ($ln->attributes->getNamedItem(\"rel\")->nodeValue == \"down\" && $ln->attributes->getNamedItem(\"type\")->nodeValue == \"application/cmistree+xml\")\n {\n //Descendents and Childredn share same \"rel\" but different document type\n $links[\"down-tree\"] = $ln->attributes->getNamedItem(\"href\")->nodeValue;\n } else\n {\n $links[$ln->attributes->getNamedItem(\"rel\")->nodeValue] = $ln->attributes->getNamedItem(\"href\")->nodeValue;\n }\n }\n return $links;\n }", "private function GetAllNodes(){\n $tree = array();\n try {\n $db = new SQLite3('mysqlitedb.db', SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);\n $result = $db->query('SELECT * FROM tree WHERE DELETE_AT IS NULL AND PARENT_ID=0');\n if (!is_bool($result)) {\n while ($row = $result->fetchArray()) {\n $nodes = $this->GetNodesByParentId($db, $row[\"ID\"]);\n $tree[] = array(\"ID\" => $row[\"ID\"], \"NAME\" => $row[\"NAME\"], \"NODES\" => $nodes);\n }\n }\n $db->close();\n } catch (Exception $ex) {\n echo \"Exception in Tree->GetAllNodes: \" . $ex->getMessage() . \"<br/>\";\n $db->close();\n }\n return $tree;\n }", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function getTestNodes(){\n\t\treturn array($this);\n\t}" ]
[ "0.72198147", "0.6994653", "0.6620756", "0.6509508", "0.64640766", "0.64517397", "0.6415531", "0.6414451", "0.6401125", "0.63678783", "0.6261343", "0.6119103", "0.6115836", "0.6098306", "0.6059664", "0.60548955", "0.5993962", "0.59810936", "0.5962862", "0.5934852", "0.5879924", "0.5850696", "0.5845473", "0.5840928", "0.5815812", "0.5788947", "0.56951547", "0.5687148", "0.56854486", "0.56728107", "0.5656981", "0.56206", "0.5616714", "0.56053805", "0.5600723", "0.55462074", "0.5538408", "0.5521134", "0.547827", "0.5476422", "0.5475946", "0.54682714", "0.5465617", "0.5453003", "0.5390988", "0.5363836", "0.53507274", "0.53347415", "0.5329689", "0.5310159", "0.53050196", "0.52914", "0.5289114", "0.527962", "0.5254209", "0.52390265", "0.52384436", "0.5233019", "0.5221467", "0.5220444", "0.5216745", "0.5214716", "0.5213721", "0.5200916", "0.5200916", "0.5200163", "0.51956594", "0.5192432", "0.5190887", "0.51772535", "0.5130634", "0.5099704", "0.5097891", "0.5086111", "0.5081864", "0.5076612", "0.5076612", "0.507321", "0.5059376", "0.5053372", "0.50527287", "0.504768", "0.5038609", "0.50367653", "0.50353795", "0.5033466", "0.5030726", "0.5027373", "0.50169224", "0.50091887", "0.50091887", "0.5003931", "0.5001871", "0.49969324", "0.49952602", "0.4995144", "0.49844068", "0.49824926", "0.498097", "0.49787045" ]
0.6694247
2
choose first ISBN13, then EAN then ISBN10 as reference
public function getProductReference() { $allowedIdentifierTypes = [ PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN13, // 15 PONIpar\ProductSubitem\ProductIdentifier::TYPE_GTIN13, // 03 PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN10 // 02 ]; $productReference = null; // loop through the allowed identifier types and pick the first successful match foreach ($allowedIdentifierTypes as $identifierType) { if($productReference = $this->getProductIdentifier($identifierType)) { if($identifierType == PONIpar\ProductSubitem\ProductIdentifier::TYPE_ISBN10) { $productReference = self::isbn10to13($productReference); } return array((String) $productReference,$identifierType); } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isbn13Selector($isbn_id)\r\n\t{\r\n\t\tforeach($isbn_id as $iid) \r\n\t\t{\r\n\t\t\tif($iid->type=='ISBN_13')\r\n\t\t\t{\r\n\t\t\t\treturn $iid->identifier;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function isbn10to13($isbn10){\n $isbnclean = preg_replace(\"/([^d])/\", \"\",substr($isbn10,0,-1));\n\n if (strlen($isbnclean) != 9) {\n return $isbn10;\n }\n\n $isbn=\"978\".$isbnclean;\n\n $check=0;\n for ($i=0;$i<12;$i++) {\n $check+=(($i%2)*2+1)*$isbn[$i];\n }\n $check=(10-($check%10))%10;\n return \"978\".substr($isbn10,0,-1).$check;\n }", "private function findISBNwithBTRN($btrn){\n\t\t$db = $this->db;\n\n\t\t$query = \"SELECT isbn13, isbn10 FROM newstech_book WHERE bowker_title_record_number='$btrn'\";\n\t\t$successful = $result = $db->query($query);\t\t\n\t\tif (!$successful){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No ISBNs found for BTRN: %s, DB: %s\", __LINE__, $btrn, $db->error));\t\n\t\t}\n\t\treturn $result;\t//\treturn the tuples of isbn13s and isbn10s (some of these values -- for one or the other -- will be null)\n\t}", "public function getBook($isbn);", "public function loadISBN(){\n $sqlQuery = 'SELECT I.val FROM identifiers I , books B WHERE I.type=\"ISBN\" AND B.id = I.book AND B.id='.$this->id;\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['val'];\n return \"\";\n }", "public function getIsbn13()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('identifiers', $this->data) || !array_key_exists('isbn_13', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['isbn_13'][0];\n\t\t}", "public function getIdentifiersISBN() {\n $fields = array('identifiersISBN' => array(\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "public function getBookByISBN($isbn) {\n\t\t$this->xpp = new \\XMLReader();\n\t\t\n\t\tif ($this->xpp->open('http://books.google.com/books/feeds/volumes?q=' . urlencode($isbn))) {\n\t\t\t$this->moveToEntry();\n\t\t\t\n\t\t\t$found = false;\n\t\t\twhile ($this->xpp->name == \"entry\") {\n\t\t\t\t$book = $this->parseBook();\n\t\t\t\t\n\t\t\t\t// if book is found \n\t\t\t\tif (isset($book['identifier']) &&\n\t\t\t\t\t(strlen($isbn) == 10 && isset($book['identifier']['ISBN']) && $book['identifier']['ISBN'] == $isbn) || // ISBN\n\t\t\t\t\t(strlen($isbn) == 13 && isset($book['identifier']['ISBN2']) && $book['identifier']['ISBN2'] == $isbn)) // ISBN2\n\t\t\t\t{\n\t\t\t\t\t$found = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn (!isset($book) || !$found) ? null : $book;\n\t}", "public function getIsbn()\n {\n return $this->isbn;\n }", "private function findBTRN(){\n\t\t$db = $this->db;\n\t\t$isbn = $this->isbn;\n\n\t\t$btrnQuery = \"SELECT bowker_title_record_number as btrn FROM newstech_book WHERE isbn10='$isbn' OR isbn13='$isbn' \";\n \t$queryResult = $db->query($btrnQuery);\n\n if ($queryResult->num_rows == 0){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No BTRN found for isbn: %s\", __LINE__, $isbn));\n }\n\n\t\t$firstRow = $queryResult->fetch_assoc();\n $btrn = $firstRow['btrn'];\n\t\t\n\t\treturn $btrn;\n\t}", "public function getIsbn()\n {\n return $this->isbn;\n }", "public function getIsbn()\n {\n return $this->isbn;\n }", "public function getIsbn10()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('identifiers', $this->data) || !array_key_exists('isbn_10', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['isbn_10'][0];\n\t\t}", "public function getIsbn10()\n {\n return $this->isbn10;\n }", "function searchBookByISBN($books, $isbn){\n for($i=0; $i< count($books); $i++){\n if (strcmp(trim($books[$i][\"isbn\"]), trim($isbn)) == 0){\n return $books[$i];\n }\n }\n return NULL;\n}", "public function getIsbnNumber()\n {\n return $this->isbnNumber;\n }", "public function getIsbn13()\n {\n return $this->isbn13;\n }", "public function getTitle(){\n\t\treturn $this->ol[\"ISBN:\".$this->isbn][\"title\"];\t\n\t}", "public function getbookbyIsbn($isbn){\n\n\t\t\t$this->db->select('name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t->from('tbl_books')\n\t\t\t\t\t->where('ISBN', $isbn);\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() == 1){\n\t\t\t\treturn $query->row();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t\t\n\t\t}", "static final public function modifyISBN($ISBN) {\n\t\t$url= @file_get_contents('http://toolserver.org/gradzeichen/IsbnTextFormat?Bot-Modus&Text='.$ISBN);\n\t\t$temp = explode(' ',$url);\n\t\tif ($temp[0])\n\t\t{\n\t\t\treturn $temp[0];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $ISBN;\n\t\t}\n\t}", "function setISBN($book_isbn){\t\n\t\t$result = file_get_contents('http://openlibrary.org/api/books?bibkeys=ISBN:'.$book_isbn.'&format=json&jscmd=data');\n\t\t$this->ol = json_decode($result, TRUE);\t\t\t\n\t\t$this->isbn = $book_isbn;\n\t\t\n\t}", "public function isbn13(): string\n {\n $code = '97' . mt_rand(8, 9) . Helper::numerify(str_repeat('#', 9));\n\n return sprintf('%s%s', $code, Ean::checksum($code));\n }", "function booklinkp($author,$isbn,$title=\"\",$pubyear=\"\",$adddate=\"\",$float=\"left\",$type=\"t\",$size=\"s\",$top=\"0\",$bordersize=\"0\",$bordercolor=\"000000\")\n {\n $type=strtolower($type);\n if ($float==\"l\") $float=\"left\";\n if ($float==\"r\") $float=\"right\";\n if (($float==\"left\")) $marg=\"right\"; else $marg=\"left\";\n\t$title=stripcslashes($title);\n\t$title=strtolower($title);\n\t$title=nomorexs($title);\n\t$author=nomorexs($author);\n\t$title=ucwords($title);\t\n\t$temptitle =explode(\":\",$title);\n\t$author=stripcslashes($author);\n $titleplus= str_replace(' ','+',$temptitle[0]);\n\t$titleplus= str_replace('&+','',$titleplus);\n $authorplus= str_replace(' ','+',$author);\n\t$authorplus= str_replace('&+','',$authorplus);\n if ($type==\"t\") { $type=\"TI%5ETITLE\"; $keywordsplus= $titleplus; }\n elseif ($type==\"a\") { $type=\"AU%5EAUTHOR\"; $keywordsplus= $authorplus; }\n elseif ($type==\"i\") { $type=\"ISBN\"; $keywordsplus= $isbn;}\n\t\n\t\t\t\t$adyear= (int) substr($adddate,2,2);\n\t\t\t\t$admonth= (int) substr($adddate,4,2);\n\t\t\t\t$adday= (int) substr($adddate,6,2);\n\t\t\t\t$adddate = $admonth.\"/\".$adday.\"/\".$adyear;\n $datedata =\" &copy; \".$pubyear.\" (Added: \".$adddate.\")\";\n // \"&amp;pubyear=\".$pubyear.\n\techo \"<a href=\\\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\".\n\t$keywordsplus.\"%22&amp;srchfield1=\".$type.\"&amp;searchoper1=AND&amp;searchdata2=%22\"\n\t.$authorplus.\"%22&amp;srchfield2=AU%5EAUTHOR\\\">\";\n\t$filename=\"images/isbn/\".$isbn.\"S.GIF\";\n\tif (file_exists($filename)) { echo \"<img src=\\\"/\".$filename.\"\\\"\";}\n\telse echo \"<img src=\\\"http://syndetics.com/index.aspx?isbn=\".$isbn.\"/\".$size.\"C.GIF\\\"\";\n\techo \" style=\\\"border:\".$bordersize.\"px solid #\".$bordercolor.\"; float:\".$float.\"; \".$yodaexception.\" margin-\".$marg.\":3px;\";\n\tif ($top!=\"0\") echo \" margin-top:\".$top.\"px;\";\n\tif ($title==\"\") {echo \"\\\" alt=\\\"\".$author.\"\\\" title=\\\"\".$author.\"\\\"></a>\";}\n\telse {echo \"\\\" alt=\\\"\".$title.\" by \".$author.$datedata.\"\\\" title=\\\"\".$title.\" by \".$author.$datedata.\"\\\"></a>\";}\n}", "private function sanitiseISBN($isbn) {\n\t\tpreg_match('/[^\\s]+/', trim($isbn), $match);\n\t\treturn (isset($match[0])) ? $match[0] : null;\n\t}", "public function getIsbn13(): string|null;", "public function e_book()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)(.+?.+)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\tif (preg_match('/^\\(Nora Roberts\\)\"(.+?)\\.(epub|mobi|html|pdf|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Doctor Who - Target Books [128/175] - \"DW125_ Terror of the Vervoids - Pip Baker.mobi\" yEnc\n\t\tif (preg_match('/^Doctor Who - Target Books \\[\\d+\\/(\\d+\\]) - \"DW[0-9]{0,3}[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(American Curves - Summer 2012) [01/10] - \"AMECURSUM12.par2\" yEnc\n\t\tif (preg_match('/^\\(([a-zA-Z0-9 -]+)\\) \\[\\d+\\/(\\d+\\]) - \".+?' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(NordicAlbino) [01/10] - \"SWHQ_NA_675qe0033102suSmzSE.sfv\" yEnc\n\t\t//365 Sex Positions A New Way Every Day for a Steamy Erotic Year [eBook] - (1/5) \"365.Sex.Positions.A.New.Way.Every.Day.for.a.Steamy.Erotic.Year.eBook.nfo\" - yenc yEnc\n\t\tif (preg_match('/(.+)[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/8] - \"Robin Lane Fox - Travelling heroes.epub\" yEnc\n\t\t//(1/1) \"Unintended Consequences - John Ross.nzb\" - 8.67 kB - yEnc\n\t\tif (preg_match('/^[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[ Mega Dating and Sex Advice Ebooks - Tips and Tricks for Men PDF ] - \"Vatsyayana - The Kama Sutra.pdf.rar\" - (54/58) yEnc\n\t\tif (preg_match('/^[\\(\\[] .+? [\\)\\][-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}[\\(\\[]\\d+\\/(\\d+[\\)\\]])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //WWII in Photos - \"WWII in Photos_05_Conflict Spreads Around the Globe - The Atlantic.epub\" yEnc\n\t\tif (preg_match('/^(WWII in Photos)[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Various ebooks on History pdf format \"Chelsea House Publishing Discovering U.S. History Vol. 8, World War I and the Roaring Twenties - 1914-1928 (2010).pdf\" [1 of 1] yEnc\n\t\tif (preg_match('/^.+?\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}\\[\\d+ of (\\d+\\])[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //A few things - [4 of 13] \"Man From U.N.C.L.E. 08 - The Monster Wheel Affair - David McDaniel.epub\" yEnc\n\t\tif (preg_match('/.+[\\(\\[]\\d+ of \\d+[\\)\\]] \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //DDR Kochbuch 1968-wir kochen gut [1/1] - \"DDR Kochbuch 1968-wir kochen gut.pdf\" toby042002\n\t\tif (preg_match('/.+[\\(\\[]\\d+\\/\\d+[\\)\\]] - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") toby\\d+$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Pottermore UK retail - \"Harry Potter and the Goblet of Fire - J.K. Rowling.epub\" (05/14) - 907.57 kB - yEnc\n\t\tif (preg_match('/^.+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") [\\(\\[]\\d+\\/\\d+[\\)\\]] ([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"(.+?)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"(.+)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_\\s]{0,3}\\d+\\/(\\d+[-_\\s]{0,3}\".+?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //04/63 Brave New World Revisited - Aldous Huxley.mobi yEnc\n\t\tif (preg_match('/\\d+\\/\\d+[-_\\s]{0,3}(.+)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //- Campbell, F.E. - Susan - HIT 125.rar BDSM Themed Adult Erotica - M/F F/F - Rtf & Pdf\n\t\tif (preg_match('/^- (.+?)\\.(par|vol|rar|nfo)[-_\\s]{0,3}(.+)/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 03 - Colossus and The Crab.epub\" (1/3)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw)\" \\(\\d+\\/(\\d+\\))/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"D. F. Jones - 01 - Colossus.epub\" (note the space on the end)\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\" $/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[01/19] - \"13_X_Panzer_Tracts_EBook.nfo \" yEnc\n\t\tif (preg_match('/^\\[\\d*+\\/(\\d+\\]) - \"(.+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4} \"|\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[09/14] Sven Hassel - Legion of the Damned 09, Reign of Hell.mobi sven hassel as requested (1/7) yEnc\n\t\t//[1/1] Alex Berenson - John Wells 05, The Secret Soldier.mobi (space at end)\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) (.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par).+?(yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[1/1] - \"Die Kunst der Fotografie Lehrbuch und Bildband f r ambitionierte Fotografen.rar\"\n\t\t//[1/1] - \"Demonic_ How the Liberal Mob Is Endanger - Coulter, Ann.mobi\" (note space at end)\n\t\t//[1/1] - \"Paris in Love_ A Memoir - Eloisa James.mobi\" 1861K\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) - \"(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)\"( \\d+K)?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //002/240 Swordships.of.Scorpio.(Dray.Prescot).-.Alan.Burt.Akers.epub\n\t\tif (preg_match('/^\\d+\\/(\\d+)[-_\\s]{0,3}(.+?)\\.(txt|pdf|mobi|epub|azw|lit|rar|nfo|par)$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Akers Alan Burt - Dray Prescot Saga 14 - Krozair von Kregen.rar yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9. ].+?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\"|) yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function totalBooks($isbn, $con)\r\n\t{\r\n\t\t$result = mysqli_query($con, \"SELECT * from booksdb where isbn13 IN ('$isbn');\");\r\n\t\t$row = mysqli_fetch_array($result);\r\n\t\tif($row['isbn13']==$isbn)\r\n {\r\n return $row['copies'];\r\n }\r\n else \r\n {\r\n return 'N/A';\r\n }\r\n\t}", "protected function _validateIsbn($isbnArray){\n \t\n \t$j = 0;\n \t$mess1 = ' is valid!';\n \t$mess2 = ' is not valid or not ISBN!';\n \tforeach ($isbnArray as $isbn){\n \t\t//13 digits isbsn\n \t\tif (strlen($isbn) == 13){\n \t\t\t$sum = 0;\n \t\t\t$res = 0;\n \t\t\tfor ($i = 0; $i < 12; $i++){\n \t\t\t\tif ($i%2 == 0){\n \t\t\t\t\t$sum += $isbn[$i]*1;\n \t\t\t\t} else {\n \t\t\t\t\t$sum += $isbn[$i]*3;\n \t\t\t\t}\n \t\t\t$res = (10 - $sum%10)%10;\n \t\t\t}\n \t\t\tif ($res == $isbn[12]){\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess1;\n \t\t\t\t$j++;\n \t\t\t} else {\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess2;\n \t\t\t\t$j++;\n \t\t\t\t}\n \t\t}\n \t\t// 10 digits isbns\n \t\tif (strlen($isbn) == 10){\n \t\t $sum = 0;\n \t\t $res = 0;\n \t\t\tfor ($k = 0; $k < 9; $k++){\n \t\t\t\t$sum += $isbn[$k]*($k+1);\n \t\t\t}\n \t\t$res = $sum%11;\n \t\tif ((($res < 10)&&($res == $isbn[9])) ||\n \t\t\t(($res == 10) &&($isbn[9]=='X')))\n \t\t\t{\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess1;\n \t\t\t\t$j++;\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$this->_isbnInfo[$j]=$isbn.$mess2;\n \t\t\t\t$j++;\n \t\t\t}\n \t\t}\n \t}\n }", "function executeSearchByISBN($patron, $bookISBN){\n\t\t$result = $patron->searchByISBN($bookISBN);\n\t\t$res=$this->controlSearch($result);\n\t\treturn $res;\n\t}", "function isbn10checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 9){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 10){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 10;\n\t\tfor ($i = 0; $i < 10 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t//echo $value . 'x' . $multiplier . ' + ';\n\t\t\t$multiplier --;\n\t\t\tif ($multiplier === 1){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//echo ' = ' . $runningTotal;\n\t\t$remainder = $runningTotal % 11;\n\t\t$checksum = $remainder == 1 ? 'X' : 11 - $remainder;\n\t\t$checksum = $checksum == 11 ? 0 : $checksum;\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn10'] = substr($input, 0, 9) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn13'] = isbn10to13($output['isbn10']);\n\t\t}\n\t\tif ((is_numeric($inputChecksum) || $inputChecksum == 'X') && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "public function queryBookByIsbn(string $isbn, array $overrideAttributes=array())\n\t\t{\n\t\t\t$endpointUrl = 'https://openlibrary.org/api/books';\n\t\t\t\n\t\t\t// Generate URL-encoded query string\n\t\t\t// See https://openlibrary.org/dev/docs/api/books\n\t\t\t$attributes = array(\n\t\t\t\t'format' => 'json',\n\t\t\t\t'jscmd' => 'data',\n\t\t\t\t'bibkeys' => 'ISBN:'.$isbn\n\t\t\t\t);\n\t\t\t\n\t\t\t// Merge with user defined attributes\n\t\t\t$attributes = array_merge($attributes, $overrideAttributes);\n\t\t\t\n\t\t\t$queryString = http_build_query($attributes);\n\t\t\t\n\t\t\t// Fetch data\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$data = $this->cache->loadURLFromWebOrCache('openlibrary', $endpointUrl.'?'.$queryString, null, $isbn.'.json', Thrush_Cache::LIFE_IMMORTAL);\n\t\t\t\t$data = json_decode($data, true);\n\t\t\t\t\n\t\t\t\tif(array_key_exists('ISBN:'.$isbn, $data))\n\t\t\t\t\treturn new Thrush_API_OpenLibrary_Book($data['ISBN:'.$isbn]);\n\t\t\t\t\n\t\t\t\treturn new Thrush_API_OpenLibrary_Book();\n\t\t\t}\n\t\t\tcatch(Thrush_Cache_NoDataToLoadException $e)\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}", "public function ebook()\n\t{\n\t\tif (preg_match('/^New eBooks.+[ _-]{0,3}(\"|#34;)([\\w., &\\'()-]{8,}?\\b)\\.(par|vol|rar|nfo).*?(\"|#34;)/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //Rowwendees post voor u op www.nzbworld.me - [0/6] - \"Animaniacs - Lights, Camera, Action!.nzb\" yEnc (1/1)\n\t\tif (preg_match('/www.nzbworld.me - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . ' yEnc/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Tune In: The Beatles: All These Years (Mark Lewisohn) - Lewisohn, Mark - Tune In- the Beatles- All These Years, Volume 01 - [epub].rar yEnc\n\t\t//Re: REQ: Robert Edsel The Monuments Men - Edsel, Robert M - The Monuments Men- Allied Heroes, Nazi Thieves, and the Greatest Treasure Hunt in History (Retail) [epub].rar yEnc\n\t\tif (preg_match('/^Re:(Req:)? [\\w:()\\?\\' -]+ - ([\\w ,.()\\[\\]-]{8,}?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\tif (preg_match('/^\\(Nora Roberts\\)\"([\\w., &\\'()-]{8,}?\\b)\\.(epub|mobi|html|pdf|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(Zelazny works) [36/39] - \"Roger Zelazny - The Furies.mobi\" yEnc\n\t\tif (preg_match('/\\((.+works)\\) \\[\\d+\\/(\\d+\\]) - ([\\w., &\\'()-]{8,}?\\b)\\.(mobi|pdf|epub|html|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[3];\n\t\t} //(Joan D Vinge sampler) [17/17] - \"Joan D Vinge - World's End.txt\" yEnc\n\t\tif (preg_match('/^\\([a-zA-Z ]+ sampler\\) \\[\\d+(\\/\\d+\\]) - \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//New - Retail - Juvenile Fiction - \"Magic Tree House #47_ Abe Lincoln at Last! - Mary Pope Osborne & Sal Murdocca.epub\" yEnc\n\t\t//New - Retail - \"Linda Howard - Cover of Night.epub\" yEnc\n\t\t//New - Retail - \"Kylie Logan_Button Box Mystery 01 - Button Holed.epub\" yEnc\n\t\tif (preg_match('/^New - Retail -( Juvenile Fiction -)? \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //(No. 1 Ladies Detective Agency) [04/13] - \"Alexander McCall Smith - No 1-12 - The Saturday Big Tent Wedding Party.mobi\" yEnc\n\t\tif (preg_match('/^\\(No\\. 1 Ladies Detective Agency\\) \\[\\d+(\\/\\d+\\]) - \"([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//[25/33] Philip Jose Farmer - Toward the Beloved City [ss].mobi\n\t\t//[2/4] Graham Masterton - Descendant.mobi\n\t\tif (preg_match('/^\\[\\d+\\/(\\d+\\]) ([\\w., &\\'()-]{8,}?\\b)\\.(txt|pdf|mobi|epub|azw)/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//(NordicAlbino) [01/10] - \"SWHQ_NA_675qe0033102suSmzSE.sfv\" yEnc\n\t\t//365 Sex Positions A New Way Every Day for a Steamy Erotic Year [eBook] - (1/5) \"365.Sex.Positions.A.New.Way.Every.Day.for.a.Steamy.Erotic.Year.eBook.nfo\" - yenc yEnc\n\t\tif (preg_match('/(.+)[-_\\s]{0,3}[\\(\\[]\\d+\\/\\d+[\\)\\]][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e0 . '([-_\\s]{0,3}yEnc){1,2}$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //[001/125] (NL Epub Wierook Set 49) - \"Abulhawa, Susan - Litteken van David_Ochtend in Jenin.epub\" yEnc\n\t\tif (preg_match('/^\\[\\d+\\/\\d+\\] .+? - \"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\") yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/1) \"Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW.pdf\" - 162,82 MB - (Radiological Imaging of the Kidney - E. Quaia (Springer, 2011) WW) yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(1/7) \"0865779767.epub\" - 88,93 MB - \"Anatomic Basis of Neurologic Diagnosis - epub\" yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \".+(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")([-_\\s]{0,3}\\d+[.,]\\d+ [kKmMgG][bB])?[-_\\s]{0,3}\"([\\w., &\\'()-]{8,}?\\b)\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[4];\n\t\t}\n\t\t//Re: REQ: Jay Lake's Mainspring series/trilogy (see titles inside) - \"Lake, Jay - Clockwork Earth 03 - Pinion [epub].rar\" 405.6 kBytes yEnc\n\t\t//Attn: Brownian - \"del Rey, Maria - Paradise Bay (FBS).rar\" yEnc\n\t\t//New Scan \"Herbert, James - Sepulchre (html).rar\" yEnc\n\t\tif (preg_match('/^(Attn:|Re: REQ:|New Scan).+?[-_\\s]{0,3}\"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+ \\(\\d+\\/\\d+\\) \"|\\.[A-Za-z0-9]{2,4}\")[-_\\s]{0,3}(\\d+[.,]\\d+ [kKmMgG][bB](ytes)?)? yEnc$/i',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Gabaldon, Diana - Outlander [5] The Fiery Cross.epub\" yEnc\n\t\t//Kiny Friedman \"Friedman, Kinky - Prisoner of Vandam Street_ A Novel, The.epub\" yEnc\n\t\tif (preg_match('/.*\"([\\w., &\\'()-]{8,}?\\b)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Patterson flood - Mobi - 15/45 \"James Patterson - AC 13 - Double Cross.mobi\"\n\t\tif (preg_match('/(.+?)[-_ ]{0,4}\\d+\\/\\d+[-_\\s]{0,3}([\\w. &\\'()\\[\\]-]{8,}?\\b.?)\\.(txt|pdf|mobi|epub|azw)\"( \\(\\d+\\/\\d+\\))?( )?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t} //--- Michael Dobbs - House of Cards.mobi yEnc\n\t\tif (preg_match('/^--- ([\\w., &\\'()-]{8,}?\\b)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //'Steel's Edge - Ilona Andrews.epub' yEnc\n\t\tif (preg_match('/^\\'([\\w. &\\'()\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})\\'[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //[1 of 1] - Howard Gordon - Gideon's War & Hard Target.epub yEnc\n\t\tif (preg_match('/^\\[\\d+ of \\d+\\][-_\\s]{0,3}([\\w. &\\'()\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //1 Playboy-Ausgabe vom Jnner 1953 [RARITT].rar yEnc\n\t\tif (preg_match('/^([\\w. &\\'\\[\\]-]{8,}?\\b.?)([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar|\\.7z)?(\\d{1,3}\\.rev|\\.vol.+?|\\.[A-Za-z0-9]{2,4})[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Re: Req: Please, does anyone have Scott Berg's Wilson biography? MTIA... - A. Scott Berg - Wilson.epub yEnc\n\t\tif (preg_match('/^.+ - ([^.]{8,})\\.[A-Za-z0-9]{2,4}[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //REQ: \"Keep it Pithy\" by Bill O'Reilly \"Keep It Pithy - Bill O'Reilly.epub\"yEnc\n\t\tif (preg_match('/.*\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)\\.[A-Za-z0-9]{2,4}\"[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //For Your Eyes Only - Ian Fleming.epub - answering my own request yEnc\n\t\tif (preg_match('/^([^.]{8,})\\.[A-Za-z0-9]{2,4}.+[-_\\s]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function isbn10(): string\n {\n $code = Helper::numerify(str_repeat('#', 9));\n\n return sprintf('%s%s', $code, Isbn::checksum($code));\n }", "function isbn13checker($input, $convert = FALSE){\n\t$output = FALSE;\n\tif (strlen($input) < 12){\n\t\t$output = array('error'=>'ISBN too short.');\n\t}\n\tif (strlen($input) > 13){\n\t\t$output = array('error'=>'ISBN too long.');\n\t}\n\tif (!$output){\n\t\t$runningTotal = 0;\n\t\t$r = 1;\n\t\t$multiplier = 1;\n\t\tfor ($i = 0; $i < 13 ; $i++){\n\t\t\t$nums[$r] = substr($input, $i, 1);\n\t\t\t$r++;\n\t\t}\n\t\t$inputChecksum = array_pop($nums);\n\t\tforeach($nums as $key => $value){\n\t\t\t$runningTotal += $value * $multiplier;\n\t\t\t$multiplier = $multiplier == 3 ? 1 : 3;\n\t\t}\n\t\t$div = $runningTotal / 10;\n\t\t$remainder = $runningTotal % 10;\n\n\t\t$checksum = $remainder == 0 ? 0 : 10 - substr($div, -1);\n\n\t\t$output = array('checksum'=>$checksum);\n\t\t$output['isbn13'] = substr($input, 0, 12) . $checksum;\n\t\tif ($convert){\n\t\t\t$output['isbn10'] = isbn13to10($output['isbn13']);\n\t\t}\n\t\tif (is_numeric($inputChecksum) && $inputChecksum != $checksum){\n\t\t\t$output['error'] = 'Input checksum digit incorrect: ISBN not valid';\n\t\t\t$output['input_checksum'] = $inputChecksum;\n\t\t}\n\t}\n\treturn $output;\n}", "function booklink($term,$type,$custom=\"\"){\n$texturl=\"http://cat.mfrl.org/uhtbin/cgisirsi.exe/0/CBURG/0/5?searchdata1=%22\";\n$esc_term=str_replace(\" \", \"+\", $term);\n$esc_term= str_replace('&+','',$esc_term);\n$texturl.=$esc_term.\"%22&amp;srchfield1=\";\nif($type==\"t\") $texturl.=\"TI%5ETITLE\";\nif($type==\"texact\") $texturl.=\"TI%5ETITLE&amp;match_on=EXACT\";\nif($type==\"a\") $texturl.=\"AU%5EAUTHOR\";\nif($type==\"i\") $texturl.=\"ISBN\";\nif($type==\"s\") $texturl.=\"GENERAL%5ESUBJECT\";\nif($custom==\"\")$custom=$term;\nif(($type==\"t\")||($type==\"texact\")) $custom=\"<i>\".$custom.\"</i>\";\necho \"<a href=\\\"\".$texturl.\"\\\">\".$custom.\"</a>\";\n\n}", "public function getBookByISBN(Request $request) {\n\n $request->validate([\n 'isbn' => 'required'\n ]);\n\n $isbn = $request->isbn;\n\n $book = Libro::where('isbn', $isbn)->get();\n return $book;\n }", "public function convert10to13($isbn10)\n {\n $isbn13 = '978' . substr($isbn10, 0, 9);\n $sum = 0;\n for ($i = 0; $i < 12; $i ++) {\n if ($i % 2 == 0) {\n $sum += $isbn13{$i};\n } else {\n $sum += 3 * $isbn13{$i};\n }\n }\n $checksum = 10 - ($sum % 10);\n if ($checksum == 10) {\n $checksum = '0';\n }\n $isbn13 = $isbn13 . $checksum;\n\n $this->_isbn13 = $isbn13;\n return $this->_isbn13;\n }", "private function getAmazonTitleAuthor($isbn){\n\t\t$searchIndex = 'Books';\n\t\t$responseGroup = 'ItemAttributes';\n\n\t\t$params = array(\n\t\t\t'IdType'\t=>\t'ISBN',\n\t\t\t'ItemId' \t=>\t(string)$isbn, \n\t\t);\n\n\t\t$lookupObject = new AmazonSearch($searchIndex, $params, $responseGroup, SearchType::ITEM_LOOKUP); // Create a new AmazonSearch\n\t\t$attempt = $lookupObject->execute(); // Execute the object to make the api call and pull results\n\n\t\tif ($attempt == false){\n\t\t return false; // If the search could not be performed, the object returns false.\n\t\t}\n\t\t$firstMatchedItem = $lookupObject->get_item_data(1); // Returns an associative array of information about the first results amazon returned\n\t\t$itemAttributes = $firstMatchedItem['attributes'];\n\t\tif (!array_key_exists('Title', $itemAttributes) || !array_key_exists('Author', $itemAttributes)){\n\t \t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No Title/Author found from Amazon for ISBN: %s\\nAmazon API Call:\\t%s\",\n __LINE__, \n $isbn, \n $lookupObject->get_api_url()\n )); \n\t\t}\n\t\t$title = $itemAttributes['Title']; \t// Get the Title\n\t\t$author = $itemAttributes['Author'];\t\t// \tGet the Author\n\n\t\t$toReturn = array(\n\t\t\t'title' \t=> \t$title,\n\t\t\t'author' \t=> \t$author\n\t\t);\n\n\t\treturn $toReturn;\n\t}", "public function getISBN(): ?string\n {\n return isset($this->ISBN) ? $this->ISBN : null;\n }", "public function getDefaultIsbn13(): string|null;", "public function getSubTitle(){\n\t\treturn $this->ol[\"ISBN:\".$this->isbn][\"subtitle\"];\t\n\t}", "public function getPublisherName(){\n\t\t//@TODO This doesnt work yet - fix it.\n\t\tReturn $this->ol[\"ISBN:\".$this->isbn][\"publishers\"][0][\"name\"];\t\n\t}", "public function getBookDetails($isbnnumber = NULL){\n\n define(\"API_KEY\",\"AIzaSyBWoCaww-UoB3VbN4QeCV2ESqqD5sD8PTA\");\n define(\"URL\", \"https://www.googleapis.com/books/v1/volumes?q=isbn:\");\n $details=array();\n $imageAvailable = false;\n $image=\"img/125x125.jpg\";\n $error=\"\";\n $description=base64_encode(\"No description available\");\n $publisher=\"No publisher available\";\n $isbn=trim($isbnnumber);\n if(!isset($isbn)||$isbn ==\"\")\n {\n $error=\"Please enter the 10 or 13 digit ISBN number located at the back of the book\";\n $valid = false;\n }\n else\n {\n $isbn= str_replace('-', '', $isbn); \n if(!is_numeric($isbn))\n {\n $error=\"ISBN number should be numeric. You entered \".$isbn.\" is not numeric\";\n $valid = false;\n } \n elseif(strlen($isbn)==13 && $isbn[0]!='9')\n {\n $error=\"ISBN should start with 978..Please review the ISBN entered and try again..\";\n $valid = false;\n } \n elseif (!(strlen($isbn)==10 || strlen($isbn)==13))\n {\n $error=\"ISBN should be atleast 10 or 13 digits...You entered only \".strlen($isbn).\" digits\";\n $valid= false;\n } \n \n }\n if(strlen($error)==\"\")\n {\n $url=URL.$isbn;\n //print_r($url);\n $bookDetails = @file_get_contents($url);\n $bookDetailsArray=json_decode($bookDetails, true);\n $totalItem=$bookDetailsArray['totalItems'];\n // print_r($bookDetailsArray);\n if($totalItem==1)\n {\n if(array_key_exists('imageLinks',$bookDetailsArray['items'][0]['volumeInfo'] ))$imageAvailable=true;\n $title= $bookDetailsArray['items'][0]['volumeInfo']['title'];\n $authors= @implode(\",\", $bookDetailsArray['items'][0]['volumeInfo']['authors']); \n\n if($imageAvailable)\n {\n $image=$bookDetailsArray['items'][0]['volumeInfo']['imageLinks']['smallThumbnail'];\n \n $description=$bookDetailsArray['items'][0]['volumeInfo']['description'];\n $publisher=$bookDetailsArray['items'][0]['volumeInfo']['publisher'];\n }\n $publishedDate=$bookDetailsArray['items'][0]['volumeInfo']['publishedDate']; \n $identifier=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][1]['identifier'];\n $identifierTen=$bookDetailsArray['items'][0]['volumeInfo']['industryIdentifiers'][0]['identifier'];\n // $categories=@implode(\",\",$bookDetailsArray['items'][0]['volumeInfo']['categories']);\n // Categories Add in DB and Return IDs\n $cat_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['categories'] as $value) {\n $result = ($this->books_model->batchAddCat($value));\n $cat_array = json_decode(json_encode($result), True);\n $cat_arr[] = $cat_array['id'];\n }\n $cat_arr = implode(',', $cat_arr);\n\n // Authors Add in DB and Return IDs\n $aut_arr = array();\n foreach ($bookDetailsArray['items'][0]['volumeInfo']['authors'] as $value) {\n $result = ($this->books_model->batchAddAuthors($value));\n $aut_array = json_decode(json_encode($result), True);\n $aut_arr[] = $aut_array['id'];\n }\n $aut_arr = implode(',', $aut_arr);\n\n\n $details['category_name'] = $cat_arr;\n $details['author_name'] = $aut_arr;\n $details['book_title'] = $title;\n $details['image'] = $image;\n $details['description'] = $description;\n $details['book_pub'] = $publisher;\n $details['isbn_13'] = $identifier;\n $details['isbn'] = $identifierTen;\n $details['copyright_year'] = $publishedDate;\n \n $valid = true;\n }\n else\n {\n $error=\"No book found for entered ISBN\";\n $valid = false;\n }\n }\n $this->data['categories'] = $this->books_model->getAllCategories();\n $this->data['authors'] = $this->books_model->getAllAuthors();\n $this->data['book_details'] = $details;\n\n $this->mPageTitle = \"Add Book\";\n\n \n $this->render('books/edit');\n }", "public function getIsbn_issn()\n {\n return $this->isbn_issn;\n }", "public function getByISBN(string $isbn): string\n {\n $subscription = $this->subscription;\n $this->subscription = null;\n $response = $this->apiClient->get(self::PATH . '/' . $isbn);\n $this->subscription = $subscription;\n \n return (string) $response->getBody();\n }", "private function getAmazonISBN($title, $author){\n\t\t$searchIndex = 'Books';\n\t\t$responseGroup = 'ItemAttributes';\t\t\n\n\t\t$params = array(\n\t\t'Title'=>$title,\n\t\t'Author'=>$author\n\t\t);\n\n\t\t$lookupObject = new AmazonSearch($searchIndex, $params, $responseGroup, SearchType::ITEM_SEARCH);\t//\tCreate a new AmazonSearch\n\t\t$attempt = $lookupObject->execute();\t\t\t\t\t\t\t\t\t\t//\tExecute the object to make the api call and pull results\n\n\t\tif ($attempt == false){\n\t\t\treturn false;\t//\tIf the search could not be performed, the object returns false.\n\t\t}\n\t\t$firstMatchedItem = $lookupObject->get_item_data(1);\t\t//\tReturns an associative array of information about the first results amazon returned\n\t\t$isbn = $firstMatchedItem['attributes']['ISBN'];\t\t\t//\tGet the ISBN\n\t\tif (strlen($isbn)==0){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No ISBN found from Amazon for Title: %s, Author: %s\\nAmazon API Call:\\t%s\", \n\t\t\t\t__LINE__, \n\t\t\t\t$title, \n\t\t\t\t$author, \n\t\t\t\t$lookupObject->get_api_url()\n\t\t\t));\n\t\t}\n\n\t\treturn $isbn;\n\t}", "public function processBooks()\n\t{\n\t\tif ($this->site->lookupbooks !== '0') {\n\t\t\t$books = new Books($this->echooutput);\n\t\t\t$books->processBookReleases();\n\t\t}\n\t}", "function getISBN($conn,$title) {\n $real_title = mysqli_real_escape_string($conn, $title);\n $ISBN = \"SELECT ISBN FROM audio_book WHERE title = '$real_title'\";\n $result = mysqli_query($conn, $ISBN);\n if(mysqli_num_rows($result) > 0) {\n return $result;\n } else {\n echo 'Nothing ISBN<br>';\n exit;\n }\n }", "function search_textbook_range($db, $title, $isbn, $author, $numstart, $numresults)\n{\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \n\t\t\t\t\t\t\".$titlekey.\" LIKE :title and \".$isbnkey.\" LIKE :isbn and \n\t\t\t\t\t\t\".$authorkey.\" LIKE :author and removed=0\n\t\t\t\t\t\tORDER BY date_time DESC LIMIT $numstart, $numresults\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "public static function firstPageBooks() {\n //but later on (when we have more books in the database), this method wants some\n //subset of books (like every books that start with \"s\", or most favourite books or books selected by admin or...)\n\n $books = Book::all();\n// self::sort_books($books);\n View::make('general/firstpage.html', array('books' => $books));\n }", "public function setIsbn($isbn)\n {\n $this->isbn = $isbn;\n\n }", "function getAuthorBooks($conn,$first_name, $last_name) {\n $author_books = \"SELECT title FROM audio_book INNER JOIN writes ON audio_book.ISBN = writes.ISBN AND writes.author_id IN (\n SELECT author_id FROM author WHERE first_name = '$first_name' AND last_name = '$last_name')\";\n $result = mysqli_query($conn, $author_books);\n if(mysqli_num_rows($result) > 0) {\n return $result;\n } else {\n echo 'Nothing author books<br>';\n exit;\n }\n }", "public function getCorporateAuthor()\n {\n // Try 110 first -- if none found, try 710 next.\n $main = $this->getFirstFieldValue('110', ['a', 'b']);\n if (!empty($main)) {\n return $main;\n }\n return $this->getFirstFieldValue('710', ['a', 'b']);\n }", "public function getEx15() {\n $books = Book::all();\n $this->printBooks($books);\n\t}", "function printBookInfo($titleValue, $authorsValue, $isbnValue, $priceValue,\n $currencyValue) {\n print \"<tr>\";\n print \"<td><a href=\\\"display_description.php?isbn=$isbnValue\\\">$titleValue</a></td>\";\n print\"<td>\";\n $cnt = (count($authorsValue)-1);\n for($j=0; $j<$cnt; $j++){\n if($j != 0){\n print \",\";\n }\n print \" $authorsValue[$j] \";\n }\n print \"</td>\";\n print \"<td>$isbnValue</td>\";\n print \"<td>$priceValue $currencyValue</td>\";\n print\"</tr>\"; \n return null; \n}", "function outputBooks() {\n $db = connectDB();\n $books = new BooksGateway($db);\n $sql = $books->getSelectStatement();\n // Subcategory filter\n if (!empty($_GET['subcategory']) && empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"';\n }\n // Imprint filter\n elseif(empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where Imprint =\"' . $_GET['imprint']. '\"';\n }\n // Both filter\n elseif(!empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"' . 'AND'.'Imprint =\"' . $_GET['imprint']. '\"';\n }\n // No filter\n else {\n // Print all books.\n }\n $sql .= ' group by Title order by Title ASC limit 0,20';\n $result = $books->getStatement($sql);\n //var_dump($result);\n foreach($result as $key => $value) {\n $img= '<img src=\"book-images/thumb/'.$result[$key]['ISBN10']. '.jpg\" alt=\"book\">';\n echo constructBookLink($result[$key]['ISBN10'], $img) .'<br/>';\n echo '<a href=\"single-book.php?ISBN10=' . $result[$key]['ISBN10'] . '\" class=\"';\n if (isset($_GET['ISBN10']) && $_GET['ISBN10'] == $result[$key]['ISBN10']) echo 'active';\n echo 'item\">';\n echo $result[$key]['Title'] . '</a><br/>'; \n echo '<p>';\n echo \"<span>Year: </span>\". $result[$key]['CopyrightYear'] . \"<br/>\";\n echo \"<span>Subcategory Name: </span>\". $result[$key]['SubcategoryName'] . \"<br/>\";\n echo \"<span>Imprint Name: </span>\". $result[$key]['Imprint']. \"<br/>\";\n echo '</P><br/>';\n }\n }", "function boj_sc3_amazon( $attr, $content ) {\n \n // Get ISBN or set default\n if( isset( $attr['isbn'] ) ) {\n $isbn = preg_replace( '/[^\\d]/', '', $attr['isbn'] );\n } else {\n $isbn = '0470560541';\n }\n \n // Sanitize content, or set default\n if( !empty( $content ) ) {\n $content = esc_html( $content );\n } else {\n if( $isbn == '0470560541' ) {\n $content = 'Professional WordPress';\n } else {\n $content = 'this book';\n }\n }\n \n return \"<a href='http://www.amazon.com/dp/$isbn'>$content</a>\";\n}", "public function get_book();", "protected function _extractIsbn($csvArray){\n \t\n \t $isbnArray = Array();\n \t $c = 0;\n \t foreach ($csvArray as $rows){\n \t \tforeach ($rows as $cell){\n \t \t\t$val=str_replace('-','',trim($cell));\n \t \t\t\tif ((is_numeric($val)&&(strlen($val) == 13))||\n \t \t\t\t\t(strlen($val) == 10)&&(is_numeric(substr($val, 0, 9)))){\n \t \t\t\t\t\t$isbnArray[$c]=$val;\n \t \t\t\t\t\t$c++;\n \t \t\t}\n \t }\n }\n return $isbnArray;\n }", "public function getOpenLibraryID(){\n\t\tReturn $this->ol[\"ISBN:\".$this->isbn][\"identifiers\"][\"openlibrary\"][0];\n\t}", "function rentBook($isbn, $student, $con) \r\n\t{\r\n\t\tmysqli_query($con,\"\r\n\t\t\tUPDATE booksdb\r\n\t\t\tSET rented = rented - 1\r\n\t\t\tWHERE isbn13 like '%{$isbn}%;'\r\n\t\t\");\r\n\t\t// Add user and student id functionality here\r\n\t\t// Also required updation of the rent date\r\n\t}", "public function setIsbn($isbn)\n {\n $this->isbn = $isbn;\n\n return $this;\n }", "function __construct(Isbn $isbnChecker) { \n $this->isbnCheker = $isbnChecker; \n $this->correctIsbns = [];\n $this->wrongIsbns = [];\n }", "public function setISBN(?string $iSBN = null): self\n {\n // validation for constraint: string\n if (!is_null($iSBN) && !is_string($iSBN)) {\n throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iSBN, true), gettype($iSBN)), __LINE__);\n }\n if (is_null($iSBN) || (is_array($iSBN) && empty($iSBN))) {\n unset($this->ISBN);\n } else {\n $this->ISBN = $iSBN;\n }\n \n return $this;\n }", "public function getEx11() {\n $books = \\App\\Book::orderBy('title','asc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `title` asc\n }", "function search_textbooks($db, $title, $isbn, $author)\n{\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \n\t\t\t\t\t\t\".$titlekey.\" LIKE :title and \".$isbnkey.\" LIKE :isbn and \n\t\t\t\t\t\t\".$authorkey.\" LIKE :author and removed=0\n\t\t\t\t\t\tORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "function ifAvailable($isbn,$con)\r\n\t{\r\n\t\t$result = mysqli_query($con, \"SELECT * from booksdb where isbn13 IN ('$isbn');\");\r\n\t\t$row = mysqli_fetch_array($result);\r\n\t\tif($row['copies'] == $row['rented'])\r\n\t\t{\r\n\t\t\treturn \"0\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$available = $row['copies'] - $row['rented'];\r\n\t\t\treturn $available;\r\n\t\t}\r\n\t}", "public function getEx10() {\n $books = \\App\\Book::where('published','>',1950)->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` where `published` > '1950'\n }", "public function e_book_german()\n\t{\n\t\tif (preg_match('/^.+\\(eBook\\).+?\\[\\d+\\/\\d+\\] - \"(.+?)' . $this->e2,\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//ATTN: falsifies RE: REQ:-Pathfinder RPG anything at all TIA [362/408] - \"Pathfinder_-_PZO1110B_-_Pathfinder_RPG_-_Beta_Playtest_-_Prestige_Enhancement.pdf\" yEnc\n\t\tif (preg_match('/^.+?\\[\\d+\\/(\\d+\\]) - \"(.+?)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[2];\n\t\t}\n\t\t//\"Abe, Shana - Der träumende Diamant 2 - Erdmagie.epub\" yEnc\n\t\tif (preg_match('/^\"(.+?)\\.(txt|pdf|mobi|epub|azw)\" yEnc$/',\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//(1/1) \"B rse Online - No 30 2013.pdf\" - 4,03 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\) \"(.+?)\\.(txt|pdf|mobi|epub|azw)\"[-_\\s]{0,3}\\d+([.,]\\d+)? [kKmMgG][bB][-_\\s]{0,3}[-_\\s]{0,3}yEnc$/ui',\n\t\t\t$this->subject,\n\t\t\t$match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "function constructBookLink($id, $label) {\n $link = '<a href=\"single-book.php?ISBN10=' . $id . '\">';\n $link .=$label;\n $link .='</a>';\n return $link;\n}", "function getBookInsight($isbn, $con)\r\n\t{\r\n\t\t$output = array();\r\n\t\t$query = \"SELECT st_name, due_date FROM rent, studentdb\r\n\t\t\tWHERE rent.isbn13 = $isbn\r\n\t\t\tAND rent.st_id = studentdb.st_id;\r\n\t\t\";\r\n\t\t$result = mysqli_query($con, $query);\r\n\t\twhile($row=mysqli_fetch_array($result))\r\n\t\t{\r\n\t\t\tarray_push($output, array(\r\n\t\t\t\t\"st_name\" => $row['st_name'],\r\n\t\t\t\t\"due_date\" => $row['due_date']\t\r\n\t\t\t));\t\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "function b_code($code){\n \t$re = new DbManager();\n \t$book = $re -> code_book($code);\n \treturn $book ;\n }", "public function getEx12() {\n $books = \\App\\Book::orderBy('published','desc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `published` desc\n\t}", "public function getAuthor($index = 0);", "function GetJournalByISSN($issn) {\n // mysql_pconnect removed (lib)\n\n if (preg_match (\"/(\\d\\d\\d\\d)(\\d\\d\\d.)/\", $issn, $matches)) {\n $issn = \"$matches[1]-$matches[2]\";\n }\n $result = mysql_query (\"SELECT title FROM phil WHERE issn = '$issn'\",$db);\n\n while ($myrow = mysql_fetch_row($result)) {\n $title = $myrow[0];\n }\n return \"$title\";\n}", "public function addBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$ISBN = $_POST['ISBN'];\n\t\t\t$title = $_POST['title'];\n\t\t\t$author = $_POST['author'];\n\t\t\t$press = $_POST['press'];\n\t\t\t$category = $_POST['category'];\n\t\t\t$pub_date = $_POST['pub_date'];\n\t\t\t$price = $_POST['price'];\n\t\t\t$floor = $_POST['floor'];\n\t\t\t$bookshelf = $_POST['bookshelf'];\n\t\t\t$area_code = $_POST['area_code'];\n\t\t\t$number = $_POST['number'];\n\t\t\t$book = D('Book_species');\n\t\t\t$sql1 = \"select count(*) as a from lib_book_unique\";\n\t\t\t$return23 = $book->query($sql1);\n\t\t\t$num = $return23[0]['a'];\n\t\t\t$newbookid = array();\n\t\t\tfor ($k = 1; $k <= $number; $k++) {\n\t\t\t\t$numnew = $k + $num;\n\t\t\t\t$temp_num = 100000;\n\t\t\t\t$new_num = $numnew + $temp_num;\n\t\t\t\tarray_push($newbookid, substr($new_num, 1, 5));\n\t\t\t}\n\t\t\t$sql2333 = \"select * from lib_book_species where isbn = '{$ISBN}';\";\n\t\t\t$return2333 = $book->query($sql2333);\n\t\t\t$sql = \"insert into lib_book_species(isbn,title,author,press,\n\t\t\t\t\tcategory,pub_date,price,floor,bookshelf,area_code) \n\t\t\t\t\tvalues('{$ISBN}','{$title}','{$author}',\n\t\t\t\t\t'{$press}','{$category}','{$pub_date}',\n\t\t\t\t\t'{$price}','{$floor}','{$bookshelf}','{$area_code}');\";\n\t\t\tif(!$return2333){\n\t\t\t\t$return = $book->execute($sql);\n\t\t\t}\n\t\t\t$return = true;\n\t\t\t$sql1 = \"insert into lib_book_unique(isbn) values('{$ISBN}');\";\n\t\t\tfor ($i = 0; $i < $number; $i++) {\n\t\t\t\t$return1 = $book->execute($sql1);\n\t\t\t\t$return = $return && $return1;\n\t\t\t}\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'msg' => 'Add successfully!',\n\t\t\t\t\t'newbookid' => json_encode($newbookid)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "function obtenerCampo($ISBN, $campo){\n $conexion_bd = conectDB();\n\n $consultar = \"SELECT $campo FROM Libros WHERE ISBN='$ISBN'\";\n $resultados = $conexion_bd->query($consultar);\n while ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n closeDB($conexion_bd);\n return $row[\"$campo\"];\n }\n\n closeDB($conexion_bd);\n return 0;\n }", "public function scrape_bib($bnum, $skip_cover = FALSE) {\n\n $iii_server_info = self::iii_server_info();\n\n $bnum = trim($bnum);\n\n $xrecord = @simplexml_load_file($iii_server_info['nosslurl'] . '/xrecord=b' . $bnum);\n\n // If there is no record, return false (weeded or non-existent)\n if ($xrecord->NULLRECORD) {\n return FALSE;\n }\n if ($xrecord->VARFLD) {\n if (!$xrecord->VARFLD[0]->MARCINFO) {\n return FALSE;\n }\n } else {\n return 'skip';\n }\n\n $bib_info_record = $xrecord->RECORDINFO;\n $bib_info_local = $xrecord->TYPEINFO->BIBLIOGRAPHIC->FIXFLD;\n $bib_info_marc = self::parse_marc_subfields($xrecord->VARFLD);\n unset($xrecord);\n\n // Process record information\n $bib['bnum'] = $bnum;\n $bib['bib_created'] = self::fixdate($bib_info_record->CREATEDATE);\n $bib['bib_lastupdate'] = self::fixdate($bib_info_record->LASTUPDATEDATE);\n $bib['bib_prevupdate'] = self::fixdate($bib_info_record->PREVUPDATEDATE);\n $bib['bib_revs'] = (int) $bib_info_record->REVISIONS;\n\n // Process local record data\n foreach ($bib_info_local as $bil_obj) {\n switch (trim($bil_obj->FIXLABEL)) {\n case 'LANG':\n $bib['lang'] = trim($bil_obj->FIXVALUE);\n break;\n case 'LOCATION':\n $bib['loc_code'] = trim($bil_obj->FIXVALUE);\n break;\n case 'MAT TYPE':\n $bib['mat_code'] = trim($bil_obj->FIXVALUE);\n break;\n case 'BCODE3':\n $bib['suppress'] = in_array(trim($bil_obj->FIXVALUE), locum::csv_parser($this->locum_config['ils_custom_config']['suppress_codes'])) ? 1 : 0;\n break;\n\n }\n }\n\n // Process MARC fields\n\n // Process Author information\n $bib['author'] = '';\n $author_arr = self::prepare_marc_values($bib_info_marc['100'], array('a','b','c','d'));\n $bib['author'] = $author_arr[0];\n\n // In no author info, we'll go for the 110 field\n if (!$bib['author']) {\n $author_110 = self::prepare_marc_values($bib_info_marc['110'], array('a'));\n $bib['author'] = $author_110[0];\n }\n\n // Additional author information\n $bib['addl_author'] = '';\n $addl_author = self::prepare_marc_values($bib_info_marc['700'], array('a','b','c','d'));\n if (is_array($addl_author)) {\n $bib['addl_author'] = serialize($addl_author);\n }\n\n // In no additional author info, we'll go for the 710 field\n if (!$bib['addl_author']) {\n $author_710 = self::prepare_marc_values($bib_info_marc['710'], array('a'));\n if (is_array($author_710)) {\n $bib['addl_author'] = serialize($author_710);\n }\n }\n\n // Title information\n $bib['title'] = '';\n $title = self::prepare_marc_values($bib_info_marc['245'], array('a','b'));\n if (substr($title[0], -1) == '/') { $title[0] = trim(substr($title[0], 0, -1)); }\n $bib['title'] = trim($title[0]);\n\n // Title medium information\n $bib['title_medium'] = '';\n $title_medium = self::prepare_marc_values($bib_info_marc['245'], array('h'));\n if ($title_medium[0]) {\n if (preg_match('/\\[(.*?)\\]/', $title_medium[0], $medium_match)) {\n $bib['title_medium'] = $medium_match[1];\n }\n }\n\n // Edition information\n $bib['edition'] = '';\n $edition = self::prepare_marc_values($bib_info_marc['250'], array('a'));\n $bib['edition'] = trim($edition[0]);\n\n // Series information\n $bib['series'] = '';\n $series = self::prepare_marc_values($bib_info_marc['490'], array('a','v'));\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['440'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['400'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['410'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['730'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['800'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['810'], array('a','v')); }\n if (!$series[0]) { $series = self::prepare_marc_values($bib_info_marc['830'], array('a','v')); }\n $bib['series'] = $series[0];\n\n // Call number\n $callnum = '';\n $callnum_arr = self::prepare_marc_values($bib_info_marc['099'], array('a'));\n if (is_array($callnum_arr) && count($callnum_arr)) {\n foreach ($callnum_arr as $cn_sub) {\n $callnum .= $cn_sub . ' ';\n }\n }\n $bib['callnum'] = trim($callnum);\n\n // Publication information\n $bib['pub_info'] = '';\n $pub_info = self::prepare_marc_values($bib_info_marc['260'], array('a','b','c'));\n $bib['pub_info'] = $pub_info[0];\n\n // Publication year\n $bib['pub_year'] = '';\n $pub_year = self::prepare_marc_values($bib_info_marc['260'], array('c'));\n $c_arr = explode(',', $pub_year[0]);\n $c_key = count($c_arr) - 1;\n $bib['pub_year'] = substr(ereg_replace(\"[^0-9]\", '', $c_arr[$c_key]), -4);\n\n // ISBN / Std. number\n $bib['stdnum'] = '';\n $stdnum = self::prepare_marc_values($bib_info_marc['020'], array('a'));\n $bib['stdnum'] = $stdnum[0];\n\n // UPC\n $bib['upc'] = '';\n $upc = self::prepare_marc_values($bib_info_marc['024'], array('a'));\n $bib['upc'] = $upc[0];\n if($bib['upc'] == '') { $bib['upc'] = \"000000000000\"; }\n\n // Grab the cover image URL if we're doing that\n $bib['cover_img'] = '';\n if ($skip_cover != TRUE) {\n if ($bib['stdnum']) { $bib['cover_img'] = locum_server::get_cover_img($bib['stdnum']); }\n }\n\n // LCCN\n $bib['lccn'] = '';\n $lccn = self::prepare_marc_values($bib_info_marc['010'], array('a'));\n $bib['lccn'] = $lccn[0];\n\n // Download Link (if it's a downloadable)\n $bib['download_link'] = '';\n $dl_link = self::prepare_marc_values($bib_info_marc['856'], array('u'));\n $bib['download_link'] = $dl_link[0];\n\n // Description\n $bib['descr'] = '';\n $descr = self::prepare_marc_values($bib_info_marc['300'], array('a','b','c'));\n $bib['descr'] = $descr[0];\n\n // Notes\n $notes = array();\n $bib['notes'] = '';\n $notes_tags = array('500','505','511','520');\n foreach ($notes_tags as $notes_tag) {\n $notes_arr = self::prepare_marc_values($bib_info_marc[$notes_tag], array('a'));\n if (is_array($notes_arr)) {\n foreach ($notes_arr as $notes_arr_val) {\n array_push($notes, $notes_arr_val);\n }\n }\n }\n if (count($notes)) { $bib['notes'] = serialize($notes); }\n\n // Subject headings\n $subjects = array();\n $subj_tags = array(\n '600', '610', '611', '630', '650', '651',\n '653', '654', '655', '656', '657', '658',\n '690', '691', '692', '693', '694', '695',\n '696', '697', '698', '699'\n );\n foreach ($subj_tags as $subj_tag) {\n $subj_arr = self::prepare_marc_values($bib_info_marc[$subj_tag], array('a','b','c','d','e','v','x','y','z'), ' -- ');\n if (is_array($subj_arr)) {\n foreach ($subj_arr as $subj_arr_val) {\n array_push($subjects, $subj_arr_val);\n }\n }\n }\n $bib['subjects'] = '';\n if (count($subjects)) { $bib['subjects'] = $subjects; }\n\n unset($bib_info_marc);\n return $bib;\n }", "function checkWeightedSum($isbn){\n $odd = 0;\n $even = 0;\n for($i = 0; $i<strlen($isbn)-1; $i++){\n if($i%2 == 0){\n $odd += $isbn[$i];\n }else{\n $even += $isbn[$i]*3;\n }\n }\n $sum = $odd + $even;\n $mod = $sum%10;\n $check = ($mod == 0) ? 0 : 10-$mod;\n if($check == substr($isbn, 12,12)){\n return 1;\n }else{\n return 0;\n }\n }", "function getPopular($conn) {\n $popular = \"SELECT title FROM audio_book INNER JOIN purchase On audio_book.ISBN = purchase.ISBN GROUP BY title ORDER BY count(purchase.ISBN) DESC LIMIT 6\";\n $result = mysqli_query($conn, $popular);\n if(mysqli_num_rows($result) > 0) {\n return $result;\n } else {\n echo 'Nothing <br>';\n exit;\n }\n }", "public function setIsbn10($isbn10)\n {\n $this->isbn10 = $isbn10;\n\n return $this;\n }", "function best_uri($reference)\n{\n\t$uri = '';\t\n\t\n\tforeach ($reference as $k => $v)\n\t{\n\t\tswitch ($k)\n\t\t{\n\t\t\tcase 'identifier':\n\t\t\t\tforeach ($reference->identifier as $identifier)\n\t\t\t\t{\n\t\t\t\t\tswitch ($identifier->type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'doi':\n\t\t\t\t\t\t\t$uri = 'http://dx.doi.org/' . $identifier->id;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'handle':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://hdl.handle.net/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'biostor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://biostor.org/reference/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'jstor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://www.jstor.org/stable/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'cinii':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://ci.nii.ac.jp/naid/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'year':\n\t\t\t\t$year = $v;\n\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n\tif ($uri == '')\n\t{\n\t\t$uri = '';\t\t\n\t\tforeach ($reference as $k => $v)\n\t\t{\n\t\t\tswitch ($k)\n\t\t\t{\n\t\t\t\tcase 'link':\n\t\t\t\t\tforeach ($reference->link as $link)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($link->anchor == 'URL')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$uri = $link->url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $uri;\n}", "public function getBookInfo()\n\t{\n\t\t$isbn = $_POST['ISBN'];\n\t\t$url = \"https://api.douban.com/v2/book/isbn/\" . $isbn;\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n\t\t$result = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t$result = json_decode($result, true);\n\n\n\t\tif ($result[\"code\"] != 6000) {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'success',\n\t\t\t\t'data' => $result\n\t\t\t));\n\t\t\techo $json;\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Can not get its information!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "function authorToStr($authorstr, $title, $keyAuthor='') {\n\n\t$aarr = explode(' and ', $authorstr);\n\t\n\t$aarr = array_map('trim', $aarr);\n\t$link ='';\n\tfor($i=0; $i < count($aarr); $i++) {\n\t\n\t\t\n\t\tif(strpos($aarr[$i], '(href)') != false){\n\t\t\t$aarr[$i] = explode('(href)', $aarr[$i] );\n\t\t\t$link = $aarr[$i][1];\n\t\t\t//echo $link;\n\t\t\t$aarr[$i] = $aarr[$i][0];\n\t\t}\n\t\t$aarr[$i] = str_replace(\"\\\\textbf\",\"\", $aarr[$i]);\n\t\tif(strpos($aarr[$i], ',') == false) {\n\t\t\t// no first/lastname indicator, let's do that ourselves\n\t\t\t$pa = strpos($aarr[$i], '{') != false && (strpos($aarr[$i],'{') == 0 || \n\t\t\t$aarr[$i][strpos($aarr[$i],'{')-1] == ' ' || \n\t\t\t$aarr[$i][strpos($aarr[$i],'{')-1] == '.') ? strpos($aarr[$i], '{') : false;\n\t\t\t\n\t\t\t$pl = ($pa == true) ? strpos($aarr[$i], '{') : strrpos($aarr[$i], ' ');\n\t\t\t$lastname = trim(substr($aarr[$i], $pl+1, ($pa && strpos($aarr[$i], '}', $pl) != false ? strpos($aarr[$i], '}', $pl) - $pl : strlen($aarr[$i])-$pl)-1) );\n\t\t\t$firstname = trim(substr($aarr[$i], 0, $pl));\n\t\t\t$fn = explode(' ', str_replace('.', '', str_replace('-', ' ', $firstname)));\n\t\t\t$fn2 = '';\n\t\t\tfor($j=0; $j < count($fn); $j++) {\n\t\t\t\tif(strlen($fn[$j]) > 0)\n\t\t\t\t\t$fn2 .= $fn[$j][0] . '.';\n\t\t\t}\n\t\t\t$aarr[$i] = $lastname . ' ' . $fn2;\n\t\t\t\n\t\t} else {\n\t\t\t$na = explode(',', $aarr[$i]);\n\t\t\t$fn = explode(' ', str_replace('.', '', str_replace('-', ' ', trim($na[1]))));\n\t\t\t$fn2 = '';\n\t\t\tfor($j=0; $j < count($fn); $j++) {\n\t\t\t\tif(strlen($fn[$j]) > 0)\n\t\t\t\t\t$fn2 .= $fn[$j][0] . '.';\n\t\t\t}\n\t\t\t$aarr[$i] = $na[0] . ' ' . $fn2;\n\t\t}\n\t\tif ($link !='') {\n\t\t\t$aarr[$i] = '<a href=\\\"' . $link. '\\\">' . $aarr[$i] . '</a>';\n\t\t}\n\t}\n\t\n\tif (count($aarr) > 1)\n\t\treturn $title[0] . \": \" . implode(', ', $aarr);\n\treturn \t$title[1] . \": \" . implode(', ', $aarr);\n}", "function book ($Nup, $quantity, &$totalSheets, &$pages) {\n\tif ($_POST[\"book\"] == \"book\"){\n\t$pages = $_POST[\"pages\"];\n\t$spreads = ceil($pages / 4);\n\t$totalSheets = ($spreads / $Nup) * $quantity;\n\t}\n\treturn $spreads;\n}", "public function ebook_technical()\n\t{\n\t\tif (preg_match('/ASST (NEW|OLD) MTLS.*\"(.+?)(\\.part\\d*|\\.rar)?(\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}\").+?yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[2];\n\t\t} //\"ASTG TRANSMISSON REBUILD MANUALS FOR BMW.rar.par2\" [07/73] yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(???) [1/1] - \"Asimov, Isaac - [Foundation 01] - De Foundation_v2.rar\" yEnc\n\t\tif (preg_match('/^\\(\\?+\\) \\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(07/14) \"NS120107 07Jan12.pdf\" - 238.80 MB - yEnc\n\t\tif (preg_match('/^\\(\\d+\\/\\d+\\)[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e2, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(103 eBooks On Music Production) [071/111] - \"Pro Enginner School Vol. 1 + 2 By Record-Producer.com PDF.rar\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //((BIO & MED 008) [29/64] - \"Acupuncture Therapy for Neurological Diseases - Y. Xia, et al., (Springer, 2010) WW.pdf\" *REPOST* yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 . '.+REPOST.+[-_\\s]{0,3}yEnc$/ui', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(Bighathi) [4/4] - \"Letters to Penthouse XXiLetters to Penthouse XXI - The Editors of Penthouse Magazine.epub\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(Repost) Computing (Recent) [32 of 44] \"Professional XMPP Programming (Wrox, 2010).pdf\" yEnc\n\t\tif (preg_match('/^\\(.+\\)[-_\\s]{0,3}[\\w]+[-_\\s]{0,3}\\(.+\\)[-_\\s]{0,3}\\[\\d+ of \\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //48 Unsorted E-books (03-12-2010) [49/52] - \"Zend Framework 1.8 Web Application Development.pdf\" yEnc\n\t\tif (preg_match('/^\\d+.+E-books[-_\\s]{0,3}.+[-_\\s]{0,3}\\[\\d+\\/\\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //A large collection of programming ebooks [128 of 527] \"Eckel - Thinking in C++ - Volume II - 2e (Prentice, 2000).pdf\" yEnc\n\t\tif (preg_match('/^A large collection of programming ebooks [-_\\s]{0,3}\\[\\d+ of \\d+\\][-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //\"Make Magazine - Volume 03.pdf\" yEnc\n\t\tif (preg_match('/^\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //ADVANCES in CHEMICAL ENGINEERING 22aug11 [8 of 30] \"Advances in Chemical Engineering Vol 20 Kwauk (AP 1994).pdf\" yEnc\n\t\tif (preg_match('/\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //Arduino Books by Request [9/9] - \"iOS Sensor Apps with Arduino - A. Allan (O'Reilly, 2011) WW.pdf\" (1/114) yEnc\n\t\tif (preg_match('/\"([\\w\\säöüÄÖÜß+¤ƒ¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1, $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}", "public function getBook()\n\t{\n\t\treturn $this->getKeyValue('book'); \n\n\t}", "function get_price($find){\n\t$books=array(\n\t\t\"paris-seoul\"=>599,\n\t\t\"paris-madrid\"=>400,\n\t\t\"paris-marseille\"=>387\n\t)\n\t;\n\n\tforeach ($books as $book => $price) {\n\t\tif($book==$find){\n\t\t\treturn $price;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function search_inventory($db, $seller_id, $title, $isbn, $author)\n{\n\t/* Copy and pasted code from \"search_textbooks\" I can't just wrap it in another function because of how the\n\t\t\t\tprepared statement works */\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \".$titlekey.\" LIKE :title and \n\t\t\".$isbnkey.\" LIKE :isbn and \".$authorkey.\" \n\t\tLIKE :author and seller_id = :seller_id ORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue, ':seller_id'=>$seller_id));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "public function hasIsbn13(): bool;", "public function viewBookId()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$isbn = $_POST['ISBN'];\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"SELECT book_id FROM lib_book_unique where isbn = '{$isbn}' and\n\t\t\t\t\tbook_id not in (select book_id from lib_remove);\";\n\t\t\t$return = $book->query($sql);\n\n\t\t\tif ($return) {\n\n\t\t\t\t$return1 = array();\n\t\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\t\t$iid = $return[$k]['book_id'];\n\t\t\t\t\t$temp_num = 100000;\n\t\t\t\t\t$bkid = $iid + $temp_num;\n\t\t\t\t\tarray_push($return1, substr($bkid, 1, 5));\n\t\t\t\t}\n\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return1),\n\t\t\t\t\t'msg' => 'success'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'query error'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "function get_book( $id ) {\r\n\t$options = get_option('nowReadingOptions');\r\n\t\r\n\t$id = intval($id);\r\n\t\r\n\t$books = get_books('include=' . $id);\r\n\t\r\n\treturn $books[0];\r\n}", "function get_recommendations($prefs, $p1){\r\n\t//if he is very similar, then get the books from those that he has not read\r\n\r\n\t//saving the array in a different array\r\n\t$prefsOriginal = $prefs;\r\n\r\n\t//unsetting the person from the array - for whom we are getting the recommendation\r\n\tunset($prefs[$p1]);\r\n\r\n\t//array to save the person and the distance\r\n\t$personDistance = array();\r\n\r\n\t//calculating the similarity of this person with other users\r\n\tforeach($prefs as $k => $v){\r\n\t\t$dist = sim_distance($prefsOriginal, $p1, $k);\r\n\t\t$personDistance[$k] = $dist;\r\n\t}\r\n\r\n\t//sorting the array based on the distance - nearest first\r\n\tarsort($personDistance);\r\n\r\n\t//printing the top recommenders\r\n\t//print_r($personDistance);\r\n\r\n\t//getting the books from the distance people - taking top 3\r\n\t$i = 0;\r\n\t$recommendedBooks = array();\r\n\t$topBooks = array();\r\n\tforeach($personDistance as $k => $v){\r\n\t\t//get the top books for this person\r\n\t\t$topBooks = top_matches($prefs, $k, $v);\r\n\t\tif(sizeof($topBooks) >= 1){\r\n\t\t\t$recommendedBooks[] = $topBooks;\r\n\t\t\t$i += 1;\r\n\t\t}\r\n\t\tif($i > RECOM_NUM) break; //condition to take the recommendations only from the top matches\r\n\t}\r\n\t//printing the combine array\r\n\t//print_r($recommendedBooks);\r\n\r\n\t//echo ('<br><br>');\r\n\r\n\t$recBooks = array();\r\n\r\n\t//merging the arrays based on the RECOM_NUM\r\n\tforeach($recommendedBooks as $rks){\r\n\t\tforeach ($rks as $key => $value) {\r\n\t\t\t//check if the key already exists\r\n\t\t\tif(array_key_exists($key, $recBooks)){\r\n\t\t\t\t//see whether the value that we are going to insert is higher\r\n\t\t\t\tif($recBooks[$key] < $value){\r\n\t\t\t\t\t$recBooks[$key] = $value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$value = $recBooks[$key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$recBooks[$key] = $value;\t\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//getting the name of the books\r\n\t//$recBooks = array_keys($recBooks);\r\n\t//print_r($recBooks);\r\n\r\n\t//subtracting the items that the user has already seen\r\n\tforeach($prefsOriginal[$p1] as $k => $v){\r\n\t\t// echo('kitaab hai = '.$k);\r\n\t\t// echo ('<br>');\r\n\t\tif (in_array($k, $recBooks)){\r\n\t\t\t$key = array_search($k, $recBooks);\r\n\t\t\t//print $key;\r\n\t\t\tunset($recBooks[$key]);\r\n\t\t}\r\n\t}\r\n\r\n\t//getting the order of the books in which to display based on the rating match\r\n\t//sorting the array based on the key\r\n\tarsort($recBooks);\r\n\r\n\t//printing after removing the read books\r\n\t//echo ('<br><br>');\r\n\r\n\treturn $recBooks;\r\n\r\n}", "public function addBook($what = NULL, $how = 'type', $num = 1)\n {\n $whereSQL = \" WHERE \" . $how . \" = '\" . $what . \"'\";\n if ($num == 1) {\n $sql = 'SELECT * FROM wd_books' . $whereSQL . ' LIMIT 1;';\n } else {\n $sql = 'SELECT * FROM wd_books' . $whereSQL . ' ORDER BY RAND() LIMIT ' . $num . ';';\n }\n $query = $this->CI->db->query($sql);\n $out = '';\n if ($query->num_rows() < 1) {\n return $out;\n }\n foreach ($query->result() as $row)\n {\n $title = $row->title;\n $author = $row->author;\n $id = $row->id;\n $banner = $row->banner;\n $out .= '<div class=\"row well rounded-2x shadow-effect-1\"><div class=\"col-lg-12 col-md-12\">' . \"\\n\";\n $out .= '<div class=\"pull-left margin-right-5\">' . \"\\n\";\n $out .= '<a href=\"http://www.fishpond.com.au/product_info.php?ref=2802&id=';\n $out .= $id;\n $out .= '&affiliate_banner_id=1\" target=\"_blank\"><img class=\"pull-left margin-right-5 box-shadow shadow-effect-1 img-thumbnail rounded-2x\" src=\"http://www.fishpond.com.au/affiliate_show_banner.php?ref=2802&affiliate_pbanner_id=';\n $out .= $banner;\n $out .= '\" alt=\"';\n $out .= $title;\n $out .= '\" title=\"';\n $out .= $title;\n $out .= '\" /></a>' . \"\\n\";\n $out .= '</div>' . \"\\n\";\n $out .= '<p><strong>';\n $out .= $title;\n $out .= '</strong></p>' . \"\\n\";\n $out .= '<p>by ' . $author . '</p>' . \"\\n\";\n $out .= '<p>Buy the book <a href=\"http://www.fishpond.com.au/product_info.php?ref=2802&id=';\n $out .= $id;\n $out .= '&affiliate_banner_id=1\" target=\"_blank\">';\n $out .= $title;\n $out .= '</a> on Fishpond.</p>' . \"\\n\";\n $out .= '</div>' . \"\\n</div>\\n\";\n }\n return $out;\n }", "function get_booksinn($id)\n {\n return $this->db->get_where('booksinn',array('id'=>$id))->row_array();\n }", "function newBookNumbers($aBooksLeft, $sBookNumberFile)\r\n{\r\n\t$newbookline = '';\r\n\tif (count($aBooksLeft) > 0) {\r\n\t\tforeach ($aBooksLeft as $itemnumber) {\r\n\t\t\t$newbookline .= $itemnumber . ',';\r\n\t\t}\r\n\t}\r\n\r\n\t$fh = fopen($sBookNumberFile, 'w');\r\n\tfwrite($fh, $newbookline);\r\n\tfclose($fh);\r\n\r\n\treturn 1;\r\n}", "function getByExactName($firstname = \"\", $von = \"\", $surname = \"\", $jr = '')\r\n {\r\n $CI = &get_instance();\r\n $CI->load->library('bibtex2utf8');\r\n $CI->load->helper('utf8_to_ascii');\r\n //check if there is input, if not fail\r\n if (!($firstname || $von || $surname || $jr))\r\n return false;\r\n \r\n //do the query\r\n if (getConfigurationSetting('CONVERT_BIBTEX_TO_UTF8')!='FALSE') {\r\n $Q = $CI->db->get_where('author',array('firstname' => $CI->bibtex2utf8->bibCharsToUtf8FromString($firstname)\r\n ,'von' => $CI->bibtex2utf8->bibCharsToUtf8FromString($von)\r\n ,'surname' => $CI->bibtex2utf8->bibCharsToUtf8FromString($surname)\r\n ,'jr' => $CI->bibtex2utf8->bibCharsToUtf8FromString($jr)));\r\n } else {\r\n $Q = $CI->db->get_where('author',array('firstname' =>$firstname\r\n ,'von' => $von\r\n ,'surname' => $surname\r\n ,'jr' => $jr));\r\n }\r\n //only when a single result is found, load the result. Else fail\r\n if ($Q->num_rows() == 1)\r\n return $this->getFromRow($Q->row());\r\n else\r\n return null;\r\n }", "public function testMultiRecurImport()\n\t{\n\t\t$books = R::dispense( array(\n\t\t\tarray( '_type' => 'book', 'title' => 'book one' ),\n\t\t\tarray( '_type' => 'book', 'title' => 'book two' ),\n\t\t) );\n\t\tasrt( is_array( $books ), TRUE );\n\t\tasrt( count( $books ), 2 );\n\t\t$book = reset( $books );\n\t\tasrt( ( $book instanceof OODBBean ), TRUE );\n\t\tasrt( $book->title, 'book one' );\n\t\t$book = next( $books );\n\t\tasrt( ( $book instanceof OODBBean ), TRUE );\n\t\tasrt( $book->title, 'book two' );\n\t}", "function bookcrossing_found_book_page($bcid = '') {\n if (empty($bcid)) {\n return '';\n }\n\n $book = bookcrossing_load_by_bcid($bcid);\n \n /**\n * There is no that book in db.\n */\n if (!$book) {\n return array(\n '#markup' => t('There is no book with that BCID.'),\n );\n }\n\n /**\n * Someone already found this book.\n */\n if ($book['status']) {\n return array(\n '#markup' => t('Someone is already reading this book.'),\n );\n }\n drupal_set_title(t('You have found the book') . ' ' . $book['node']->title);\n $build = node_view($book['node'], 'found_book');\n $build = bookcrossing_prepare_book_view($build, $book, FALSE);\n $build['book_found'] = drupal_get_form('bookcrossing_book_comment', $book);\n\n /**\n * Generate output for found book status.\n */\n $status_string = $book['status'] ? t('Found') : t('Travelling');\n $items = array(\n '<div class=\"status-label\">' . t('Book status') . ':</div>' . $status_string,\n );\n\n if ($book['status']) {\n $items[] = '<div class=\"status-label\">' . t('Reader') . ':</div>' . l($book['user']->name, 'user/' . $book['user']->uid);\n }\n else {\n $items[] = '<div class=\"status-label\">' . t('Released') . ':</div>' . l($book['user']->name, 'user/' . $book['user']->uid) . ', ' . format_date($book['time_left']);\n }\n\n $build['book_found_status'] = array(\n '#markup' => theme('item_list', array('title' => '', 'items' => $items, 'type' => 'ul', 'attributes' => array('class' => 'status-info'))),\n );\n \n $build['author_and_year'] = array(\n '#markup' => bookcrossing_author_and_year($book),\n );\n\n return $build;\n}", "public function getBook($title) \n {\n // in a real life scenario this will be done through a db select command \n $allBooks = $this->getBookList(); \n return $allBooks[$title]; \n }" ]
[ "0.719691", "0.6323025", "0.62641466", "0.62335235", "0.60724264", "0.6056607", "0.60492444", "0.6034663", "0.60135716", "0.6009205", "0.6002468", "0.6002468", "0.5989756", "0.59177315", "0.5808929", "0.58025724", "0.5789007", "0.5761969", "0.5754082", "0.5673303", "0.56473035", "0.5584383", "0.5580752", "0.5504292", "0.5499595", "0.5457218", "0.5390521", "0.5378716", "0.5352735", "0.53197545", "0.53177357", "0.53066117", "0.52864677", "0.526667", "0.5238813", "0.52352935", "0.5206656", "0.5164828", "0.5162441", "0.5161293", "0.51574063", "0.5135408", "0.51248384", "0.51074", "0.5103444", "0.5095108", "0.50843817", "0.49988267", "0.49983034", "0.4954057", "0.495278", "0.49465606", "0.49331975", "0.48961005", "0.4886901", "0.4870939", "0.48667687", "0.4865036", "0.48618782", "0.4855929", "0.4851474", "0.48477694", "0.48162323", "0.48106006", "0.47940463", "0.4784746", "0.4779788", "0.47604278", "0.47560984", "0.47182462", "0.46623743", "0.46553594", "0.46463394", "0.46396083", "0.46285322", "0.46147805", "0.46067876", "0.46042687", "0.45875433", "0.45873448", "0.45863527", "0.45814398", "0.4576544", "0.4575162", "0.45737877", "0.45693207", "0.45693016", "0.4564961", "0.4559594", "0.45488462", "0.4537929", "0.4534186", "0.4511748", "0.45045456", "0.450268", "0.4493808", "0.44812235", "0.44680014", "0.44567743", "0.4454031" ]
0.5300224
32
Returns author of the title if available or null.
public function getAuthor() { $contributors = $this->product->getContributors(); foreach ($contributors as $contributor) { if($contributor->getRole() == PONIpar\ProductSubitem\Contributor::ROLE_AUTHOR) { $value = $contributor->getValue(); if(key_exists('PersonName',$value)) { return $value['PersonName']; } elseif(key_exists('PersonNameInverted',$value)) { $inverted = $value['PersonNameInverted']; $author = implode(' ',array_reverse(explode(', ',$inverted))); } // if the first author string is too long (might be a collections of authors), skip to the next if(strlen($author) < 100) return $author; else continue; } } // if we reach this that means we haven't found an author return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function author()\n {\n return optional($this->author);\n }", "public function author(): ?string\n {\n return $this->author;\n }", "public function getAuthor(): ?Author\n {\n return $this->author;\n }", "public function getAuthor();", "public function getAuthor();", "public function getAuthor();", "public function getAuthor(): string\n {\n return $this->_author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function getAuthor()\n {\n return $this->author;\n }", "public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }", "public function getAuthor() {}", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function getAuthor() {\n return $this->author;\n }", "public function get_author() {\n\t\treturn $this->author();\n\t}", "abstract public function getAuthor();", "public function getAuthor() {\n\t\treturn $this->author;\n\t}", "public function getAuthorname() {}", "public function getAuthorUsername()\n {\n return $this->AUTHOR_USERNAME;\n }", "public function getAuthor() {\n return $this->randomQuote->author_name;\n }", "function getAuthor(){\n $author = $this->getResource('schema:author');\n if (empty($author)){\n $author = $this->getResource('schema:creator');\n }\n return $author;\n }", "public function get_author()\n\t{\n\t\treturn '';\n\t}", "function GetAuthor()\n {\n return 'calguy1000';\n }", "public function checkAuthor()\n {\n if ($this->author()) {\n return $this->author->name;\n }\n return 'N/A';\n }", "public function getAuthorName()\n\t{\n\t\tif(is_null($this->_authorName)){\n\t\t\t$this->loadData();\n\t\t}\n\t\treturn $this->_authorName;\n\t}", "public function getAuthor()\n {\n return $this->author = get_userdata($this->get()->post_author);\n }", "public function getAuthor() {\n return $this->_author;\n }", "public function author() : string\n {\n if (isset($this->entity->author)) {\n return $this->entity->author->name;\n }\n\n return 'Sin autor';\n }", "protected function getFirstAuthor() {\r\n\t\treturn $this->authors[0];\r\n\t}", "public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}", "public function getAuthor(): ?User\r\n {\r\n return $this->author;\r\n }", "public function getAuthor(): ?User\r\n {\r\n return $this->author;\r\n }", "public function getAuthorName()\n {\n return 'Fightmaster.publication.author.name';\n }", "public function getAuthor(): ?User\n {\n return $this->author;\n }", "public function getAuthorName()\n {\n if ($this->Name) {\n return $this->Name;\n } elseif ($author = $this->Author()) {\n return $author->getName();\n }\n }", "function get_the_author_firstname()\n {\n }", "public function getBookAuthor()\n {\n return $this->author;\n }", "function get_the_author_nickname()\n {\n }", "public function getAuthorLabel()\n {\n return (string) $this->_theme->themeAuthor->authorLabel;\n }", "public function getAuthor() \r\n { \r\n return $this->_author; \r\n }", "function the_author() {\n\tglobal $discussion;\n\treturn $discussion['author'];\n}", "function GetAuthor()\n {\n return 'texus';\n }", "function get_the_author_aim()\n {\n }", "public function getAuthorName() : void {\n\t\treturn $this->authorName;\n\t}", "public function getAuthorName()\n {\n return $this->author ? $this->author : $this->createUser->firstname . ' ' . $this->createUser->lastname;\n }", "private function getAuthor()\n {\n $tokenStorage = $this->getOption('token_storage');\n\n return $tokenStorage->getToken()->getUser();\n }", "public function for_author( $params ) {\n\t\t$obj = $this->head_action->for_author( $params['id'] );\n\n\t\tif ( $obj->status === 404 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $obj->head;\n\t}", "public function getAuthor($realValue = false) {\n\t\treturn ($realValue) ? $this->author : UsersManagement::getUserName($this->author);\n\t}", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function get_author()\n {\n return 'Kamen Blaginov';\n }", "public function getAuthor() {\n\t\t\treturn $this->MODULE_AUTHOR;\n\t\t}", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function get_author()\n {\n return 'Chris Graham';\n }", "public function Author()\n {\n return $this->rssField($this->authorField);\n }", "public function author();", "public function gettodoAuthor(): string {\n\t\treturn $this->todoAuthor;\n\t}", "public function getAuthor()\n\t\t{\n\t\t\treturn $this->hasOne(Users::className(), ['id' => 'author_id']);\n\t\t}", "public function getByAuthor()\n {\n return $this->by_author;\n }", "public function getAuthor(): ?AuthorInterface;", "function getAuthor($template) {\n\tif ( !is_string($template['Repository'])) return false;\n\tif ( $template['Author'] ) return strip_tags($template['Author']);\n\t$repoEntry = explode(\"/\",$template['Repository']);\n\tif (count($repoEntry) < 2)\n\t\t$repoEntry[] = \"\";\n\n\treturn strip_tags(explode(\":\",$repoEntry[count($repoEntry)-2])[0]);\n}", "public function meta_author_name()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}", "public function getTitle(): ?string\r\n {\r\n return $this->title;\r\n }", "public function getTitle(): ?string\n {\n return $this->title ?? null;\n }", "public function getAuthor()\n {\n return $this->hasOne(User::className(), ['id' => 'author_id']);\n }", "public function getTitle(): ?string\n {\n return $this->title;\n }", "public function getTitle(): ?string\n {\n return $this->title;\n }", "public function getTitle(): ?string\n {\n return $this->title;\n }", "public function getTitle(): ?string\n {\n return isset($this->Title) ? $this->Title : null;\n }", "public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }", "public function getCorporateAuthor()\n {\n // Try 110 first -- if none found, try 710 next.\n $main = $this->getFirstFieldValue('110', ['a', 'b']);\n if (!empty($main)) {\n return $main;\n }\n return $this->getFirstFieldValue('710', ['a', 'b']);\n }", "public function getAuthorInfo($name) {\n\t\tif (isset($this->authorInfo[$name])) return $this->authorInfo[$name];\n\t\treturn null;\n\t}", "function emc_get_the_author( $post_id ) {\r\n\r\n\tif ( ! class_exists( 'Acf', false ) ) return false;\r\n\r\n\t$author = get_post_meta( $post_id, 'byline', true );\r\n\r\n\tif ( isset( $author ) && ! empty( $author ) ) {\r\n\r\n\t\t$html = sprintf( __( ' by %s', 'emc' ),\r\n\t\t\tesc_html( $author )\r\n\t\t);\r\n\t\treturn $html;\r\n\r\n\t}\r\n\r\n\treturn false;\r\n\r\n}", "function rs_the_author($display_name)\n{\n if (null !== $display_name) {\n $custom_author = get_post_meta(get_the_ID(), '_author', true);\n if (!empty($custom_author)) {\n $display_name = trim($custom_author);\n }\n }\n return $display_name;\n}", "public function getAuthor()\n {\n return $this->hasOne(Authors::className(), ['id' => 'author_id']);\n }", "protected function author()\n {\n if ($this->presenter->wasByCurrentUser() || !$this->wrappedObject->user_id) {\n return 'You ';\n }\n\n if (!$this->wrappedObject->security) {\n return 'This user ';\n }\n\n return $this->presenter->author().' ';\n }", "function get_author_name($auth_id = \\false)\n {\n }", "function bd_get_author($comment) {\n\t\t$author ='';\n\n\t\tif ( empty($comment->comment_author) )\n\t\t\t$author = __('Anonymous', 'wolf');\n\t\telse\n\t\t\t$author = $comment->comment_author;\n\n\t\treturn $author;\n\t}", "public function author()\n {\n $userId = $_post['userId'];\n $userRepository = new UserRepository();\n if (!empty($userId)) {\n $author = $userRepository->getAuthor();\n }\n }", "public function getTitle()\n {\n return isset($this->Title) ? $this->Title : null;\n }", "function get_the_author_yim()\n {\n }", "public function getTitle(): ?string;", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function getAuthorID();", "public function getAuthor0()\n {\n return $this->hasOne(User::className(), ['id' => 'author_id']);\n }", "public function get_autor()\n {\n return $this->_autor;\n }", "function get_the_author_lastname()\n {\n }", "function the_author_firstname()\n {\n }", "function get_the_author_ID()\n {\n }", "public function getAuthor()\n {\n return $this->hasOne($this->userClassName, ['id' => 'author_id'])->from(['author' => $this->userTableName]);\n }", "protected function author($username)\n {\n $user = User::whereUsername($username)->first();\n\n $userId = $user ? $user->id : null;\n\n return $this->builder->whereUserId($userId);\n }" ]
[ "0.7772653", "0.770168", "0.73291695", "0.73001057", "0.73001057", "0.73001057", "0.7234893", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.723102", "0.7199938", "0.71987224", "0.71546304", "0.71546304", "0.71546304", "0.7143735", "0.71396637", "0.7102659", "0.7057379", "0.7054256", "0.70529777", "0.7031167", "0.7022101", "0.70190436", "0.7015327", "0.6990818", "0.6985008", "0.6969742", "0.6936284", "0.6925584", "0.69181114", "0.69058096", "0.69058096", "0.6903943", "0.68912804", "0.6853623", "0.68529326", "0.6778765", "0.67776895", "0.67443544", "0.6740401", "0.6722479", "0.67175084", "0.6706624", "0.6692781", "0.6675082", "0.66349655", "0.66334504", "0.6624793", "0.66201633", "0.66201633", "0.6612899", "0.6602328", "0.6602328", "0.6602328", "0.6602328", "0.6602328", "0.6602328", "0.65992147", "0.65735245", "0.6569425", "0.6549608", "0.6546827", "0.65378594", "0.6529786", "0.6516445", "0.65072316", "0.6490435", "0.64777505", "0.64732116", "0.64732116", "0.64732116", "0.6451567", "0.6440517", "0.64306647", "0.6427364", "0.64178723", "0.640769", "0.6398782", "0.63940215", "0.637648", "0.63725436", "0.6349729", "0.6345256", "0.63318616", "0.63247013", "0.63184816", "0.6315627", "0.6297866", "0.6287395", "0.62779325", "0.62769353", "0.6268971", "0.6251053", "0.6247543" ]
0.73661774
2
/Get URL to highest resolution.
public function getCoverLink() { $link = $this->_getFirstElement('MediaFile[MediaFileTypeCode=06 or MediaFileTypeCode=04]/MediaFileLink'); if($link) { return $link; } else return null; /* From the docs: Codelists f114: MediaFileTypeCode 04, Image, front cover 06, Image, front cover, high quality 10, wenn der Annotationtyp = ‚BPROB‘ 29, wenn der Annotationtyp = ‚VPROB‘ 30, wenn der Annotationtyp = ‚HPROB‘ f115: MediaFileFormatCode 02 GIF 03 JPEG 04 PDF 05 TIF 06 REALAudio 28.8 07 MP3 08 MPEG-4 */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function best()\n {\n return Urls::best();\n }", "private function getLatestPlace(){\n $last = -100000000;\n foreach($this->URLs as $url){\n if($url['url_place'] > $last) $last = $url['url_place'];\n }\n if($last == -100000000) $last = 0;\n return $last;\n }", "public function getLastPageUrl();", "function get_last_url_slug() {\n\n $url = $_SERVER['REQUEST_URI'];\n $parts = explode(\"/\", $url);\n $lastPart = $parts[count($parts)-2];\n \n \n return $lastPart;\n}", "public function getUrl()\n {\n return $this->lastUrl;\n }", "function tidyt_get_highest_available_page( $string, $page ){\n\n\n $files = array();\n $path = tidyt_get_constant_path('TEMPLATE');\n\n if ( file_exists(STYLESHEETPATH . '/' . $path)) {\n $dir = STYLESHEETPATH . '/' . $path;\n } else if ( file_exists(TEMPLATEPATH . '/' . $path) ) {\n $dir = TEMPLATEPATH . '/' . $path;\n }\n\n // find all matching tempates\n foreach (glob($dir.$string.\"-paged-*.php\") as $filename)\n $files[] = $filename;\n\n\n // return if none available\n if(!$files)\n return;\n\n // for each of the found templates we flag the highest number\n foreach($files as $file ):\n // get the highest numbered file\n $max = max($files);\n // strip the non number characters from it\n $num = preg_replace(\"/[^0-9]/\",\"\",$max);\n // if the number is greater than the current page unset it\n if($num > $page)\n unset( $files[array_search($max, $files)] );\n endforeach;\n\n if(!$files)\n return;\n\n $max = max($files);\n\n $url = trim($max, '/');\n\n return substr($url, strrpos($url, '/')+1);\n\n}", "private function getLastURL() {\n\t\tif (!isset($_SERVER['REQUEST_URI'])) {\n\t\t\t$serverrequri = $_SERVER['PHP_SELF'];\n\t\t} else {\n\t\t\t$serverrequri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\t$slcurrentPageName=str_replace('?&no_cache=1', '', $serverrequri);\n\t\t$slcurrentPageName=str_replace('?no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?L=0', '', $slcurrentPageName);\n\t\treturn $slcurrentPageName;\n\t}", "function get_long_url() {\n\t$long_url = has_altis_config() ? Altis\\get_config()['hm-juicer']['juicer-long-url'] : false;\n\n\t// If the Altis setting is not defined, check the JUICER_LONG_URL constant and use that if it exists.\n\tif ( empty( $long_url ) ) {\n\t\tif ( defined( 'JUICER_LONG_URL' ) ) {\n\t\t\t$long_url = JUICER_LONG_URL;\n\t\t} else {\n\t\t\t// Return the option, if it exists.\n\t\t\t$long_url = Settings\\juicer_get_option( 'JUICER_LONG_URL', false );\n\t\t}\n\t}\n\n\t// If the url doesn't have a scheme, add one for consistency.\n\tif ( $long_url && strpos( $long_url, 'http' ) !== 0 ) {\n\t\t$long_url = 'https://' . $long_url;\n\t}\n\n\treturn $long_url;\n}", "function wp_sitemaps_get_max_urls($object_type)\n {\n }", "function best_uri($reference)\n{\n\t$uri = '';\t\n\t\n\tforeach ($reference as $k => $v)\n\t{\n\t\tswitch ($k)\n\t\t{\n\t\t\tcase 'identifier':\n\t\t\t\tforeach ($reference->identifier as $identifier)\n\t\t\t\t{\n\t\t\t\t\tswitch ($identifier->type)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'doi':\n\t\t\t\t\t\t\t$uri = 'http://dx.doi.org/' . $identifier->id;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'handle':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://hdl.handle.net/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'biostor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://biostor.org/reference/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'jstor':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://www.jstor.org/stable/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\n\t\t\t\t\t\tcase 'cinii':\n\t\t\t\t\t\t\tif ($uri == '')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uri = 'http://ci.nii.ac.jp/naid/' . $identifier->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'year':\n\t\t\t\t$year = $v;\n\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n\tif ($uri == '')\n\t{\n\t\t$uri = '';\t\t\n\t\tforeach ($reference as $k => $v)\n\t\t{\n\t\t\tswitch ($k)\n\t\t\t{\n\t\t\t\tcase 'link':\n\t\t\t\t\tforeach ($reference->link as $link)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($link->anchor == 'URL')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$uri = $link->url;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $uri;\n}", "public function getFirstPageUrl();", "function get_last_comic_permalink() {\n\t$terminal = get_last_comic();\n\treturn !empty($terminal) ? get_permalink($terminal->ID) : false;\n}", "public function getNextPageUrl();", "public function getNextPageUrl();", "private function getNextNotCrawledUrl(): ?Url\n {\n return $this->search->urls()\n ->notCrawled()\n ->first();\n }", "function GetMainBaseFromURL()\n{\n\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\n\t$chars = preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY);\n\t$slash = 3; // 3rd slash\n\t$i = 0;\n\tforeach($chars as $key => $char)\n\t{\n\t\tif($char == '/')\n\t\t{\n\t\t $j = $i++;\n\t\t}\n\t\n\t\tif($i == 3)\n\t\t{\n\t\t $pos = $key; break;\n\t\t}\n\t}\n\tif($_REQUEST['CFSystem']['url_friendly'])\n\t{\n\t\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME']: \"http://\".$_SERVER['SERVER_NAME'];\n\t\t$main_base = rtrim($url.'/'.basename($_REQUEST['CFSystem']['baseurl']),'/');\n\t}\n\telse\n\t{\n\t\t$main_base = substr($url, 0, $pos);\n\t}\n\treturn $main_base.'/';\t\n}", "public function getUrlN()\n {\n if (! isset($this->urlN)) {\n $this->urlN = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getUrlNQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->urlN;\n }", "function get_effective_url()\n\t{\n\t\t//最后一个有效的url地址\n\t\treturn curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL);\n\t}", "public function lastPageUrl(): string\n {\n if ($this->hasOnlyOnePage()) {\n return $this->firstPageUrl();\n }\n\n return $this->url($this->number_of_pages);\n }", "public function getNextLink()\n {\n return $this->getAlbum()->getNextLink($this);\n }", "function get_final_url($url){\n\t$redirects = get_all_redirects($url);\n\tif (count($redirects)>0){\n\t\treturn array_pop($redirects);\n\t} else {\n\t\treturn $url;\n\t}\n}", "public function LastLink()\n {\n return HTTP::setGetVar(\n $this->getPaginationGetVar(),\n ($this->TotalPages() - 1) * $this->getPageLength(),\n ($this->request instanceof HTTPRequest) ? $this->request->getURL(true) : null\n );\n }", "private function full($url = NULL)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$headers = get_headers($url,1);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t// Some kind of error\n\t\t\t// Abandon and return original url\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e));\n\t\t\treturn $url;\n\t\t}\n\n\t\tif (empty($headers))\n\t\t{\n\t\t\treturn $url;\n\t\t}\n\n\t\tif ( ! isset($headers['Location']))\n\t\t{\n\t\t\treturn $url;\n\t\t}\n\t\t$url = $headers['Location'];\n\t\t\n\t\t// If an Array is returned for redirects\n\t\t// Return the last item in the array\n\t\treturn is_array($url)? end($url) : $url;\n\t}", "public function getMaxMenuPosition()\n {\n $value=DB::table('links')\n ->max('menu_position');\n return $value;\n }", "public function get_last_url_request() {\n\t\treturn $this->_last_url_request;\n\t}", "function get_final_url($url){\n\t\t$redirects = get_all_redirects($url);\n\t\tif (count($redirects)>0){\n\t\t\treturn array_pop($redirects);\n\t\t} else {\n\t\t\treturn $url;\n\t\t}\n\t}", "public function getMoreUrl()\n {\n $value = $this->get(self::more_url);\n return $value === null ? (string)$value : $value;\n }", "public function getFirstPhotoURL( $size = \"300\" ){\n $pics = $this->getPhotos();\n return $pics[0][\"Uri{$size}\"];\n }", "public function getUrlM()\n {\n if (! isset($this->urlM)) {\n $this->urlM =(($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getUrlMQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->urlM;\n }", "public static function max_photo_id() {\n\t\t$sql = \"SELECT MAX(photo_id) AS photo_id FROM photo_directory;\";\n\t\t$sql_dbo = mysql_query($sql);\n\t\t$sql_row = mysql_fetch_assoc($sql_dbo);\n\t\t$max_photo_id = $sql_row['photo_id'];\n\t\treturn $max_photo_id;\n\t}", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }", "function getTopLinks() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY visits DESC LIMIT 50;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function get_linkQuality(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::LINKQUALITY_INVALID;\n }\n }\n $res = $this->_linkQuality;\n return $res;\n }", "public static function top_page_url () {\n\t\treturn self::$video_url_base;\n\t}", "public function getMaxLng() {\n return $this->maxLng;\n }", "public function getSiteUrl()\n {\n sort($this->siteUrl);\n return $this->siteUrl;\n }", "function getCurrentUrlFromRoutes()\n {\n $input = &SGL_Registry::singleton();\n $url = $input->getCurrentUrl();\n $currUrl = $url->toString();\n $baseUrl = $url->getBaseUrl($skipProto = false, $includeFc = false);\n return str_replace($baseUrl, '', $currUrl);\n }", "public function getMediaFirstFullUrlAttribute()\n {\n $banner = $this->media()->where('collection_name', 'banners')->first();\n\n return $banner ? $banner->getFullUrl() : null;\n }", "public function getImgMax()\n {\n return $this->_params['imgmax'];\n }", "function MaxLongitude() {\n return $GLOBALS[\"maxLong\"];\n }", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "function MaxLatitude() {\n return $GLOBALS[\"maxLat\"];\n }", "function getHighQualityFormat($links){\n\tif(is_array($links)){\n\t\tforeach($links as $link){\n\t\t\tif(isset($link['type']) && (stripos($link['type'], \"video/mp4\") !== false)\n\t\t\t\t&& isset($link['quality']) && (stripos($link['quality'], \"hd720\") !== false)){\n\t\t\t\t$high_quality_mp4 = $link;\n\t\t\t}\n\t\t\telse if(isset($link['type']) && (stripos($link['type'], \"video/mp4\") !== false)){\n\t\t\t\t$unknown_quality_mp4 = $link;\n\t\t\t}\n\n\t\t\tif(isset($link['type']) && (stripos($link['type'], \"video/mp4\") !== false)\n\t\t\t\t&& isset($link['quality']) && (stripos($link['quality'], \"medium\") !== false)){\n\t\t\t\t$medium_quality_mp4 = $link;\n\t\t\t}\n\n\t\t\tif(isset($link['type']) && (stripos($link['type'], \"video/x-flv\") !== false)){\n\t\t\t\t$small_quality_flv = $link;\n\t\t\t}\n\t\t}\n\n\t\tif(isset($high_quality_mp4)){\n\t\t\treturn $high_quality_mp4;\n\t\t}\n\t\telse if(isset($medium_quality_mp4)){\n\t\t\treturn $medium_quality_mp4;\n\t\t}\n\t\telse if(isset($unknown_quality_mp4)){\n\t\t\treturn $unknown_quality_mp4;\n\t\t}\n\t\telse if(isset($small_quality_flv)){\n\t\t\treturn $small_quality_flv;\n\t\t}\n\t\telse{\n\t\t\treturn $links[0];\n\t\t}\n\t}\n\n\treturn false;\n}", "public function AbsoluteLink()\n {\n if ($Page = $this->Link()) {\n return Director::absoluteURL($Page);\n }\n }", "function max_parent( $dirpath, $prefix )\n{\n $dirpath = rtrim ( $dirpath, \"/\" ); // Trim any trailing slash\n $position = strrpos( $dirpath, \"/\" );\n $dirpath = substr ( $dirpath, 0, $position );\n\n $lines = http_get_file( $dirpath );\n\n $regex_match = \"#${prefix}[\\d\\.]+/#\";\n $regex_replace = \"#^.*(${prefix}[\\d\\.]+)/.*$#\";\n $max = find_max( $lines, $regex_match, $regex_replace );\n\n return \"$dirpath/$max\";\n}", "public function resolveThumbnailUrl();", "public function shortUrl()\n {\n return Str::limit(trim($this->url, '/'), 50);\n }", "public function getUrl()\n {\n if($this->storage)\n {\n $this->save();\n\n return $this->storage->getUrl($this);\n }\n\n return NULL;\n }", "function getLatestRev() {\n\t\t$rev = $this->LatestRevPacked;\n\t\tif(!$rev && $this->URL) {\n\t\t\t$this->NeedsLatestRev = 1;\n\t\t\t$this->update();\n\t\t\t$rev = $this->LatestRevPacked;\n\t\t}\n\t\treturn $rev;\n\t}", "public static function getHighestQuality(): int\n {\n return static::$highestQuality;\n }", "protected function urlForSize($width, $height=null)\n {\n\n if (!$this->sizes) {\n return $this->getUrl();\n }\n\n $targetSize = $width instanceof Size ? $width : new Size($width, $height);\n $targetKey = \"$targetSize\";\n\n if (isset($this->optimalSizeCache[$targetKey])) {\n return $this->optimalSizeCache[$targetKey];\n }\n\n $optimalSize = $targetSize->findBest($this->sizes());\n\n if ($this->getSize()->equals($optimalSize)) {\n $this->optimalSizeCache[$targetKey] = $this->getUrl();\n return $this->optimalSizeCache[$targetKey];\n }\n\n $optimalKey = \"$optimalSize\";\n\n if (isset($this->sizeUrls[$optimalKey])) {\n $this->optimalSizeCache[$targetKey] = $this->sizeUrls[$optimalKey];\n return $this->optimalSizeCache[$targetKey];\n }\n\n return $this->getUrl();\n\n }", "function get_x_max()\n\t{\n\t\t$values = array();\n\n\t\tforeach($this->_config[self::VALUES] as $index=>$value)\n\t\t{\n\t\t\t$values[] = $value['right'];\n\t\t}\n\n\t\t$x = array_values($values);\n\t\tsort($x);\n\t\treturn array_pop($x);\n\t}", "static function get_final_url($url)\n\t\t{\n\t\t\t$redirects = CUtils::get_all_redirects($url);\n\t\t\tif (count($redirects)>0)\n\t\t\t{\n\t\t\t\treturn array_pop($redirects);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\treturn $url;\n\t\t\t}\n\t\t}", "public function getAbsoluteUrl()\n {\n return $this->getHostInfo() . $this->getUrl();\n }", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "function finalPageName()\n{\n\t$urlname = $_SERVER[\"REQUEST_URI\"]; //to get complete url //\n\t$urlurl = explode(\"/\",$urlname); // to explode based on '/' to get array of folders //\n\t$cnturl = count($urlurl); // count all folders in array //\n\t$finalpagename_q = $urlurl[$cnturl-1]; // to get last page of url //\n\t$arr_of_qs = explode(\"?\",$finalpagename_q); // to remove query string from last page //\n\t$finalpagename = $arr_of_qs[0]; // to get final page name //\n\treturn $finalpagename;\n}", "public function getLargest()\n {\n return $this->getVersionAlgorithm()->largestDim()->byImage($this)->first();\n }", "public function getNextPageUrl()\n {\n return $this->nextPageUrl;\n }", "function short_url($string, $max_len = 30)\n{\n\t$value = str_replace(array('http://', 'https://', 'ftp://'), '', $string);\n\tif(strlen($value) > $max_len) {\n\t\t$domain = reset(explode('/', $value));\n\t\t$domain_len = strlen($domain);\n\t\tif($domain_len + 3 >= $max_len) {\n\t\t\treturn $domain;\n\t\t} else {\n\t\t\t$remaining = strlen($value) - $max_len - $domain_len + 3;\n\t\t\treturn $domain . ($remaining > 0 ? '...' . substr($value, -$remaining) : '/');\n\t\t}\n\t} else {\n\t\treturn $value;\n\t}\n}", "public function getURL()\n {\n return $this->finalURL;\n }", "function getUrl();", "public function domainOfURL()\n {\n $urlDetails = parse_url($this->url);\n return $urlDetails['host'] ?? $this->shortUrl(20);\n }", "public function getMax();", "function get_final_url($xid){\n\t$base_url = 'http://www.swarthmore.edu/';\n\t$url = $base_url . $xid; \n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_AUTOREFERER, 1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 5);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30);\n\tcurl_exec ($ch);\n\treturn str_replace($base_url, '', curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));\n}", "function amap_ma_get_initial_limit($pluginname) {\n if (!$pluginname)\n return AMAP_MA_NEWEST_NO_DEFAULT;\n\n $limit = trim(elgg_get_plugin_setting('newest_no', $pluginname));\n if (is_numeric($limit) && $limit > 0) {\n return $limit;\n }\n\n return AMAP_MA_NEWEST_NO_DEFAULT;\n}", "function _tsuiseki_tracking_get_network($opts = array(), $max_length = 254) {\n $max_length = (int)($max_length);\n $network = NULL;\n foreach (_tsuiseki_tracking_get_network_names() as $key) {\n if (empty($opts)) {\n if (isset($_GET[\"$key\"]) && !empty($_GET[\"$key\"])) {\n $network = (string)(trim(_check_plain($_GET[\"$key\"])));\n if (mb_strlen($network) > $max_length) {\n $network = substr($network, 0, $max_length);\n }\n break; // Schleife beenden\n }\n }\n else {\n if (isset($opts[\"$key\"]) && !empty($opts[\"$key\"])) {\n $network = (string)(trim(_check_plain($opts[\"$key\"])));\n if (mb_strlen($network) > $max_length) {\n $network = substr($network, 0, $max_length);\n }\n break; // Schleife beenden\n }\n }\n } // foreach\n if (empty($network)) {\n $network = 'free';\n }\n return $network;\n}", "public function getThumbnail()\n {\n if ($this->getThumbnailUrl() !== false) {\n $url = $this->getThumbnailUrl();\n } else {\n $url = Path::child('/img/no-thumb.jpg');\n }\n\n return $url;\n }", "function TI3WM_GetImageURL($URL, $ImgScale)\n{\n\tglobal $TI3WM_redirects;\n\t\n\tif(strpos($URL, 'http://') === false)\n\t\t$URL = \"http://www.ti3wiki.org/wikimap/${ImgScale}/$URL\";\n\telse\n\t\t$URL = str_replace('$scale',$ImgScale, $URL);\n\t\n\tif(!isset($TI3WM_redirects[$URL]))\n\t\treturn $URL;\n\treturn $TI3WM_redirects[$URL];\n}", "function fetch_linux_distro_latest_version($linux_distro_name) \n { \n // Fetch linux distribution details from DistroWatch\n $url = \"http://distrowatch.com/table.php?distribution=$linux_distro_name\";\n \n $html_page = file_get_contents($url); \n\n // Match anything in the form <a href=\"<a href=\"8394\">Distribution Release: Fedora 21</a>\n $pattern = \"/<a href=\\\"[\\d]*\\\">(Distribution Release:|BSD Release:)(.+?)(\\d+(.\\d+)?(-\\d+)?)<\\/a>/\";\n\t\n preg_match_all($pattern, $html_page, $matches);\n // Get key of the biggest version number\n\t//print_r($matches[3]);\n $max_version = array_search(max($matches[3]),$matches[3]);\n \n return $matches[3][$max_version];\n \n }", "public function getResolution()\n {\n return $this->resolution;\n }", "function _tsuiseki_tracking_get_referer($max_length = 254) {\n $max_length = (int)($max_length);\n $ref = NULL;\n if (isset($_SERVER['HTTP_REFERER'])) {\n $ref = _check_plain($_SERVER['HTTP_REFERER']);\n if (mb_strlen($ref) > $max_length) {\n $ref = substr($ref, 0, $max_length);\n }\n }\n return $ref;\n}", "function wmf_get_most_recent_child_page_uri( $page_id ) {\n\t$child_pages = get_posts(\n\t\tarray(\n\t\t\t'post_type' => 'page',\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_parent' => $page_id,\n\t\t\t'posts_per_page' => 1,\n\t\t\t'orderby' => 'date',\n\t\t\t'suppress_filters' => false,\n\t\t)\n\t);\n\n\tif ( ! empty( $child_pages ) ) {\n\t\treturn get_permalink( $child_pages[0] );\n\t}\n\n\treturn '';\n}", "public function getPageImgMaxWidth() : string\n {\n return $this->json['page']['img_maxwidth'] ?? IMG_MAX_WIDTH;\n }", "public function getPageUrl($number);", "function LastArticleUrl($path, $path_home)\n\t{\n\t\t$last = LastArticle($path);\n\t\t$id = LastValidArticle($last);\n\t\tif ($id == 0){ \n\t\t\treturn \"\"; \n\t\t}else{ \n\t\t\t$url = $path_home . '?id=' . $id;\n\t\t\treturn $url;\n\t\t}\n\t}", "function getResponsiveLink($size) {\n\t\t// don't scale up\n\t\tif ($this->getWidth() > $size) {\n\t\t\t$resized = $this->getImageByWidth($size);\n\t\t\t$link = $resized->Link();\n\t\t} \n\t\t\n\t\t// let the browser scale\n\t\telse {\n\t\t\t$link = $this->Link();\n\t\t}\n\n\t\treturn $link;\n\t}", "public function getRealUrlAliasBase(): string;", "public static function getLastRequestUri()\n {\n return self::$lastRequestUri;\n }", "public function getOfficeMaxPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.skuBestPrice')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.skuListPrice')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }", "public function getLastUrl($absolute = false)\n {\n return $this->getUrl($this->getLast(), $absolute);\n }", "public function getHighestAvailableVersion()\n {\n if (array_key_exists(\"highestAvailableVersion\", $this->_propDict)) {\n return $this->_propDict[\"highestAvailableVersion\"];\n } else {\n return null;\n }\n }", "public function getResolution();", "public function getLastRequestUri()\n\t{\n\t\treturn $this->_lastRequestUri;\n\t}", "public function max(): Option;", "function last_segment()\n{\n\t$CI =& get_instance();\n\t// get url segments\n\t$segments = $CI->uri->segment_array();\n\t// set array to last item\n\tend($segments);\n\t// return last item\n\treturn $segments[key($segments)];\n}", "public function getAbsoluteURL()\n {\n return null;\n }", "protected function _getUrlSuffix()\n\t{\n\t\treturn self::getUrlSuffix();\n\t\treturn trim(Mage::getStoreConfig('landingpage/seo/url_suffix'));\n\t}", "function curPageURL()\n{\n\t$pageURL = 'http';\n\n\t$pageURL .= \"://\";\n\n\tif ($_SERVER[\"SERVER_PORT\"] != \"80\")\n\t{\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"REQUEST_URI\"];\n\t}\n\telse\n\t{\n\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"REQUEST_URI\"];\n\t}\n\n\treturn $pageURL;\n}", "function basel_get_compare_page_url() {\n\t\t$page_id = basel_get_opt( 'compare_page' );\n\n\t\tif ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) {\n\t\t\t$page_id = wpml_object_id_filter( $page_id, 'page', true );\n\t\t}\n\n\t\treturn get_permalink( $page_id );\n\t}", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public function getLimitUrl($limit)\n {\n return request()->fullUrlWithQuery([\n 'limit' => $limit\n ]);\n }", "public function getUrl()\n {\n if (array_key_exists(\"url\", $this->_propDict)) {\n return $this->_propDict[\"url\"];\n } else {\n return null;\n }\n }", "public static function get_latest_version_url()\r\n\t\t{\r\n\t\t\treturn get_option('siteurl') . '/' . str_replace(ABSPATH, '', self::get_latest_version_dir());\r\n\t\t}", "function getpr($url) {\n\t\t$url = $this->fixurl($url);\n\t\t\n\t\t// if we have it cached return that\n\t\t$query = sprintf(\n\t\t\t\"SELECT pagerank FROM pageranks WHERE url='%s' AND timestamp >='%s' ORDER BY timestamp DESC LIMIT 1\",\n\t\t\tsqlite_escape_string($url),\n\t\t\tstrtotime(\"-1 day\")\n\t\t);\n\t\t$result = $this->db->query($query);\n\t\tif($result->numRows()){\n\t\t\t$res = $result->fetch(SQLITE_ASSOC);\n\t\t\t$this->lastSource = \"cache\";\n\t\t\treturn $res['pagerank'];\n\t\t}\n\t\t\n\t\t// otherwise, check in with google\n\t\t\n\t\t// first, see if the user has caused over 100 new lookups in the past 24 hours\n\t\t$query = sprintf(\n\t\t\t\"SELECT count(*) AS lookups FROM pageranks WHERE ip='%s' AND timestamp >='%s'\",\n\t\t\t$this->_get_ip(),\n\t\t\tstrtotime(\"-1 day\")\n\t\t);\n\t\t$result = $this->db->query($query);\n\t\t$res = $result->fetch(SQLITE_ASSOC);\n\t\t// if the limit has been reached, throw an exception\n\t\tif($res['lookups'] >= $this->maxPerDay){\n\t\t\tthrow new RateLimitException(\"Sorry, you've hit the rate limit. Please try again in 24 hours.\");\n\t\t}\n\t\t\n\t\t$ch = $this->getch($url);\n\t\t$fp = fsockopen($this->googlehost, 80, $errno, $errstr, 30);\n\t\tif ($fp) {\n\t\t $out = \"GET /tbr?client=navclient-auto&ch=$ch&features=Rank&q=info:$url HTTP/1.1\\r\\n\";\n\t\t //echo \"<pre>$out</pre>\\n\"; //debug only\n\t\t $out .= \"User-Agent: {$this->googleua}\\r\\n\";\n\t\t $out .= \"Host: {$this->googlehost}\\r\\n\";\n\t\t $out .= \"Connection: Close\\r\\n\\r\\n\";\n\t\t\n\t\t fwrite($fp, $out);\n\t\t \n\t\t //$pagerank = substr(fgets($fp, 128), 4); //debug only\n\t\t //echo $pagerank; //debug only\n\t\t while (!feof($fp) && !isset($pr)) {\n\t\t\t\t$data = fgets($fp, 128);\n\t\t\t\t//echo $data;\n\t\t\t\t$pos = strpos($data, \"Rank_\");\n\t\t\t\tif($pos === false){} else{\n\t\t\t\t\t$pr=substr($data, $pos + 9);\n\t\t\t\t\t$pr=trim($pr);\n\t\t\t\t\t$pr=str_replace(\"\\n\",'',$pr);\n\t\t\t\t}\n\t\t }\n\t\t fclose($fp);\n\t\t \n\t\t if(isset($pr)) {\n\t\t\t\t// save & return the results\n\t\t\t\t$this->lastSource = \"google\";\n\t\t\t\t$this->db->query(sprintf(\n\t\t\t\t\t\"insert into pageranks (url, pagerank, timestamp, ip) values ('%s','%s','%s','%s')\",\n\t\t\t\t\tsqlite_escape_string($url),\n\t\t\t\t\t$pr,\n\t\t\t\t\ttime(),\n\t\t\t\t\t$this->_get_ip()\n\t\t\t\t));\n\t\t\t\treturn $pr;\n\t\t } \n\t\t else {\n\t\t\t $this->lastSource = \"none\";\n\t\t\t return NULL; \n\t\t }\n\t\t}\n\t}", "function maxRouteVal($tri_graph)\n{\n\t$maxVal = 0;\n\tfor($i = 0; $i < count($tri_graph);++$i)\n\t{\n\t\t$row = $tri_graph[$i];\n\n\t\tfor($j = 0; $j < count($row);++$j)\n\t\t{\n\t\t\t$currVal = $row[$j]->sendValue();\n\t\t\tif($currVal > $maxVal)\n\t\t\t\t$maxVal = $currVal;\t\t\t\n\t\t}\n\n\t}\n\n\treturn $maxVal;\n\n}", "public function getMaxTarget()\n {\n $bits = $this->lowestBits();\n $target = $this->math->getCompact($bits);\n\n return $target;\n }", "public function getBigPicUrl()\n\t{\n\t\treturn $this->bigPicUrl;\n\t}", "public function getUrl() {\r\n\r\n // removing GET parameters from URL.\r\n return strtolower(rtrim(explode('?', $_SERVER['REQUEST_URI'], 2)[0], '/'));\r\n \r\n }", "public function url() {\n\n if(isset($this->cache['url'])) return $this->cache['url'];\n\n // Kirby is trying to remove the home folder name from the url\n if($this->isHomePage()) {\n // return the base url\n return $this->cache['url'] = $this->site->url();\n } else if($this->parent->isHomePage()) {\n return $this->cache['url'] = $this->site->url() . '/' . $this->parent->uid . '/' . $this->uid;\n } else {\n $purl = $this->parent->url();\n return $this->cache['url'] = $purl == '/' ? '/' . $this->uid : $this->parent->url() . '/' . $this->uid;\n }\n\n }", "public function getUrl(): string\n {\n $url = $this->getBaseMediaDirectoryUrl().'/'.$this->getPathRelativeToRoot();\n $url = $this->makeCompatibleForNonUnixHosts($url);\n $url = $this->rawUrlEncodeFilename($url);\n\n return $url;\n }" ]
[ "0.6634133", "0.64844525", "0.6127786", "0.56992096", "0.566053", "0.55811864", "0.55535346", "0.5485904", "0.5485899", "0.54836226", "0.5462551", "0.545741", "0.5450273", "0.5450273", "0.54310304", "0.54287696", "0.542643", "0.5406381", "0.5405204", "0.5393089", "0.53632325", "0.53557634", "0.5331908", "0.53268886", "0.5325394", "0.5323084", "0.53213716", "0.53130484", "0.529927", "0.5286452", "0.5252946", "0.5242711", "0.52311593", "0.52281934", "0.5218796", "0.52182895", "0.52095217", "0.51822877", "0.51807785", "0.5178357", "0.51579016", "0.51578724", "0.5122896", "0.51125836", "0.5107787", "0.5106629", "0.5105108", "0.51030225", "0.51020783", "0.50601655", "0.50599974", "0.50555176", "0.50455505", "0.50442487", "0.50404733", "0.50317794", "0.5029566", "0.5028835", "0.50242174", "0.50225085", "0.5017479", "0.5011812", "0.5011645", "0.50088125", "0.5004961", "0.5002934", "0.49992725", "0.49951074", "0.4992587", "0.49905708", "0.498927", "0.49839282", "0.49743897", "0.49734098", "0.49639413", "0.4959921", "0.4957145", "0.49537075", "0.4948829", "0.4946853", "0.49429107", "0.49308315", "0.4927851", "0.4924503", "0.49215692", "0.49207172", "0.491765", "0.49149504", "0.49081826", "0.49033898", "0.4901376", "0.48987332", "0.48955643", "0.48954254", "0.48933557", "0.4891209", "0.48897249", "0.48887083", "0.48884213", "0.48825186", "0.48815203" ]
0.0
-1
Returns the code for the outdated category scheme.
public function getVLBSchemeOld() { $result = $this->product->get("mainsubject[b191=26]/SubjectCode") or $this->product->get("Subject[b191=26]/SubjectCode"); if($result) { $vlbSchemeOld = $result[0]->nodeValue; // remove last "0" if there are 5 characters and last character is "0" if(strlen($vlbSchemeOld) == 5 && substr($vlbSchemeOld,-1) === "0") { $vlbSchemeOld = substr($vlbSchemeOld,0,4); } return $vlbSchemeOld; } else return false; /* From the docs: Verarbeitungsregel für Feld "pr.VLBSchemeOld" 1. SubjectCode aus MainSubject Composite wenn SchemeIdentifier=26 und SchemeVersion=0 oder leer 2. SubjectCode aus Subject Composite wenn SchemeIdentifier=26 und SchemeVersion=0 oder leer wenn 5-stellig und letzte Stelle "0" wird die letzte 0 entfernt */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnUpdateCat() {\n return $this->category_id;\n }", "public function getCategoryCode(): ?string\n {\n return isset($this->CategoryCode) ? $this->CategoryCode : null;\n }", "public function getUpdateCategory()\n {\n if (array_key_exists(\"updateCategory\", $this->_propDict)) {\n if (is_a($this->_propDict[\"updateCategory\"], \"\\Beta\\Microsoft\\Graph\\Model\\MacOSSoftwareUpdateCategory\") || is_null($this->_propDict[\"updateCategory\"])) {\n return $this->_propDict[\"updateCategory\"];\n } else {\n $this->_propDict[\"updateCategory\"] = new MacOSSoftwareUpdateCategory($this->_propDict[\"updateCategory\"]);\n return $this->_propDict[\"updateCategory\"];\n }\n }\n return null;\n }", "public function getCategoryColor()\n {\n switch ($this->category) {\n case self::CATEGORY_IMAGE:\n return 'warning';\n case self::CATEGORY_AUDIO:\n return 'primary';\n case self::CATEGORY_VIDEO:\n return 'danger';\n }\n\n return 'default';\n }", "public function getCodeStatutCateg() {\n return $this->codeStatutCateg;\n }", "public function getHash()\n {\n return $this->getValue('nb_commerce_product_category_hash');\n }", "private function getNewCode()\r\n\t\t{\r\n\t\t\t\t$Db = Db::classCache();\r\n\t\t\t\t$lastRow = $Db->readSelectedLastRow(array(\"table\" => \"history\", \"columnName\" => \"code\"));\r\n\r\n\t\t\t\tif ($lastRow != NULL) {\r\n\t\t\t\t\t\treturn $lastRow['code'] + 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\t\t}", "public function get_cat_url_indicator()\n {\n if(isset(ee()->publisher_model->current_language['cat_url_indicator']) &&\n ee()->publisher_model->current_language['cat_url_indicator'] != '')\n {\n return ee()->publisher_model->current_language['cat_url_indicator'];\n }\n\n return ee()->config->item('reserved_category_word');\n }", "public static function code($category) {\n\t\treturn strtolower(substr($category['displayName'], 0, 2));\n\t}", "public function getCode() {\n\t\treturn $this->languagCode;\n\t}", "public function getComboKindCategory()\n {\n $querystr = <<<EOQUERY\n SELECT * FROM askme_kind_category a\n ORDER BY a.`desc` LIMIT 0,10\nEOQUERY;\n\n $results = $this->c->query($querystr);\n if ($results === FALSE)\n return \"\";\n\n $ret = '<select class=\"gradient_combo\" id=\"id_kind_category\" '.\n 'style=\"margin-right: 10px; width: '.$this->width.'px;\">';\n $ret .= \"<option value='0'>\";\n $ret .= $this->first_element;\n $ret .= \"</option>\";\n\n while (($row = $results->fetch_assoc()) !== NULL)\n {\n $ret .= \"<option value='{$row['id_kind_category']}'>\";\n $ret .= $row['desc'];\n $ret .= \"</option>\";\n }\n\n $ret .= \"</select>\";\n\n $results->close();\n\n return $ret;\n\n }", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "function getCategoryClass()\n {\n global $category_class;\n \n if ($category_class) {\n // nothing\n } elseif ($category = get_constructor_category()) {\n if (sizeof($category) > 0)\n $category_class = 'category-' .join(' category-', $category);\n } else {\n $category_class = '';\n }\n \n return $category_class;\n }", "public function getLastCode()\n {\n return $this->lastErrorCode;\n }", "public function get_category_id() {\n return (int)get_config('block_homework_diary', 'course_category');\n }", "function update_category_cache()\n {\n }", "public function getCategory()\n {\n if (array_key_exists(\"category\", $this->_propDict)) {\n if (is_a($this->_propDict[\"category\"], \"\\Beta\\Microsoft\\Graph\\Model\\WindowsMalwareCategory\") || is_null($this->_propDict[\"category\"])) {\n return $this->_propDict[\"category\"];\n } else {\n $this->_propDict[\"category\"] = new WindowsMalwareCategory($this->_propDict[\"category\"]);\n return $this->_propDict[\"category\"];\n }\n }\n return null;\n }", "public function activeThemeCode(): string\n {\n return Theme::getActiveThemeCode();\n }", "protected function getCmanCode()\n {\n switch ($this->sheetName)\n {\n case 'DS':\n $cmanName = 'DS';\n break;\n case 'CITROEN':\n $cmanName = 'CITROEN';\n break;\n case 'JEEP STK':\n $cmanName = 'JEEP';\n break;\n case 'ALFA STK':\n $cmanName = 'ALFA ROMEO';\n break;\n case 'ABARTH STOCK':\n $cmanName = 'ABARTH';\n break;\n case 'FIAT STOCK':\n $cmanName = 'FIAT';\n break;\n }\n\n return CAPMan::where('cman_name', $cmanName)->first()->cman_code;\n }", "private function getCategoryID() {\n return 0;\n }", "function get_omfg_category_id($cat_name){\n\t$term = get_term_by('name', $cat_name, 'omfg_mobile_themes');\n\treturn $term->term_id;\n}", "public function appCategory()\n {\n return File::get_app_category($this->getExtension());\n }", "final public function getCode()\n {\n return 5;\n }", "public function getCode()\n {\n return $this->get(self::ENTRY_CODE);\n }", "public static function getCategory()\n {\n return self::$category;\n }", "public function _code()\n {\n if (!$this->validateCSRF()) {\n return response()->json($this->restrictionAccessMessage());\n }\n\n $item_category = ItemCategory::find(\\Input::get('item_category_id'));\n $item = Item::where('item_category_id', '=', $item_category->id)->orderBy('id', 'desc')->first();\n $number = 1;\n if ($item) {\n $array_number = explode('-', $item->code);\n $number = $array_number[count($array_number) - 1] + 1;\n }\n\n $response = array(\n 'code' => $item_category->code . '-' . $number\n );\n return response()->json($response);\n }", "public function getCode()\n {\n return $this->__get(\"code\");\n }", "public function getCode() {\n return $this->get(self::CODE);\n }", "public function get_scheme()\n {\n }", "public function get_scheme()\n {\n }", "public function get_scheme()\n {\n }", "public function getCode()\n {\n return curl_getinfo($this->handler)['http_code'];\n }", "private function getLastVisitedcategory()\n {\n try {\n $session = Mage::getSingleton(\"core/session\", array(\"name\" => \"frontend\"));\n\n // update category on product and category page\n if ($this->currentProductRegistry || $this->currentCategoryRegistry) {\n\n $category = null;\n //product page\n if ($this->currentProductRegistry) {\n //get categories of current product\n $productId = $this->currentProductRegistry->getId();\n $product = Mage::getModel('catalog/product')->load((int)$productId);\n $categoryIds = $product->getCategoryIds();\n\n if (count($categoryIds) > 0) {\n $category = $this->catalogCategory->load((int)$categoryIds[0]);\n $catParent = $this->getTopParentCategory($category);\n $category = empty($catParent) ? $category : $catParent;\n }\n } else {\n //category page\n $catId = $this->currentCategoryRegistry->getId();\n $category = $this->catalogCategory->load((int)$catId);\n }\n\n if (isset($category)) {\n $categoryName = $category->getName();\n $categoryLink = $category->getUrl();\n\n // save category name and url in session\n $session->setData('lastVisitedCategoryName', $categoryName);\n $session->setData('lastVisitedCategoryLink', $categoryLink);\n } else {\n // if product has no category, retrieve information from session\n $categoryName = $session->getData('lastVisitedCategoryName');\n $categoryLink = $session->getData('lastVisitedCategoryLink');\n }\n } else {\n // retrieve category information from session, if not on product or category page\n $categoryName = $session->getData('lastVisitedCategoryName');\n $categoryLink = $session->getData('lastVisitedCategoryLink');\n }\n\n $lastVisitedCategory = array(\n 'name' => isset($categoryName) ? $categoryName : null,\n 'link' => isset($categoryLink) ? $categoryLink : null\n );\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n\n $lastVisitedCategory = array(\n 'name' => null,\n 'link' => null\n );\n }\n\n return $lastVisitedCategory;\n }", "public function get_code() {\n\t\treturn $this->code;\n\t}", "public function retrieveLastCategoryId() {\n return $this->categoriesDB->retrieveLastCategoryId();\n }", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public function getCode()\n {\n return $this->get(self::CODE);\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getCode()\n {\n return static::CODE;\n }", "public function get_category()\n {\n return 'New Features';\n }", "public function get_category()\n {\n return 'New Features';\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode() {\n\t\treturn $this->code;\n\t}", "public function getCode() {\n\t\treturn $this->code;\n\t}", "public function getCode() {\n\t\treturn $this->code;\n\t}", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n {\n return $this->code;\n }", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getCode()\n\t{\n\t\treturn $this->code;\n\t}", "public function getContentCategoriesVersion()\n {\n return $this->content_categories_version;\n }", "public function getNewStatusCode()\n\t {\n\t\t$select = $this->_db->select() \n\t\t\t\t ->from(array('MS'=>STATUS_MASTER),array(\"MS.code_numeric\"))\n\t\t\t\t ->order('master_id DESC')\n\t\t\t\t ->limit('1');\n\t\t\t\t //echo $select->__tostring();die;\n\t\t $result = $this->getAdapter()->fetchrow($select);\n\t\t $start = substr($result['code_numeric'],0,2);\n\t\t\t\t\t\t\t $newCode = (substr($result['code_numeric'],2)+1); \n\t\t\t\t\t\t\t $newStatus = (strlen($newCode)<3) ? $start.'0'.$newCode : $start.$newCode; \n\t\t return $newStatus;\n\t }", "function get_category() {\n return self::CATEGORY_CLUSTER;\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function Code()\n {\n return $this->code;\n }", "private function getCategory() {\n return '';\n }", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function changeCategoryToUnknown()\n {\n $sql = 'UPDATE posts SET category_id=1 WHERE category_id=:id';\n return $this->db->request($sql, ['id' => $_GET['id']], 'posts');\n }", "final function getCode();", "public function getCategoryId(): string\n {\n return $this->categoryId;\n }", "public function code()\n {\n return $this->code;\n }", "public function code()\n {\n return $this->code;\n }", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode() {\n return $this->code;\n }", "public function getCode()\n {\n return $this->_code;\n }", "public function getCode()\n {\n return $this->_code;\n }", "public function getCode()\n {\n return $this->_code;\n }", "public function getScheme(): string;", "protected static function table_change_code(): mixed\n\t{\n\t\treturn self::$query->table_change_code;\n\t}", "public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }", "public function getCode()\r\n {\r\n return $this->code;\r\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function getCategory(){\r\n return Mage::registry('current_category');\r\n }", "public function getCode()\n {\n return $this->getValueObject('code');\n }" ]
[ "0.5700827", "0.55734944", "0.55350786", "0.55233705", "0.5476821", "0.5313977", "0.5273527", "0.527035", "0.52588046", "0.52390206", "0.5205613", "0.5191795", "0.5177493", "0.5176649", "0.51656675", "0.51538837", "0.51146203", "0.5114448", "0.50808173", "0.5073058", "0.5069634", "0.50664777", "0.50525796", "0.50228256", "0.5015848", "0.49997267", "0.49880123", "0.49795085", "0.49774283", "0.49759704", "0.4975806", "0.4974486", "0.49729475", "0.49713704", "0.49696732", "0.4958109", "0.4953866", "0.49324763", "0.49296322", "0.49127394", "0.49127394", "0.49114174", "0.49039218", "0.49039218", "0.49039218", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.4902935", "0.48985356", "0.48985356", "0.48985356", "0.48978463", "0.48923916", "0.48900378", "0.488753", "0.488753", "0.488753", "0.48842588", "0.48798183", "0.4878389", "0.48758402", "0.48712364", "0.4870202", "0.48649013", "0.48649013", "0.48602062", "0.48554623", "0.48554623", "0.48534188", "0.48534188", "0.48534188", "0.48494685", "0.4847753", "0.48471117", "0.4828297", "0.48218894", "0.48203266", "0.48179272" ]
0.5277092
6
Retrieve Price information from ONIX data
public function getPrices() { // get available price information $pricesAsDom = $this->product->get("SupplyDetail/Price"); // get child nodes as array $pricesAsArray = array_map(array($this,'_childNodes2Array'), $pricesAsDom); return $pricesAsArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPriceInformation() {\n $fields = array('priceInformation' => array(\n 'priceHeader' => 'header',\n 'price',\n 'acquisitionTerms',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "abstract public function getPrice();", "public function getPriceFromDatabase()\n {\n }", "abstract function getPriceFromAPI($pair);", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrices()\n {\n }", "public function getPriceNet();", "public function getPrice() {\n }", "public function getPrice(): string;", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "public function getProductPrice()\n {\n }", "function getLitecoinPrice()\r\n{\r\n\t // Fetch the current rate from MtGox\r\n\t$ch = curl_init('https://mtgox.com/api/0/data/ticker.php');\r\n\tcurl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');\r\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"CakeScript/0.1\");\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t$mtgoxjson = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\r\n\t// Decode from an object to array\r\n\t$output_mtgox = json_decode($mtgoxjson);\r\n\t$output_mtgox_1 = get_object_vars($output_mtgox);\r\n\t$mtgox_array = get_object_vars($output_mtgox_1['ticker']);\r\n\r\n\techo '\r\n\t\t\t<ul>\r\n\t\t\t<li><strong>Last:</strong>&nbsp;&nbsp;', $mtgox_array['last'], '</li>\r\n\t\t\t<li><strong>High:</strong>&nbsp;', $mtgox_array['high'], '</li>\r\n\t\t\t<li><strong>Low:</strong>&nbsp;&nbsp;', $mtgox_array['low'], '</li>\r\n\t\t\t<li><strong>Avg:</strong>&nbsp;&nbsp;&nbsp;', $mtgox_array['avg'], '</li>\r\n\t\t\t<li><strong>Vol:</strong>&nbsp;&nbsp;&nbsp;&nbsp;', $mtgox_array['vol'], '</li>\r\n\t\t\t</ul>';\r\n}", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }", "public function ethPrice() {\n return $this->request->exec([\n 'module' => \"stats\",\n 'action' => \"ethprice\",\n ]);\n }", "public function getTaxedPrice();", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPrice(){\n }", "public function getPrice(){\n }", "public function getPrice(): float;", "public function getPrice(): float;", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "function getPrice ($api, $exchange, $pairSymbol) {\n if ($exchange=='binance') {\n $price = $api->price($pairSymbol);\n } elseif ($exchange=='kraken') {\n $price = $api->QueryPublic('Ticker', array('pair'=>$pairSymbol));\n \t$price = $price['result'][$pairSymbol]['c'][0];\n }\n return $price;\n}", "public function priceToDB(){\n\n return $this->attributes['price'];\n\n }", "function getStartPrice($_DATA)\n { \n $dp=$this->dp; \n \n $nodeId = $_DATA['objId']; //$this->utf8Urldecode($_DATA['objId']);\n $q= \"SELECT START_OF_DAY_PRICE FROM imk_II WHERE ISIN_CODE = '$nodeId'\";\n\n $dp->setQuery($q);\n $price = $dp->loadResult();\n \n return $price;\n }", "public function getMyPriceForASIN($request);", "public function getProductPriceDetails($params){\n\t\ttry {\n\t\t\t$query = \"SELECT * FROM store_products_price spp WHERE spp.statusid=1 AND spp.product_id = \".$params['id'];\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getCurrentPrice() : float;", "public function getPriceListInfo()\n {\n return $this->get(self::PRICELISTINFO);\n }", "private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public function getPrice(){\n return $this->price;\n }", "public function getStock();", "public function getInfo(){\n $info = $this->getData();\n $price = $this->getData('price');\n $info['formatted_price'] = $this->priceHelper->currency($price, true, false);\n $info['website'] = $this->websiteHelper->getWebsites();\n $info['customergroup'] = $this->customerGroupHelper->getCustomerGroups();\n\n return $info;\n }", "public function getTaxInvoiced();", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "function get_price($name)\r\n{\r\n //Read data from DB table\r\n\r\n $servername = \"localhost\";\r\n $dbname = \"webservices\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n\t\r\n\r\n \r\n $sql = \"SELECT price, make, model, year FROM vehicles_pinefalls where make ='$name' order by price asc limit 1\";\r\n $result = $conn->query($sql);\r\n\r\n $info=mysqli_fetch_array($result,MYSQLI_ASSOC);\r\n\r\n return $info;\r\n}", "public function getPrice($id_ressource, $id_pricing){\n\t\t$sql = \"select price_day, price_night, price_we from sy_j_resource_pricing where id_resource=? AND id_pricing=?\";\n\t\t$user = $this->runRequest($sql, array($id_ressource, $id_pricing));\n\t\tif ($user->rowCount() == 1){\n\t\t\treturn $user->fetch();\n\t\t}\n\t\telse{\n\t\t\treturn array('price_day' => 0, 'price_night' => 0, 'price_we' => 0);\n\t\t}\n\t}", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "public function getCurrentPriceData() {\n $priceData = new \\stdClass();\n $priceData->ask = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->bid = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->high = $this->rates[$this->rateIndex]['high_mid'];\n $priceData->open = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->low = $this->rates[$this->rateIndex]['low_mid'];\n $priceData->id = $this->rates[$this->rateIndex]['id'];\n $priceData->dateTime = $this->rates[$this->rateIndex]['rate_date_time'];\n $priceData->rateUnixTime = $this->rates[$this->rateIndex]['rate_unix_time'];\n $priceData->instrument = $this->exchange->exchange;\n\n Config::set('bt_rate_time', $this->rates[$this->rateIndex]['rate_unix_time']);\n\n $this->currentPriceData = $priceData;\n }", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "protected function calculatePrices()\n {\n }", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "Function SalesPriceUsedInOrder($int_record_id) {\r\n return GetField(\"SELECT orders.OrderID\r\n\t\t\t\t\t FROM order_details\r\n\t\t\t\t\t INNER JOIN orders ON orders.OrderID = order_details.OrderID\r\n\t\t\t\t\t INNER JOIN pricing ON pricing.ProductID = order_details.ProductID\r\n\t\t\t\t\t\t\t\t\t AND (order_details.Quantity >= pricing.start_number OR pricing.start_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (pricing.ContactID = orders.ContactID OR pricing.ContactID = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate >= pricing.start_date OR pricing.start_date = 0)\r\n\t\t\t\t\t\t\t\t\t AND (orders.OrderDate <= pricing.end_date OR pricing.end_date = 0)\r\n\t\t\t\t\t\t\t\t\t\t AND (order_details.Quantity <= pricing.end_number OR pricing.end_number = 0)\r\n\t\t\t\t\t WHERE recordID = $int_record_id\");\r\n}", "function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "public function getPrice(){ return $this->price_rur; }", "public function getPriceList()\n {\n try {\n $apiClient = $this->getApiClientPricing();\n $priceList = $apiClient->get(\n array(\"parcel\" => array('dimensions' => $this->getParcelDimensions()))\n );\n\n return json_decode($priceList);\n } catch (\\Exception $e) {\n Logger::debug($e->getMessage());\n return array();\n }\n }", "function getPrice($id,$rdvtype){\r global $bdd;\r\r $req4=$bdd->prepare(\"select * from packs where idpack=? \");\r $req4->execute(array($id));\r while($ar = $req4->fetch()){\r if($rdvtype == 'visio'){return $ar['prvisio'];}else if($rdvtype == 'public'){return $ar['prpublic'];}else if($rdvtype == 'domicile'){return $ar['prdomicile'];}\r }\r\r return 200;\r}", "function blockchain_get_price_24h() {\n $_o_url = new URLScrape(\"http://blockchain.info/q/24hrprice\");\n return $_o_url->response;\n}", "public function getPrice()\n {\n return $this->object->Price;\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "public function neoProductInfo()\r\n {\r\n $result = array();\r\n\r\n $sysUtil = new SysUtility();\r\n $productInfoTblName = $sysUtil->getNeoProductInfoTblName();\r\n\r\n $neoModel = new NeoModel(SysDefinition::USER_DB_CONFIG);\r\n // Connect to Database\r\n $db_neo_conn = $neoModel->connect();\r\n\r\n if (! $db_neo_conn) {\r\n return (false); // Connect to DB failed return without further handling\r\n }\r\n\r\n // set the db table name\r\n $neoModel->setTableName($productInfoTblName);\r\n $queryResult = $neoModel->getNeoAllProductInfo();\r\n\r\n if (! is_bool($queryResult)) {\r\n $result = $queryResult;\r\n // Preset the default value\r\n $result[\"service_term\"] = 6;\r\n $result[\"store_quantity\"] = 1;\r\n\r\n $neoModel->close();\r\n return ($result);\r\n } else {\r\n $neoModel->close();\r\n return (false);\r\n }\r\n\r\n return ($result);\r\n }", "function fetch_customer_data($connect)\n{\t\n\t$totalprice=0;\n $query = \"SELECT * FROM PAYMENT5\";\n \n //oci_parse ( resource $connect , string $sql_text ) \n //oci_fetch ( resource $statement ) : bool\n\t$statement = $connect->prepare($query);\n\t$statement->execute();\n\t$result = $statement->fetchAll();\n\t$output = '\n \n <div class=\"invoice-box\">\n <table cellpadding=\"0\" cellspacing=\"0\">\n <tr class=\"top\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td class=\"title\">\n <img src=\"logo.png\" style=\"width:70%; max-width:70px;\">\n </td>\n \n <td>\n Invoice #: 123<br>\n Created: January 1, 2015<br>\n Due: February 1, 2015\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"information\">\n <td colspan=\"2\">\n <table>\n <tr>\n <td>\n Sparksuite, Inc.<br>\n 12345 Sunny Road<br>\n Sunnyville, CA 12345\n </td>\n \n <td>\n Acme Corp.<br>\n John Doe<br>\n [email protected]\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Payment Method\n </td>\n \n <td>\n Check #\n </td>\n </tr>\n \n <tr class=\"details\">\n <td>\n Check\n </td>\n \n <td>\n 1000\n </td>\n </tr>\n \n <tr class=\"heading\">\n <td>\n Item\n </td>\n \n <td>\n Price\n </td>\n </tr>\n \n \n \n\n\t';\n\tforeach($result as $row)\n\t{\n\t\t$output .= '\n\n\n\t\t<tr class=\"item\">\n <td>\n '.$row[\"PNAME\"].'\n\n </td>\n <td>\n '.$row[\"PQTY\"].'\n\n </td>\n \n <td>\n '.$row[\"TOTAL\"].'\n </td>\n </tr>\n\t\t\t\n\t\t';\n\n\n\t\t$totalprice=$totalprice+$row[\"TOTAL\"];\n\t}\n\n\t$output .= '\n <tr class=\"total\">\n <td></td>\n \n <td>\n Total: '.$totalprice.'\n </td>\n </tr>\n\t\n\t';\n\n\t$output .= '\n\n\t\t</table>\n\t</div>\n\t';\n\treturn $output;\n\n\n}", "public function resolvePrice();", "public function getPrice($url) \n\t{\n\t\t$this->api->parseUrl($url);\n $this->api->setParam('ProductType','10');\n\t\treturn $this->api->call(['command' => 'PE_GetProductPrice'])->response();\n\t}", "public function getPricing() : array\n {\n $data = $this->fetchJson();\n $result = [];\n\n foreach ($data['fuel']['types'] as $fuelType) {\n if (!in_array($fuelType['name'], $this->types)) {\n continue;\n }\n\n $result[] = [\n 'name' => $fuelType['name'],\n 'price' => $fuelType['price'] * 100\n ] ;\n }\n\n return $result;\n }", "function getProductInfos($oid){\n if (!isset($this->products[$oid])){\n $r = array('pool'=>NULL, 'ticket'=>NULL, 'person'=>NULL, 'taarticleno'=>NULL);\n $selectedfields = array('tapool', 'taperson', 'taticket', 'prdconf');\n if ($this->xwtscatalog->fieldExists('taarticleno')){\n $selectedfields[] = 'taarticleno';\n }\n $dp = $this->xwtscatalog->display(array('oid'=>$oid,\n 'selectedfields'=>$selectedfields,\n 'options'=>array('tapool'=>array('target_fields'=>array('prjno', 'poolno')),\n 'taperson'=>array('target_fields'=>array('ptno')),\n 'prdconf'=>array('target_fields'=>array('calendar')),\n 'taticket'=>array('target_fields'=>array('tapool', 'ttno'))\n )\n )\n );\n $r['project'] = $dp['otapool']->link['oprjno']->raw;\n $r['pool'] = $dp['otapool']->link['opoolno']->raw;\n $r['ticket'] = $dp['otaticket']->link['ottno']->raw;\n $r['person'] = $dp['otaperson']->link['optno']->raw;\n $r['calendartype'] = $dp['oprdconf']->link['ocalendar']->link['otype']->raw;\n if (isset($dp['otaarticleno']))\n $r['taarticleno'] = $dp['otaarticleno']->raw;\n $this->products[$oid] = $r;\n }\n return $this->products[$oid];\n }", "public function query_my_product_info(){\n\t\t$response = $this->execute($this->query_my_product_info_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "public function getTickerPrice($symbol = NULL);", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "function GetPrice($symbol)\n{\n\t//google finance can only handle up to 100 quotes at a time so split up query then merge results\n\tif(count($symbol) > 100)\n\t{\n\t\t$retArr = array();\n\t\tfor($j=0; $j< count($symbol); $j +=100)\n\t\t{\n\t\t\t$arr = LookUpWithFormattedString(FormatString(array_slice($symbol, $j, 100)));\n\t\t\t$retArr = array_merge($retArr, $arr);\n\t\t}\n\t\treturn $retArr;\n\t}\n\telse\n\t\treturn LookUpWithFormattedString(FormatString($symbol));\n}", "public function getProductPrice(){\n return $this->product_price;\n }", "public function getPricePoint() {\n return $this->pricePoint;\n }", "public function getPrice()\n {\n $price = Cache::tags([$this->exchange])->get($this->pair, function () {\n return $this->getPriceFromAPI($this->pair);\n });\n return $price;\n }", "public function getListPrice()\n {\n return 0;\n }", "public function getListPrice()\n {\n return 0;\n }", "public function getPrice()\r\n {\r\n return $this->price;\r\n }", "public function getItemsPrice()\n {\n return [10,20,54];\n }", "public function getPricing($data)\n {\n $query = Price::where('sellable_id', '=', (int)$data['sellable_id']);\n $returnData = $query->where('sellable_type', '=', $data['sellable_type'])\n ->get()\n ->toArray();\n if (!empty($returnData)) {\n return $returnData[0];\n } else {\n return null;\n }\n }", "function get_indicator_price($price,$vat){\r\n $full_price = $price + ($price * $vat);\r\n return $full_price;\r\n}", "public function modelReadSearchProductPrice($fromPrice,$toPrice,$recordPerPage){\n\t\t\t//lay bien p truyen tu url\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"select * from products where price >= $fromPrice and price <= $toPrice order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\t$result = $query->fetchAll();\t\t\t\n\t\t\t//---\n\t\t\treturn $result;\n\t\t}", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "public function getLot_price() {\n return $this->lot_price;\n }", "public function getPrice()\n {\n return 0.2;\n }", "function getCryptoLivePrice(){\n \n //$url = \"https://api.coinmarketcap.com/v1/ticker/ethereum/\";\n $url = \"https://api.coinmarketcap.com/v2/ticker/?limit=10&structure=array\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $data = curl_exec($ch);\n $transaction = json_decode($data, TRUE);\n curl_close($ch);\n \n //BTC\n $btcUsdPrice = 0;\n $cryptoSymbol_1 = isset($transaction['data'][0]['symbol'])?$transaction['data'][0]['symbol']:'';\n \n if($cryptoSymbol_1==\"BTC\"){\n $btcUsdPrice = isset($transaction['data'][0]['quotes']['USD']['price'])?$transaction['data'][0]['quotes']['USD']['price']:0;\n }\n //ETH\n $ethUsdPrice = 0;\n $cryptoSymbol_2 = isset($transaction['data'][1]['symbol'])?$transaction['data'][1]['symbol']:'';\n if($cryptoSymbol_2==\"ETH\"){\n $ethUsdPrice = isset($transaction['data'][1]['quotes']['USD']['price'])?$transaction['data'][1]['quotes']['USD']['price']:0;\n }\n //LTC\n $ltcUsdPrice = 0;\n $cryptoSymbol_3 = isset($transaction['data'][5]['symbol'])?$transaction['data'][5]['symbol']:'';\n if($cryptoSymbol_3==\"LTC\"){\n $ltcUsdPrice = isset($transaction['data'][5]['quotes']['USD']['price'])?$transaction['data'][5]['quotes']['USD']['price']:0;\n } \n \n return ['eth_price_usd'=>$ethUsdPrice,'btc_price_usd'=>$btcUsdPrice,'ltc_price_usd'=>$ltcUsdPrice];\n}", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "function get_market_price($cianId) {\n\n\t$price = 0;\n\t$cnt = 0;\n\t$accuracy = 0;\n\n\t//--------------------------------\n\t//Точность зависит от кол-ва транзакций и как далеко мы уточнили критерии поиска (до дома квартиры и тд)\n\n\t//1 ищем тип квартиры такой же как и у нашей. выоводим ср. цену рыночную и кол-во сделок\n\t//точность = 50%\n\t//цена = средняя цена\n\t//<0 (может быть студия). Возврат прошлого результата (все по нулям)\n\n\t//добавляем в запрос еще и улицу. \n\t//< 0 сделок возврат ПРОШЛОГО результата \n\t//==1. точность 70%. Цена = средняя цена\n\t//>1. точность 80%. Цена = средняя цена\n\t\n\t//Добавляем дом.\n\t//< 0 сделок - возврат прошлого результата\n\t//==1. точность 90%. Цена = средняя цена.\n\t//>1. Точность 100%. цена = средняя цена\n\t//--------------------------------\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId}\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.type: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse {\n\t\t$price = $data['price'];\n\t\t$accuracy = 50;\n\t}\n\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 70;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 80;\n\t}\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street and cg.house=mrk.house\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street + house: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 90;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 100;\n\t}\n\n\n\n\n\treturn [\n\t\t'price' => $price,\n\t\t'accuracy' => $accuracy\n\t];\n}", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }" ]
[ "0.70512897", "0.67254406", "0.67109066", "0.67043626", "0.6688906", "0.661633", "0.661633", "0.661633", "0.661633", "0.6608259", "0.63641334", "0.63224113", "0.63052315", "0.62630504", "0.62630504", "0.6252231", "0.62331706", "0.6229603", "0.620279", "0.6115813", "0.6114906", "0.6108185", "0.61031866", "0.60542953", "0.60542953", "0.6044456", "0.6044456", "0.60401183", "0.6025146", "0.602261", "0.6021521", "0.59934556", "0.59882665", "0.5970576", "0.59634584", "0.59390616", "0.5938753", "0.5938526", "0.593182", "0.5922635", "0.5911865", "0.5892209", "0.5887405", "0.58859116", "0.5874057", "0.5874057", "0.58554304", "0.58545", "0.58532757", "0.58457434", "0.5829216", "0.5827393", "0.5827393", "0.5823686", "0.5823686", "0.58225864", "0.58217806", "0.5818102", "0.5813574", "0.58111984", "0.58047265", "0.57986015", "0.5791538", "0.5781265", "0.5780469", "0.577143", "0.57682467", "0.57523316", "0.5749933", "0.57439834", "0.5739385", "0.57340163", "0.5733848", "0.57295364", "0.5722587", "0.57104075", "0.57037294", "0.56973433", "0.56736934", "0.5670161", "0.5657125", "0.5655479", "0.5655479", "0.5644239", "0.56262803", "0.56233454", "0.5622469", "0.56189597", "0.5617005", "0.5610456", "0.56079614", "0.5605715", "0.56004953", "0.5596267", "0.5587269", "0.5587269", "0.5587269", "0.5587269", "0.5587269", "0.5587269" ]
0.56774575
78
Retrieve Blurb Text from ONIX data
public function getBlurb() { // check if there is text available in the onix message // and return as Blurb if it exists $records = $this->product->get('OtherText'); foreach ($records as $record) { if($record->getType() == 18) { return $record->getValue(); } } return false; /* Original SQL statement from spMacSelectProductsFairnopoly.sql: > update macSelectProducts > set Blurb = > cast(( > select top 1 OtherText from refProductOtherText > where macSelectProducts.ProductReference = refProductOtherText.ProductReference > and refProductOtherText.TextTypeCode = '18') > as varchar(4000)) */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_featureblurb() {\n\t\tglobal $product;\n\t\tif ( is_front_page() ) {\n\t\t\t$content = get_post_meta( $product->id, 'featureblurb', true );\n\t\t\tif ( $content ) {\n\t\t\t\techo( '<div class=\"featureblurb\">' . html_entity_decode( $content ) . '</div>' );\n\t\t\t}\n\t\t}\n\t}", "public function getBodyText();", "function getTextContent() {\n\t\treturn $this->lobSub->lobText;\n\t}", "function getSuburb()\n\t{\n\t\t// Load the Suburb data\n\t\tif ($this->_loadSuburb())\n\n\t\treturn $this->_suburb;\n\t}", "public function getBillText() {\n \n $contentsUrl = $this->getBillTextUrl();\n \n // If no URL that means there is no bill text to download yet (boo)\n if ($contentsUrl == false)\n return false;\n\n // Base URL for all pages same as the first URL, but with different file name,\n // so we want to strip that.\n $baseUrl = $contentsUrl;\n $baseUrl = preg_replace(\"/[^\\/]*$/\", '', $baseUrl);\n \n $ch = curl_init();\n $timeout = 10;\n curl_setopt($ch, CURLOPT_URL, $contentsUrl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $response = curl_exec($ch);\n curl_close($ch);\n\n // Get all the HTML pages for the bill from the page control\n $matches = array();\n preg_match(\"/\\<p class=\\\"LegNavTextBottom\\\"\\>.*\\<\\/p\\>/\", $response, $matches);\n \n if (!isset($matches[0]))\n return false;\n\n $billPages = array(); \n $regexp = \"<a\\s[^>]*href=(\\\"??)([^\\\" >]*?)\\\\1[^>]*>(.*)<\\/a>\";\n if (preg_match_all(\"/$regexp/siU\", $matches[0], $matches, PREG_SET_ORDER)) {\n foreach($matches as $match) {\n array_push($billPages, $baseUrl.$match[2]);\n }\n }\n \n // Get the stripped HTML for each seperate page and stitch them all together\n $billText = '';\n foreach ($billPages as $url) {\n $billText .= $this->getBillPageHtml($url);\n }\n\n return $billText;\n }", "function detect_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Detect?appId=\".$api.\"&text=\".urlencode($data['text']); \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t $code_str = htmlspecialchars_decode($ostr[2]); \n\t\t $arr = explode(\"-\",$code_str);\n\t\t return (count($arr)>1) ? $arr[0] : $code_str;\n\t\t } \n\t }", "public function getTextContent();", "public function getBrief() {\n\t\t$baseUrl = \"http://\" . $_SERVER['SERVER_NAME'] . Director::BaseURL();\n\t\t$themeDir = $baseUrl . 'themes/' . SSViewer::current_theme();\n\t\t$html = '<div class=\"brief\">\n\t\t\t\t\t<div class=\"cell\" >'.$this->statusButton().'</div>\n\t\t\t\t\t<div class=\"cell weather\"><img src=\"'.$themeDir.'/images/weather_report/'.$this->getWeatherBrief().'.png\" alt=\"weather-icon\" /></div>\n\t\t\t\t\t<div class=\"cell temp\">'.$this->getWeatherTempurature().'&deg;</div>\n\t\t\t\t\t<div class=\"cell snowfall\">\n\t\t\t\t\t\tLast Snowfall<br />\n\t\t\t\t\t\t<span class=\"amount\">'.$this->getLatestFall().'cm</span><br />\n\t\t\t\t\t\t\ton '.$this->getLatestFallDate().'\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\treturn $html;\n\t}", "public function getSearchQBis()\n {\n return $this->getFormattedText('description');\n }", "public function get_text()\n {\n }", "public function getText() {\n return $this->data->text;\n }", "public function getblogContent(): string {\n\t\treturn ($this->blogContent);\n\t}", "public function getDescription() {\r\n\t\t$tmp_body = strip_tags($this -> body);\r\n\t\t$description = Engine_Api::_() -> ynblog() -> subPhrase($tmp_body, 150);\r\n\t\treturn $description;\r\n\t}", "protected function getBio()\n\t{\n\t\treturn apply_filters('the_author_description', $this->rawDescription, $this->id);\n\t}", "protected function getBody() {\n $db = DBManager::get();\n $stmt = $db->prepare('SELECT body FROM plugin_rich_text WHERE range_id = ?');\n $stmt->execute(array(Utils\\getSeminarId()));\n return Purifier\\purify($stmt->fetchColumn());\n }", "public function getInfotext()\n {\n return $this->_infotext;\n }", "public function getTextEntity();", "public function biography();", "public function getText();", "public function getText();", "public function getText();", "public function bold($text) {\n return $this->begin() . $this->formats['bold'] . $text . $this->end();\n }", "function getFamilyIntroText($familyId) {\n $dbh = Doctrine_Manager::connection()->getDbh();\n $sth = $dbh->query('SELECT text_content FROM families_fr WHERE id = '.$familyId);\n $row = $sth->fetch(PDO::FETCH_ASSOC);\n return $row['text_content'];\n }", "public function bbcodeAction() : object\n {\n $title = \"BBcode\";\n $text = file_get_contents(__DIR__ . \"/textfiles/bbcode.txt\");\n // $filter = new MyTextFilter();\n\n // Deal with the action and return a response.\n $this->app->page->add(\"textfilter/bbcode\", [\n \"text\" => $text,\n \"html\" => $this->filter->parse($text, [\"bbcode\"])\n ], \"main\");\n return $this->app->page->render([ \"title\" => $title ]);\n }", "public function actionBisnis() {\n $strata = new WStrata('search');\n $strata->unsetAttributes(); // clear any default values\n if (isset($_GET['WStrata']))\n $strata->attributes = $_GET['WStrata'];\n \n $this->render('bisnis', array(\n 'strata' => $strata,\n ));\n }", "function getDescriptionB() {\r\r\n\t\treturn $this->descriptionB;\r\r\n\t}", "public function getText() {\n\t\treturn html_entity_decode($this->text);\n\t}", "public function getBio()\n {\n return $this->bio;\n }", "public function getBio()\n {\n return $this->bio;\n }", "public function getText(){\n return $this->TEXT;\n }", "public function getText(): string {\n\t\t$html = $this->getHTML();\n\t\treturn Sanitizer::stripAllTags( $html );\n\t}", "public function getBanner() {\n\t\t$ls = DBModel::getByFields('cernet_contest');\n\t\treturn $ls[0]['h_banner'];\n\t}", "public function getText() {\n return $this->text;\n }", "public function getBio()\n {\n return $this->bio;\n }", "public function getItemText()\n {\n return $this->stripTags($this->getEntity()->getData('list_item_text'));\n }", "public function text () { return trim($this[0]->textContent); }", "public function getText()\n {\n return $this->text;\n }", "public function getMarkup();", "function get_our_business_text() {\n\t/**\n\t * Check if we are in companies page:\n\t */\n\tif (is_singular('companies')) {\n\t\tif ( get_field('company_our_business') ) {\n\t\t\techo wpautop(get_field('company_our_business'));\n\t\t}\n\t\telse {\n\t\t\t?>\n\t\t\t<script type=\"application/javascript\">\n\t\t\t\tjQuery(document).ready(function($) {\n\t\t\t\t\t$(\".our-business-title\").addClass(\"display-none-class\");\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}\n\t/**\n\t * Check if we are in group of companies page:\n\t */\n\tif (is_singular('group_of_companies')) {\n\t\tif ( get_field('group_of_companies_our_business') ) {\n\t\t\techo wpautop(get_field('group_of_companies_our_business'));\n\t\t}\n\t\telse {\n\t\t\t?>\n\t\t\t<script type=\"application/javascript\">\n\t\t\t\tjQuery(document).ready(function($) {\n\t\t\t\t\t$(\".our-business-title\").addClass(\"display-none-class\");\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}\n}", "public function displayData()\r\n {\r\n $htmlContent = '';\r\n $htmlContent .= html_entity_decode($this->content);\r\n return $htmlContent;\r\n }", "public function getTechnicalDescription(): ?string\r\n {\r\n\t\t$parsedown = new \\Parsedown();\r\n\t\t$stripTags = strip_tags($this->getTechnicalDescriptionOrigin());\r\n\t\t$stripTags = html_entity_decode($stripTags);\r\n//\t\t$markdown = preg_replace('@[\\n\\r]+@', \"\\n\", $stripTags);\r\n\t\treturn $parsedown->text($stripTags);\r\n }", "function displayBoilerDetails(){\n $mS = Steam_MeasurementSystem::getInstance();\n $translator = Zend_Registry::get('Zend_Translate');\n $details = \"<table class='data'>\n <tr><th>\".$translator->_('Blowdown Rate').\"</th><td>\".number_format(100*$this->blowdownRate,1).\" \".$mS->label('%').\"</td></tr>\n <tr><th>\".$translator->_('Boiler Energy').\"</th><td>\".$mS->displayEnergyflowLabeled($this->boilerEnergy).\"</td></tr>\n <tr><th>\".$translator->_('Combustion Efficiency').\"</th><td>\".number_format(100*$this->boilerEff,1).\" \".$mS->label('%').\"</td></tr>\n <tr><th>\".$translator->_('Fuel Energy').\"</th><td>\".$mS->displayEnergyflowLabeled($this->fuelEnergy).\"</td></tr>\n </table>\";\n return $details;\n }", "function getBio() {\n return $this->bio;\n }", "public function getText()\n {\n return $this->text();\n }", "public function getText()\n {\n return $this->text();\n }", "public function getRawBankField() {\n\n\t\t$matches = [];\n\n\t\tpreg_match('/(\\<bank[\\s\\>].*\\<\\/bank>)/', $this->rawResponse, $matches);\n\n\t\treturn count($matches) ? $matches[0] : '';\n\t}", "private function printBodinfo()\n {\n if (sizeof($this->stringBiedingenArray) > 0) {\n\n $html = <<<HTML\n<div class=\"row\">\n<div class=\"col\">\n <table class=\"table table-sm table-dark\">\n <thead>\n <tr>\n <th scope=\"col\">Bodbedrag</th>\n <th scope=\"col\">Datum bod</th>\n <th scope=\"col\">Bieder</th>\n </tr>\n </thead>\n <tbody>\n</div>\nHTML;\n for ($i = 0; $i < sizeof($this->stringBiedingenArray); $i++) {\n $array = explode(\"|||||||||\", $this->stringBiedingenArray[$i]);\n\n $html .= <<<HTML\n <tr>\n <td>&euro; $array[0]</td>\n <td>$array[1]</td>\n <td>$array[2]</td>\n </tr>\nHTML;\n\n }\n\n $html .= <<<HTML\n </tbody> \n </table> \n </div> \n</div>\n</div>\nHTML;\n } else {\n\n $html = <<<HTML\n<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col\">\n <p>Wees de eerste bieder!</p>\n </div>\n </div>\nHTML;\n\n }\n return $html;\n }", "function &objectAttributeContent( &$contentObjectAttribute )\r\n {\r\n return $contentObjectAttribute->attribute( 'data_text' );\r\n }", "public function isBold() {}", "public function isBold() {}", "public function isBold() {}", "public function get_obat()\n {\n $q = $this->db->get(\"tb_obat\");\n return $q;\n }", "public function isBold() {}", "public function isBold() {}", "public function getTextData()\n {\n return $this->text;\n }", "function _erpal_contract_helper_get_billable_text() {\n\n $default_text = t('Payment for !service_category_token contract \"!contract_title_token\"', array('!service_category_token' => '[erpal_contract_billable_subject:service_category]', '!contract_title_token' => '[erpal_contract_billable_subject:contract_title]'));\n return variable_get('erpal_billable_text_erpal_contract', $default_text);\n}", "public function GetFeatureContent()\n\t{\n\t\treturn '';\n\t}", "function tsd_add_donate_blurb_to_content( $content ) {\n if( is_single() && get_the_title() != \"sidebar\" && get_the_title() != \"header\" ) {\n ob_start();\n include \"donate-blurb.php\";\n $donate_blurb_content = ob_get_contents();\n ob_end_clean();\n $content .= $donate_blurb_content;\n }\n return $content;\n}", "function tidy_get_body(tidy $object) {}", "protected function getTextBody()\n {\n return null; // pragma nocover\n }", "public function getHeaderText()\n {\n return Mage::helper('jaro_bibleteacher')->__('Bible');\n }", "public function getBiography()\n {\n return 'Etienne is passionate about clean code, Good music '\n . 'and great coffee. He loves coding for the web and create '\n . 'amazing api\\'s';\n }", "public function getText()\n {\n $parameters = func_get_args();\n\n //set parameter values\n if (count($parameters) > 0) {\n $pageNumber = $parameters[0];\n }\n\n\n $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() .\n ((isset($parameters[0])) ? '/pages/' . $pageNumber . '/TextItems' : '/TextItems');\n\n $signedURI = Utils::sign($strURI);\n\n $responseStream = Utils::processCommand($signedURI, 'GET', '', '');\n\n $json = json_decode($responseStream);\n\n $rawText = '';\n foreach ($json->TextItems->List as $textItem) {\n $rawText .= $textItem->Text;\n }\n return $rawText;\n }", "public function getText()\r\n {\r\n return $this->text;\r\n }", "public function bersuara()\n {\n return \"DARAWET ANJING DAWET\";\n }", "public function bmwClubInfo() {\n return [\n 'bmw_club_info' => [\n '#type' => 'frontendapi_address_element',\n '#country' => $this->t('Belarus'),\n '#link_text' => 'BMW club Belarus',\n '#link_url' => 'http://bmwclub.by',\n ],\n ];\n }", "protected function toText()\n\t{\n\t\treturn html_entity_decode($this->toHtml());\n\t}", "function _format_text ($body) {\n\t\t// Stop here if text is empty\n\t\tif (empty($body)) return \"\";\n\t\t// If special code is \"on\" - process it\n\t\tif ($this->USE_BB_CODES) {\n\t\t\t$body = _class(\"bb_codes\")->_process_text($body);\n\t\t} else {\n\t\t\t$body = nl2br(_prepare_html($body, 0));\n\t\t}\n\t\treturn $body;\n\t}", "function getBill($billId){\n\t\t\tif( defined(\"TEST\")){\n\t\t\t\t\n\t\t\t //read data from txt file\n\t\t\t $url = app_path() . \"/tests/bill.txt\";\n\t\t\t\treturn json_decode(file_get_contents($url));\n\t\t }\n\t\t\t\n\t\t\t$url = \"https://www.govtrack.us/api/v2/bill/\" . $billId . \"/text\";\n\t\t\treturn json_decode(file_get_contents($url));\n\t\t}", "public function BlockView()\n {\n if ($proxiedBlock = $this->getProxiedObject()) {\n // For search results and other contexts, cast as HTMLText so {@link Text::ContextSummary)} can be called.\n $content = $proxiedBlock->Content();\n if (!$content instanceof HTMLText) {\n $htmlTextObj = HTMLText::create();\n $htmlTextObj->setValue($content);\n $content = $htmlTextObj->getValue();\n }\n \n return $content;\n }\n\n return null;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n\t{\n\t\treturn $this->getValue('text');\n\t}", "static function before(){\n\t\t$text = \"\n\t\t\\n== Background == \n\t\tThis databrowser queries data from this paper. <ref name='PMID:########'/>\n\t\t\n\t\t\\n== References ==\n\t\t<references/>\n\t\t\t\n\t\t\\n== Search ==\n\t\t\";\n\treturn $text;\n\t}", "public function getText() {\n\t\tif (isset($this->_data['text'])) {\n\t\t\treturn $this->_data['text'];\n\t\t}\n\t\treturn null;\n\t}", "public function setContent($council, $data)\n {\n if ($data['real_terms_increase'] != \"no data\" && $data['real_terms_increase'] >= 0)\n { \n $concatenatedString = \"Council tax charged by \" . $council['council'] . \" has risen by \" . $data['real_terms_increase'] . \" in real terms since 1996-97.\";\n \n return $concatenatedString;\n }\n if ($data['real_terms_increase'] != \"no data\" && $data['real_terms_increase'] < 0)\n { \n $concatenatedString = \"Council tax charged by \" . $council['council'] . \" has fallen by \" . abs($data['real_terms_increase']) . \" in real terms since 1996-97.\";\n \n return $concatenatedString;\n }\n\n $concatenatedString = \"There is no available data for historic council charged by \" . $council['council'] . \".\";\n \n return $concatenatedString;\n }", "function getHighlightedContent($results, $id) {\n foreach($results as $result) {\n if( $result->id == $id ) {\n $str = strip_tags($result->content);\n //echo $str . \"<br /><br />\";\n $str = '...' . str_replace(\"#TERM#\", \"<strong>\", $str);\n $str = str_replace(\"#/TERM#\", \"</strong>\", $str);\n $str = str_replace(\"#BREAK#\", \"<br />...\", $str);\n return $str;\n }\n }\n }", "public function text() {}", "public function text() {}", "public function text() {}", "public function getText() {\n\t\treturn $this->text;\n\t}", "function contentDescription(){\n\n\t\t/* Check if description exists */\n\t\tif($this->contentDescription == ''){\n\t\t\t$user = $this->getUserInfo();\n\t\t\t$content = $user->person->description->_content;\n\t\t} else {\n\t\t\t$content = $this->contentDescription;\n\t\t}\n\n\t\t/* Only to first line break */\n\t\tif(strpos($content, \"\\n\") !== false){\n\t\t\t$content = explode(\"\\n\",$content);\n\t\t\t$content = $content[0];\n\t\t}\n\t\treturn $content;\n\t}", "public function getText(){\n\t\treturn $this->_text;\n\t}", "function get_site_description() {\r\n\t?>\r\n\t\t<div id=\"title-description\" class=\"five3-font\">Meal Replacement<br/>Energy Drink Mix</div>\r\n\t<?php\r\n}", "public function getBrief()\n {\n return $this->brief;\n }", "function embolden()\n {\n $CI =& get_instance();\n \n // Get the output of the objects\n $page = $CI->output->get_output();\n\n // Retrieve the DOM object\n $dom = new DOMDocument();\n\n $dom->loadHTML($page);\n \n $plist = $dom->getElementsByTagName('p');\n \n $search = array(\n '/([A-Z][A-Za-z]*)/' \n );\n\n $replace = array(\n '<strong>$1</strong>'\n );\n \n // Loop through each paragraph tag on the page\n foreach($plist as $p)\n {\n // If the paragraph tag has a class of 'lead'\n if ($p->getAttribute('class') == 'lead')\n {\n $string = $p->nodeValue;\n\n // Replace the string with bold capitalized words\n $string = preg_replace($search, $replace, $string);\n\n // Create a new tag object\n $frag = $dom->createDocumentFragment();\n $frag->appendXML($string);\n \n // Append the new object to the element\n $p->nodeValue = '';\n $p->appendChild($frag);\n }\n }\n \n // Render the page\n echo $dom->saveHTML();\n }", "public final function getText() : string\n {\n return self::htmlToText($this->getHtml());\n }", "public function getText(): string\n {\n return $this->attributes->get('text', '');\n }", "function getText()\r\n {\r\n return $this->text;\r\n }" ]
[ "0.6004652", "0.59671986", "0.5666079", "0.5549008", "0.5529162", "0.54114276", "0.54049116", "0.53617334", "0.53467906", "0.5331171", "0.5294811", "0.5259774", "0.5241196", "0.520316", "0.5161109", "0.5139849", "0.5134706", "0.51287276", "0.5109651", "0.5109651", "0.5109651", "0.5104748", "0.50912225", "0.50548816", "0.50510013", "0.50430834", "0.5037806", "0.5036474", "0.5036474", "0.50339264", "0.5029402", "0.50273955", "0.49956682", "0.49902153", "0.49858773", "0.49758986", "0.49738052", "0.4970548", "0.49681267", "0.4962885", "0.49568784", "0.49458632", "0.49455276", "0.49377403", "0.49377403", "0.4924701", "0.49243343", "0.4922548", "0.49026975", "0.49026975", "0.49026975", "0.490181", "0.49007663", "0.49007663", "0.48945054", "0.48927408", "0.488222", "0.48764417", "0.48722738", "0.48688707", "0.48672354", "0.48668253", "0.4853512", "0.48493904", "0.48432487", "0.4831696", "0.4819492", "0.48191828", "0.48171774", "0.48055172", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.4805362", "0.47924897", "0.47924423", "0.4792044", "0.47862136", "0.47849056", "0.4782597", "0.4782597", "0.4782597", "0.47822827", "0.47816494", "0.47812706", "0.47792625", "0.477639", "0.47757813", "0.47732416", "0.47684604", "0.47665137" ]
0.7552279
0
get the code list
public function getLibriNotificationKey() { $codeList = $this->_getFirstElement('lieferantintern/ms/ms01'); // only return key if it's from the default code list return ($codeList == "01") ? $this->_getFirstElement('lieferantintern/ms/ms02') : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllCode(){\n return parent::getAll('code_ade');\n }", "public static function getAutoCodeList()\n {\n $autocodes = array();\n\n $scopes = JFolder::folders(ECRPATH_AUTOCODES);\n\n foreach($scopes as $scope)\n {\n if($scope != 'admin' && $scope != 'site')\n continue;\n\n $names = JFolder::folders(ECRPATH_AUTOCODES.DS.$scope);\n\n foreach($names as $name)\n {\n if($name == 'sql')\n continue;\n\n $types = JFolder::folders(ECRPATH_AUTOCODES.DS.$scope.DS.$name);\n\n foreach($types as $type)\n {\n $path = ECRPATH_AUTOCODES.DS.$scope.DS.$name.DS.$type.DS.'tmpl';\n $files = JFolder::files($path, '.', true, true);\n\n if( ! $files)\n continue;\n\n foreach($files as $file)\n {\n $autocodes[$scope][$name][$type][] = str_replace($path.DS, '', $file);\n }\n }\n }\n }\n\n return $autocodes;\n }", "final function getCode();", "public function getCodes () {\n $list = [\n '' => '全部',\n 'optask' => '任务',\n 'patientrecord' => '运营备注',\n 'patientstage' => '患者阶段',\n 'patientgroup' => '患者分组',\n 'patientremark' => '患者文本备注',\n ];\n\n return $list;\n }", "public function getCodes()\n {\n \n $materials = $this->materialsDao->getAll();\n \n $codesArr = array_map(function ($material) {\n return $material->code;\n }, $materials);\n\n return $codesArr;\n }", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function getCode();", "public function codes()\n {\n return $this->codes;\n }", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "public static function getCodes()\n\t{\n\t\treturn [\n\t\t\tBase::Mail,\n\t\t\tBase::Call,\n\t\t\tBase::Imol,\n\t\t\tBase::Site,\n\t\t\tBase::Site24,\n\t\t\tBase::Shop24,\n\t\t\tBase::SiteDomain,\n\t\t\tBase::Button,\n\t\t\tBase::Form,\n\t\t\tBase::Callback,\n\t\t\tBase::FbLeadAds,\n\t\t\tBase::VkLeadAds,\n\t\t\tBase::Rest,\n\t\t\tBase::Order,\n\t\t\tBase::SalesCenter,\n\t\t];\n\t}", "public function getCode() {}", "protected function getAllCodes() {\n \t$codes = array();\n \t$config = Mage::getConfig()->getNode('crontab/jobs'); /* @var $config Mage_Core_Model_Config_Element */\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n \treturn $codes;\n }", "protected function getAllCodes() {\n\t\t$codes = array();\n\t\t$config = Mage::getConfig()->getNode('crontab/jobs'); \n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$config = Mage::getConfig()->getNode('default/crontab/jobs');\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n\t\treturn $codes;\n\t}", "public function getCode() {\n\t\t$code = [];\n\t\tforeach($this->code as $_ => $val) {\n\t\t\t$code[] = \"API.{$val[0]}(\".json_encode($val[1], JSON_UNESCAPED_UNICODE).\")\";\n\t\t}\n\n\t\treturn 'return ['.implode(',', $code).'];';\n\t}", "public function getAllCodesList()\n {\n try {\n $codesList = VoucherCode::getAllCodesList();\n return response()->json(['message' => 'There are '.count($codesList).' voucher code(s).', 'data'=>$codesList]);\n } catch (NotFoundException $e) {\n return response()->json(['message' => $e->getMessage()]);\n }\n }", "public function getCode()\n {\n }", "static function getCodes() {\n $oClass = new ReflectionClass(__CLASS__);\n return $oClass->getConstants();\n }", "private function generate_code() {\n\t\t$secret = $this->code_generator->createSecret();\n\t\t$code = $this->code_generator->getCode($secret);\n\t\treturn array('secret'=>$secret, 'code'=>$code);\n\t}", "public function getAppCodes() {\n return $this->api('appcodes')->getRows();\n }", "public static function codes()\n {\n return static::CODES;\n }", "private function getTokens($code) {\n\t\t$this->src = $code;\n\t\treturn token_get_all($code);\n\t}", "public function getListParentCode()\n {\n\n $urlConApi = config('app.api') . 'category?mod=list_category';\n\n $result = $this->getListData($urlConApi);\n\n $listParentCode = [];\n if (isset($result['data'])) {\n foreach ($result['data'] as $key => $parentCode) {\n $listParentCode[] = $parentCode['Code'];\n }\n }\n\n return $listParentCode;\n }", "public function get_langs_list()\n {\n // they must come first. (ex: CSS has to come \n // before CSS-extras)\n\n return [\n 1 => ['id' => 'markup', 'name' => 'Markup', 'file' => 'prism-markup', 'require' => '', 'in_popup' => 1],\n 2 => ['id' => 'css', 'name' => 'CSS', 'file' => 'prism-css', 'require' => '', 'in_popup' => 1],\n 3 => ['id' => 'css-extras', 'name' => 'CSS Extras', 'file' => 'prism-css-extras', 'require' => 'css', 'in_popup' => 0],\n 4 => ['id' => 'clike', 'name' => 'C-Like', 'file' => 'prism-clike', 'require' => '', 'in_popup' => 1],\n 5 => ['id' => 'javascript', 'name' => 'Java-Script', 'file' => 'prism-javascript', 'require' => 'clike', 'in_popup' => 1],\n 6 => ['id' => 'php', 'name' => 'PHP', 'file' => 'prism-php', 'require' => 'clike', 'in_popup' => 1],\n 7 => ['id' => 'php-extras', 'name' => 'PHP Extras', 'file' => 'prism-php-extras', 'require' => 'php', 'in_popup' => 0],\n 8 => ['id' => 'ruby', 'name' => 'Ruby', 'file' => 'prism-ruby', 'require' => 'clike', 'in_popup' => 1],\n 9 => ['id' => 'sql', 'name' => 'SQL', 'file' => 'prism-sql', 'require' => '', 'in_popup' => 1],\n 10 => ['id' => 'c', 'name' => 'C', 'file' => 'prism-c', 'require' => 'clike', 'in_popup' => 1],\n 11 => ['id' => 'abap', 'name' => 'ABAP', 'file' => 'prism-abap', 'require' => '', 'in_popup' => 1],\n 12 => ['id' => 'actionscript', 'name' => 'ActionScript', 'file' => 'prism-actionscript', 'require' => 'javascript', 'in_popup' => 1],\n 13 => ['id' => 'ada', 'name' => 'Ada', 'file' => 'prism-ada', 'require' => '', 'in_popup' => 1],\n 14 => ['id' => 'apacheconf', 'name' => 'Apache Configuration', 'file' => 'prism-apacheconf', 'require' => '', 'in_popup' => 1],\n 15 => ['id' => 'apl', 'name' => 'APL', 'file' => 'prism-apl', 'require' => '', 'in_popup' => 1],\n 16 => ['id' => 'applescript', 'name' => 'Applescript', 'file' => 'prism-applescript', 'require' => '', 'in_popup' => 1],\n 17 => ['id' => 'asciidoc', 'name' => 'AsciiDoc', 'file' => 'prism-asciidoc', 'require' => '', 'in_popup' => 1],\n 18 => ['id' => 'aspnet', 'name' => 'ASP.NET (C#)', 'file' => 'prism-aspnet', 'require' => 'markup', 'in_popup' => 1],\n 19 => ['id' => 'autoit', 'name' => 'AutoIt', 'file' => 'prism-autoit', 'require' => '', 'in_popup' => 1],\n 20 => ['id' => 'autohotkey', 'name' => 'AutoHotkey', 'file' => 'prism-autohotkey', 'require' => '', 'in_popup' => 1],\n 21 => ['id' => 'bash', 'name' => 'Bash', 'file' => 'prism-bash', 'require' => '', 'in_popup' => 1],\n 22 => ['id' => 'basic', 'name' => 'BASIC', 'file' => 'prism-basic', 'require' => '', 'in_popup' => 1],\n 23 => ['id' => 'batch', 'name' => 'Batch', 'file' => 'prism-batch', 'require' => '', 'in_popup' => 1],\n 24 => ['id' => 'bison', 'name' => 'Bison', 'file' => 'prism-bison', 'require' => 'c', 'in_popup' => 1],\n 25 => ['id' => 'brainfuck', 'name' => 'Brainfuck', 'file' => 'prism-brainfuck', 'require' => '', 'in_popup' => 1],\n 26 => ['id' => 'bro', 'name' => 'Bro', 'file' => 'prism-bro', 'require' => '', 'in_popup' => 1],\n 27 => ['id' => 'csharp', 'name' => 'C#', 'file' => 'prism-csharp', 'require' => 'c', 'in_popup' => 1],\n 28 => ['id' => 'cpp', 'name' => 'C++', 'file' => 'prism-cpp', 'require' => 'c', 'in_popup' => 1],\n 29 => ['id' => 'coffeescript', 'name' => 'CoffeeScript', 'file' => 'prism-coffeescript', 'require' => 'javascript', 'in_popup' => 1],\n 30 => ['id' => 'crystal', 'name' => 'Crystal', 'file' => 'prism-crystal', 'require' => 'ruby', 'in_popup' => 1],\n 31 => ['id' => 'd', 'name' => 'D', 'file' => 'prism-d', 'require' => 'clike', 'in_popup' => 1],\n 32 => ['id' => 'dart', 'name' => 'Dart', 'file' => 'prism-dart', 'require' => 'clike', 'in_popup' => 1],\n 33 => ['id' => 'diff', 'name' => 'Diff', 'file' => 'prism-diff', 'require' => '', 'in_popup' => 1],\n 34 => ['id' => 'django', 'name' => 'Django/Jinja2', 'file' => 'prism-django', 'require' => 'markup', 'in_popup' => 1],\n 35 => ['id' => 'docker', 'name' => 'Docker', 'file' => 'prism-docker', 'require' => '', 'in_popup' => 1],\n 36 => ['id' => 'eiffel', 'name' => 'Eiffel', 'file' => 'prism-eiffel', 'require' => '', 'in_popup' => 1],\n 37 => ['id' => 'elixir', 'name' => 'Elixir', 'file' => 'prism-elixir', 'require' => '', 'in_popup' => 1],\n 38 => ['id' => 'erlang', 'name' => 'Erlang', 'file' => 'prism-erlang', 'require' => '', 'in_popup' => 1],\n 39 => ['id' => 'fsharp', 'name' => 'F#', 'file' => 'prism-fsharp', 'require' => 'clike', 'in_popup' => 1],\n 40 => ['id' => 'fortran', 'name' => 'Fortran', 'file' => 'prism-fortran', 'require' => '', 'in_popup' => 1],\n 41 => ['id' => 'gherkin', 'name' => 'Gherkin', 'file' => 'prism-gherkin', 'require' => '', 'in_popup' => 1],\n 42 => ['id' => 'git', 'name' => 'Git', 'file' => 'prism-git', 'require' => '', 'in_popup' => 1],\n 43 => ['id' => 'glsl', 'name' => 'GLSL', 'file' => 'prism-glsl', 'require' => 'clike', 'in_popup' => 1],\n 44 => ['id' => 'go', 'name' => 'Go', 'file' => 'prism-go', 'require' => 'clike', 'in_popup' => 1],\n 45 => ['id' => 'graphql', 'name' => 'GraphQL', 'file' => 'prism-graphql', 'require' => '', 'in_popup' => 1],\n 46 => ['id' => 'groovy', 'name' => 'Groovy', 'file' => 'prism-groovy', 'require' => 'clike', 'in_popup' => 1],\n 47 => ['id' => 'haml', 'name' => 'Haml', 'file' => 'prism-haml', 'require' => 'ruby', 'in_popup' => 1],\n 48 => ['id' => 'handlebars', 'name' => 'Handlebars', 'file' => 'prism-handlebars', 'require' => 'markup', 'in_popup' => 1],\n 49 => ['id' => 'haskell', 'name' => 'Haskell', 'file' => 'prism-haskell', 'require' => '', 'in_popup' => 1],\n 50 => ['id' => 'haxe', 'name' => 'Haxe', 'file' => 'prism-haxe', 'require' => 'clike', 'in_popup' => 1],\n 51 => ['id' => 'http', 'name' => 'HTTP', 'file' => 'prism-http', 'require' => '', 'in_popup' => 1],\n 52 => ['id' => 'icon', 'name' => 'Icon', 'file' => 'prism-icon', 'require' => '', 'in_popup' => 1],\n 53 => ['id' => 'inform7', 'name' => 'Inform 7', 'file' => 'prism-inform7', 'require' => '', 'in_popup' => 1],\n 54 => ['id' => 'ini', 'name' => 'Ini', 'file' => 'prism-ini', 'require' => '', 'in_popup' => 1],\n 55 => ['id' => 'j', 'name' => 'J', 'file' => 'prism-j', 'require' => '', 'in_popup' => 1],\n 56 => ['id' => 'jade', 'name' => 'Jade', 'file' => 'prism-jade', 'require' => 'javascript', 'in_popup' => 1],\n 57 => ['id' => 'java', 'name' => 'Java', 'file' => 'prism-java', 'require' => 'clike', 'in_popup' => 1],\n 58 => ['id' => 'jolie', 'name' => 'Jolie', 'file' => 'prism-jolie', 'require' => 'clike', 'in_popup' => 1],\n 59 => ['id' => 'json', 'name' => 'JSON', 'file' => 'prism-json', 'require' => '', 'in_popup' => 1],\n 60 => ['id' => 'julia', 'name' => 'Julia', 'file' => 'prism-julia', 'require' => '', 'in_popup' => 1],\n 61 => ['id' => 'keyman', 'name' => 'Keyman', 'file' => 'prism-keyman', 'require' => '', 'in_popup' => 1],\n 62 => ['id' => 'kotlin', 'name' => 'Kotlin', 'file' => 'prism-kotlin', 'require' => 'clike', 'in_popup' => 1],\n 63 => ['id' => 'latex', 'name' => 'LaTex', 'file' => 'prism-latex', 'require' => '', 'in_popup' => 1],\n 64 => ['id' => 'less', 'name' => 'Less', 'file' => 'prism-less', 'require' => 'css', 'in_popup' => 1],\n 65 => ['id' => 'livescript', 'name' => 'LiveScript', 'file' => 'prism-livescript', 'require' => '', 'in_popup' => 1],\n 66 => ['id' => 'lolcode', 'name' => 'LOLCODE', 'file' => 'prism-lolcode', 'require' => '', 'in_popup' => 1],\n 67 => ['id' => 'lua', 'name' => 'Lua', 'file' => 'prism-lua', 'require' => '', 'in_popup' => 1],\n 68 => ['id' => 'makefile', 'name' => 'Makefile', 'file' => 'prism-makefile', 'require' => '', 'in_popup' => 1],\n 69 => ['id' => 'markdown', 'name' => 'Markdown', 'file' => 'prism-markdown', 'require' => 'markup', 'in_popup' => 1],\n 70 => ['id' => 'matlab', 'name' => 'MATLAB', 'file' => 'prism-matlab', 'require' => '', 'in_popup' => 1],\n 71 => ['id' => 'mel', 'name' => 'MEL', 'file' => 'prism-mel', 'require' => '', 'in_popup' => 1],\n 72 => ['id' => 'mizar', 'name' => 'Mizar', 'file' => 'prism-mizar', 'require' => '', 'in_popup' => 1],\n 73 => ['id' => 'monkey', 'name' => 'Monkey', 'file' => 'prism-monkey', 'require' => '', 'in_popup' => 1],\n 74 => ['id' => 'nasm', 'name' => 'NASM', 'file' => 'prism-nasm', 'require' => '', 'in_popup' => 1],\n 75 => ['id' => 'nginx', 'name' => 'nginx', 'file' => 'prism-nginx', 'require' => 'clike', 'in_popup' => 1],\n 76 => ['id' => 'nim', 'name' => 'Nim', 'file' => 'prism-nim', 'require' => '', 'in_popup' => 1],\n 77 => ['id' => 'nix', 'name' => 'Nix', 'file' => 'prism-nix', 'require' => '', 'in_popup' => 1],\n 78 => ['id' => 'objectivec', 'name' => 'Objective-C', 'file' => 'prism-objectivec', 'require' => 'c', 'in_popup' => 1],\n 79 => ['id' => 'ocaml', 'name' => 'OCaml', 'file' => 'prism-ocaml', 'require' => '', 'in_popup' => 1],\n 80 => ['id' => 'oz', 'name' => 'Oz', 'file' => 'prism-oz', 'require' => '', 'in_popup' => 1],\n 81 => ['id' => 'parigp', 'name' => 'PARI/GP', 'file' => 'prism-parigp', 'require' => '', 'in_popup' => 1],\n 82 => ['id' => 'parser', 'name' => 'Parser', 'file' => 'prism-parser', 'require' => 'markup', 'in_popup' => 1],\n 83 => ['id' => 'pascal', 'name' => 'Pascal', 'file' => 'prism-pascal', 'require' => '', 'in_popup' => 1],\n 84 => ['id' => 'perl', 'name' => 'Perl', 'file' => 'prism-perl', 'require' => '', 'in_popup' => 1],\n 85 => ['id' => 'powershell', 'name' => 'PowerShell', 'file' => 'prism-powershell', 'require' => '', 'in_popup' => 1],\n 86 => ['id' => 'processing', 'name' => 'Processing', 'file' => 'prism-processing', 'require' => 'clike', 'in_popup' => 1],\n 87 => ['id' => 'prolog', 'name' => 'Prolog', 'file' => 'prism-prolog', 'require' => '', 'in_popup' => 1],\n 88 => ['id' => 'properties', 'name' => '.properties', 'file' => 'prism-properties', 'require' => '', 'in_popup' => 1],\n 89 => ['id' => 'protobuf', 'name' => 'Protocol Buffers', 'file' => 'prism-protobuf', 'require' => 'clike', 'in_popup' => 1],\n 90 => ['id' => 'puppet', 'name' => 'Puppet', 'file' => 'prism-puppet', 'require' => '', 'in_popup' => 1],\n 91 => ['id' => 'pure', 'name' => 'Pure', 'file' => 'prism-pure', 'require' => '', 'in_popup' => 1],\n 92 => ['id' => 'python', 'name' => 'Python', 'file' => 'prism-python', 'require' => '', 'in_popup' => 1],\n 93 => ['id' => 'q', 'name' => 'Q', 'file' => 'prism-q', 'require' => '', 'in_popup' => 1],\n 94 => ['id' => 'qore', 'name' => 'Qore', 'file' => 'prism-qore', 'require' => 'clike', 'in_popup' => 1],\n 95 => ['id' => 'r', 'name' => 'R', 'file' => 'prism-r', 'require' => '', 'in_popup' => 1],\n 96 => ['id' => 'jsx', 'name' => 'React JSX', 'file' => 'prism-jsx', 'require' => 'markup', 'in_popup' => 1],\n 97 => ['id' => 'reason', 'name' => 'Reason', 'file' => 'prism-reason', 'require' => 'clike', 'in_popup' => 1],\n 98 => ['id' => 'rest', 'name' => 'reST (reStructuredText)', 'file' => 'prism-rest', 'require' => '', 'in_popup' => 1],\n 99 => ['id' => 'rip', 'name' => 'Rip', 'file' => 'prism-rip', 'require' => '', 'in_popup' => 1],\n 100 => ['id' => 'roboconf', 'name' => 'Roboconf', 'file' => 'prism-roboconf', 'require' => '', 'in_popup' => 1],\n 101 => ['id' => 'rust', 'name' => 'Rust', 'file' => 'prism-rust', 'require' => '', 'in_popup' => 1],\n 102 => ['id' => 'sas', 'name' => 'SAS', 'file' => 'prism-sas', 'require' => '', 'in_popup' => 1],\n 103 => ['id' => 'sass', 'name' => 'Sass (Sass)', 'file' => 'prism-sass', 'require' => 'css', 'in_popup' => 1],\n 104 => ['id' => 'scss', 'name' => 'Sass (Scss)', 'file' => 'prism-scss', 'require' => 'css', 'in_popup' => 1],\n 105 => ['id' => 'scala', 'name' => 'Scala', 'file' => 'prism-scala', 'require' => 'clike', 'in_popup' => 1],\n 106 => ['id' => 'scheme', 'name' => 'Scheme', 'file' => 'prism-scheme', 'require' => '', 'in_popup' => 1],\n 107 => ['id' => 'smalltalk', 'name' => 'Smalltalk', 'file' => 'prism-smalltalk', 'require' => '', 'in_popup' => 1],\n 108 => ['id' => 'smarty', 'name' => 'Smarty', 'file' => 'prism-smarty', 'require' => 'markup', 'in_popup' => 1],\n 109 => ['id' => 'stylus', 'name' => 'Stylus', 'file' => 'prism-stylus', 'require' => '', 'in_popup' => 1],\n 110 => ['id' => 'swift', 'name' => 'Swift', 'file' => 'prism-swift', 'require' => 'clike', 'in_popup' => 1],\n 111 => ['id' => 'tcl', 'name' => 'Tcl', 'file' => 'prism-tcl', 'require' => '', 'in_popup' => 1],\n 112 => ['id' => 'textile', 'name' => 'Textile', 'file' => 'prism-textile', 'require' => 'markup', 'in_popup' => 1],\n 113 => ['id' => 'twig', 'name' => 'Twig', 'file' => 'prism-twig', 'require' => 'markup', 'in_popup' => 1],\n 114 => ['id' => 'typescript', 'name' => 'TypeScript', 'file' => 'prism-typescript', 'require' => 'javascript', 'in_popup' => 1],\n 115 => ['id' => 'verilog', 'name' => 'Verilog', 'file' => 'prism-verilog', 'require' => '', 'in_popup' => 1],\n 116 => ['id' => 'vhdl', 'name' => 'VHDL', 'file' => 'prism-vhdl', 'require' => '', 'in_popup' => 1],\n 117 => ['id' => 'vim', 'name' => 'vim', 'file' => 'prism-vim', 'require' => '', 'in_popup' => 1],\n 118 => ['id' => 'wiki', 'name' => 'Wiki markup', 'file' => 'prism-wiki', 'require' => 'markup', 'in_popup' => 1],\n 119 => ['id' => 'xojo', 'name' => 'Xojo (REALbasic)', 'file' => 'prism-xojo', 'require' => '', 'in_popup' => 1],\n 120 => ['id' => 'yaml', 'name' => 'YAML', 'file' => 'prism-yaml', 'require' => '', 'in_popup' => 1],\n\n ];\n }", "public function getBackupCodes();", "public static function getCodeName(){\n\n $langArray = [];\n\n foreach (self::where('status', 1)->select('code','name')->get() as $lang){\n $langArray[$lang->code] = $lang->name;\n }\n\n return $langArray;\n }", "abstract public function getLinesOfCode();", "static function getListCode($pm_list_name_or_id) {\n\t\tif (ca_lists::$s_list_code_cache[$pm_list_name_or_id]) {\n\t\t\treturn ca_lists::$s_list_code_cache[$pm_list_name_or_id];\n\t\t}\n\t\tif (!is_numeric($pm_list_name_or_id)) {\n\t\t\treturn $pm_list_name_or_id;\n\t\t} else {\n\t\t\t$t_list = new ca_lists();\n\t\t\tif (!$t_list->load((int)$pm_list_name_or_id)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t$vn_list_id = $t_list->getPrimaryKey();\n\t\t\t$vs_list_code = $t_list->get('list_code');\n\t\t}\n\t\t\n\t\treturn ca_lists::$s_list_code_cache[$vn_list_id] = $vs_list_code;\n\t}", "public function getList();", "public function getList();", "public function list();", "public function list();", "public function list();", "public function getCode() {\n return $this->parse()['code'];\n }", "protected function getStateCodes()\n {\n $states = \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\State')->findAll();\n $result = array();\n\n foreach ($states as $state) {\n $result[] = array(\n 'id' => $state->getStateId(),\n 'code' => $state->getCode(),\n );\n }\n\n return json_encode($result);\n }", "public function list_handled_codes()\n {\n $list = array();\n $list['filedump'] = array(do_lang('CONTENT'), do_lang('filedump:NOTIFICATION_TYPE_filedump'));\n return $list;\n }", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "public function getCodeIdentifier() : array\n {\n $list = [];\n\n foreach ($this->binds as $codeName => $value){\n $list['codeName'] = Str::snake($codeName);\n $list['value'] = intval($value);\n }\n\n return $list;\n }", "public function select_list_code()\n\t{\n\t\treturn ORM::factory('country')->select_list('iso_code','name');\n\t}", "public function getCode() {\n\n $licence = '/*\n * Auto Generated Code for HomeNet\n *\n * Copyright (c) 2011 HomeNet.\n *\n * This file is part of HomeNet.\n *\n * HomeNet is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * HomeNet is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with HomeNet. If not, see <http ://www.gnu.org/licenses/>.\n */';\n return $licence;\n }", "public function getCodeDefinitions()\n {\n return $this->definitions;\n }", "static function getList_languages(){\n \t$configFile = dirname ( __FILE__ ).'/../config/'.DIRECTORY_SEPARATOR.'config_languages.php';\n \t$tmp=require($configFile);\n \t foreach ($tmp as $code=>$item){\n \t$tmp[$code]=Language::t(Yii::app()->language,'Backend.Language.List',$item);\n }\n return $tmp;\n }", "public function getLanguageList();", "public function actionCodes()\n {\n $searchModel = new PromotionCodeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n // For store admin index\n if (CurrentStore::isNone()) {\n $codes = PromotionCode::findAll(['is_active' => true, 'is_deleted' => false]);\n } else {\n $codes = PromotionCode::find()\n ->where([\n 'is_active' => true,\n 'is_deleted' => false\n ])\n ->all();\n }\n\n return $this->render('code/index', [\n 'codes' => $codes,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function mainCodes()\n {\n return static::MAIN_CODES;\n }", "function get_all_codes( $is_front_page = false ) {\n\n\n $return_array = array();\n foreach( $this->locations as $location_id => $location_name ) {\n\n // Get the current list of nav items\n $partner_codes = $this->get_all( $location_id, ( $is_front_page ? PC_EXCLUDE_CBR_FRONT_PAGE : PC_EXCLUDE_NONE ) );\n if ( !empty( $partner_codes ) && is_array( $partner_codes ) &&\n ( count( $partner_codes ) > 0 ) ) {\n $return_array[$location_id] = $partner_codes;\n }\n }\n\n return( $return_array );\n }", "public function getCode(): ?array\n\t{\n\t\treturn $this->code;\n\t}", "public function getCloneCodes()\n {\n $codes = array();\n foreach ($this->code as $key => $code) {\n $codes[$key] = clone $code;\n }\n return $codes;\n }", "public function list_bbcodes()\r\n\t{\r\n\t\treturn array_keys($this->bbcodes);\r\n\t}", "abstract public function getList();", "public static function getNames()\n\t{\n\t\t$list = [];\n\t\tforeach (self::getCodes() as $code)\n\t\t{\n\t\t\t$list[$code] = Base::getNameByCode($code);\n\t\t}\n\n\t\treturn $list;\n\t}", "protected function getCompilerDescriptions(): array\n {\n return [];\n }", "public function getCode(): string;", "public function getCode(): string;", "public function getCode(): string;", "public function list()\n {\n return [1, 2, 3];\n }", "public function getAllStatesByCode(){\n return array(\"AC\",\"AL\",\"AM\",\"AP\",\"BA\",\"CE\",\"DF\",\"ES\",\"GO\",\"MA\",\"MT\",\"MS\",\"MG\",\"PA\",\"PB\",\"PR\",\"PE\",\"PI\",\"RJ\",\"RN\",\"RO\",\"RS\",\"RR\",\"SC\",\"SE\",\"SP\",\"TO\");\n }", "public function lists();", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/geshi.php',\n 'sources_custom/geshi/.htaccess',\n 'sources_custom/geshi/index.html',\n 'sources_custom/geshi/4cs.php',\n 'sources_custom/geshi/abap.php',\n 'sources_custom/geshi/actionscript.php',\n 'sources_custom/geshi/actionscript3.php',\n 'sources_custom/geshi/ada.php',\n 'sources_custom/geshi/apache.php',\n 'sources_custom/geshi/applescript.php',\n 'sources_custom/geshi/apt_sources.php',\n 'sources_custom/geshi/asm.php',\n 'sources_custom/geshi/asp.php',\n 'sources_custom/geshi/autohotkey.php',\n 'sources_custom/geshi/autoit.php',\n 'sources_custom/geshi/avisynth.php',\n 'sources_custom/geshi/awk.php',\n 'sources_custom/geshi/bash.php',\n 'sources_custom/geshi/basic4gl.php',\n 'sources_custom/geshi/bf.php',\n 'sources_custom/geshi/bibtex.php',\n 'sources_custom/geshi/blitzbasic.php',\n 'sources_custom/geshi/bnf.php',\n 'sources_custom/geshi/boo.php',\n 'sources_custom/geshi/c.php',\n 'sources_custom/geshi/c_mac.php',\n 'sources_custom/geshi/caddcl.php',\n 'sources_custom/geshi/cadlisp.php',\n 'sources_custom/geshi/cfdg.php',\n 'sources_custom/geshi/cfm.php',\n 'sources_custom/geshi/cil.php',\n 'sources_custom/geshi/clojure.php',\n 'sources_custom/geshi/cmake.php',\n 'sources_custom/geshi/cobol.php',\n 'sources_custom/geshi/cpp-qt.php',\n 'sources_custom/geshi/cpp.php',\n 'sources_custom/geshi/csharp.php',\n 'sources_custom/geshi/css.php',\n 'sources_custom/geshi/cuesheet.php',\n 'sources_custom/geshi/d.php',\n 'sources_custom/geshi/dcs.php',\n 'sources_custom/geshi/delphi.php',\n 'sources_custom/geshi/diff.php',\n 'sources_custom/geshi/div.php',\n 'sources_custom/geshi/dos.php',\n 'sources_custom/geshi/dot.php',\n 'sources_custom/geshi/eiffel.php',\n 'sources_custom/geshi/email.php',\n 'sources_custom/geshi/erlang.php',\n 'sources_custom/geshi/fo.php',\n 'sources_custom/geshi/fortran.php',\n 'sources_custom/geshi/freebasic.php',\n 'sources_custom/geshi/fsharp.php',\n 'sources_custom/geshi/gambas.php',\n 'sources_custom/geshi/gdb.php',\n 'sources_custom/geshi/genero.php',\n 'sources_custom/geshi/gettext.php',\n 'sources_custom/geshi/glsl.php',\n 'sources_custom/geshi/gml.php',\n 'sources_custom/geshi/gnuplot.php',\n 'sources_custom/geshi/groovy.php',\n 'sources_custom/geshi/haskell.php',\n 'sources_custom/geshi/hq9plus.php',\n 'sources_custom/geshi/html4strict.php',\n 'sources_custom/geshi/idl.php',\n 'sources_custom/geshi/ini.php',\n 'sources_custom/geshi/inno.php',\n 'sources_custom/geshi/intercal.php',\n 'sources_custom/geshi/io.php',\n 'sources_custom/geshi/java.php',\n 'sources_custom/geshi/java5.php',\n 'sources_custom/geshi/javascript.php',\n 'sources_custom/geshi/jquery.php',\n 'sources_custom/geshi/kixtart.php',\n 'sources_custom/geshi/klonec.php',\n 'sources_custom/geshi/klonecpp.php',\n 'sources_custom/geshi/latex.php',\n 'sources_custom/geshi/lisp.php',\n 'sources_custom/geshi/locobasic.php',\n 'sources_custom/geshi/logtalk.php',\n 'sources_custom/geshi/lolcode.php',\n 'sources_custom/geshi/lotusformulas.php',\n 'sources_custom/geshi/lotusscript.php',\n 'sources_custom/geshi/lscript.php',\n 'sources_custom/geshi/lsl2.php',\n 'sources_custom/geshi/lua.php',\n 'sources_custom/geshi/m68k.php',\n 'sources_custom/geshi/make.php',\n 'sources_custom/geshi/mapbasic.php',\n 'sources_custom/geshi/matlab.php',\n 'sources_custom/geshi/mirc.php',\n 'sources_custom/geshi/mmix.php',\n 'sources_custom/geshi/modula3.php',\n 'sources_custom/geshi/mpasm.php',\n 'sources_custom/geshi/mxml.php',\n 'sources_custom/geshi/mysql.php',\n 'sources_custom/geshi/newlisp.php',\n 'sources_custom/geshi/nsis.php',\n 'sources_custom/geshi/oberon2.php',\n 'sources_custom/geshi/objc.php',\n 'sources_custom/geshi/ocaml-brief.php',\n 'sources_custom/geshi/ocaml.php',\n 'sources_custom/geshi/oobas.php',\n 'sources_custom/geshi/oracle11.php',\n 'sources_custom/geshi/oracle8.php',\n 'sources_custom/geshi/pascal.php',\n 'sources_custom/geshi/per.php',\n 'sources_custom/geshi/perl.php',\n 'sources_custom/geshi/perl6.php',\n 'sources_custom/geshi/php-brief.php',\n 'sources_custom/geshi/php.php',\n 'sources_custom/geshi/pic16.php',\n 'sources_custom/geshi/pike.php',\n 'sources_custom/geshi/pixelbender.php',\n 'sources_custom/geshi/plsql.php',\n 'sources_custom/geshi/povray.php',\n 'sources_custom/geshi/powerbuilder.php',\n 'sources_custom/geshi/powershell.php',\n 'sources_custom/geshi/progress.php',\n 'sources_custom/geshi/prolog.php',\n 'sources_custom/geshi/properties.php',\n 'sources_custom/geshi/providex.php',\n 'sources_custom/geshi/purebasic.php',\n 'sources_custom/geshi/python.php',\n 'sources_custom/geshi/qbasic.php',\n 'sources_custom/geshi/rails.php',\n 'sources_custom/geshi/rebol.php',\n 'sources_custom/geshi/reg.php',\n 'sources_custom/geshi/robots.php',\n 'sources_custom/geshi/rsplus.php',\n 'sources_custom/geshi/ruby.php',\n 'sources_custom/geshi/sas.php',\n 'sources_custom/geshi/scala.php',\n 'sources_custom/geshi/scheme.php',\n 'sources_custom/geshi/scilab.php',\n 'sources_custom/geshi/sdlbasic.php',\n 'sources_custom/geshi/smalltalk.php',\n 'sources_custom/geshi/smarty.php',\n 'sources_custom/geshi/sql.php',\n 'sources_custom/geshi/systemverilog.php',\n 'sources_custom/geshi/tcl.php',\n 'sources_custom/geshi/teraterm.php',\n 'sources_custom/geshi/text.php',\n 'sources_custom/geshi/thinbasic.php',\n 'sources_custom/geshi/tsql.php',\n 'sources_custom/geshi/typoscript.php',\n 'sources_custom/geshi/vb.php',\n 'sources_custom/geshi/vbnet.php',\n 'sources_custom/geshi/verilog.php',\n 'sources_custom/geshi/vhdl.php',\n 'sources_custom/geshi/vim.php',\n 'sources_custom/geshi/visualfoxpro.php',\n 'sources_custom/geshi/visualprolog.php',\n 'sources_custom/geshi/whitespace.php',\n 'sources_custom/geshi/whois.php',\n 'sources_custom/geshi/winbatch.php',\n 'sources_custom/geshi/xml.php',\n 'sources_custom/geshi/xorg_conf.php',\n 'sources_custom/geshi/xpp.php',\n 'sources_custom/geshi/z80.php',\n 'sources_custom/geshi.php',\n 'sources_custom/geshi/.gitignore',\n 'sources_custom/geshi/6502acme.php',\n 'sources_custom/geshi/6502kickass.php',\n 'sources_custom/geshi/6502tasm.php',\n 'sources_custom/geshi/68000devpac.php',\n 'sources_custom/geshi/aimms.php',\n 'sources_custom/geshi/algol68.php',\n 'sources_custom/geshi/arm.php',\n 'sources_custom/geshi/asymptote.php',\n 'sources_custom/geshi/autoconf.php',\n 'sources_custom/geshi/bascomavr.php',\n 'sources_custom/geshi/c_loadrunner.php',\n 'sources_custom/geshi/c_winapi.php',\n 'sources_custom/geshi/chaiscript.php',\n 'sources_custom/geshi/chapel.php',\n 'sources_custom/geshi/coffeescript.php',\n 'sources_custom/geshi/cpp-winapi.php',\n 'sources_custom/geshi/dart.php',\n 'sources_custom/geshi/dcl.php',\n 'sources_custom/geshi/dcpu16.php',\n 'sources_custom/geshi/e.php',\n 'sources_custom/geshi/ecmascript.php',\n 'sources_custom/geshi/epc.php',\n 'sources_custom/geshi/euphoria.php',\n 'sources_custom/geshi/ezt.php',\n 'sources_custom/geshi/f1.php',\n 'sources_custom/geshi/falcon.php',\n 'sources_custom/geshi/freeswitch.php',\n 'sources_custom/geshi/genie.php',\n 'sources_custom/geshi/go.php',\n 'sources_custom/geshi/gwbasic.php',\n 'sources_custom/geshi/haxe.php',\n 'sources_custom/geshi/hicest.php',\n 'sources_custom/geshi/html5.php',\n 'sources_custom/geshi/icon.php',\n 'sources_custom/geshi/ispfpanel.php',\n 'sources_custom/geshi/j.php',\n 'sources_custom/geshi/jcl.php',\n 'sources_custom/geshi/lb.php',\n 'sources_custom/geshi/ldif.php',\n 'sources_custom/geshi/llvm.php',\n 'sources_custom/geshi/magiksf.php',\n 'sources_custom/geshi/modula2.php',\n 'sources_custom/geshi/nagios.php',\n 'sources_custom/geshi/netrexx.php',\n 'sources_custom/geshi/nginx.php',\n 'sources_custom/geshi/nimrod.php',\n 'sources_custom/geshi/objeck.php',\n 'sources_custom/geshi/octave.php',\n 'sources_custom/geshi/oorexx.php',\n 'sources_custom/geshi/oxygene.php',\n 'sources_custom/geshi/oz.php',\n 'sources_custom/geshi/parasail.php',\n 'sources_custom/geshi/parigp.php',\n 'sources_custom/geshi/pcre.php',\n 'sources_custom/geshi/pf.php',\n 'sources_custom/geshi/pli.php',\n 'sources_custom/geshi/postgresql.php',\n 'sources_custom/geshi/postscript.php',\n 'sources_custom/geshi/proftpd.php',\n 'sources_custom/geshi/pycon.php',\n 'sources_custom/geshi/pys60.php',\n 'sources_custom/geshi/q.php',\n 'sources_custom/geshi/qml.php',\n 'sources_custom/geshi/racket.php',\n 'sources_custom/geshi/rbs.php',\n 'sources_custom/geshi/rexx.php',\n 'sources_custom/geshi/rpmspec.php',\n 'sources_custom/geshi/rust.php',\n 'sources_custom/geshi/scl.php',\n 'sources_custom/geshi/spark.php',\n 'sources_custom/geshi/sparql.php',\n 'sources_custom/geshi/standardml.php',\n 'sources_custom/geshi/stonescript.php',\n 'sources_custom/geshi/unicon.php',\n 'sources_custom/geshi/upc.php',\n 'sources_custom/geshi/urbi.php',\n 'sources_custom/geshi/uscript.php',\n 'sources_custom/geshi/vala.php',\n 'sources_custom/geshi/vbscript.php',\n 'sources_custom/geshi/vedit.php',\n 'sources_custom/geshi/xbasic.php',\n 'sources_custom/geshi/yaml.php',\n 'sources_custom/geshi/zxbasic.php',\n );\n }", "public function getList()\r\n {\r\n return $this->setNuki(\r\n __FUNCTION__\r\n );\r\n }", "public function getCode():string;", "public function get_postal_code_list()\n {\n return $this -> generate_postal_code_list();\n }", "public function getList()\n {\n }", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "public function ratesCodesDataProvider()\n {\n return [\n [['some_code'], 'ESCAPED:some_code'],\n [['some_code', 'some_code2'], 'ESCAPED:some_code, some_code2'],\n [[], ''],\n [null, ''],\n ];\n }", "public function getAll(): array\n {\n $codes = [];\n foreach ($this->codeToIdMap as $code => $id) {\n $codes[$code] = new VatCodeId($id);\n }\n\n return $codes;\n }", "public static function getList($code)\r\n {\r\n self::$code = htmlentities($code, ENT_QUOTES, 'UTF-8');\r\n\r\n $post = array(\r\n 'code' => self::$code,\r\n 'client_id' => self::$details['client_id'],\r\n 'client_secret' => self::$details['client_secret'],\r\n 'redirect_uri' => self::$details['redirect'],\r\n 'grant_type' => 'authorization_code',\r\n );\r\n\r\n // getting the JSON file and decoding it\r\n if ($access = json_decode(self::postContents('https://accounts.google.com/o/oauth2/token', $post), true)) {\r\n self::$token = $access['access_token'];\r\n $url = 'https://www.google.com/m8/feeds/contacts/default/full?max-results=' . self::$details['max_results'] . '&oauth_token=' . self::$token;\r\n\r\n if ($content = self::getContents($url)) {\r\n // parsing XML objects\r\n $xml = new SimpleXMLElement($content);\r\n // registering the path\r\n $xml->registerXPathNamespace('gd', 'http://schemas.google.com/g/2005');\r\n self::$emailList = $xml->xpath('//gd:email');\r\n\r\n foreach (self::$emailList as $email) {\r\n self::$emailArray[] = $email->attributes()->address;\r\n }\r\n\r\n return self::$emailArray; // returning the email list array.\r\n } else {\r\n return false;\r\n }\r\n\r\n } else {\r\n return false;\r\n }\r\n }", "function getLista(){\n\n }", "public function getFirstCode() {}", "protected function _getLangCodesMapping()\n {\n $oLang = \\OxidEsales\\Eshop\\Core\\Registry::getLang();\n $aLanguages = $oLang->getLanguageArray();\n $aRetArray = array();\n foreach ($aLanguages as $aLanguage) {\n $aRetArray[$aLanguage->oxid] = $aLanguage->id;\n }\n return $aRetArray;\n }", "public function getAllCouponCodes()\n {\n return CouponCode::all();\n }", "public function getModulesList();", "public function getCustomsDeclarationCodes()\n {\n return $this->_toArrayObject($this->getConfig(\n 'countryCodesCustomsDeclaration'));\n }", "public function getCode() {return $this->code;}", "public function getList() {\n\t\t$modules=$this->_module->getList();\n\t\tforeach($modules as $module_id=>$module_name) {\n\t\t\t$module_name=strtolower($module_name);\n\t\t\t$result=$this->_db->query(\"SELECT * FROM controller WHERE module_id='$module_id'\");\n\t\t\tforeach($result as $controller) {\n\t\t\t\t$controllers[$module_name][]=$controller['name'];\n\t\t\t}\n\t\t}\t\t\n\t\treturn($controllers);\n\t\t\t\n\t}", "public function getItemCodes()\n {\n return $this->itemCodes;\n }", "protected function _getNextCode() {}", "public static function getTypeList() {\n return array(\n self::TYPE_CODE_1=>self::TYPE_STRING_1,\n self::TYPE_CODE_2=>self::TYPE_STRING_2,\n self::TYPE_CODE_3=>self::TYPE_STRING_3,\n self::TYPE_CODE_4=>self::TYPE_STRING_4,\n self::TYPE_CODE_5=>self::TYPE_STRING_5,\n self::TYPE_CODE_6=>self::TYPE_STRING_6\n );\n }", "function getCode()\n {\n return $this->code;\n }", "public function get_code() {\n\t\treturn $this->code;\n\t}", "public function getProgramList()\n {\n $query = \"SELECT name FROM bolt_custom_programs\";\n\n $rows = $this->app['db']->executeQuery($query)->fetchall();\n\n $values = array('Select');\n\n foreach($rows as $x=>$y) {\n $values[$y[\"name\"]] = $y[\"name\"];\n }\n\n return($values);\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "static public function getCodes(){\n return array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Moved Temporarily',\n 307 => 'Temporary Redirect',\n 310 => 'Too many Redirects',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Time-out',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested range unsatisfiable',\n 417 => 'Expectation failed',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Time-out',\n 508 => 'Loop detected',\n );\n }", "public function getPageTextFromCode() {\r\n\t\t\treturn array( // page info\r\n\t\t\t\t'info' => array(\r\n\t\t\t\t\t'title' => 'iarecoding',\r\n\t\t\t\t\t'subtitle' => 'a simple PHP MVC framework.',\r\n\t\t\t\t\t'description' => 'Learn to code this MVC (Model-View-Controller) framework from scratch! The YouTube/GitHub links below will walk you through the process of coding the iarecoding framework so you learn and have a better understanding of how frameworks work :D',\r\n\t\t\t\t),\r\n\t\t\t\t'links' => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'link_title' => 'GitHub',\r\n\t\t\t\t\t\t'link_url' => 'https://github.com/jstolpe/iarecoding'\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'link_title' => 'YouTube',\r\n\t\t\t\t\t\t'link_url' => 'https://youtube.com/justinstolpe'\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}", "public function getJavascriptCode() {}", "public function getList() {\n\t\treturn Cgn_Module_Manager_File::getListStatic();\n\t}", "function getSources();", "function listLanguages()\r\n\t\t{\r\n\t\t\t// scan mod directory\r\n\t\t\t$path = './lang/';\r\n\t\t\t$list = scandir($path);\r\n\t\t\t\r\n\t\t\t// remove . and ..\r\n\t\t\tforeach ($list as $val)\r\n\t\t\t{\r\n\t\t\t\tif ($val != '.'\r\n\t\t\t\t\t&& $val != '..'\r\n\t\t\t\t\t&& $val != '.svn')\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t// remove lang_\r\n\t\t\t\t\t$x = substr($val, 5);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// remove .php\r\n\t\t\t\t\t$x = substr($val, 0, -4);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$out[] = substr($x, 5);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $out;\r\n\t\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }", "function getCode()\r\n {\r\n return $this->code;\r\n }", "public static function getParentCodeList($code){\n\n if( !self::verifyCode($code)){\n return false;\n }\n $totalW=array_sum(self::$WIDTH_SETTING);\n $code=trim(''.$code);\n $codeLen=strlen($code);\n\n $curW=0;\n\n $parentCodes=array();\n for($i=0; $i<count(self::$WIDTH_SETTING); $i++){\n\n $curW+=self::$WIDTH_SETTING[$i];\n if($curW==$codeLen){\n break;\n }\n array_push($parentCodes, substr($code,0,$curW));\n }\n return $parentCodes;\n\n\n }", "public function getBrandCodes() {\n return $this->api('brandcodes')->getRows();\n }", "protected function generate_postal_code_list()\n {\n $sql = \"SELECT PostalCode FROM zip_list\";\n $conn = $this -> connect();\n $stmt = $this -> query($conn, $sql);\n $this -> disconnect($conn);\n\n $list = [];\n while($row = $stmt -> fetch()): $list[] = $row['PostalCode']; endwhile;\n return $list;\n }", "public function getcode()\n {\n return $this->code;\n }", "public function getWebsiteCodes()\n {\n return $this->websiteCodes;\n }", "public function generateSampleCode() {\n\t\t$sampleCode = new SampleCode();\n\t\treturn array($sampleCode);\n\t}", "public function getList() {\n\t\t\tif (is_null($this->arList)) $this->load(); \n\t\t\treturn $this->arList; \n\t\t}", "protected function getCodeCoverage()\n {\n $codeCoverage = xdebug_get_code_coverage();\n $result = array();\n foreach ($codeCoverage as $file => $lines) {\n $result[$file] = $lines;\n }\n\n return $result;\n }" ]
[ "0.7399222", "0.72470206", "0.69297373", "0.6919468", "0.6807274", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6806866", "0.6765369", "0.66771406", "0.66729605", "0.6575543", "0.65106094", "0.65098315", "0.64870447", "0.64714026", "0.6358635", "0.6356381", "0.6333975", "0.62883866", "0.6278358", "0.6261989", "0.6230066", "0.6219664", "0.62138647", "0.6198128", "0.6142429", "0.61326915", "0.61251456", "0.61251456", "0.60838217", "0.60838217", "0.60838217", "0.6075148", "0.60692644", "0.6068894", "0.6053715", "0.6048333", "0.6040591", "0.60362244", "0.601161", "0.6006644", "0.60010004", "0.5975479", "0.5968016", "0.59565645", "0.5954257", "0.59519047", "0.595176", "0.59379023", "0.5924794", "0.5910007", "0.5901732", "0.5901732", "0.5901732", "0.5898907", "0.5895487", "0.58924145", "0.58915", "0.58750606", "0.58721495", "0.5871608", "0.5870941", "0.58510137", "0.5806633", "0.5797246", "0.5793926", "0.57916343", "0.5776281", "0.57755387", "0.5773675", "0.57721466", "0.5767162", "0.5766781", "0.57644516", "0.57536554", "0.5748926", "0.5728238", "0.57251066", "0.57215595", "0.57140654", "0.5704739", "0.5695295", "0.56945634", "0.56809896", "0.5679561", "0.5678577", "0.56689364", "0.56684095", "0.5667491", "0.5661161", "0.5661055", "0.5660315", "0.5654014", "0.56536263", "0.5647651", "0.5642354", "0.56233996" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Handle an incoming request.
public function handle(Request $request, Closure $next) { if (! $this->digestAuthService->getDigest()) { $dg = new DigestAuthCreate(); return $dg->make($request); } $config = config('digest-auth'); if ($config['driver'] == 'env' && ! $this->digestAuthService->isValidEnv()) { return $this->digestAuthService->unauthorized($request); } if ($config['driver'] == 'db' && ! $this->digestAuthService->isValidDb()) { return $this->digestAuthService->unauthorized($request); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Renders the index view for the module
public function actionIndex() { return $this->render('index', [ 'dashboardData' => [ [ Yii::t('app', 'WEBME_EMAIL'), Yii::t('app', 'WEBME_EMAIL_INFO'), Email::findIdentityCount('id_user',User::getUserId()), 'email', 'info' ], [ Yii::t('app', 'WEBME_LETTER'), Yii::t('app', 'WEBME_LETTER_INFO'), Letter::findIdentityCount('id_user',User::getUserId()), 'letter', 'secondary' ], [ Yii::t('app', 'WEBME_MAILING'), Yii::t('app', 'WEBME_MAILING_INFO'), Mailing::findIdentityCount('id_user',User::getUserId()), 'mailing', 'success' ] ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex()\n {\n $this->layout = \"main_module\";\n return $this->render('index');\n }", "public function actionIndex()\r\n\t{\r\n\t\t$modules = ModuleModel::instance()->find();\r\n\t\t$this->render('index', array('modules' => $modules));\r\n\t}", "function index() {\n $this->renderView(\"index\");\n }", "public function index() {\n $this->view->render('index/index', null, null);\n }", "public function actionIndex()\n {\n $this->render('index');\n }", "public function actionIndex()\n {\n $this->view->render('index');\n }", "public function index() {\r\r\n $this->render('index', array('model' => $this->model));\r\r\n }", "public function indexAction()\n {\n $this->render('/views/index.html');\n }", "public function actionIndex()\n {\n return $this->render('/index');\n }", "public function actionIndex(){\r\r\n\t\t$this->render('index', array());\r\r\n\t}", "public function Index()\n {\n $rv = array(\n 'page' => 'Index',\n );\n return view('module.index')->with($rv);\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Module::find()->indexBy('id'),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return $this->render('index', [\n 'model' => $this->model,\n ]);\n }", "public function actionIndex()\n {\n\n return $this->render('index');\n }", "public function actionIndex()\n {\n\n return $this->render('index');\n }", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function actionIndex()\r\n {\r\n\t\treturn $this->render('index');\r\n }", "public function index(){\n\t\t$this->view->render($this,'index');\n\t}", "public function actionIndex()\n {\n return $this->render('index.twig');\n }", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function actionIndex() {\n\t\treturn $this->render('index');\n\t}", "public function actionIndex() {\n\n return $this->render('index', [\n ]);\n }", "public function index(){\r\n $this->display(index);\r\n }", "public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}", "public function actionIndex()\n\t{\n\t\t\n\t\t$this->render('index');\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function actionIndex()\n {\n\n $moduleIds = $this->module->getModuleIds();\n array_walk($moduleIds, function(&$value, $key) {\n $value .= \" (\" . $this->module->getModulePercentage($key, $this->language) . \"%)\";\n });\n\n $files = $this->module->getFiles($this->moduleId, $this->language);\n array_walk($files, function(&$value, $key) {\n $value .= \" (\" . $this->module->getFilePercentage($key, $this->moduleId, $this->language) . \"%)\";\n });\n\n $languages = $this->module->getLanguages();\n array_walk($languages, function(&$value, $key) {\n if ($key == $this->language) {\n $value .= \" (\" . $this->module->getLanguagePercentage($key) . \"%)\";\n }\n });\n\n// Render Template\n return $this->render('index', array(\n// Available Options\n 'moduleIds' => $moduleIds,\n 'languages' => $languages,\n 'files' => $files,\n // Current selection\n 'language' => $this->language,\n 'moduleId' => $this->moduleId,\n 'file' => $this->file,\n // Translation\n 'messages' => $this->messages\n ));\n }", "public function index()\n {\n return view('commonmodule::index');\n }", "public function actionIndex()\n {\n return $this->renderIndex();\n }", "public function Index() {\n $modules = new CMModules();\n $controllers = $modules->AvailableControllers();\n $allModules = $modules->ReadAndAnalyse();\n $this->views->SetTitle('Manage Modules')\n ->AddInclude(__DIR__ . '/index.tpl.php', array('controllers'=>$controllers), 'primary')\n ->AddInclude(__DIR__ . '/sidebar.tpl.php', array('modules'=>$allModules), 'sidebar');\n }", "function index() {\n\n $this->view->render();\n\n }", "public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}", "public function index() {\n\t\t\t$this->render();\n\t\t}", "public function index()\n\t{\n\t\t$data = Module::data();\n\t\t//return View::make('modules.index')->with('data', $data);\n\t\treturn View::make('modules.index', compact('data'));\n\t}", "public function index()\n {\n return view('modules.index');\n }", "public function index()\n {\n $title = $this->title;\n $module_name = $this->module_name;\n $module_icon = $this->module_icon;\n\n $page_heading = \"All \" . $module_name;\n\n $$module_name = Permission::paginate(5);\n\n return view(\"backend.$module_name.index\", compact('title', 'page_heading', 'module_icon', \"module_name\", \"$module_name\"));\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\n\n }", "public function actionIndex()\n {\n \t$this->layout = \"layout\";\n return $this->render('index');\n }", "public function actionIndex()\n {\n $this->layout = 'minimal';\n return $this->render('index');\n }", "public function index()\n\t{\n $this->view->render();\n\t}", "public function indexAction() {\n\t\t$this->_model->where_clause(NULL);\n\n\t\tif(!isset($this->params['page'])) {\n\t\t\tself::$params['page'] = 1;\n\t\t} \n\n\t\t$this->_view->data['info'] = $this->_model->getPage($this->params['page'], $this->config->pagination_limit);\n\t\t$this->_view->data['total_items'] = $this->_model->getCount();\n\t\t$this->addModuleTemplate($this->module, 'index');\n\n\t}", "public function actionIndex() {\r\n // renders the view file 'protected/views/site/index.php'\r\n // using the default layout 'protected/views/layouts/main.php'\r\n $this->render('index');\r\n }", "public function index()\n {\n $modules = Module::orderBy('name')->get();\n return view('modules.index')->withModules($modules);\n }", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }", "public function actionIndex()\n\t{\n\t\t$this->layout ='main';\n\t\t$this->render('index');\n\t}", "public function indexAction() {\n\t\t$this->_initAction()\n\t\t\t->renderLayout();\n\t}", "public function actionIndex()\n {\n \t$this->layout='main';\n return $this->render('index');\n }", "public function actionIndex()\n {\n \t$this->layout='main';\n return $this->render('index');\n }", "public function index()\n\t{\n\t\t// Modules in \"modules\" folder\n\t\t$found_modules = Modules()->get_modules();\n\n\t\t// ionize Modules config\n\t\t$modules = array();\n\t\tinclude APPPATH . 'config/modules.php';\n\n\t\t// Get all modules from folders\n\t\tforeach($found_modules as $folder => &$module)\n\t\t{\n\t\t\t// Does the module install tables in DB ?\n\t\t\t$module['uses_database'] = FALSE;\n\t\t\t$module['installed'] = FALSE;\n\t\t\t$module['uri_user_segment'] = $module['uri'];\n\n\t\t\tif (in_array($folder, $modules))\n\t\t\t{\n\t\t\t\t// Set installed to true\n\t\t\t\t$module['installed'] = TRUE;\n\n\t\t\t\t// Get the user segment\n\t\t\t\tforeach($modules as $segment => $f)\n\t\t\t\t{\n\t\t\t\t\tif ($f == $folder)\n\t\t\t\t\t\t$module['uri_user_segment'] = $segment;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->template['modules'] = $found_modules;\n\n\t\t$this->output('modules/index');\n\t}", "public function indexAction()\n {\n return $this->twig->render('index.html.twig');\n }", "public function actionIndex()\n\t{\n\t\t$this->layout = 'main' ;\n\t\t$this->render('index') ;\n\t}", "public function index()\n {\n\n\n $this->view->render();\n }", "public function Index() {\n $this->Render();\n }", "public function indexAction() {\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }", "public function index()\n {\n return view('cataloguemodule::index');\n }", "public function indexAction()\r\n {\r\n $this->_initAction()\r\n ->renderLayout();\r\n }", "public function indexAction () {\r\n $this->_helper->viewRenderer->setNoRender(false);\r\n $this->_helper->layout()->enableLayout();\r\n $this->view->assign('controller', $this->_request->getControllerName());\r\n $this->view->assign('module', $this->_request->getModuleName());\r\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction()\n {\n $this->_initAction()\n ->renderLayout();\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\n\t\t$this->render('index');\n\t}", "public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }", "public function actionIndex()\n {\n $this->layout = '@app/views/layouts/right';\n return $this->render('index');\n }", "public function actionIndex() {\n $view_str = $this->renderView('index.php');\n return $view_str;\n \n //uncomment and edit the line below to incorporate the view above into your app's template\n //return $this->renderLayout( 'main-template.php', ['content'=>$view_str] );\n }", "public function index(){\n $this->viewManager->renderTemplate(\"index.twig.html\");\n\n }", "public function index()\n {\n // count\n $modules_count = Module::all();\n $modules_count = count($modules_count);\n\n // fetch all module and paginate\n $modules = Module::orderBy('module_title')\n ->paginate(5);\n\n return view('pages.admin.module.index', [\n 'modules' => $modules,\n 'modules_count' => $modules_count,\n ]);\n }", "public function actionIndex() {\n\t\t$this->layout = 'main2';\n\t\t$this->render('index');\n\t}", "public function indexAction()\n {\n $this->loadLayout();\n $this->renderLayout();\n }", "public function indexAction()\n\t{\n\t\t$this->loadLayout();\n\t\t$this->renderLayout();\n\t\t\n\t}" ]
[ "0.8542062", "0.83196074", "0.8300524", "0.82760626", "0.8169512", "0.8125656", "0.81207645", "0.8093793", "0.80549777", "0.8050916", "0.80312014", "0.80235296", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.80111486", "0.8007013", "0.79865193", "0.79661924", "0.79661924", "0.796118", "0.7960079", "0.79597837", "0.79597455", "0.7937208", "0.7937208", "0.7937208", "0.7937208", "0.7925917", "0.7924278", "0.79198015", "0.7909536", "0.79075646", "0.78821695", "0.78691083", "0.78632575", "0.7843475", "0.7815729", "0.7805055", "0.779494", "0.77932185", "0.7787316", "0.77848357", "0.77847755", "0.777512", "0.77569425", "0.7738422", "0.7709446", "0.76979846", "0.76795655", "0.7674287", "0.76708174", "0.76673603", "0.76654387", "0.766172", "0.7621588", "0.7615379", "0.7615379", "0.7614135", "0.7613315", "0.76121426", "0.76072323", "0.7606001", "0.75987077", "0.7598556", "0.7595555", "0.7592871", "0.75927335", "0.75914663", "0.75844324", "0.75822496", "0.7578986", "0.7578696", "0.75694054", "0.75686216", "0.75631964", "0.7546485", "0.75398475" ]
0.0
-1
end _construct() Get the information of tier price
public function getInfo(){ $info = $this->getData(); $price = $this->getData('price'); $info['formatted_price'] = $this->priceHelper->currency($price, true, false); $info['website'] = $this->websiteHelper->getWebsites(); $info['customergroup'] = $this->customerGroupHelper->getCustomerGroups(); return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getTierPriceStructure()\n {\n return [\n 'children' => [\n 'record' => [\n 'children' => [\n 'website_id' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'options' => $this->getWebsites(),\n 'value' => $this->getDefaultWebsite(),\n 'visible' => true,\n 'disabled' => false,\n ],\n ],\n ],\n ],\n 'price_value' => [\n 'children' => [\n 'price' => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'addbefore' => $this->getStore()->getBaseCurrency()\n ->getCurrencySymbol(),\n ]\n ]\n ],\n ],\n 'value_type' => [\n 'arguments' => [\n 'data' => [\n 'options' => $this->productPriceOptions->toOptionArray(),\n ]\n ],\n ],\n ],\n ],\n ],\n ],\n ],\n ];\n }", "protected function _construct()\r\n {\r\n $this->_init('ss_price', 'price_id');\r\n }", "abstract public function getPrice();", "public function getPrices()\n {\n }", "public function __construct() {\n trace('[METHOD] '.__METHOD__);\n $this->classConfigArr = $GLOBALS['TSFE']->tmpl->setup['config.']['tx_ptgsaaccounting.'];\n $this->shopConfigArr = $GLOBALS['TSFE']->tmpl->setup['config.']['tx_ptgsashop.']; \n \n if($this->shopConfigArr['usePricesWithMoreThanTwoDecimals'] == 1) {\n $this->precision = 4;\n } else {\n $this->precision = 2;\n } \n trace($this->classConfigArr,0,'classConfigArr');\n trace($this->shopConfigArr,0,'shopConfigArr');\n }", "public function getPriceNet();", "function get_price_object() {\r\n\t\t$price_obj = array (\r\n\t\t\t\t\"Currency\" => false,\r\n\t\t\t\t\"TotalDisplayFare\" => 0,\r\n\t\t\t\t\"PriceBreakup\" => array (\r\n\t\t\t\t\t\t'BasicFare' => 0,\r\n\t\t\t\t\t\t'Tax' => 0,\r\n\t\t\t\t\t\t'AgentCommission' => 0,\r\n\t\t\t\t\t\t'AgentTdsOnCommision' => 0\r\n\t\t\t\t) \r\n\t\t);\r\n\t\treturn $price_obj;\r\n\t}", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function __construct($_quantity, $_productName, $_price, $_type, $_duty)\n {\n //variabili uguali all'input\n $this->quantity = $_quantity;\n $this->productName = $_productName;\n $this->price = $_price;\n\n //usando le funzioni del trait taxes mi trovo le tassazioni e i totali\n $this->salesTax = $this->findTax($_type);\n $this->dutyTax = $this->imported($_duty);\n $this->addNet($this->quantity * $this->price);\n $this->addTaxes($this->computeTaxes($this->quantity, $this->price, $this->salesTax, $this->dutyTax));\n $this->getTotal();\n\n \n }", "public function getPrice() {\n }", "public function __construct($price,$basics)\n {\n $this->data = $price;\n $this->details = $basics;\n }", "protected function calculatePrices()\n {\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice(){\n }", "public function getPrice(){\n }", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function getPrice(){ return $this->price_rur; }", "public function getProductPrice()\n {\n }", "public function __construct()\n {\n $this->type = 'percentage';\n $this->amount = 20;\n $this->end_date = strtotime(\"+1 day\");\n $this->minimum_amount = 100;\n $this->free_shipping = false;\n $this->included_categories = [10, 20];\n $this->excluded_categories = [50];\n $this->included_products = [3];\n $this->excluded_products = [4, 1];\n }", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function getTaxedPrice();", "public function getPriceInformation() {\n $fields = array('priceInformation' => array(\n 'priceHeader' => 'header',\n 'price',\n 'acquisitionTerms',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "function editTierPrice()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\t$sql='SELECT * FROM msrp_by_quantity_table WHERE product_id ='.$id;\n\t\t\t$obj= new Bin_Query();\n\t\t\t$obj->executeQuery($sql);\n\t\t\treturn Display_DManageProducts::editTierPrice($obj->records);\n\t\t}\n\t}", "function __construct($id, $label, $price, $nbSame, $listProvConcern){\n \n parent::__construct($id, $label, $price);\n $this->nbSame = $nbSame;\n // $this->provInfo = $this->getProvInfo();\n // $this->totalPrice = $this->getTotalPrice();\n \n \n }", "public function getPriceFromDatabase()\n {\n }", "public function __construct()\n {\n $this->itemPrices = new ArrayCollection();\n }", "public function __construct($id, $ProductName, $Extra, $maxExtra , $price, $type) {\n $this->id = $id;\n $this->ProductName = $ProductName;\n $this->Extra = $Extra;\n $this->maxExtra = $maxExtra;\n $this->price = $price;\n $this->type = $type;\n}", "public function __construct($cost, $isbn)\n {\n //assigning the instance variables using constructor\n $this->price = $cost;\n $this->isbnNumber = $isbn;\n }", "protected function getTierPriceProcessor()\n {\n return $this->tierPriceProcessor;\n }", "public function getTonicDiscount()\n {\n }", "public function __construct()\n {\n $exchange_rates = new ExchangeRatesService();\n\n $res = $exchange_rates->get('EUR');\n if($res->getStatusCode() === 200)\n $this->eur_data = json_decode( $res->getBody() );\n \n $res = $exchange_rates->get('USD');\n if($res->getStatusCode() === 200)\n $this->usd_data = json_decode( $res->getBody() );\n\n $res = $exchange_rates->get('GBP');\n if($res->getStatusCode() === 200)\n $this->gbp_data = json_decode( $res->getBody() );\n\n $res = $exchange_rates->get('RUB');\n if($res->getStatusCode() === 200)\n $this->rub_data = json_decode( $res->getBody() );\n }", "function test_leverage_tier($exchange, $method, $tier) {\n $format = array(\n 'tier' => 1,\n 'minNotional' => 0,\n 'maxNotional' => 5000,\n 'maintenanceMarginRate' => 0.01,\n 'maxLeverage' => 25,\n 'info' => array(),\n );\n $keys = is_array($format) ? array_keys($format) : array();\n for ($i = 0; $i < count($keys); $i++) {\n $key = $keys[$i];\n assert (is_array($tier, $exchange->id . ' ' . $method . ' ' . $key . ' missing from response') && array_key_exists($key, $tier, $exchange->id . ' ' . $method . ' ' . $key . ' missing from response'));\n }\n if ($tier['tier'] !== null) {\n assert ((is_float($tier['tier']) || is_int($tier['tier'])));\n assert ($tier['tier'] >= 0);\n }\n if ($tier['minNotional'] !== null) {\n assert ((is_float($tier['minNotional']) || is_int($tier['minNotional'])));\n assert ($tier['minNotional'] >= 0);\n }\n if ($tier['maxNotional'] !== null) {\n assert ((is_float($tier['maxNotional']) || is_int($tier['maxNotional'])));\n assert ($tier['maxNotional'] >= 0);\n }\n if ($tier['maxLeverage'] !== null) {\n assert ((is_float($tier['maxLeverage']) || is_int($tier['maxLeverage'])));\n assert ($tier['maxLeverage'] >= 1);\n }\n if ($tier['maintenanceMarginRate'] !== null) {\n assert ((is_float($tier['maintenanceMarginRate']) || is_int($tier['maintenanceMarginRate'])));\n assert ($tier['maintenanceMarginRate'] <= 1);\n }\n var_dump ($exchange->id, $method, $tier['tier'], $tier['minNotional'], $tier['maxNotional'], $tier['maintenanceMarginRate'], $tier['maxLeverage']);\n return $tier;\n}", "function getTierDetails($pid) {\n $this->db->select('*');\n $this->db->from('product_tier_price');\n $this->db->where('product_tier_price.tier_product_id', intval($pid));\n $this->db->group_by('product_tier_price.tier_id');\n $this->db->order_by('product_tier_price.tier_min_qty', 'ASC');\n $query = $this->db->get();\n //die($this->db->last_query());\n return $query->result_array();\n }", "public function __construct(float $price)\n {\n $this->price = $price;\n }", "public function __construct($_originalRetailPrice = NULL,$_minimumAdvertisedPrice = NULL,$_minimumAdvertisedPriceExposure = NULL,$_pricingTreatment = NULL,$_soldOneBay = false,$_soldOffeBay = false,$_any = NULL)\r\n\t{\r\n\t\tparent::__construct(array('OriginalRetailPrice'=>$_originalRetailPrice,'MinimumAdvertisedPrice'=>$_minimumAdvertisedPrice,'MinimumAdvertisedPriceExposure'=>$_minimumAdvertisedPriceExposure,'PricingTreatment'=>$_pricingTreatment,'SoldOneBay'=>$_soldOneBay,'SoldOffeBay'=>$_soldOffeBay,'any'=>$_any));\r\n\t}", "public function getTierPriceCount()\n {\n return $this->getPriceModel()->getTierPriceCount($this);\n }", "public function __construct($htCatNum,$htDescrip,$nQty,$nPrice,$nShItem,$nShPkg) {\n\t$this->htCatNum = $htCatNum;\n\t$this->htDescrip = $htDescrip;\n\t$this->nQty = $nQty;\n\t$this->nPrice = $nPrice;\n\t$this->nShItem = $nShItem;\n\t$this->nShPkg = $nShPkg;\n }", "public function __construct($price, $currency)\n {\n $this->price = $price;\n $this->currency = $currency;\n }", "public function getBasePrice()\n {\n return $this->base_price;\n }", "public function __construct($type, $price)\n {\n $this->type = $type;\n $this->price = $price;\n }", "public function __construct($data_price, $excursion, $request)\n {\n $this->data_price = $data_price;\n $this->excursion = $excursion;\n $this->request = $request;\n }", "public function getPrice(){\n return $this->price;\n }", "function getPrice()\n {\n return $this->price;\n }", "public function getCurrentPriceData() {\n $priceData = new \\stdClass();\n $priceData->ask = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->bid = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->high = $this->rates[$this->rateIndex]['high_mid'];\n $priceData->open = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->low = $this->rates[$this->rateIndex]['low_mid'];\n $priceData->id = $this->rates[$this->rateIndex]['id'];\n $priceData->dateTime = $this->rates[$this->rateIndex]['rate_date_time'];\n $priceData->rateUnixTime = $this->rates[$this->rateIndex]['rate_unix_time'];\n $priceData->instrument = $this->exchange->exchange;\n\n Config::set('bt_rate_time', $this->rates[$this->rateIndex]['rate_unix_time']);\n\n $this->currentPriceData = $priceData;\n }", "public function getPerformanceTier()\n {\n return $this->performance_tier;\n }", "public function __construct(StockPrice $stockPrice)\n {\n //\n $this->stockPrice = $stockPrice;\n\n }", "function __construct($tkr, $entry_date, $open, $high, $low, $close, $vol, $adj_close) {\n\t\t\t$this->tkr = $tkr;\n\t\t\t$this->entry_date = $entry_date;\n\t\t\t$this->open = $open;\n\t\t\t$this->high = $high;\n\t\t\t$this->low = $low;\n\t\t\t$this->close = $close;\n\t\t\t$this->vol = $vol;\n\t\t\t$this->adj_close = $adj_close;\n\t\t\t\n\t\t\t$tkr_qry = sprintf(\"SELECT * FROM %s WHERE ticker='%s'\", TKR_TBL, $this->tkr);\n\t\t\tif (!mysql_ping()) {\n\t\t\t\t$con = connect();\n\t\t\t\t}\n\t\t\t$result = mysql_query($tkr_qry);\n\t\t\tif (!$result) {\n\t\t\t\tdie(\"ERROR: Could not get ticker ID: \" . mysql_error());\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t$data = mysql_fetch_row($result);\n\t\t\t\t$this->tkr_id = $data[0];\n\t\t\t\t}\n\t\t\t}", "function init()\n {\n // the first band.\n $ethFeeSchedule = new FeeScheduleList();\n $ethFeeSchedule->push(new FeeScheduleItem(0.0, 1.0, 0.30, 0.0));\n $ethFeeSchedule->push(new FeeScheduleItem(1.0, 2.5, 0.24, 0.0));\n $ethFeeSchedule->push(new FeeScheduleItem(2.5, 5.0, 0.22, 0.0));\n $ethFeeSchedule->push(new FeeScheduleItem(5.0, 10.0, 0.19, 0.0));\n $ethFeeSchedule->push(new FeeScheduleItem(10.0, 20.0, 0.15, 0.0));\n $ethFeeSchedule->push(new FeeScheduleItem(20.0, INF, 0.10, 0.0));\n\n $pairs = $this->publicQuery('/products');\n foreach($pairs as $pairInfo){\n try{\n $pair = $pairInfo['base_currency'] . $pairInfo['quote_currency'];\n $base = CurrencyPair::Base($pair); //checks the format\n if ($base == Currency::ETH) {\n $this->feeSchedule->addPairFees($pair, $ethFeeSchedule);\n }\n\n $this->supportedPairs[] = mb_strtoupper($pair);\n $this->minOrderSizes[$pair] = $pairInfo['base_min_size'];\n $this->productIds[$pair] = $pairInfo['id'];\n $this->quotePrecisions[$pair] = intval(abs(floor(log10($pairInfo['quote_increment']))));\n }catch(\\Exception $e){}\n }\n }", "function __construct ()\n\t\t{\n\t\t\tparent::__construct ('Charges', 'Charge', 'Charge');\n\t\t}", "public function getPrice(): string;", "public function get_price(){\n\t\treturn $this->price;\n\t}", "function __construct()\n\t{\n\t /* product */\n\t \t$this->url = \"https://khachhang.giaohangtietkiem.vn\";\n\t\t\t$this->ghtk_token = \"E0Ffc300eDa222cE8F12c95586c4f7fa8aBBa0B5\";\n\t\t\t$this->return_transfer = true;\n\t $this->version = CURL_HTTP_VERSION_1_1;\n\t $this->currency = 'VND';\n \n\t}", "public function __construct()\n {\n if (4 == func_num_args()) {\n $this->cost = func_get_arg(0);\n $this->storeId = func_get_arg(1);\n $this->sku = func_get_arg(2);\n $this->extensionAttributes = func_get_arg(3);\n }\n }", "public function __construct()\n {\n // Metres, Centimetres, Millimetres, Yards, Foot, Inches\n $conversions = array(\n 'Weight' => array(\n 'base' => 'kg',\n 'conv' => array(\n 'g' => 1000,\n 'mg' => 1000000,\n 't' => 0.001,\n 'oz' => 35.274,\n 'lb' => 2.2046,\n )\n ),\n 'Distance' => array(\n 'base' => 'km',\n 'conv' => array(\n 'm' => 1000,\n 'cm' => 100000,\n 'mm' => 1000000,\n 'in' => 39370,\n 'ft' => 3280.8,\n 'yd' => 1093.6\n )\n )\n );\n\n foreach ($conversions as $val) {\n $this->addConversion($val['base'], $val['conv']);\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ClusterId\",$param) and $param[\"ClusterId\"] !== null) {\n $this->ClusterId = $param[\"ClusterId\"];\n }\n\n if (array_key_exists(\"InstanceIds\",$param) and $param[\"InstanceIds\"] !== null) {\n $this->InstanceIds = $param[\"InstanceIds\"];\n }\n\n if (array_key_exists(\"Prices\",$param) and $param[\"Prices\"] !== null) {\n $this->Prices = [];\n foreach ($param[\"Prices\"] as $key => $value){\n $obj = new TradePrice();\n $obj->deserialize($value);\n array_push($this->Prices, $obj);\n }\n }\n\n if (array_key_exists(\"InstanceRealTotalPrice\",$param) and $param[\"InstanceRealTotalPrice\"] !== null) {\n $this->InstanceRealTotalPrice = $param[\"InstanceRealTotalPrice\"];\n }\n\n if (array_key_exists(\"StorageRealTotalPrice\",$param) and $param[\"StorageRealTotalPrice\"] !== null) {\n $this->StorageRealTotalPrice = $param[\"StorageRealTotalPrice\"];\n }\n\n if (array_key_exists(\"RequestId\",$param) and $param[\"RequestId\"] !== null) {\n $this->RequestId = $param[\"RequestId\"];\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"OriginalDiskPrice\",$param) and $param[\"OriginalDiskPrice\"] !== null) {\n $this->OriginalDiskPrice = $param[\"OriginalDiskPrice\"];\n }\n\n if (array_key_exists(\"OriginalPrice\",$param) and $param[\"OriginalPrice\"] !== null) {\n $this->OriginalPrice = $param[\"OriginalPrice\"];\n }\n\n if (array_key_exists(\"Discount\",$param) and $param[\"Discount\"] !== null) {\n $this->Discount = $param[\"Discount\"];\n }\n\n if (array_key_exists(\"DiscountPrice\",$param) and $param[\"DiscountPrice\"] !== null) {\n $this->DiscountPrice = $param[\"DiscountPrice\"];\n }\n\n if (array_key_exists(\"DetailPrices\",$param) and $param[\"DetailPrices\"] !== null) {\n $this->DetailPrices = [];\n foreach ($param[\"DetailPrices\"] as $key => $value){\n $obj = new DetailPrice();\n $obj->deserialize($value);\n array_push($this->DetailPrices, $obj);\n }\n }\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"OriginalDiskPrice\",$param) and $param[\"OriginalDiskPrice\"] !== null) {\n $this->OriginalDiskPrice = $param[\"OriginalDiskPrice\"];\n }\n\n if (array_key_exists(\"OriginalPrice\",$param) and $param[\"OriginalPrice\"] !== null) {\n $this->OriginalPrice = $param[\"OriginalPrice\"];\n }\n\n if (array_key_exists(\"Discount\",$param) and $param[\"Discount\"] !== null) {\n $this->Discount = $param[\"Discount\"];\n }\n\n if (array_key_exists(\"DiscountPrice\",$param) and $param[\"DiscountPrice\"] !== null) {\n $this->DiscountPrice = $param[\"DiscountPrice\"];\n }\n\n if (array_key_exists(\"DetailPrices\",$param) and $param[\"DetailPrices\"] !== null) {\n $this->DetailPrices = [];\n foreach ($param[\"DetailPrices\"] as $key => $value){\n $obj = new DetailPrice();\n $obj->deserialize($value);\n array_push($this->DetailPrices, $obj);\n }\n }\n }", "public function deliveryPriceDhaka()\n {\n }", "public function getFreeTier()\n {\n return $this->free_tier;\n }", "public function getCost();", "abstract function getPriceFromAPI($pair);", "public function __construct()\n {\n if (6 == func_num_args()) {\n $this->price = func_get_arg(0);\n $this->storeId = func_get_arg(1);\n $this->sku = func_get_arg(2);\n $this->priceFrom = func_get_arg(3);\n $this->priceTo = func_get_arg(4);\n $this->extensionAttributes = func_get_arg(5);\n }\n }", "function __construct() {\r\n\t\t$this->production_total = \"0\";\r\n\t\t$this->id_state = 1;\r\n\t}", "public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }", "public function getPrice()\n {\n return 0.2;\n }", "public function __construct() \n\t{\n\t\t$strSqlModel = \n\t\t'SELECT cat.*, prd.* \n\t\tFROM \n\t\t(\n\t\t\t(\n\t\t\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\tproducts prd INNER JOIN categories cat ON (prd.prd_cat_id = cat.cat_id)\n\t\t\t\t\t) INNER JOIN prices pri ON (prd.prd_id = pri.pri_prd_id)\n\t\t\t\t) INNER JOIN countries cnt ON (pri.pri_cnt_id = cnt.cnt_id)\n\t\t\t) INNER JOIN currencies cur ON (cnt.cnt_cur_id = cur.cur_id)\n\t\t)\n\t\tINNER JOIN stocks stk ON (prd.prd_id = stk.stk_prd_id) \n\t\t'.CONF_TAG_LIST_SQL_CRITERIA.' \n\t\tGROUP BY prd.prd_id \n\t\tORDER BY cat.cat_id ASC, prd.prd_id ASC \n\t\t'.CONF_TAG_LIST_SQL_LIMIT.'';\n\t\t\n\t\t$intPageNbRow = CONF_LIST_PAGE_COUNT_ROW_PROD;\n\t\t\n\t\t$tabCritOperation = array();\n\t\t$tabCritOperation['cur_id'] = \"(cur.cur_id = \".CONF_TAG_LIST_SQL_OPE_VALUE.\")\";\n\t\t\n\t\tparent::__construct($strSqlModel, $tabCritOperation, $intPageNbRow);\n\t}", "public function __construct()\n {\n if (4 == func_num_args()) {\n $this->currency = func_get_arg(0);\n $this->name = func_get_arg(1);\n $this->notes = func_get_arg(2);\n $this->price = func_get_arg(3);\n }\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}", "public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }", "public function __construct() {\n\t\t$this->setTitle('Low Order Fee');\n\t\t$this->setDescription('Low Order Fee');\n\n\t\t$this->init('loworderfee');\n\n\t\tif ($this->isInstalled() === true){\n\t\t\t$this->taxClass = $this->getConfigData('TAX_CLASS');\n\t\t\t$this->allowFees = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE');\n\t\t\t$this->feesDestination = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION');\n\t\t\t$this->lowOrderAmount = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER');\n\t\t\t$this->lowOrderFee = $this->getConfigData('MODULE_ORDER_TOTAL_LOWORDERFEE_FEE');\n\t\t}\n\t}", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public function __construct()\n\t{\n\t\t/*if (!$measureCommodity)\n\t\t{\n\t\t\t$measureCommodity = CommodityFactory::build('FRN');\n\t\t}\n\n\t\t$this->measureCommodity = $measureCommodity;\n\t\t*/\n\t\t$this->measureCommodity = CommodityFactory::build('FRN');\n\t}", "public function getTaxRate();", "function __construct() {\n $this->get_info();\n }", "function builder_price() {\n\n $this->Item->recursive = 0;\n\n if( !isset($this->params['named']['limit']) ) {\n $this->paginate['limit'] = REPORT_LIMIT;\n $this->paginate['maxLimit'] = REPORT_LIMIT;\n }\n elseif( isset($this->params['named']['limit']) && $this->params['named']['limit'] != 'All' ) {\n $this->paginate['limit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n $this->paginate['maxLimit'] = isset($this->params['named']['limit']) ? $this->params['named']['limit'] : REPORT_LIMIT;\n }\n else {\n $this->paginate['limit'] = 0;\n $this->paginate['maxLimit'] = 0;\n }\n $this->Prg->commonProcess();\n $this->paginate['conditions'] = $this->Item->parseCriteria($this->passedArgs);\n $this->paginate['conditions']['Item.base_item']['base_item'] = 0;\n\n $items = $this->paginate();\n $paginate = true;\n $legend = \"Items\";\n\n $this->set(compact('items', 'paginate', 'legend'));\n }", "public function __construct()\n {\n $this->_cash = array ( 1 => 25, 2 => 74, 5 => 14, 10 => 18, 20 => 0, 50 => 5, 100 => 30, 200 => 15, 500 => 8, 1000 => 11, 2000 => 8, 5000 => 5, 10000 => 2, 20000 => 0, 50000 => 0 );\n;\n }", "public function getCurrentPrice() : float;", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "function getLitecoinPrice()\r\n{\r\n\t // Fetch the current rate from MtGox\r\n\t$ch = curl_init('https://mtgox.com/api/0/data/ticker.php');\r\n\tcurl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');\r\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"CakeScript/0.1\");\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t$mtgoxjson = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\r\n\t// Decode from an object to array\r\n\t$output_mtgox = json_decode($mtgoxjson);\r\n\t$output_mtgox_1 = get_object_vars($output_mtgox);\r\n\t$mtgox_array = get_object_vars($output_mtgox_1['ticker']);\r\n\r\n\techo '\r\n\t\t\t<ul>\r\n\t\t\t<li><strong>Last:</strong>&nbsp;&nbsp;', $mtgox_array['last'], '</li>\r\n\t\t\t<li><strong>High:</strong>&nbsp;', $mtgox_array['high'], '</li>\r\n\t\t\t<li><strong>Low:</strong>&nbsp;&nbsp;', $mtgox_array['low'], '</li>\r\n\t\t\t<li><strong>Avg:</strong>&nbsp;&nbsp;&nbsp;', $mtgox_array['avg'], '</li>\r\n\t\t\t<li><strong>Vol:</strong>&nbsp;&nbsp;&nbsp;&nbsp;', $mtgox_array['vol'], '</li>\r\n\t\t\t</ul>';\r\n}", "public function __construct()\n\t{\n\t\t$this->incomeData = FieldMap::getFieldLabel(\"income_data\",\"\",1);\n\t\t$this->removeIncomeFlag = 0;\n\t}", "public function getPrice() {\n return $this->price;\n}", "public function getStock();", "public function __construct($name){\n $this->name = $name;\n $this->savings = new Dollar(1500);\n }", "public function __construct(Product $product, $amount)\n {\n //\n }", "public function ethPrice() {\n return $this->request->exec([\n 'module' => \"stats\",\n 'action' => \"ethprice\",\n ]);\n }", "public function getTicket_price()\n {\n return $this->ticket_price;\n }", "function __construct($title,$prodName,$price, $appropriateAges){\n\t\t// you become responsible for the parent constructor as well\n\t\tparent::__construct($title, $prodName,$price); // puts these defaults into the parent constructor\n\t\t$this->appropriateAges=$appropriateAges; // sets the child property\n\t\t}", "public function getPrice(): float;", "public function getPrice(): float;", "public function getUnitPrice()\n\t{\n\t\treturn $this->getKeyValue('unit_price'); \n\n\t}", "public function cost()\n {\n return $this->price;\n }", "function _loadProductAttributesInfo()\n {\n global $zone;\n\n if ($this->_fBaseProductInfo == null)\n {\n $this->_loadBaseProductInfo();\n }\n $display_product_price_including_taxes = modApiFunc('Settings', 'getParamValue', 'TAXES_PARAMS', \"DISPLAY_PRICES_W_INCLUDED_TAXES\");\n\n $a = (int)$this->_fProductID;\n $b = (int)$this->_fBaseProductInfo[0]['p_type_id'];\n $c = $display_product_price_including_taxes == DB_TRUE ? 1 : 0;\n if (isset(self::$_cache_attr[$a][$b][$c])) {\n $this->_fProductAttributesInfo = self::$_cache_attr[$a][$b][$c];\n return;\n }\n\n $params = array('product_id' => (int)$this->_fProductID,\n 'product_type_id' => (int)$this->_fBaseProductInfo[0]['p_type_id']);\n $this->_fProductAttributesInfo = execQuery('SELECT_PRODUCT_ATTRIBUTES_INFO', $params);\n // SalePrice,\n // TaxClass.\n $tax_class_id = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'taxclass' )\n {\n $tax_class_id = $attribute['pa_value'];\n break;\n }\n }\n\n $price_including_included_taxes_if_any = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'saleprice' )\n {\n if($zone == 'CustomerZone')\n {\n $membership = modApiFunc('Customer_Account','getCurrentSignedCustomerGroupID');\n $attribute['pa_value'] = modApiFunc('Quantity_Discounts','getFixedPrice',$this->_fProductID,1,$attribute['pa_value'],$membership);\n }\n\n $price_including_included_taxes_if_any = $attribute['pa_value'];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['a_view_tag'] = NULL;\n\n // TaxClass - , .\n if($tax_class_id !== NULL)\n {\n // .\n $price_excluding_taxes = modApiFunc(\"Catalog\", \"computePriceExcludingTaxes\", $attribute['pa_value'], $tax_class_id);\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_excluding_taxes;\n\n // _ _ 'salepriceexcludingtaxes':\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_value'] = $price_excluding_taxes;\n }\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['a_view_tag'] = NULL;\n\n if($tax_class_id !== NULL)\n {\n // .\n // _c_ 'salepriceexcludingtaxes':\n $price_including_taxes = $price_including_included_taxes_if_any;\n // ,\n // , \" \"\n //modApiFunc(\"Catalog\", \"computePriceIncludingTaxes\", $attribute['pa_value'], $tax_class_id);\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_value'] = $price_including_taxes;\n\n if($display_product_price_including_taxes == DB_TRUE)\n {\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_including_taxes;\n }\n }\n\n break;\n }\n }\n self::$_cache_attr[$a][$b][$c] = $this->_fProductAttributesInfo;\n }" ]
[ "0.68826574", "0.64331955", "0.6345974", "0.6339499", "0.62771", "0.6111145", "0.61040646", "0.60992914", "0.60992914", "0.60507244", "0.6031805", "0.60252446", "0.5965318", "0.5944057", "0.5944057", "0.5944057", "0.5944057", "0.5925326", "0.5925326", "0.58978975", "0.5829166", "0.58113545", "0.57974", "0.57964396", "0.5782504", "0.57344097", "0.57293886", "0.5723251", "0.5722372", "0.57116634", "0.57055885", "0.5700539", "0.5694383", "0.5685027", "0.56776464", "0.56557876", "0.5594154", "0.55938685", "0.5586404", "0.5571491", "0.5548214", "0.55472606", "0.5545609", "0.5537412", "0.55340433", "0.55292046", "0.55255944", "0.5525302", "0.5524482", "0.55205506", "0.55090225", "0.5498946", "0.5496559", "0.5486643", "0.5483653", "0.5477231", "0.5474132", "0.54691225", "0.5468826", "0.5462947", "0.54603267", "0.54603267", "0.5456079", "0.54551893", "0.5453303", "0.5451205", "0.54497576", "0.5430329", "0.54233813", "0.5422201", "0.5413741", "0.54024667", "0.53950465", "0.53950465", "0.5386719", "0.5386653", "0.5381943", "0.53749096", "0.5372057", "0.53470534", "0.53369427", "0.53335154", "0.531871", "0.5307566", "0.52994967", "0.52994967", "0.52969533", "0.5292417", "0.52894723", "0.5288832", "0.52739584", "0.526328", "0.5250766", "0.52469176", "0.52461606", "0.5245686", "0.5245686", "0.52445245", "0.52423143", "0.5239782" ]
0.5310136
83
need to check that following on doesn't break this code!!!
function IsOK() { return ($this->status == 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function broken() { return TRUE; }", "function broken() { }", "protected function fixSelf() {}", "protected function fixSelf() {}", "public function benchThisWillBeSkipped()\n {\n }", "protected function _refine() {\n\n\t}", "public function qualifyToStart(): bool;", "public function afmelden()\n {\n return true;\n }", "function CheckSequence()\n\t{\n\t\treturn true;\n\t}", "function __return_false()\n {\n }", "function _pre() {\n\n\t}", "abstract protected function doEvil();", "public function stepOutOfScope();", "function fix() ;", "function __flop(&$tmp) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}", "public function _check()\n {\n }", "protected function isTargetCorrect() {}", "private function validate() {\n\t\n\t\t\treturn false;\n\t}", "function Step1_IntegrityHard() { return( $this->stepTest( 'integ_') ); }", "public function onOutOfBand (): void;", "protected function checkLibXmlBug() {}", "abstract protected function _preProcess();", "public function needsReprocessing() {}", "function tideways_last_detected_exception()\n{\n}", "function __return_true()\n {\n }", "function yy_r113()\n {\n return;\n }", "function yy_r97(){ \n $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor; $this->yystack[$this->yyidx + -3]->minor->values($this->yystack[$this->yyidx + -1]->minor); \n if ($this->yystack[$this->yyidx + 0]->minor) $this->_retvalue->onDuplicate($this->yystack[$this->yyidx + 0]->minor);\n }", "protected function assertPostConditions() {\n\t\tprint \"---------------------------------------------------------------- \\n\";\n\t}", "public function checkToAddTrailingStop() {\n if (!$this->backtesting) {\n ///Handle Real Live Stuff\n }\n else {\n if ($this->openPosition['gl'] >= $this->optionalTrailingStopAmount) {\n $this->addTrailingStopToPosition($this->optionalTrailingStopAmount);\n }\n }\n }", "function yy_r74()\n {\n $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 1]->minor . ')';\n }", "private function checkExpirated() {\n\n }", "function CheckCondition()\n\t{\n\t\treturn true;\n\t}", "public function step_3()\n {\n }", "public function quash_unused() {\n\t\t// Don't put any code in here.\n\t}", "public function branching()\n {\n }", "abstract protected function safetyCheck() : self;", "private function lookRoutings(){\n return false;\n }", "function next(){ \r\n\t $this->valid = (FALSE !== next($this->array)); \r\n\t }", "static function unittest_loopBarrier () {\n PhlintTest::assertIssues('\n class A {\n function foo () {}\n }\n function foo () {\n /** @var A */\n $a = null;\n foreach ([1, 2, 3] as $x) {\n if (is_null($a))\n break;\n else\n $a->foo();\n $a->foo();\n }\n $a->foo();\n }\n ', [\n 'Unable to invoke undefined *mixed::foo* for the expression *$a->foo()* on line 14.',\n ]);\n }", "public function isAangemeld()\n {\n return false;\n }", "private function __wakeup() {\n\t\t\treturn false;\n\t\t}", "public function _break()\n {\n //set the internal execution flag to false, stopping execution\n $this->executing = false;\n }", "function yy_r76(){ $this->_retvalue = ['ON', $this->yystack[$this->yyidx + 0]->minor]; }", "protected function _before()\n\t{\n\t\t\n\t}", "public function check()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function process() {\n\t\treturn false;\n\t}", "public function failNoisily() :bool{\n\t\treturn !$this->failSilently;\n\t}", "protected function check_something() {\n\t\t$this->something_happen = true;\n\t}", "public function tell()\n {\n return false;\n }", "function affected(){\t\n\t\treturn(0);\n\t}", "public function match() {\r\n\t\treturn false;\r\n\t}", "function yy_r74(){ $this->_retvalue = 'OUTER'; }", "public function step_2()\n {\n }", "function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }", "function after_change()\n\t{\n\t\treturn true;\n\t}", "public function needsIncrementOffset();", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n foreach ($gotos as $goto) {\n if ($goto->resolved === true)\n continue;\n \n if (!isset ($this->labels[$lid]))\n Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id);\n else {\n Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id);\n Logger::info_at($this->labels[$lid]->loc, 'label was defined here');\n \n if (!$seen_loop_info) {\n $seen_loop_info = true;\n Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement');\n }\n }\n }\n }\n }", "final public function onOutOfBand (): void {\n // do nothing\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "abstract protected function _preHandle();", "function yy_r153(){ return; }", "public function runBare()\n {\n $e = null;\n ha::resetCount();\n\n try {\n parent::runBare();\n } catch (\\Exception $e) { }\n\n $this->addToAssertionCount(ha::getCount());\n\n if ($e !== null) {\n throw $e;\n }\n }", "public function step_1()\n {\n }", "function Skip() {\n }", "public function testRegonLocal6()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "private function checkCurrent() {\n\t\tif ($this->currentObjectWriter==null)\n\t\t\tthrow new AjapWriterException(\"Wrong State\");\n\t}", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function movedElementsCanNotBeFoundAtTheirOrigin() {}", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "public function call() {\n\t\treturn false;\n\t}", "public function testPreprocessingUnrotate()\n {\n }", "public function testRegonLocal4()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function preProcess() {}", "public function testRegon4()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRegon6()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function yy_r137(){ $this->_retvalue = @$this->yystack[$this->yyidx + 0]->minor; }", "public function testRegonLocal7()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function is_trackback()\n {\n }", "public function testRegon3()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function game_is_broken($game) {\n\tif ($game->is_tie()) {\n\t\techo \"\\n\\n****ERROR: Broken Game. Tie! in game_is_broken()\";\n\t\tpause(\"\");\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function testRegon0()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function fix() {}", "public function fix() {}", "function ensure_content() {\r\n \t\tif ($this->offset >= $this->length - 1) {\r\n \t\t\treturn $this->increase_length();\r\n \t\t} else {\r\n \t\t\treturn true;\r\n \t\t}\r\n \t}", "public function testRegonLocal3()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "final public function check() : void {\n\t\tif($this !== self::current()) {\n\t\t\tthrow new PlatformMismatchException(self::current(), $this);\n\t\t}\n\t}", "function test()\n {\n return true;\n }", "public function testRegonLocal2()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == true (line 69)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function impliesPositioningCursorAtTheBeginning()\n {\n return $this->base != 'a';\n }", "function yy_r139(){$this->_retvalue = '!='; }", "public function testRegonLocal5()\n{\n\n // Traversed conditions\n // for (...) == true (line 65)\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == true (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRegon7()\n{\n\n // Traversed conditions\n // for (...) == true (line 40)\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == true (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function preprocessInternal()\n\t{\n\t\t// void\n\t}", "public function testRegonLocal0()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testRegon2()\n{\n\n // Traversed conditions\n // for (...) == false (line 40)\n // for (...) == true (line 44)\n // for (...) == false (line 44)\n // if ($checksum == 10) == false (line 48)\n\n $actual = $this->company->regon();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function test9() {\n\n }", "function skip() {\n # This method is meant to sidestep any expensive processing\n # a subclass might perform as part of next().\n $this->next();\n }", "public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }", "function processa()\n {\n return true;\n }", "function yy_r76()\n {\n $this->_retvalue = '!(1 & ' . $this->yystack[$this->yyidx + - 2]->minor . ' / ' . $this->yystack[$this->yyidx + 0]->minor . ')';\n }" ]
[ "0.6182695", "0.6130271", "0.60010654", "0.60010654", "0.599624", "0.5970275", "0.589821", "0.5882317", "0.57822347", "0.57153153", "0.5701259", "0.56878024", "0.56466585", "0.5640242", "0.5640025", "0.56266403", "0.5623793", "0.56098425", "0.55810934", "0.55798614", "0.5575358", "0.5571203", "0.5568611", "0.5556565", "0.5550023", "0.5541395", "0.55373603", "0.55273485", "0.5521605", "0.5512628", "0.55059576", "0.54970807", "0.5492337", "0.54834485", "0.5455699", "0.5449045", "0.5429307", "0.5426349", "0.54083323", "0.5404159", "0.53960556", "0.5395913", "0.5395405", "0.539417", "0.5388426", "0.5378852", "0.5377373", "0.5377237", "0.5362348", "0.5357344", "0.5355406", "0.53511304", "0.53411853", "0.53185624", "0.53177583", "0.5314683", "0.5307356", "0.5295428", "0.5294385", "0.52912074", "0.5286065", "0.5283245", "0.5276328", "0.5272133", "0.5271511", "0.527103", "0.52693975", "0.5266818", "0.5265596", "0.5265596", "0.5263288", "0.5253195", "0.52456886", "0.5235105", "0.52333647", "0.52302855", "0.5227395", "0.522661", "0.52265126", "0.52261055", "0.52223504", "0.5222239", "0.5222049", "0.52215147", "0.5216911", "0.5214126", "0.5213996", "0.5211265", "0.52093303", "0.5202925", "0.52020407", "0.52006066", "0.5200429", "0.5199108", "0.51987165", "0.51986444", "0.5197203", "0.5196451", "0.5190125", "0.51828307", "0.51824754" ]
0.0
-1
echo $queryTerm, ' ', $queryType, "\n";
function search($institution, $queryType, $queryTerm, $start=0, $limit=10) { if (strcasecmp($institution,'CASENT') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'inbiocri') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'lacment') == 0) { $institution = 'CASENT'; } if (strcasecmp($institution,'jtlc') == 0) { $institution = 'CASENT'; } $server = $this->serverURL[$institution]; $resource = $this->resourceCode[$institution] ; // Build request message $tree = new XML_Tree(); $root = & $tree->addRoot( "request", '', array( "xmlns" => 'http://digir.net/schema/protocol/2003/1.0', "xmlns:xsd" => 'http://www.w3.org/2001/XMLSchema', "xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-instance', "xmlns:digir" => 'http://digir.net/schema/protocol/2003/1.0', "xmlns:dwc" => 'http://digir.net/schema/conceptual/darwin/2003/1.0', "xmlns:darwin" => 'http://digir.net/schema/conceptual/darwin/2003/1.0', "xsi:schemaLocation" => 'http://digir.net/schema/protocol/2003/1.0', "xsi:schemaLocation" => 'http://digir.net/schema/protocol/2003/1.0 http://digir.sourceforge.net/schema/protocol/2003/1.0/digir.xsd http://digir.net/schema/conceptual/darwin/2003/1.0 http://digir.sourceforge.net/schema/conceptual/darwin/2003/1.0/darwin2.xsd', ) ); $header = & $root->addChild("header"); $header->addChild("version", "1.0.0"); $header->addChild("sendTime", date("Ymd \TG:i:s") ); $header->addChild("source", $_SERVER['SERVER_ADDR']); $header->addChild("destination", $server, array( "resource" => $resource ) ); $header->addChild("type", "search"); $search = & $root->addChild("search"); $filter = & $search->addChild("filter"); $equals = & $filter->addChild("equals"); switch($queryType) { case 'genus': $equals->addChild("darwin:Genus", $queryTerm); break; case 'family': $equals->addChild("darwin:Family", $queryTerm); break; case 'class': $equals->addChild("darwin:Class", $queryTerm); break; case 'country': $equals->addChild("darwin:Country", $queryTerm); break; case 'specimen': switch ($this->schema[$institution]) { case "1.14": $equals->addChild("darwin:CatalogNumber", $queryTerm); break; default: $equals->addChild("darwin:CatalogNumberText", $queryTerm); break; } break; default: break; } $records = & $search->addChild("records", "", array( "limit" => $limit, "start" => $start ) ); if ($this->schema[$institution] == '1.12') { $records->addChild("structure", "", array( // "schemaLocation" => "http://bnhm.berkeley.museum/manis/DwC/darwin2resultfull.xsd", "schemaLocation" => "http://digir.sourceforge.net/schema/conceptual/darwin/result/full/2003/darwin2resultfull.xsd", ) ); } else { $structure = & $records->addChild("structure", ""); $element = & $structure->addChild("xsd:element", "", array( "name" => "record" )); $complexType = & $element->addChild("xsd:complexType", ""); $sequence = & $complexType->addChild("xsd:sequence", ""); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:InstitutionCode" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CollectionCode" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CatalogNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:ScientificName" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:VerbatimCollectingDate" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DateLastModified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:YearCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:MonthCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DayCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:TimeCollected" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Kingdom" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Phylum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Class" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Order" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Family" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Genus" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Species" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Subspecies" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Country" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:StateProvince" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:County" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Island" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:IslandGroup" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:ContinentOcean" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Locality" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:HorizontalDatum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Collector" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Remarks" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:TypeStatus" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:OtherCatalogNumbers" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:CollectorNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:FieldNumber" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:GenBankNum" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Latitude" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Longitude" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Sex" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:Notes" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:IdentifiedBy" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:YearIdentified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:MonthIdentified" )); $sequence->addChild("xsd:element", "", array( "ref" => "darwin:DayIdentified" )); } $xml = $tree->get(); //echo $xml; // Strip XML header $xml = str_replace ( '<?xml version="1.0"?>', '', $xml); // Remove line breaks $xml = str_replace ( "\n", '', $xml); // Replace spaces with HEX code $xml = str_replace ( " ", '%20', $xml); //echo $xml; $url = "http://$server?doc="; $url .= $xml; //echo $url; return $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printquery(){\n\t\techo $this->query.\";\";\n\t}", "function testQueryTerms()\n\t{\n\t\t// system is functional\n\t\treturn \"<filter>\\n\".\n\t\t\t\"\t<or>\\n\".\n\t\t\t\"\t\t<equals>\\n\".\n\t\t\t\"\t\t\t<darwin:Genus>Helix</darwin:Genus>\\n\".\n\t\t\t\"\t\t</equals>\\n\".\n\t\t\t\"\t\t<equals>\\n\".\n\t\t\t\"\t\t\t<darwin:Genus>Conus</darwin:Genus>\\n\".\n\t\t\t\"\t\t</equals>\\n\".\n\t\t\t\"\t</or>\\n\".\n\t\t\t\"</filter>\\n\".\n\t\t\t\"<records start='0' limit='5'>\\n\".\n\t\t\t\"\t<structure schemaLocation='http://digir.sourceforge.net/schema/conceptual/darwin/full/2003/1.0/darwin2full.xsd'/>\\n\".\n\t\t\t\"</records> \\n\";\n\t}", "function displaySearcher()\n{\n\t$q = $_GET['query'];\n\techo <<<END\n\t<br />\n\t<br />\n\tSearcher:\n\t<br>\n\t<form action=\"searchResults.php\" method=\"get\">\n\t<input type=\"text\" id=\"query\" value=\"$q\" name=\"query\">\n\t<br>\n\tSpelling Accuracy:\n\t<br>\n\t<SELECT name=\"et\">\n\t<OPTION value=\"1\">Very Close\n\t<OPTION value=\"2\">Close\n\t<OPTION value=\"3\" SELECTED>Somewhat\n\t<OPTION value=\"4\">Off\n\t<OPTION value=\"5\">Way Off\n\t<OPTION value=\"6\">Nowhere Near Correct\n\t</SELECT>\n\t<br><br>\n\t<input type=\"submit\" value=\"Search\">\n\t</form>\nEND;\n}", "public function printResult ($term = NULL) {\n print $this->saveResult($term);\n\n }", "function showquery() {\r\n #~ echo '<td align=right>'; // see nav.inc.php for reason\r\n echo '<form name=\"search\" method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n #~ echo '<img src=\"images/b_search.png\" border=\"0\">';\r\n echo lang('Search').' ';\r\n echo '<input type=hidden name=m value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=act value=\"browse\">';\r\n echo '<input type=text name=query value=\"'.$this->_query.'\" size=10>';\r\n echo ' '.lang('in').' ';\r\n echo '<select name=\"qf\">';\r\n #~ echo '<option value=\"\">With selected:</option>';\r\n echo '<option value=\"*\">'.lang('All fields').'</option>';\r\n echo \"<option value=''>______________</option>\";\r\n foreach ($this->properties as $key=>$col) {\r\n if (!$col->queryable or $col->colname=='') continue;\r\n $key == $_REQUEST['qf']? $ischecked = 'selected': $ischecked = '';\r\n echo \"<option value='$key' $ischecked>{$col->label}</option>\";\r\n }\r\n echo '</select>';\r\n #~ echo '<input type=submit value=\"Query\">';\r\n echo '</form>';\r\n #~ echo '</td>'; // see nav.inc.php for reason\r\n\r\n #~ echo '</td></tr></table>';\r\n }", "function echoTerm(\n $actcode, $showAll, $hideuntil, $spanid, $hidetag, $currcharcount, $record\n): int {\n echo_term($actcode, $showAll, $spanid, $hidetag, $currcharcount, $record);\n return 0;\n}", "public function getSearchQueryText()\n {\n return __(\"Search results for: '%1'\", $this->catalogSearchData->getEscapedQueryText());\n }", "public function getSearchQueryText()\n {\n $mesg = (int)$this->getRequest()->getParam('as') ?\n __(\"Search results for: '%1'\", 'Attributes Search') :\n __(\"Search results for: '%1'\", $this->catalogSearchData->getEscapedQueryText());\n return $mesg;\n }", "function buildQuery( )\n {\n $field = \"KeyWords\";\n\n $QueryText = $this->QueryText;\n \n $QueryText = trim( $QueryText );\n// $QueryText = ereg_replace( \"[ ]+\", \" \", $QueryText );\n// $queryArray = explode( \" \", $QueryText );\n $QueryText = ereg_replace( '\\\\\\\\\"', '\"', $QueryText );\n preg_match_all( \"/((\\\"[^\\\"]+\\\")|([^ ]+))/\", $QueryText, $m );\n $queryArray = array();\n foreach( $m[0] as $match )\n {\n $queryArray[] = $match;\n }\n if ( count( $queryArray ) == 0 )\n $queryArray[] = \"\";\n\n $normalArray = array();\n $addArray = array();\n $subArray = array();\n\n foreach( $queryArray as $queryItem )\n {\n switch ( $queryItem[0] )\n {\n case '-':\n {\n $subArray[] = substr( $queryItem, 1 );\n break;\n }\n case '+':\n {\n $addArray[] = substr( $queryItem, 1 );\n break;\n }\n default:\n {\n $normalArray[] = $queryItem;\n }\n }\n }\n\n $arrs = array( array( \"array\" => \"normalArray\", \"item_delim\" => \"OR\", \"delim\" => \"OR\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"addArray\", \"item_delim\" => \"OR\", \"delim\" => \"AND\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"subArray\", \"item_delim\" => \"AND\", \"delim\" => \"AND\", \"compare\" => \"NOT LIKE\" ) );\n\n $total_query = \"\";\n foreach( $arrs as $arr )\n {\n $queryArray = ${$arr[\"array\"]};\n $item_delim = $arr[\"item_delim\"];\n $delim = $arr[\"delim\"];\n $compare = $arr[\"compare\"];\n $query = \"\";\n for ( $i=0; $i<count($queryArray); $i++ )\n {\n $queryVal = $queryArray[$i];\n if ( strlen( $queryVal ) > 1 and $queryVal[0] == '\"' and $queryVal[strlen($queryVal)-1] == '\"' )\n {\n $queryVal = substr( $queryVal, 1, strlen( $queryVal ) - 2 );\n }\n\n $subquery = \"\";\n for ( $j=0; $j<count($this->Fields); $j++ )\n {\n $queryItem = $queryVal;\n\n $queryItem = $this->Fields[$j] .\" $compare '%\" . $queryItem . \"%' \";\n\n if ( $j > 0 )\n $queryItem = $item_delim . \" \" . $queryItem . \" \";\n\n $subquery .= $queryItem;\n }\n $query .= \"( $subquery )\";\n\n if ( count( $queryArray) != ($i+1) )\n $query .= \" $delim \";\n }\n if ( count( $queryArray ) )\n {\n if ( !empty( $total_query ) )\n {\n $total_query = \"$total_query $delim ( $query )\";\n }\n else\n {\n $total_query = \"( $query )\";\n }\n }\n }\n return $total_query;\n }", "function department_query()\n//\tprint the query\n{\n\t$actionpage = $_SERVER[\"PHP_SELF\"];\n\t\n\tprint \"<H2>Department Query</H2>\";\n\tprint \"<form action='$actionpage' method=POST>\";\n\tprint \"<TABLE BORDER=0 BGCOLOR=LIGHTGREY>\";\n\tprint \"<TR><TD WIDTH=300></TD><TD WIDTH=400></TD></TR>\";\n\tprint \"<TR><TD>Department:</TD><TD>\".department_options(\"\").\"</TD><TR>\";\t\t\n\tprint \"</TABLE>\";\n\n\tprint \"<P>\";\n\tprint \"<input type='submit' value='Go!'>\";\n\tprint \"</form>\";\n}", "function _admin_search_query()\n {\n }", "public function __toString() {\n return $this->query;\n }", "public function getSearchTerm()\n {\n return $this->_catalogSearch->getEscapedQueryText();\n }", "function kind_verbs() {\n echo join( ' and ', get_kind_verbs() ) . '\"';\n}", "function echoResultsQREE ($rows) \r{\r \techo \"<table cellpadding=7>\\n\";\r \tforeach ($rows as $row) {\r\t\techo \"\\n\\n\\n<tr>\\n<td valign=top>\\n\";\r\t\techoDocumentLink($row);\r\t\techo \"<td><font color=blue>\".$row[0].\"</font><br>\";\r\t\techoTwoSentences($row[3],$row[4],$row[5],$row[6],$row[7],false);\r \t}\r \techo \"</table>\\n\";\r}", "public function getQueryAsString();", "function show_query($query) {\r\n global $debug;\r\n\r\n if($debug)\r\n echo \"<p>Query = $query</p>\" ;\r\n}", "private function getQueryString()\n {\n return \\apply_filters('swiftype_search_query_string', stripslashes(\\get_search_query(false)));;\n }", "function __toString() {\n\t\treturn $this->query;\n\t}", "public function __toString() {\n\t\treturn $this->query;\n\t}", "public function getQueryType();", "public function __toString(){\r\n\t\treturn $this->queryString();\r\n\t}", "public function __toString()\n {\n $q = $this->getQteReste();\n return (string)$q;\n\n // return \" \";\n\n }", "function print_search_form(){\n global $cfg, $db, $libhtml;\n\n $html = $libhtml->form_start();\n $html .= open_table();\n $html .= $libhtml->render_form_table_row(\"keyword\", my_request(\"keyword\"), \"Keyword\", \"keyword\");\n $html .= close_table();\n $html .= $libhtml->render_form_table_row_hidden(\"search\", \"Search\");\n $html .= $libhtml->render_form_table_row_hidden(\"move_to_get\", true);\n\n $html .= $libhtml->render_actions(\n array(\n $libhtml->render_button(\"search_button\", \"Search\"),\n ),\n array(\n \"show_prompt\"=>false,\n \"show_cancel\"=>false,\n \"pause\"=>false,\n )\n );\n\n $html .= $libhtml->form_end();\n $html .= '<div class=\"clear\"></div><br/>';\n return $html;\n }", "function echo_term(\n $actcode, $showAll, $spanid, $hidetag, $currcharcount, $record, \n &$exprs = array()\n)\n{\n $actcode = (int)$record['Code'];\n if ($actcode > 1) {\n // A multiword, $actcode is the number of words composing it\n\t\tif (empty($exprs) || $exprs[sizeof($exprs)-1][1] != $record['TiText'])\n\t\t\t$exprs[] = array($actcode, $record['TiText'], $actcode);\n\n if (isset($record['WoID'])) {\n\n $attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"mword\", ($showAll ? 'mwsty' : 'wsty'), \n \"order\" . $record['Ti2Order'],\n\t\t\t\t 'word' . $record['WoID'], 'status' . $record['WoStatus'], \n\t\t\t\t 'TERM' . strToClassName($record['TiTextLC'])]\n ),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_wid' => $record['WoID'],\n\t\t\t\t'data_trans' => tohtml(repl_tab_nl($record['WoTranslation']) . \n\t\t\t\tgetWordTagList($record['WoID'], ' ', 1, 0)),\n\t\t\t\t'data_rom' => tohtml($record['WoRomanization']),\n\t\t\t\t'data_status' => $record['WoStatus'],\n 'data_code' => $actcode,\n 'data_text' => tohtml($record['TiText'])\n );\n $span = '<span';\n foreach ($attributes as $attr_name => $val) {\n $span .= ' ' . $attr_name . '=\"' . $val . '\"';\n }\n $span .= '>'; \n if ($showAll) {\n $span .= $actcode;\n } else {\n $span .= tohtml($record['TiText']);\n }\n $span .= '</span>';\n echo $span;\n }\n } else {\n // Single word\n if (isset($record['WoID'])) {\n // Word found status 1-5|98|99\n\t\t\t$attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"word\", \"wsty\", \"word\" . $record['WoID'],\n 'status' . $record['WoStatus'], \n 'TERM' . strToClassName($record['TiTextLC'])\n ]),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_wid' => $record['WoID'],\n\t\t\t\t'data_trans' => tohtml(repl_tab_nl($record['WoTranslation']) . \n\t\t\t\tgetWordTagList($record['WoID'], ' ', 1, 0)),\n\t\t\t\t'data_rom' => tohtml($record['WoRomanization']),\n\t\t\t\t'data_status' => $record['WoStatus']\n\t\t\t);\n } else {\n // Not registered word (status 0)\n\t\t\t$attributes = array(\n\t\t\t\t'id' => $spanid,\n\t\t\t\t'class' => implode(\" \", [\n $hidetag, \"click\", \"word\", \"wsty\", \"status0\", \n \"TERM\" . strToClassName($record['TiTextLC'])\n ]),\n\t\t\t\t'data_pos' => $currcharcount,\n\t\t\t\t'data_order' => $record['Ti2Order'],\n\t\t\t\t'data_trans' => '',\n\t\t\t\t'data_rom' => '',\n\t\t\t\t'data_status' => '0',\n\t\t\t\t'data_wid' => ''\n\t\t\t);\n }\n\t\tforeach ($exprs as $expr) {\n\t\t\t$attributes['data_mw' . $expr[0]] = tohtml($expr[1]);\n\t\t}\n $span = '<span';\n foreach ($attributes as $attr_name => $val) {\n $span .= ' ' . $attr_name . '=\"' . $val . '\"';\n\t\t}\n $span .= '>' . tohtml($record['TiText']) . '</span>';\n echo $span;\n\t\tfor ($i = sizeof($exprs) - 1; $i >= 0; $i--) {\n\t\t\t$exprs[$i][2]--;\n\t\t\tif ($exprs[$i][2] < 1) {\n\t\t\t\tunset($exprs[$i]);\n\t\t\t\t$exprs = array_values($exprs);\n\t\t\t}\n\t\t}\n }\n}", "public function queryFormat(): string\n {\n return 'Pretty';\n }", "function show_query($query) {\n global $debug;\n\n if($debug)\n echo \"<p>Query = $query</p>\" ;\n}", "function gSiteMap_outputTerm($pageUrl, $priority, $changeFreq, $lastMod)\n{\n\tprint(\"<url>\\n\");\n\t$pageUrl = str_replace(\"&\",\"&amp;\",$pageUrl);\n\t$pageUrl = str_replace(\"'\",\"&apos;\",$pageUrl);\n\t$pageUrl = str_replace(\"\\\"\",\"&quot;\",$pageUrl);\n\t$pageUrl = str_replace(\">\",\"&gt;\",$pageUrl);\n\t$pageUrl = str_replace(\"<\",\"&lt;\",$pageUrl);\n\tprint(\" <loc>\" . utf8_encode($pageUrl) . \"</loc>\\n\");\n\tif($priority != 0)\n\t{\n\t\tprint(\" <priority>\" . $priority . \"</priority>\\n\");\n\t}\n\tif($changeFreq != \"\")\n\t{\n\t\tprint(\" <changefreq>\" . $changeFreq . \"</changefreq>\\n\");\n\t}\n\tif($lastMod != 0)\n\t{\n\t\tprint(\" <lastmod>\" . $lastMod . \"</lastmod>\\n\");\n\t}\n\tprint(\"</url>\\n\");\n}", "function the_search_query()\n {\n }", "function search_results_title() {\r\n if( is_search() ) {\r\n \r\n global $wp_query;\r\n \r\n if( $wp_query->post_count == 1 ) {\r\n $result_title .= '1 search result found';\r\n } else {\r\n $result_title .= 'Showing ' . $wp_query->found_posts . ' results';\r\n }\r\n \r\n $result_title .= \" for “<span style='color:#e83936;'>\" . wp_specialchars($wp_query->query_vars['s'], 1) . \"</span>”\";\r\n \r\n echo $result_title;\r\n \r\n }\r\n}", "function print_table($query_result) {\n echo \"<table>\";\n echo \"<tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr>\";\n\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "public function query(): string;", "protected function getQueryType()\n {\n }", "function search($record=\"\")\n {\n return \"&nbsp;\";\n }", "public function getTypeNameShort()\n {\n global $Language;\n $typ = $this->getType();\n switch ($typ) {\n case \"=\":\n $typname = $Language->phrase(\"QuickSearchExactShort\");\n break;\n case \"AND\":\n $typname = $Language->phrase(\"QuickSearchAllShort\");\n break;\n case \"OR\":\n $typname = $Language->phrase(\"QuickSearchAnyShort\");\n break;\n default:\n $typname = $Language->phrase(\"QuickSearchAutoShort\");\n break;\n }\n if ($typname != \"\") {\n $typname .= \"&nbsp;\";\n }\n return $typname;\n }", "function admin() {\n $value=clean_input($_GET['value']);\n $tag=clean_input($_GET['tag']);\n $table=clean_input($_GET['table']);\n $sql=\"show fields from $table\";\n $res=dbHelp::mysql_query2($sql) or die ($sql);\n // mysql_data_seek($res,0);\n $field1=dbHelp::mysql_fetch_row2($res);\n // mysql_data_seek($res,1);\n $field2=dbHelp::mysql_fetch_row2($res);\n \n $sql=\"select \" . $field2[0] . \",\". $field1[0] . \" from $table where lower(\" . $field2[0] . \") like lower('\" . $value . \"%')\";\n $res=dbHelp::mysql_query2($sql) or die ($sql);\n $arr=dbHelp::mysql_fetch_row2($res);\n echo $arr[0];\n echo \"|\" . $arr[1];\n}", "public function toString()\n {\n return 'Full text search does not work as expected!';\n }", "function owl_query($endpoint, $onturi, $query, $type) {\n $url = $endpoint . '?query=' . urlencode($query) . \n '&type=' . strtolower($type) .\n '&ontology=' . $onturi;\n //print $url;\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($request, CURLOPT_HTTPHEADER, array(\n 'Accept: application/json'\n ));\n\n $result = curl_exec($request);\n $info = curl_getinfo($request);\n\n // TODO: Reasonable error handling\n if($result === '' || $info['http_code'] != 200) {\n return;\n }\n \n curl_close($request);\n\n return $result;\n}", "public function get_query() {\n\t return $this->decodedWebhook['queryResult']['queryText'];\n }", "public function get_term()\n {\n }", "function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}", "function getQuery() ;", "public function createQuery()\n\t{\n\t\t$this->tab[] = $this->action;\n\t\t$this->tab[] = !is_array($this->field) ? $this->field : join(', ',$this->field);\n\t\t$this->tab[] = ' FROM '.$this->from;\n\t\tif(!empty($this->where)){$this->tab[] = 'WHERE '.$this->where;}\n\t\tif(!empty($this->and)){$this->tab[] = 'AND '.$this->and;}\n\t\tif(!empty($this->or)){$this->tab[] = 'OR '.$this->or;}\n\t\tif(!empty($this->in)){$this->tab[] = 'IN '.$this->in;}\n\t\tif(!empty($this->beetween)){$this->tab[] = 'BEETWEEN '.$this->beetween;}\n\t\tif(!empty($this->not)){$this->tab[] = 'NOT '.$this->not;}\n\t\tif(!empty($this->like)){$this->tab[] = 'LIKE '.$this->like;}\n\t\tif(!empty($this->order)){$this->tab[] = 'ORDER BY '.$this->order;}\n\t\treturn join(\" \",$this->tab);\n\t}", "function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function suggest()\n\t{\n\t\t$suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "public function formatQuery(string $query): string;", "function show_query($query) {\n global $debug;\n\n if(false && $debug)\n echo \"<p>Query = $query</p>\" ;\n}", "public function booleanAndTerm($term){\n\t\t$term = preg_replace(\"/[^ a-zA-Z0-9]/\", '', $term);\n\t\t\n\t\t$term = mysql_real_escape_string(trim($term));\n\t\t$terms = explode(' ', $term);\n\t\t$return = '';\n\t\tforeach($terms as $word){\n\t\t\tif(strlen($word)>2){\n\t\t\t\t// if has a plural then try without\n\t\t\t\tif(substr($word,-1) == 's'){\n\t\t\t\t\t$return .= '+(>' . $word. ' <' . substr($word,0,-1) . '*) ';\n\t\t\t\t}else{\n\t\t\t\t// if singular then try with an s\n\t\t\t\t\t$return .= '+(>' . $word . ' <' . $word . 's) ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//echo $return;\n\t\t//echo ' --> ';\n\t\treturn $return;\n\t}", "function existingQueryForm () { return \"\"; }", "public function query($query) {\n\t\t$query = \"\nPREFIX sioc: <http://rdfs.org/sioc/ns#>\nPREFIX sioct: <http://rdfs.org/sioc/types#>\nPREFIX foaf: <http://xmlns.com/foaf/0.1/>\nPREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX dc: <http://purl.org/dc/elements/1.1/>\nPREFIX dct: <http://purl.org/dc/terms/>\nPREFIX tags: <http://www.holygoat.co.uk/owl/redwood/0.1/tags/>\nPREFIX moat: <http://moat-project.org/ns#>\nPREFIX opo: <http://online-presence.net/opo/ns#>\nPREFIX opo-actions: <http://online-presence.net/opo-actions/ns#>\nPREFIX ctag: <http://commontag.org/ns#>\nPREFIX smob: <http://smob.me/ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX xsd: <http://www.w3.org/2001/XMLSchema#>\nPREFIX rev: <http://purl.org/stuff/rev#>\nPREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>\n$query\n\";\n\t\treturn $query;\n\t}", "public function toString()\n {\n return '{0 < $query->count() < 2}';\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "public function get_query()\n {\n }", "function plugin_suggest_callback() {\r\n\t\t\tglobal $wpdb, $post;\r\n\t\t\t\r\n\t\t\t$posttype = $wpdb->escape($_GET['type']);\r\n\t\t\t$in = $wpdb->escape($_GET['q']);\r\n\r\n\t\t\t$query = \"SELECT ID from $wpdb->posts where post_type = '$posttype' AND post_title like '%$in%' \";\r\n\t\t\t$mypostids = $wpdb->get_col($query);\r\n\r\n\t\t\tforeach ($mypostids as $key => $value) {\r\n\t\t\t\tprint get_the_title($value) . \" [#\" . $value . \"]\" . \"\\n\";\r\n\t\t\t}\r\n\t\t\tdie(); // this is required to return a proper result\r\n\t\t}", "public function suggest()\n\t{\n\t\t$suggestions = $this->Role->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function agriflex4_search_results_header() {\n\n\t$title = sprintf(\n\t\t'<div class=\"entry-header\"><h1 class=\"entry-title\">Search Results for: %s</h1></div>',\n\t\tget_search_query()\n\t);\n\n\techo wp_kses_post( $title );\n\n}", "function nothing($kw='') {\n\tdie(\"{query:'\".$kw.\"', suggestions:'', data:''}\");\n}", "function Q($query)\n{\n\t$sugest = '';\n\t$count = 0;\n\t$len = strlen($query);\n\tfor($i = $len-1;$i==0;$i--)\n\t{\n\t\tif($query[$i] == \"'\")$count++;\n\t}\n\tif($count%2 != 0){\n\t\t\t$sugest .= \"Sugerencia: Hay un error,no todas las comillas estan bien cerradas\";\n\t\t\treturn $sugest;\n\t\t}\t\n\t/*\n\t * Second, search for references to dates or id, in case of dates check if the value is properly encased in \"'\"\n\t * In case of being a Id value, check if its without \"'\"\n\t * Search for encased values by default\n\t */\n\t \n}", "function print_input_fields()\n{\n\t$fields = func_get_args();\n\tforeach ($fields as $field)\n\t{\n\t\t$value = array_key_value($_POST,$field,'');\n\t\t$label = ucwords(str_replace('_',' ',$field));\n\t\tprint <<<EOQ\n <tr>\n <td valign=top align=right>\n <b>$label:</b>\n </td>\n <td valign=top align=left>\n <input type=\"text\" name=\"$field\" size=\"40\" value=\"$value\">\n </td>\n </tr>\nEOQ;\n\t}\n}", "function search_query($query){\n\t\tglobal $bBlog;\n\t\t$query = $this->replace($query);\n\t\t$words = explode(' ', $query);\n\t \n\t\t$sql = '';\n\t\tforeach ($words as $word){\n\t\t\t$this->make_tmp($word);\n\t\t\t$sql .= \" OR `string` = '\".$word.\"'\";\n\t\t}\n\t\treturn $bBlog->db->get_results(\"\n\t \tSELECT \n\t\t\t`article_id` AS `id`,\n\t\t\tSUM(points) AS points_sum\n\t\tFROM `\".T_SEARCH_TMP.\"`\n\t\tWHERE 0 \".$sql.\"\n\t\tGROUP BY `id`\n\t\tORDER BY `points_sum` DESC\n\t\tLIMIT 20;\n\t\t\");\n\t}", "public static function get_query_type($query) {\n\t\t$query_type = strtoupper(strtok(trim($query), \" \\n\\t\"));\n\n\t\treturn in_array($query_type, self::$query_types) ? $query_type : 'OTHER';\n\t}", "public function getType()\r\n\t{\r\n\t\treturn isset($this->parsedQuery['querytype']) ? strtolower($this->parsedQuery['querytype']) : null;\r\n\t}", "function getSearchTerm() {\n if(isset($_POST['searchStr']))\n return $_POST['searchStr'];\n else\n return \"\";\n }", "public\r\n\tfunction getStrands() {\r\n\t\treturn implode( \" AND \", $this->queryStrands );\r\n\t}", "function show_query_results($result, $fldCapt, $chkBoxPref)\n{\n\t$useChkBoxes = (strlen($chkBoxPref) != 0);\n\n\techo \"<table border='1'>\\n\";\n // extract field names if $fieldsName is empty\n\t$rowsCnt=mysql_numrows($result);\n\t$fieldsCnt=mysql_num_fields($result);\n\n\t$names=array();\n\tfor ($i=0; $i<$fieldsCnt; $i++)\n\t{\n\t\t $meta = mysql_fetch_field($result, $i);\n\t\t $names[]=$meta->name;\n\t};\n\t// print table header\n\techo \"<tr>\\n\";\n\n\t//-----------\n\t// skip one cell for column of check-boxes if necessary\n\tif ($useChkBoxes) echo \"<td></td>\"; \n\t//-----------\t\n\n\tif ($fldCapt == 0)\n\t{\n\t\tfor ($i=0; $i<count($names); $i++)\n\t\t\t echo \"<td>{$names[$i]}</td>\";\n\t}\n\telse\n\t{\n\t\tfor ($i=0; $i<count($names); $i++)\n\t\t\t echo \"<td>{$fldCapt[$i]}</td>\";\n\t};\n\t\n\techo \"\\n</tr>\\n\";\n // print table contents\n\tfor ($r=0; $r<$rowsCnt; $r++)\n\t{\n\t\techo \"<tr>\";\n\t\t//-----------\n\t\t// put check box if necesary\n\t\tif ($useChkBoxes) \n\t\t\techo \"<td><input type='checkbox' name='{$chkBoxPref}' value = '{$r}'></td>\";\n\t\t//-----------\n\t\t\n\t\t\n\t\tfor ($i=0; $i<count($names); $i++)\n\t\t{\n\t\t\t$item=mysql_result($result, $r, $names[$i]);\n\t\t\techo \"<td>{$item}</td>\";\n\t\t};\n\t\techo \"</tr>\\n\";\n\t};\n\techo \"</table>\\n\";\n\t\n\n}", "function get_search_query($escaped = \\true)\n {\n }", "public function __toString() {\n\t\treturn $this->getQuery();\n\t}", "private function makeTwitterQuery() {\n\t\t// The basic URL for the twitter search API\n\t\t$base_query = 'http://search.twitter.com/search.json?q=';\n\n\t\tif (isset($this->tag)) { // Make a search query by tag\n\t\t\t$this->query = $base_query . urlencode('#' . $this->tag);\n\t\t} elseif ((isset($this->geo)) && (count($this->geo) >0 )) {\n\t\t\t$this->query = $base_query . '&' . 'geocode=' . $this->geo['lat'] . urlencode(',') . $this->geo['lon'] . urlencode (',') . $this->geo['distance'] / 1000 . 'km';\n\t\t}\n\n\t\tlogger::log(DEBUG, \"TWITTER - Query: \".$this->query );\n\t}", "public function getQueryType()\n {\n return $this->query_type;\n }", "function SQLFormat ($query)\r{\r\t$lowercase = array ('select ', ' max', ' min', ' count', ' avg', ' sum',\r\t\t\t\t\t\t'from ', ' as ',\r\t\t\t\t\t\t'join ', \"left \\nJOIN \", \"right \\nJOIN \", \"inner \\nJOIN \", \"outer \\nJOIN \", ' on ',\r\t\t\t\t\t\t'where ', ' like ', ' and ', ' or ',\r\t\t\t\t\t\t'group by ',\r\t\t\t\t\t\t'order by ', ' asc', ' desc', 'ASC, ', 'DESC, ',\r\t\t\t\t\t\t'limit ',\r\t\t\t\t\t\t\"\\n\\n\");\r\t$uppercase = array ('SELECT ', ' MAX', ' MIN', ' COUNT', ' AVG', ' SUM',\r\t\t\t\t\t\t\"\\nFROM \", ' AS ',\r\t\t\t\t\t\t\"\\nJOIN \", \"\\nLEFT JOIN \", \"\\nRIGHT JOIN \", \"\\nINNER JOIN\", \"OUTER JOIN\", \"\\n\\tON \",\r\t\t\t\t\t\t\"\\nWHERE \", ' LIKE ', ' AND ', ' OR ',\r\t\t\t\t\t\t\"\\nGROUP BY \",\r\t\t\t\t\t\t\"\\nORDER BY\\n\\t\", ' ASC', ' DESC', \"ASC,\\n\\t\", \"DESC,\\n\\t\",\r\t\t\t\t\t\t\"\\nLIMIT \",\r\t\t\t\t\t\t\"\\n\");\r\r\treturn str_replace ($lowercase, $uppercase, $query);;\r}", "function show_graduate_query()\n{\n\tif(!$_POST['excel_export'])\n\t{\t\n\t\tgraduate_query_form();\n\t\tif(!$_POST['query_type'])\n\t\t{\n\t\t\tprint_graduate_intro();\n\t\t\tprint_graduate_options();\n\t\t}\n\t}\n}", "function wp_idolondemand_query_text_index($args) {\n\textract($args);\n\techo $before_widget;\n\techo $before_title;?>query_text_index<?php echo $after_title;\n\tdisplay_wp_idolondemand_query_text_index();\n\techo $after_widget;\n}", "function createQuery($arr) {\n $printArray = \"\";\n for ($i = 0; $i < sizeof($arr); $i++) {\n if ($i == sizeof($arr) - 1) $printArray = $printArray .'\\'' . $arr[$i] . '\\'';\n else $printArray = $printArray . '\\'' . $arr[$i] . '\\'' . \", \";\n } \n return $printArray;\n}", "function Query ($QueryString);", "function _tsuiseki_tracking_get_query_names() {\n return array(\n 'qe',\n 'target_passthrough',\n 'query',\n );\n}", "function toString() {\n\t\t$out = '';\n\t\tif(!empty($this->cats)) {\n\t\t\t$str = implode('>', $this->cats);\n\t\t\t$out = '(' . $str . ') ';\n\t\t}\n\t\t$out .= $this->question . \"?\";\n\t\treturn $out;\n\t}", "public function getSystemType()\r\n{\r\n $query_string = \"SELECT systemtypename, systemtypedesc FROM system_type \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid\";\r\n\r\n return $query_string;\r\n}", "public function getQueryText()\n\t{\n\t\tif (empty($this->queryText)) {\n\t\t\t$this->queryText = $this->getParam('q');\n\t\t}\n\t\t$queryText = str_replace(':', '', $this->queryText);\n\t\treturn $queryText;\n\t}", "public function getFulltextQuery()\n {\n return $this->getRequest()->getParam('query');\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "function ingres_query($link, $query, $params = array(), $types = NULL)\n{\n}", "private function formatWheres()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->wheres as $val)\n\t\t{\n\t\t\tif ($value != '')\n\t\t\t\t$value .= ' AND ';\n\t\t\t$value .= $val;\n\t\t}\n\t\treturn $value;\n\t}", "public function __toString()\n {\n return $this->getQuery();\n }", "function create_term_stream($circuit, $label, $pop, $think) // void create_term_stream(int circuit, char *label, double pop, double think)\n{\n\tglobal $job; // extern JOB_TYPE *\n\tglobal $s1; // extern char[]\n\tglobal $DEBUG; // extern int\n\tglobal $c;\n\t$p = \"create_term_stream()\"; // char *\n\n\tif ($DEBUG)\n\t\tdebug($p, \"Entering\");\n\n\t$job[$c]->term->name = $label;\n\t$job[$c]->should_be_class = TERM;\n\t$job[$c]->network = $circuit;\n\t$job[$c]->term->think = $think;\n\t$job[$c]->term->pop = $pop;\n\n\tif ($DEBUG) {\n\t\ttypetostr($s1, $job[$c]->should_be_class);\n printf(\"\\tStream[%d]: %s \\\"%s\\\"; N: %3.1f, Z: %3.2f\\n\",$c, $s1,$job[$c]->term->name,$job[$c]->term->pop,$job[$c]->term->think);\n\t\t$s1=\"\";\n\t};\n\n\tif ($DEBUG)\n\t\tdebug($p, \"Exiting\");\n}", "abstract protected function buildQuery(): string;", "public function __toString(){\n\t\t$output = '';\n\t\tforeach ($this->_queries as $query){\n\t\t\tif (isset($query['sql'])){\n\t\t\t\t$output .= $query['sql'] . PHP_EOL . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getQueryString() {\n\t\t\n\t}", "function aecom_use_search_types( $query ) {\n\n // if this isn't one of our custom searches, then who cares?\n if ( ! $search_type = $query->get( 'search_type' ) ) return;\n\n switch ( $search_type ) {\n /* *********** DEACTIVATED WHILE IT IS COMPLETED: it is missing to format results in global search\n case 'offices':\n //search of offices are performed in the universal site only, so change blog temporally\n switch_to_blog(aecom_get_uni_blog_id());\n $query->set( 'post_type', 'office' );\n break;*/\n case 'markets':\n $query->set( 'post_type', 'market' );\n break;\n case 'solutions':\n $query->set( 'post_type', 'service' );\n break;\n case 'projects':\n $query->set( 'post_type', 'project' );\n break;\n case 'insights':\n if ( $documents_page = get_page_by_path( 'documents' ) )\n $query->set( 'post_parent', $documents_page->ID );\n break;\n case 'careers':\n // TODO\n break;\n case 'press-releases':\n $query->set( 'post_type', 'press-release' );\n break;\n }\n}", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "public function getType(): string\n {\n return Client::QUERY_ANALYSIS_FIELD;\n }", "public function getDefinitions()\r\n{\r\n $query_string = \"SELECT word, worddefinition FROM glossary\";\r\n\r\n return $query_string;\r\n}", "function console_out($text = \"\", $type = 0)\n{\n\n echo($text . PHP_EOL);\n\n}", "function get_variable_search_field($is_fulltext=TRUE)\n\t{\n\t\t$index=array();\n\n\t\t$variable_fields=$this->variable_fields();\n\n\t\t//select which index to use\n\t\tif( in_array('name',$variable_fields) )\n\t\t{\n\t\t\t$index[]='name';\n\t\t}\n\t\tif( in_array('labl',$variable_fields) )\n\t\t{\n\t\t\t$index[]='labl';\n\t\t}\n\t\tif( in_array('qstn',$variable_fields) )\n\t\t{\n\t\t\t$index[]='qstn';\n\t\t}\n\t\tif( in_array('catgry',$variable_fields) )\n\t\t{\n\t\t\t$index[]='catgry';\n\t\t}\n\n\t\tif (count($index)==0)\n\t\t{\n\t\t\t$index[]='name,labl,qstn,catgry';\n\t\t}\n\n\t\tif ($is_fulltext==TRUE)\n\t\t{\n\t\t\t//fulltext\n\t\t\treturn implode(',',$index);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//concatenated fields\n\t\t\treturn 'concat(' . implode(\",' ',\",$index) .')';\n\t\t}\n\t}" ]
[ "0.6567252", "0.5907134", "0.58895934", "0.5691077", "0.56161386", "0.5581429", "0.5440151", "0.53114104", "0.5260784", "0.52588737", "0.5256253", "0.52561885", "0.5254958", "0.52311647", "0.5229302", "0.5160042", "0.5155938", "0.514605", "0.5132944", "0.5120667", "0.5114413", "0.5109165", "0.51065564", "0.51058906", "0.51057976", "0.5102782", "0.50945485", "0.5086181", "0.5085454", "0.5067849", "0.5066193", "0.50647956", "0.50611436", "0.50440246", "0.50291455", "0.50285465", "0.5028242", "0.5028076", "0.5007759", "0.49957386", "0.49952248", "0.49772874", "0.4974057", "0.49715206", "0.49646398", "0.4937898", "0.4931649", "0.49308592", "0.4921502", "0.49153018", "0.4908565", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.49056634", "0.48977348", "0.48923743", "0.4890249", "0.48895153", "0.48854396", "0.4871611", "0.48700482", "0.4862377", "0.48548758", "0.48508096", "0.48439187", "0.48398116", "0.48386237", "0.48370838", "0.48267883", "0.48188138", "0.48120785", "0.48108184", "0.48101652", "0.48085135", "0.4807061", "0.48039144", "0.48027632", "0.47968125", "0.47963274", "0.47921115", "0.4788666", "0.47863847", "0.47790793", "0.47774097", "0.47760424", "0.47753865", "0.4770887", "0.4770484", "0.47598094", "0.47541988", "0.47493193", "0.47455618", "0.47438043", "0.47380182" ]
0.48347777
74
ENQUEUE SCRIPTS AND STYLES
function gwself_scripts() { global $post; //default script - needed everywhere wp_enqueue_script( 'theme-jquery', get_template_directory_uri() . '/dist/js/theme.js', array('jquery'), 20190529, true); wp_localize_script('theme-jquery', 'WPURLS', array('siteurl' => get_option('siteurl'))); //header, footer, global css wp_enqueue_style( 'theme-style', get_template_directory_uri() . '/dist/css/theme.css', array(), date("H:i:s")); //section specific styles and scripts if(is_front_page()) { //FRONT PAGE SCRIPTS wp_enqueue_script( 'fp-script', get_template_directory_uri() . '/dist/js/frontpage.js', array('jquery'), 20190529, true); wp_enqueue_style( 'frontpage-style', get_template_directory_uri() . '/dist/css/frontpage.css', array(), date("H:i:s")); } elseif(is_singular()) { $type = $post->post_type; wp_enqueue_style( $type.'-style', get_template_directory_uri() . '/dist/css/type_'.$type.'.css', array(), date("H:i:s")); } else { wp_enqueue_style( 'page-style', get_template_directory_uri() . '/dist/css/type_page.css', array(), date("H:i:s")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onEnqueueScripts()\n {\n $this->enqueue('front');\n }", "function prosody_plugin_queue_scripts ()\n{\n\n wp_enqueue_style(\n 'poem-css',\n plugin_dir_url( __FILE__ ) . 'css/poem.css',\n array(),\n null,\n false\n );\n\n wp_register_script(\n 'handlers.js',\n plugins_url('js/handlers.js', __FILE__),\n array(),\n null,\n true\n );\n // Localize the script to pass in the siteurl\n wp_localize_script('handlers.js', 'WPURLS', array( 'siteurl' => home_url() ));\n wp_enqueue_script( 'handlers.js' );\n}", "public function enqueueScripts(){}", "function put_in_queue() {\n wp_enqueue_script('reviewsjs', plugins_url('/assets/js/reviews.js', __FILE__));\n wp_enqueue_style('reviewscss', plugins_url('/assets/css/reviews.css', __FILE__));\n }", "function enqueues() {\n\t\twp_register_style( 'ks-thematic-actions', plugin_dir_url( __FILE__ ) . 'style.css' );\n\t wp_enqueue_style( 'ks-thematic-actions' );\n\t}", "public function queue_scripts() {\n\t\t\tif ( $queue = WPO_WCPDF_Dropbox()->hooks->get_queued_files() ) {\n\t\t\t\twp_register_script(\n\t\t\t\t\t'dropbox-queue',\n\t\t\t\t\tplugins_url( 'js/dropbox-queue.js' , dirname(__FILE__) ),\n\t\t\t\t\tarray( 'jquery', 'thickbox' )\n\t\t\t\t);\n\t\t\t\twp_enqueue_script( 'dropbox-queue' );\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t}\n\t\t}", "private function enqueues(){\n\n\t\t\tadd_action( 'init', function(){\n\n\t\t\t\t//scripts:\n\t\t\t\t$url = Url::plugin( 'chef-sections', true ).'Assets/js/libs/';\n\t\t\t\t\n\t\t\t\tScript::register( 'isotope', $url.'isotope.min', false );\n\t\t\t\tScript::register( 'imagesloaded', $url.'imagesloaded.min', false );\n\t\t\t\tScript::register( 'autoload', $url.'autoload', false );\n\t\t\t\tScript::register( 'fitvids', $url.'fitvids.min', false );\n\n\t\t\t\t//sass:\n\t\t\t\tif( !Sass::ignore() ){\n\t\t\t\t\t\n\t\t\t\t\t$url = 'chef-sections/Assets/sass/front/';\n\t\t\t\t\t\n\t\t\t\t\tSass::register( 'sections-columns', $url.'_columns', false );\n\t\t\t\t\tSass::register( 'sections-collection', $url.'_collection', false );\n\t\t\t\t\tSass::register( 'sections-loader', $url.'_loader', false );\n\t\t\t\t\tSass::register( 'sections-socials', $url.'_socials', false );\n\t\t\t\t\tSass::register( 'sections-responsive', $url.'_responsive', false );\n\n\t\t\t\t}else{\n\n\t\t\t\t\t//we need to ignore sass and enqueue a regular css file:\n\t\t\t\t\tadd_action( 'wp_enqueue_scripts', function(){\n\n\t\t\t\t\t\twp_enqueue_style( 'chef_sections', Url::plugin( 'chef-sections', true ).'Assets/css/compiled.css' );\n\n\t\t\t\t\t});\n\n\t\t\t\t}\n\t\t\t});\n\t\t}", "public function dequeue_scripts() {\n\n\t\t\\wp_dequeue_script( 'wpforms-flatpickr' );\n\t\t\\wp_dequeue_script( 'wpforms-jquery-timepicker' );\n\n\t\t\\wp_dequeue_style( 'wpforms-jquery-timepicker' );\n\t\t\\wp_dequeue_style( 'wpforms-flatpickr' );\n\n\t\t\\wp_dequeue_style( 'wpforms-full' );\n\t\t\\wp_dequeue_style( 'wpforms-base' );\n\t}", "function starkers_script_enqueuer() {\n\t\twp_register_script( 'site', get_template_directory_uri().'/js/scripts.min.js', array( 'jquery' ) );\n\t\twp_enqueue_script( 'site' );\n\n\t\twp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );\n\t\twp_enqueue_style( 'screen' );\n\t}", "function prosody_queue_scripts ()\n{\n\n wp_enqueue_style(\n 'normalize',\n get_template_directory_uri() . '/css/normalize.css',\n array(),\n null,\n false\n );\n\n wp_enqueue_style(\n 'bootstrap',\n get_template_directory_uri() . '/css/bootstrap.min.css',\n array(),\n null,\n false\n );\n\n wp_enqueue_style(\n 'jquery-ui-css',\n get_template_directory_uri() . '/css/jquery-ui.css',\n array(),\n null,\n false\n );\n\n wp_enqueue_style(\n 'screen',\n get_template_directory_uri() . '/css/screen.css',\n array('normalize', 'bootstrap', 'jquery-ui-css'),\n null,\n false\n );\n\n wp_register_script(\n 'prosody-jquery',\n get_template_directory_uri().'/js/jquery-3.3.1.min.js',\n array('jquery'), null, false\n );\n wp_enqueue_script('prosody-jquery');\n\n wp_register_script(\n 'prosody-jquery-ui',\n get_template_directory_uri().'/js/jquery-ui-1.12.1.min.js',\n array(), null, false\n );\n wp_enqueue_script('prosody-jquery-ui');\n\n if ( is_front_page() ) {\n wp_enqueue_script(\n 'prosody-jquery-cycle',\n get_template_directory_uri(). '/js/jquery.cycle.js',\n array('prosody-jquery'),\n null,\n false\n );\n }\n\n wp_enqueue_script(\n 'popup',\n get_template_directory_uri() . '/js/popup.js',\n array('prosody-jquery', 'prosody-jquery-ui'),\n null,\n true\n );\n\n wp_enqueue_script(\n 'utility',\n get_template_directory_uri() . '/js/utility.js',\n array('prosody-jquery', 'prosody-jquery-ui'),\n null,\n true\n );\n}", "public function register_enqueuing() {\n\t\tadd_action( 'admin_print_scripts-nav-menus.php', array( &$this, 'enqueue_scripts' ) );\n\t}", "public function enqueues() {\n\n\t\t// CSS.\n\t\twp_enqueue_style(\n\t\t\t'wpforms-builder-setup',\n\t\t\tWPFORMS_PLUGIN_URL . 'assets/css/admin-builder-setup.css',\n\t\t\tnull,\n\t\t\tWPFORMS_VERSION\n\t\t);\n\t}", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "function queue_scripts() {\n\n if (!is_admin()) {\n\n // Deregister scripts.\n wp_deregister_script('jquery');\n\n\n // Scripts in header.\n wp_register_script('modernizr-js', get_stylesheet_directory_uri() . '/assets/js/vendor/modernizr-2.7.1.min.js', array(), '2.7.1', false);\n\n\n // Scripts in footer.\n wp_register_script('jquery', get_stylesheet_directory_uri() . '/assets/js/vendor/jquery-1.10.2.min.js', array(), '1.10.2', true);\n wp_register_script('main-js', get_stylesheet_directory_uri() . '/assets/js/main.min.js', array(), '', true);\n\n\n // Queue scripts.\n wp_enqueue_script('modernizr-js');\n // wp_enqueue_script('jquery');\n // wp_enqueue_script('main-js');\n\n }\n}", "static public function enqueue_late() {\r\n\t\t\t/*\r\n\t\t\t * Beta-testers will not have cached scripts!\r\n\t\t\t * Just in case we have to update the plugin prior to launch.\r\n\t\t\t */\r\n\t\t\tif ( defined( 'WPMUDEV_BETATEST' ) && WPMUDEV_BETATEST ) {\r\n\t\t\t\t$script_version = time();\r\n\t\t\t} else {\r\n\t\t\t\t$script_version = self::VERSION;\r\n\t\t\t}\r\n\r\n\t\t\twp_enqueue_style(\r\n\t\t\t\t'wdev-plugin-ui',\r\n\t\t\t\tself::$module_url . 'wdev-ui.css',\r\n\t\t\t\tarray( 'wdev-plugin-google_fonts' ),\r\n\t\t\t\t$script_version\r\n\t\t\t);\r\n\r\n\t\t\twp_enqueue_script(\r\n\t\t\t\t'wdev-plugin-ui',\r\n\t\t\t\tself::$module_url . 'wdev-ui.js',\r\n\t\t\t\tarray( 'jquery' ),\r\n\t\t\t\t$script_version\r\n\t\t\t);\r\n\r\n\t\t\t/**\r\n\t\t\t * Allow other plugins to enqueue css/js after shared-ui to\r\n\t\t\t * overwrite certain definitions.\r\n\t\t\t */\r\n\t\t\tdo_action( 'wpmudev_plugin_ui_enqueued' );\r\n\t\t}", "public function enqueues()\n {\n\n // CSS\n wp_enqueue_style(\n 'wpforms-builder-settings',\n WPFORMS_PLUGIN_URL . 'assets/css/admin-builder-settings.css',\n null,\n WPFORMS_VERSION\n );\n }", "public function onAdminEnqueueScripts()\n {\n $this->enqueue('admin');\n }", "static public function enqueue() {\r\n\t\t\t/*\r\n\t\t\t * Beta-testers will not have cached scripts!\r\n\t\t\t * Just in case we have to update the plugin prior to launch.\r\n\t\t\t */\r\n\t\t\tif ( defined( 'WPMUDEV_BETATEST' ) && WPMUDEV_BETATEST ) {\r\n\t\t\t\t$script_version = time();\r\n\t\t\t} else {\r\n\t\t\t\t$script_version = self::VERSION;\r\n\t\t\t}\r\n\r\n\t\t\twp_enqueue_style(\r\n\t\t\t\t'wdev-plugin-google_fonts',\r\n\t\t\t\t'https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700|Roboto:400,500,300,300italic',\r\n\t\t\t\tfalse,\r\n\t\t\t\t$script_version\r\n\t\t\t);\r\n\r\n\t\t\twp_enqueue_style(\r\n\t\t\t\t'wdev-plugin-notice',\r\n\t\t\t\tself::$module_url . 'notice.css',\r\n\t\t\t\tarray( 'wdev-plugin-google_fonts' ),\r\n\t\t\t\t$script_version\r\n\t\t\t);\r\n\t\t}", "private function enqueue () {\n\n\t\t$this->add_action ('admin_enqueue_scripts', $this, 'enqueue_files' );\n\t}", "public function enqueue_control_scripts()\n {\n }", "static function enqueue_scripts(){\n\t\tself::include_css();\n\t\tself::include_js();\n\t}", "function mp_enqueue_scripts(){\n\n // Action pour shunter mp_register_style\n do_action('enqueue_scripts');\n\n // On charge les registers\n $enqueue_registers = mp_cache_data('mp_register_script');\n\n if( !empty($enqueue_registers) ){\n\n // On charge les registers\n foreach ($enqueue_registers as $handle => $args)\n mp_enqueue_script($handle);\n }\n\n}", "public function enqueueScripts() {\n wp_register_style('rrze-faq-style', plugins_url('assets/css/rrze-faq.css', plugin_basename($this->pluginFile)));\n wp_enqueue_style('rrze-faq-style');\n }", "public function enqueue_scripts() {\n\n if ( ! isset( $this->plugin_screen_hook_suffix ) ) {\n return;\n }\n\n $screen = get_current_screen();\n\n if ( $screen->id == $this->plugin_screen_hook_suffix ) {\n\n wp_enqueue_script( 'thickbox' );\n wp_enqueue_style( 'thickbox' );\n wp_enqueue_script( 'media-upload' );\n wp_enqueue_script( 'jquery-ui-datepicker' );\n wp_enqueue_script( 'chartjs', plugin_dir_url( __FILE__ ) . 'js/vendor/Chart.min.js', array(), $this->version );\n wp_enqueue_script( 'wpp-chart', plugin_dir_url( __FILE__ ) . 'js/chart.js', array('chartjs'), $this->version );\n wp_register_script( 'wordpress-popular-posts-admin-script', plugin_dir_url( __FILE__ ) . 'js/admin.js', array('jquery'), $this->version, true );\n wp_localize_script( 'wordpress-popular-posts-admin-script', 'wpp_admin_params', array(\n 'nonce' => wp_create_nonce( \"wpp_admin_nonce\" )\n ));\n wp_enqueue_script( 'wordpress-popular-posts-admin-script' );\n\n }\n\n }", "public function enqueueScripts()\n {\n wp_enqueue_style('gfbitpay-admin', $this->plugin->urlBase . 'style-admin.css', false, GFBITPAY_PLUGIN_VERSION);\n }", "public static function enqueue_scripts() {\n\t\tif ( ! static::$enqueued && wp_script_is( 'cmb2-scripts', 'enqueued' ) ) {\n\t\t\twp_enqueue_script( 'wplibs-form' );\n\t\t\tstatic::$enqueued = true;\n\t\t}\n\t}", "public function dequeue_script() {\r\n\t wp_dequeue_script( 'jquery-ui-sortable' );\r\n\t wp_dequeue_script( 'scporderjs' );\r\n\t wp_dequeue_script( 'plt-quick-add' );\r\n\t}", "public function enqueue_scripts() {\n\t\t$this->styles();\n\t\t$this->scripts();\n\t}", "function alpha_scripts() {\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\n\t\t// Register scripts\n\t\twp_register_script( 'bootstrap-js', 'http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js', array( 'jquery' ), false, true );\n\t\twp_register_script( 'alpha-custom', SCRIPTS . '/scripts.js', array( 'jquery' ), false, true );\n\n\t\t// Load the custom scripts\n\t\twp_enqueue_script( 'bootstrap-js' );\n\t\twp_enqueue_script( 'alpha-custom' );\n\n\t\t// Load the stylesheets\n\t\twp_enqueue_style( 'font-awesome', THEMEROOT . '/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'alpha-master', THEMEROOT . '/css/master.css' );\n\t}", "function add_scripts_to_front() {\n $media = get_option('smfn_option_3') ? get_option('smfn_option_3') : \"1023\";\n wp_register_style('smfn-dynamic-css', plugin_dir_url(SMFN_FILE).'assets/css/dynamic.css.php?media=' . $media);\n wp_enqueue_style( 'smfn-dynamic-css');\n wp_enqueue_script('smfn-actions', plugin_dir_url(SMFN_FILE) . 'assets/js/smfnfunctions.js', array(), '1.0.0', true);\n }", "public function enqueue_admin_stylescripts() {\n\n\t\t$screen = get_current_screen();\n\n\t\tif ( ! isset( $this->plugin_screen_hook_suffix ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( in_array( $screen->id, $this->plugin_screen_hook_suffix, true ) ) {\n\t\t\t$slug = array_search( $screen->id, $this->plugin_screen_hook_suffix );\n\t\t\t// $configfiles = glob( $this->get_path( __FILE__ ) .'configs/'.$slug.'-*.php' );\n\t\t\tif ( file_exists( $this->get_path( __FILE__ ) . 'configs/fieldgroups-' . $slug . '.php' ) ) {\n\t\t\t\tinclude $this->get_path( __FILE__ ) . 'configs/fieldgroups-' . $slug . '.php';\n\t\t\t}\n\n\t\t\tif ( ! empty( $configfiles ) ) {\n\n\t\t\t\tforeach ( $configfiles as $key => $fieldfile ) {\n\t\t\t\t\tinclude $fieldfile;\n\t\t\t\t\tif ( ! empty( $group['scripts'] ) ) {\n\t\t\t\t\t\tforeach ( $group['scripts'] as $script ) {\n\t\t\t\t\t\t\twp_enqueue_script( $this->plugin_slug . '-' . strtok( $script, '.' ), $this->get_url( 'assets/js/' . $script, __FILE__ ), array( 'jquery' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! empty( $group['styles'] ) ) {\n\t\t\t\t\t\tforeach ( $group['styles'] as $style ) {\n\t\t\t\t\t\t\twp_enqueue_style( $this->plugin_slug . '-' . strtok( $style, '.' ), $this->get_url( 'assets/css/' . $style, __FILE__ ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\twp_enqueue_style( $this->plugin_slug . '-admin-styles', $this->get_url( 'assets/css/panel.css', __FILE__ ), array(), self::VERSION );\n\t\t\twp_enqueue_style( 'pods-codemirror' );\n\t\t\twp_enqueue_script( $this->plugin_slug . '-admin-scripts', $this->get_url( 'assets/js/panel.js', __FILE__ ), array(), self::VERSION );\n\t\t\twp_enqueue_script( 'pods_codemirror' );\n\t\t\twp_enqueue_script( 'pods-codemirror-overlay' );\n\t\t\twp_enqueue_script( 'pods-codemirror-hints' );\n\t\t\twp_enqueue_script( $this->plugin_slug . '-cm-editor', $this->get_url( 'assets/js/editor1.js', __FILE__ ), array( 'jquery' ), self::VERSION, true );\n\t\t\twp_enqueue_script( 'pods-codemirror-mode-xml' );\n\t\t\twp_enqueue_script( 'pods-codemirror-mode-html' );\n\t\t\twp_enqueue_script( 'pods-codemirror-mode-css' );\n\t\t}//end if\n\n\t}", "public function register_styles_scripts(){\n\t\t\tglobal $eventon_rs;\n\t\t\t\n\t\t\tif(is_admin()) return false;\n\t\t\t\n\t\t\t$evOpt = evo_get_options('1');\n\t\t\tif( evo_settings_val('evcal_concat_styles',$this->evoopt1, true))\n\t\t\t\twp_register_style( 'evo_RS_styles',$eventon_rs->assets_path.'RS_styles.css', '', $eventon_rs->version);\n\t\t\t\n\t\t\twp_register_script('evo_RS_script',$eventon_rs->assets_path.'RS_script.js', \n\t\t\t\tarray('jquery','jquery-ui-core'), \n\t\t\t\t$eventon_rs->version, true );\n\n\t\t\twp_localize_script( \n\t\t\t\t'evo_RS_script', \n\t\t\t\t'evors_ajax_script', \n\t\t\t\tarray( \n\t\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' ) , \n\t\t\t\t\t'postnonce' => wp_create_nonce( 'evors_nonce' )\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function enqueue_styles_scripts() {\n\t\tif ( nyscaa_is_nyscaa_group() ) {\n\t\t\t// Styles\n\t\t\twp_enqueue_style( $this->plugin_slug . '-plugin-styles', plugins_url( 'css/public.css', __FILE__ ), array(), $this->version );\n\n\t\t\t// IE specific\n\t\t\t// global $wp_styles;\n\t\t\t// wp_enqueue_style( $this->plugin_slug . '-ie-plugin-styles', plugins_url( 'css/public-ie.css', __FILE__ ), array(), $this->version );\n\t\t\t// $wp_styles->add_data( $this->plugin_slug . '-ie-plugin-styles', 'conditional', 'lte IE 9' );\n\n\t\t\t// Scripts\n\t\t\twp_enqueue_script( $this->plugin_slug . '-plugin-script', plugins_url( 'js/public.min.js', __FILE__ ), array( 'jquery' ), $this->version );\n\t\t}\n\t}", "function enqueue(){\n\t\t}", "public function enqueue_scripts()\n {\n if (is_singular($this->token)) {\n wp_register_style($this->token, esc_url($this->assets_url . 'css/chiroquiz.css'), [], CHIRO_QUIZ_PLUGIN_VERSION);\n wp_register_style('animate', esc_url($this->assets_url . 'css/animate.css'), [], CHIRO_QUIZ_PLUGIN_VERSION);\n wp_register_style('roboto', 'https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,900,900italic,300italic,300');\n wp_register_style('robo-slab', 'https://fonts.googleapis.com/css?family=Roboto+Slab:400,700,300,100');\n wp_enqueue_style($this->token);\n wp_enqueue_style('animate');\n wp_enqueue_style('roboto');\n wp_enqueue_style('roboto-slab');\n\n wp_register_script('icheck', esc_url($this->assets_url . 'js/icheck.js'), ['jquery']);\n wp_register_script($this->token . '-js', esc_url($this->assets_url . 'js/scripts.js'), [\n 'jquery',\n 'icheck'\n ]);\n wp_enqueue_script('icheck');\n wp_enqueue_script($this->token . '-js');\n wp_register_script('platform-email-validator', esc_url($this->assets_url . 'js/platform-email-validator.js'), [\n 'jquery'\n ], CHIRO_QUIZ_PLUGIN_VERSION);\n wp_enqueue_script('platform-email-validator');\n\n $localize = [\n 'ajaxurl' => admin_url('admin-ajax.php'),\n ];\n wp_localize_script($this->token . '-js', 'ChiroQuiz', $localize);\n }\n }", "public function enqueue_scripts() {\n\t\twp_add_inline_style( 'at-main', $this->inline_css() );\n\t}", "public function enqueue_scripts() {\r\n\r\n\t\t}", "function asc_enqueue_scripts() {\n\t/**\n\t * Fires when scripts and styles are enqueued.\n\t *\n\t * @since 2.8.0\n\t */\n\tdo_action( 'asc_enqueue_scripts' );\n}", "final public function admin_enqueue_scripts()\n\t{\n\t\t// Initialisation des scripts\n\t\twp_enqueue_style( 'tiFyPluginEmailingCampaignEditForm', self::tFyAppUrl() .'/EditForm.css', array( ), '150403' );\n\n\t\tswitch( $this->CurrentStep ) :\n\t\t\tcase 1 :\n\t\t\t\ttify_control_enqueue( 'text_remaining' );\n\t\t\t\tbreak;\n\t\t\tcase 2 :\n\t\t\t\twp_enqueue_script( 'tiFyPluginEmailingCampaignEditForm-step2', self::tFyAppUrl() .'/EditForm-step2.js', array( 'jquery' ), '150928', true );\n\t\t\t\t// Actions et Filtres Wordpress\n\t\t\t\tadd_filter( 'tiny_mce_before_init', array( $this, 'tiny_mce_before_init' ), 99, 2 );\n\t\t\t\tadd_filter( 'mce_css', array( $this, 'mce_css' ) );\n\t\t\t\tbreak;\n\t\t\tcase 3 :\n\t\t\t\twp_enqueue_style( 'tiFyPluginEmailingCampaignEditForm-step3', self::tFyAppUrl() .'/EditForm-step3.css', array( 'tify_control-suggest' ), '150918' );\n\t\t\t\twp_enqueue_script( 'tiFyPluginEmailingCampaignEditForm-step3', self::tFyAppUrl() . '/EditForm-step3.js', array( 'jquery', 'tify_control-suggest' ), '150918', true );\n\t\t\t\tbreak;\n\t\t\tcase 4 :\t\t\t\t\t\t\n\t\t\t\ttify_control_enqueue( 'switch' );\n\t\t\tbreak;\n\t\t\tcase 5 :\n\t\t\t\twp_enqueue_style( 'tiFyPluginEmailingCampaignEditForm-step5', self::tFyAppUrl() . '/EditForm-step5.css', array( 'tify_control-touch_time', 'tify_control-progress' ), '150918' );\n\t\t\t\twp_enqueue_script( 'tiFyPluginEmailingCampaignEditForm-step5', self::tFyAppUrl() . '/EditForm-step5.js', array( 'jquery', 'tify_control-touch_time', 'tify_control-progress' ), '150918', true );\n\t\t\t\twp_localize_script( 'tiFyPluginEmailingCampaignEditForm-step5', 'tyem_campaign', array( \n\t\t\t\t\t\t'handle_prepare'\t=> __( 'Récupération des élments à traiter', 'tify' ),\n\t\t\t\t\t\t'handle_sub'\t\t=> __( 'Traitement des emails abonnés', 'tify' ),\n\t\t\t\t\t\t'handle_list'\t\t=> __( 'Traitement des emails liste de diffusion', 'tify' )\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tbreak;\n\t\tendswitch;\n\t}", "function enqueue_scripts() {\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 21 );\n\t\tadd_action( 'admin_init', array( $this, 'add_pagination' ) );\n\t\tadd_action( \"bc_plugin_browser_content_{$this->page_slug}\", array( $this, 'display_plugins_browser' ), 10, 2 );\n\t}", "public function admin_enqueue()\n\t{\n\t\t// styles.\n\n\t}", "public function enqueue()\n {\n foreach ($this->assets as $name => $asset) {\n if (preg_match('/\\.js$/', $asset)) {\n wp_enqueue_script($name, $this->assetsUrl . $asset, [], false, true);\n }\n if (preg_match('/\\.css$/', $asset)) {\n wp_enqueue_style($name, $this->assetsUrl . $asset);\n }\n }\n }", "public function scripts() {\n\t\tif ( get_post_type() == 'agenda' && ! is_single() ) {\n\t\t\twp_enqueue_script( 'jquery' );\n\t\t\twp_enqueue_script( 'events-calendar', plugins_url( 'assets/js/calendar.js', plugin_dir_path( __FILE__ ) ), array( 'jquery' ), '', true );\n\t\t\twp_enqueue_style( 'events-calendar-styles', plugins_url( 'assets/css/calendar.css', plugin_dir_path( __FILE__ ) ), array(), '' );\n\t\t}\n\n\t\twp_enqueue_style( 'timeline-styles', plugins_url( 'assets/css/timeline.css', plugin_dir_path( __FILE__ ) ), array(), '' );\n\t}", "function manofbytes_enque() {\n\t// Fonts and styles.\n\twp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Montserrat:700|Source+Sans+Pro:400,400i,700', array(), null );\n\twp_enqueue_style( 'manofbytes-style', get_stylesheet_uri() );\n\n\t// Replace jQuery from WP with CDN.\n\twp_deregister_script( 'jquery' ); // Triggers warning with WP-DEBUG on.\n\twp_enqueue_script( 'jquery', '//code.jquery.com/jquery-3.1.1.min.js', array(), false, true );\n\n\t// Bootstrap JS.\n\twp_enqueue_script( 'manofbytes-bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array(), '', true );\n\n\t// ScrollMagic.\n\tif ( is_singular( 'post' ) ) {\n\t\twp_enqueue_script( 'scrollMagic', '//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/ScrollMagic.min.js', array(), '', true );\n\n\t\t// Debug Scroll Magic.\n\t\t// wp_enqueue_script( 'scrollMagicDebug', '//cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.5/plugins/debug.addIndicators.min.js', array(), '', true );\n\t}\n\n\t// Manofbytes JS.\n\twp_enqueue_script( 'manofbytes-js', get_template_directory_uri() . '/js/manofbytes.js', array(), '', true );\n\n\t// Macke ajax url avail. to our js.\n\twp_localize_script( 'manofbytes-js', 'mob_subscribe', array( 'ajax' => admin_url( 'admin-ajax.php' ) ) );\n}", "function preRenderCallback() {\n $scripts = array('aurigma.uploader', 'aurigma.uploader.amazons3');\n foreach ($scripts as $script) {\n $this->_parent->addScriptFileName($script, $this->_parent->getDebugScriptLevel() > 0 ?\n $script . '.js' : $script . '.min.js');\n }\n\n $clientPreRender = $this->_parent->getClientEvents()->getPreRender();\n if (!isset($clientPreRender)) {\n $clientPreRender = array();\n }\n $clientPreRender[] = $this->buildScript();\n $this->_parent->getClientEvents()->setPreRender($clientPreRender);\n }", "public function enqueue_feedback_dialog_scripts() {\r\n\t\t\r\n\t\tif ( ! in_array( get_current_screen()->id, [ 'plugins', 'plugins-network' ], true ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tadd_action( 'admin_footer', [ $this, 'print_deactivate_feedback_dialog' ] );\r\n\t\t\r\n\t\twp_enqueue_style( 'feedback-css', HelperProviderCoreUC_EL::$urlCore. 'assets/feedback.css' );\r\n\t\twp_enqueue_script( 'feedback-admin', HelperProviderCoreUC_EL::$urlCore . 'assets/feedback.js', array('jquery') );\r\n\t\t\r\n\t}", "public function enqueue_front_end_scripts() {}", "public function enqueue_scripts()\n {\n }", "public function enqueue_scripts()\n {\n }", "public function enqueue_scripts()\n {\n }", "public function admin_enqueue_scripts() {\n\t\tif ( 'post' === get_current_screen()->base && 'page' === get_current_screen()->post_type ) {\n\t\t\twp_enqueue_script( 'wsublock-admin', plugins_url( '/js/wsublock-admin.js', __FILE__ ), array( 'jquery' ), $this->script_version, true );\n\t\t\twp_enqueue_style( 'wsublock-admin', plugins_url( '/css/wsublock-admin.css', __FILE__ ), array(), $this->script_version );\n\t\t}\n\t}", "public static function enqueues() {\n\t\twp_enqueue_script( 'wc-country-select' ) ;\n\t\twp_enqueue_script( 'wc-address-i18n' ) ;\n\t}", "public function enqueue_edit_scripts() {\n\t}", "public function enqueue_scripts() {\n wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/coinqvest.modal.min.js', array('jquery'), $this->version, false);\n\n\t\t$params = array ('ajaxurl' => admin_url('admin-ajax.php' ) );\n\t\twp_enqueue_script('coinqvest_ajax_handle', plugin_dir_url( __FILE__ ) . 'js/coinqvest-frontend-ajax-handler.js', array('jquery'), $this->version, false);\n\t\twp_localize_script('coinqvest_ajax_handle', 'params', $params);\n\t}", "function jakes_message_enqueue_scripts() {\r\n\r\n global $pagenow, $typenow;\r\n \r\n if ( $typenow == 'message') {\r\n\r\n wp_enqueue_style('message-cpt-style', get_template_directory_uri().'/css/message-cpt-style.css', false, '1.0.0', 'all');\r\n wp_enqueue_script('customjs-jakob', get_template_directory_uri().'/js/message-cpt-script.js', array(), '1.0.0', true);\r\n\r\n }\r\n}", "function emc_scripts() {\r\n\tglobal $post;\r\n\r\n\twp_enqueue_style( 'emc-style', get_stylesheet_uri() );\r\n\r\n\twp_enqueue_script( 'emc-scripts', get_template_directory_uri() . '/js/emc.js', array( 'jquery' ) );\r\n\twp_enqueue_script( 'modal-script', get_template_directory_uri() . '/js/jsmodal.min.js', array() );\r\n\r\n\t//wp_enqueue_style( 'sharing', WP_SHARING_PLUGIN_URL.'sharing.css', false, JETPACK__VERSION );\r\n\twp_enqueue_style( 'fontawsome', get_template_directory_uri() .'/css/font-awesome.min.css');\r\n\t//wp_enqueue_script( 'sharing-js-fe', WP_SHARING_PLUGIN_URL . 'sharing.js', array( ), 3 );\r\n\r\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\r\n\t\twp_enqueue_script( 'comment-reply' );\r\n\t}\r\n\r\n}", "public function enqueue_scripts() {\n\n\t}", "public static function enqueue_scripts() {\n\t\tglobal $wp_query;\n\n\t\tif ( ! isset( $wp_query->posts ) || ! is_array( $wp_query->posts ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $wp_query->posts as $post ) {\n\t\t\tif ( ! $post instanceof WP_Post ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$found_forms = $found_blocks = array();\n\t\t\tself::parse_forms( $post->post_content, $found_forms, $found_blocks );\n\n\t\t\tif ( ! empty( $found_forms ) ) {\n\t\t\t\tforeach ( $found_forms as $form_id => $ajax ) {\n\t\t\t\t\t$form = GFAPI::get_form( $form_id );\n\n\t\t\t\t\tif ( $form && $form['is_active'] && ! $form['is_trash'] ) {\n\t\t\t\t\t\tself::enqueue_form_scripts( $form, $ajax );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Allows custom actions to be performed when scripts/styles are enqueued.\n\t\t\t\t *\n\t\t\t\t * @since 2.4.18\n\t\t\t\t *\n\t\t\t\t * @param array $found_forms An array of found forms using the form ID as the key to the ajax status.\n\t\t\t\t * @param array $found_blocks An array of found GF blocks.\n\t\t\t\t * @param WP_Post $post The post which was processed.\n\t\t\t\t */\n\t\t\t\tdo_action( 'gform_post_enqueue_scripts', $found_forms, $found_blocks, $post );\n\t\t\t}\n\t\t}\n\t}", "function tac_script_enqueuer() {\n\tif ( ! is_admin() ) {\n\t\t// Site.\n\t\twp_register_script( 'tac_main', get_stylesheet_directory_uri() . '/js/main.js', array( 'jquery' ), null, true );\n\t\twp_enqueue_script( 'tac_main' );\n\t};\n}", "function queue_options_page_scripts(){ \r\n wp_enqueue_script('common');\r\n wp_enqueue_script('wp-lists');\r\n wp_enqueue_script('postbox');\r\n //wp_enqueue_script('twitlink_script');\r\n //wp_enqueue_script('twitlink_fancybox');\r\n wp_enqueue_script('thickbox',null,array('jquery'));\r\n echo \"<link rel='stylesheet' href='/\".WPINC.\"/js/thickbox/thickbox.css?ver=\".$this->version.\"' type='text/css' media='all' />\\n\";\r\n //wp_enqueue_script('twitlink_fancybox-media');\r\n //wp_enqueue_style('twitlink_fancybox_style');\r\n // removeable metaboxes \r\n //debugbreak();\r\n add_meta_box('twitlink_removable','Ads','twitlink_removeable_metabox',$this->hook,'normal');\r\n\r\n // localize for settings page messages\r\n $global_settings = array(\r\n 'reset_message'=>__('Are you sure you want to reset the settings back to the default values?',$this->plugin_domain)\r\n );\r\n wp_localize_script ( 'twitlink_script', 'ab_global',$global_settings);\r\n\r\n }", "public function enqueue_scripts() {\n\n\t\t// Setup scripts array\n\t\t$scripts = array();\n\n\t\t// Always pull in jQuery for TinyMCE shortcode usage\n\t\tif ( bbp_use_wp_editor() ) {\n\t\t\t$scripts['bbpress-editor'] = array(\n\t\t\t\t'file' => 'js/editor.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\t\t}\n\n\t\t// Forum-specific scripts\n\t\tif ( bbp_is_single_forum() ) {\n\t\t\t$scripts['bbpress-forum'] = array(\n\t\t\t\t'file' => 'js/forum.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\t\t}\n\n\t\t// Topic-specific scripts\n\t\tif ( bbp_is_single_topic() ) {\n\n\t\t\t// Topic favorite/unsubscribe\n\t\t\t$scripts['bbpress-topic'] = array(\n\t\t\t\t'file' => 'js/topic.js',\n\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t);\n\n\t\t\t// Hierarchical replies\n\t\t\tif ( bbp_thread_replies() ) {\n\t\t\t\t$scripts['bbpress-reply'] = array(\n\t\t\t\t\t'file' => 'js/reply.js',\n\t\t\t\t\t'dependencies' => array( 'jquery' )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// User Profile edit\n\t\tif ( bbp_is_single_user_edit() ) {\n\t\t\t$scripts['bbpress-user'] = array(\n\t\t\t\t'file' => 'js/user.js',\n\t\t\t\t'dependencies' => array( 'user-query' )\n\t\t\t);\n\t\t}\n\n\t\t// Filter the scripts\n\t\t$scripts = apply_filters( 'BBP_IOA_scripts', $scripts );\n\n\t\t// Enqueue the scripts\n\t\tforeach ( $scripts as $handle => $attributes ) {\n\t\t\tbbp_enqueue_script( $handle, $attributes['file'], $attributes['dependencies'], $this->version, 'screen' );\n\t\t}\n\t}", "function enqueue_scripts() {\n\t\tinclude $this->dir_path . 'scripts.php';\n\t}", "function admin_enqueue_script(){\n\t\tglobal $postmec;\n\t\t\n\t\tif($_GET['page'] == 'stores-management'){\n\t\t\twp_enqueue_script('jquery');\n\t\t\twp_enqueue_style( 'thickbox' ); // Stylesheet used by Thickbox\n\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\twp_enqueue_script( 'media-upload' );\n\t\t\twp_register_script('store-media-upload', $postmec->get_postmec_url() . 'js/plugin.media-uploader.js', array('jquery', 'thickbox', 'media-upload'));\n\t\t\twp_enqueue_script('store-media-upload');\n\t\t\n\t\t\t//wp_register_script('media-uploader-activator', $commentbar->get_this_url() . 'js/uploader.activator.js', array('jquery'));\n\t\t\t//wp_enqueue_script('media-uploader-activator');\n\t\t}\n\t}", "public function enqueue()\n {\n\n \n $css_uri = YATRI_THEME_URI . 'mantrabrain-theme/customizer/controls/modal/';\n\n $js_uri = YATRI_THEME_URI . 'mantrabrain-theme/customizer/controls/modal/';\n\n wp_enqueue_script('yatri-modal-control-js', $js_uri . 'modal.js', array('yatri-color-alpha'), YATRI_THEME_VERSION, true);\n\n wp_enqueue_style('yatri-modal-control-css', $js_uri . 'modal.css', array(), YATRI_THEME_VERSION);\n\n if ($this->has_typography_fields()) {\n\n $all_fonts['google'] = Mantrabrain_Theme_Helper::get_google_fonts();\n $all_fonts['normal'] = Mantrabrain_Theme_Helper::get_normal_fonts();\n $all_fonts['varients'] = Mantrabrain_Theme_Helper::all_font_varients();\n\n wp_localize_script('yatri-modal-control-js', 'yatriAllFonts', $all_fonts);\n }\n\n\n }", "public function editor_scripts() {\n\t\tadd_filter( 'script_loader_tag', [ $this, 'editor_scripts_as_a_module' ], 10, 2 );\n\n\t\twp_enqueue_style( 'elementor-editor-style', plugins_url( '/assets/editor.css', __FILE__ ) ); // Editor Style\n\t\t\n\t}", "public static function enqueue_admin_script(){\n\t global $pagenow;\n\t if( !empty($_REQUEST['page']) && ($_REQUEST['page'] == 'events-manager-forms-editor' || ($_REQUEST['page'] == 'events-manager-bookings' && !empty($_REQUEST['action']) && $_REQUEST['action'] == 'manual_booking')) ){\n\t\t\twp_enqueue_script('events-manager-pro', plugins_url('includes/js/events-manager-pro.js',__FILE__), array('jquery', 'jquery-ui-core','jquery-ui-widget','jquery-ui-position')); //jQuery will load as dependency\n\t\t\tdo_action('em_enqueue_admin_scripts');\n\t }\n\t if( $pagenow == 'user-edit.php' ){\n\t //need to include the em script for dates\n\t EM_Scripts_and_Styles::admin_enqueue();\n\t }\n\t}", "public function enqueue() {\r\n\t\twp_enqueue_style( 'wfct-ei', WFC_EI_CSS_URL . 'environment-indicator.css', array(), WFC_EI_VERSION );\r\n\t}", "public function enqueue_scripts() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Fastnetmarketing_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Fastnetmarketing_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/fastnetmarketing-admin-admin.js', array( 'jquery' ), $this->version, false );\n\n\t}", "function salong_admin_print_styles_send(){\n\twp_enqueue_script( 'salong_js', get_template_directory_uri() . '/includes/messages/js/script.js', array( 'jquery-ui-autocomplete' ) );\n\tdo_action( 'salong_print_styles', 'send' );\n}", "function nameless_sheep_scripts() {\n\t\t// Get the theme data.\n\t\t$the_theme = wp_get_theme();\n\t\t$theme_version = $the_theme->get( 'Version' );\n\n\t\t$css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' );\n\t\twp_enqueue_style( 'nameless_sheep-styles', get_template_directory_uri() . '/css/theme.min.css', array(), $css_version );\n\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function scripts(){\n\n\t\t// this handy function checks a post or page to see if your component exists beore enqueueing assets\n\t\tif ( function_exists('aesop_component_exists') && aesop_component_exists('reveal') ) {\n\n\t\t\twp_enqueue_style('reveal-style', \t\tAESOP_REVEAL_URL.'/css/twentytwenty.css', AESOP_REVEAL_VERSION );\n\t\t\twp_enqueue_script('reveal-script', \t\tAESOP_REVEAL_URL.'/js/jquery.event.move.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\t\t\twp_enqueue_script('reveal-script-more', AESOP_REVEAL_URL.'/js/jquery.twentytwenty.js', array('jquery'), AESOP_REVEAL_VERSION, true);\n\n\t\t}\n\n\t}", "public function enqueue_scripts() {\n\t\twp_enqueue_script(\n\t\t\t'woocommerce_ebanx_one_click_script',\n\t\t\tplugins_url( 'assets/js/one-click.js', WC_EBANX::DIR ),\n\t\t\tarray(),\n\t\t\tWC_EBANX::VERSION,\n\t\t\ttrue\n\t\t);\n\n\t\twp_enqueue_style(\n\t\t\t'woocommerce_ebanx_one_click_style',\n\t\t\tplugins_url( 'assets/css/one-click.css', WC_EBANX::DIR )\n\t\t);\n\t}", "public function enqueue_scripts() {\n\t\twp_enqueue_script( \n\t\t\t$this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/deeppress-admin.js',\n\t\t\tarray( 'jquery' ), \n\t\t\t$this->version, true \n\t\t);\n\t\twp_enqueue_script( \n\t\t\t$this->plugin_name.'-imageview', plugin_dir_url( __FILE__ ) . 'js/jquery.imageview.js', \n\t\t\tarray( 'jquery' ), \n\t\t\t$this->version, false \n\t\t);\n\t\twp_enqueue_script( \n\t\t\t$this->plugin_name.'-annotorious', plugin_dir_url( __FILE__ ) . 'js/jquery.selectareas.js',\n\t\t\tarray( 'jquery' ), \n\t\t\t$this->version, false \n\t\t);\n\t\twp_enqueue_script(\n\t\t\t$this->plugin_name.'-input', plugin_dir_url( __FILE__ ) . 'js/input.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t$this->version, false\n\t\t);\n\t\twp_enqueue_script(\n\t\t\t$this->plugin_name.'-lightgallery', plugin_dir_url( __FILE__ ) . 'js/lightgallery.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t$this->version, false\n\t\t);\n\t\t/*wp_enqueue_script(\n\t\t\t$this->plugin_name.'-dropzone', plugin_dir_url( __FILE__ ) . 'js/dropzone.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t$this->version, false\n\t\t);*/\n\t\t// Localize the script with new data\n\t\t$config_array = array(\n\t\t\t'remote_url' => get_option('deeppress_remote_url'),\n\t\t\t'remote_username' => get_option('deeppress_remote_username'),\n\t\t\t'remote_password' => get_option('deeppress_remote_password')\n\t\t);\n\t\twp_localize_script( $this->plugin_name, 'deeppress', $config_array );\n\t}", "function aitEnqueueScriptsAndStyles(){\r\n\tif(!is_admin()){\r\n\t\t// just shortcuts\r\n\t\t$s = THEME_CSS_URL;\r\n\t\t$j = THEME_JS_URL;\r\n\r\n\t\taitAddStyles(array(\r\n\t\t\t'ait-colorbox' => array('file' => \"$s/libs/colorbox.css\"),\r\n\t\t\t'ait-fancybox' => array('file' => \"$s/libs/fancybox.css\"),\r\n\t\t\t'jquery-ui' \t => array('file' => \"$s/libs/jquery-ui.css\"),\r\n\t\t\t'prettysociable' => array('file' => \"$s/libs/prettySociable.css\"),\r\n\t\t\t'hoverzoom' \t => array('file' => \"$s/libs/hoverZoom.css\"),\r\n\t\t));\r\n\r\n\t\taitAddScripts(array(\r\n\t\t\t'jquery-ui-tabs' \t\t\t=> true,\r\n\t\t\t'jquery-ui-accordion' \t\t\t=> true,\r\n\t\t\t'jquery-infieldlabel' \t\t\t=> array('file' => \"$j/libs/jquery-infieldlabel.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-iconmenu' \t\t\t\t=> array('file' => \"$j/libs/jquery-iconmenu.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-plugins'\t \t\t\t=> array('file' => \"$j/libs/jquery-plugins.js\", 'deps' => array('jquery')),\r\n\t\t\t'modernizr'\t\t\t\t\t\t=> array('file' => \"$j/libs/modernizr-2.6.1-custom.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\r\n\t\t\t'ait-gridgallery' \t\t\t=> array('file' => \"$j/gridgallery.js\", 'deps' => array('jquery', 'jquery-plugins'), 'inFooter' => true),\r\n\t\t\t'ait-testimonials' \t\t\t=> array('file' => \"$j/testimonials.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'ait-script' \t\t\t=> array('file' => \"$j/script.js\", 'deps' => array('jquery', 'jquery-infieldlabel', 'jquery-iconmenu', 'jquery-plugins', 'modernizr'), 'inFooter' => true),\r\n\t\t));\r\n\t}\r\n}", "public function public_enqueue_scripts() {\n\n\t\twp_register_script('custom-event-polyfill', get_template_directory_uri() . '/js/polyfill/custom-event.min.js', array(), $this->version, true);\n\t\twp_register_script('promise-polyfill', get_template_directory_uri() . '/js/polyfill/promise.min.js', array(), $this->version, true);\n\t\t// wp_register_script('scroll-polyfill', get_template_directory_uri() . '/js/polyfill/smoothscroll.min.js', array(), $this->version, true);\n\n\t\twp_register_script('tinyAnimate', get_template_directory_uri() . '/js/utils/TinyAnimate.js', array(), $this->version, true);\n\t\twp_register_script('swipe', get_template_directory_uri() . '/js/utils/swipe.js', array(), $this->version, true);\n\t\twp_register_script('collection', get_template_directory_uri() . '/js/utils/collection.js', array(), $this->version, true);\n\t\twp_register_script('media-player', get_template_directory_uri() . '/js/utils/media-player.js', array('tinyAnimate', 'collection'), $this->version, true);\n\t\twp_register_script('media-player-v2', get_template_directory_uri() . '/js/utils/media-player-v2.js', array('tinyAnimate', 'collection'), $this->version, true);\n\t\twp_register_script('build', get_template_directory_uri() . '/js/utils/build.js', array(), $this->version, true);\n\t\twp_register_script('ajax', get_template_directory_uri() . '/js/utils/ajax.js', array(), $this->version, true);\n\t\twp_register_script('marquee', get_template_directory_uri() . '/js/utils/marquee.js', array(), $this->version, true);\n\t\twp_register_script('popup', get_template_directory_uri() . '/js/utils/popup.js', array('tinyAnimate'), $this->version, true);\n\t\twp_register_script('calendar', get_template_directory_uri() . '/js/utils/calendar.js', array(), $this->version, true);\n\t\twp_register_script('translation', get_template_directory_uri() . '/js/utils/translation.js', array(), $this->version, true);\n\t\twp_register_script('grid-system', get_template_directory_uri() . '/js/utils/grid-system.js', array('tinyAnimate'), $this->version, true);\n\t\twp_register_script('sticky', get_template_directory_uri() . '/js/utils/sticky.js', array(), $this->version, true);\n\t\twp_register_script('custom-dispatcher', get_template_directory_uri() . '/js/utils/custom-dispatcher.js', array(), $this->version, true);\n// \t\twp_enqueue_script('grid', get_template_directory_uri() . '/js/grid.js', array('grid-system'), $this->version, true);\n// \t\twp_enqueue_script('projects-grid', get_template_directory_uri() . '/js/projects.js', array('grid'), $this->version, true);\n// \t\twp_enqueue_script('project', get_template_directory_uri() . '/js/project.js', array('grid'), $this->version, true);\n// \t\twp_enqueue_script('image', get_template_directory_uri() . '/js/image.js', array('tinyAnimate'), $this->version, true);\n\t\t// wp_register_script('grid-slideshow', get_template_directory_uri() . '/js/grid-slideshow.js', array('media-player', 'swipe', 'build'), $this->version, true);\n\n\t\t// wp_enqueue_script('home', get_template_directory_uri() . '/js/home.js', array('grid-slideshow'), $this->version, true);\n\t\t// wp_enqueue_script('header', get_template_directory_uri() . '/js/header.js', array('popup', 'sticky', 'marquee'), $this->version, true);\n\t\t// wp_enqueue_script('single', get_template_directory_uri() . '/js/single.js', array('grid-slideshow'), $this->version, true);\n\t\t// wp_enqueue_script('bios', get_template_directory_uri() . '/js/bios.js', array('popup'), $this->version, true);\n\t\t// wp_enqueue_script('agenda', get_template_directory_uri() . '/js/agenda.js', array('popup', 'ajax', 'build', 'calendar', 'grid-slideshow'), $this->version, true);\n\t\t// wp_enqueue_script('intro', get_template_directory_uri() . '/js/intro.js', array('media-player'), $this->version, true);\n\n\t\twp_register_script('cookies', get_template_directory_uri() . '/js/utils/cookies.js', array(), $this->version, false);\n\n\t\twp_register_script('gmap', get_template_directory_uri() . '/js/utils/gmap.js', array('gmap-api'), $this->version, true);\n\n\t}", "function indosEnqueue() {\n global $app_base_url;\n\n\tif(! is_admin()){\n\t wp_register_style('indoshipping_css',$app_base_url.'assets/indoshipping.css');\n\t wp_register_script('indoshipping_js',$app_base_url.'assets/indoshipping.js',array('jquery'));\n\t wp_localize_script('indoshipping_js','indoshipping',array('pluginurl'=>$app_base_url,'ajaxurl'=>admin_url('admin-ajax.php')));\n\t wp_enqueue_style('indoshipping_css');\n\t wp_enqueue_script('indoshipping_js');\n\t}\n}", "function wp_dequeue_script($handle)\n {\n }", "public function enqueue_scripts () {\n wp_register_script( $this->_token . '-frontend', esc_url( $this->assets_url ) . 'js/script.js', array( 'jquery' ), $this->_version );\n // Localize the script with new data\n\n $url = admin_url('admin-ajax.php');\n wp_localize_script( $this->_token . '-frontend', 'ajax_url', $url );\n wp_enqueue_script( $this->_token . '-frontend' );\n }", "protected function enqueue_scripts()\n {\n \\wp_enqueue_style('tify_control-progress');\n \\wp_enqueue_script('tify_control-progress');\n }", "function wagw_scripts() {\n\t\t$theme = wp_get_theme();\n\t\t$ver = $theme->get( 'Version' );\n\t$themecsspath = get_stylesheet_directory() . '/style.css';\n\t$style_ver = filemtime( $themecsspath );\n\twp_enqueue_style( 'wagw-style', get_stylesheet_uri(),array(),$style_ver );\n\n\twp_enqueue_script( 'wagw-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'wagw-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\twp_enqueue_script( 'thickbox', true );\n\twp_enqueue_style( 'thickbox' );\n\n\tif ( is_page_template( 'slider-page.php' ) ) {\n\t\twp_enqueue_style( 'flexslider-css', get_stylesheet_directory_uri() . '/flexslider/flexslider.css' );\n\t}\n\n}", "public function enqueue_scripts() {\n wp_enqueue_style( $this->name, plugins_url( '/assets/css/admin.css', IMFILE ), '', $this->version, 'all' );\n \n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( $this->name, plugins_url( '/assets/js/admin.js', IMFILE ), array( 'jquery' ), $this->version, true );\n }", "public function admin_enqueue_scripts() {\n\n\t\t\tglobal $pagenow;\n\t\t\tglobal $post;\n\n\t\t\t$screen = get_current_screen();\n\n\t\t\tif ( ( 'post-new.php' == $pagenow || 'post.php' == $pagenow ) && 'astra_adv_header' == $screen->post_type ) {\n\t\t\t\t$rtl = '';\n\t\t\t\tif ( is_rtl() ) {\n\t\t\t\t\t$rtl = '-rtl';\n\t\t\t\t}\n\t\t\t\t// Styles.\n\t\t\t\twp_enqueue_media();\n\n\t\t\t\t/**\n\t\t\t\t * Localize wp-color-picker & wpColorPickerL10n.\n\t\t\t\t *\n\t\t\t\t * This is only needed in WordPress version >= 5.5 because wpColorPickerL10n has been removed.\n\t\t\t\t *\n\t\t\t\t * @see https://github.com/WordPress/WordPress/commit/7e7b70cd1ae5772229abb769d0823411112c748b\n\t\t\t\t *\n\t\t\t\t * This is should be removed once the issue is fixed from wp-color-picker-alpha repo.\n\t\t\t\t * @see https://github.com/kallookoo/wp-color-picker-alpha/issues/35\n\t\t\t\t *\n\t\t\t\t * @since 2.6.3\n\t\t\t\t */\n\t\t\t\tglobal $wp_version;\n\n\t\t\t\tif ( version_compare( $wp_version, '5.4.99', '>=' ) ) {\n\t\t\t\t\twp_localize_script(\n\t\t\t\t\t\t'wp-color-picker',\n\t\t\t\t\t\t'wpColorPickerL10n',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'clear' => __( 'Clear', 'astra-addon' ),\n\t\t\t\t\t\t\t'clearAriaLabel' => __( 'Clear color', 'astra-addon' ),\n\t\t\t\t\t\t\t'defaultString' => __( 'Default', 'astra-addon' ),\n\t\t\t\t\t\t\t'defaultAriaLabel' => __( 'Select default color', 'astra-addon' ),\n\t\t\t\t\t\t\t'pick' => __( 'Select Color', 'astra-addon' ),\n\t\t\t\t\t\t\t'defaultLabel' => __( 'Color value', 'astra-addon' ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Scripts.\n\t\t\t\tif ( SCRIPT_DEBUG ) {\n\n\t\t\t\t\twp_enqueue_style( 'astra-advanced-headers-admin-edit', ASTRA_ADDON_EXT_ADVANCED_HEADERS_URL . 'assets/css/unminified/astra-advanced-headers-admin-edit' . $rtl . '.css', array( 'wp-color-picker' ), ASTRA_EXT_VER );\n\n\t\t\t\t\twp_enqueue_script( 'astra-advanced-headers-admin', ASTRA_ADDON_EXT_ADVANCED_HEADERS_URL . 'assets/js/unminified/astra-advanced-headers-admin.js', array( 'jquery', 'wp-color-picker', 'astra-color-alpha', 'jquery-ui-tooltip' ), ASTRA_EXT_VER, false );\n\n\t\t\t\t} else {\n\t\t\t\t\twp_enqueue_style( 'astra-advanced-headers-admin-edit', ASTRA_ADDON_EXT_ADVANCED_HEADERS_URL . 'assets/css/minified/astra-advanced-headers-admin-edit' . $rtl . '.min.css', array( 'wp-color-picker' ), ASTRA_EXT_VER );\n\n\t\t\t\t\twp_enqueue_script( 'astra-advanced-headers-admin', ASTRA_ADDON_EXT_ADVANCED_HEADERS_URL . 'assets/js/minified/astra-advanced-headers-admin.min.js', array( 'jquery', 'wp-color-picker', 'astra-color-alpha', 'jquery-ui-tooltip' ), ASTRA_EXT_VER, false );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function enqueue() {\n\t\tgutenberg_widgets_init( 'gutenberg_customizer' );\n\t}", "public function enqueue_back_end_scripts() {\n\n wp_enqueue_script( 'pms-content-dripping-script', PMS_CONTENT_DRIPPING_DIR_URL . 'assets/js/back-end.js', array( 'jquery', 'jquery-ui-core' ), PMS_CONTENT_DRIPPING_VERSION );\n wp_enqueue_style( 'pms-content-dripping-style', PMS_CONTENT_DRIPPING_DIR_URL . 'assets/css/back-end.css', array(), PMS_CONTENT_DRIPPING_VERSION );\n\n }", "function berry_scripts() {\n\n\twp_dequeue_style( 'seed-style');\n\twp_enqueue_style( 'berry-style', get_stylesheet_uri() );\n\twp_enqueue_script( 'berry-main', get_stylesheet_directory_uri() . '/js/main.js', array(), '2016-1', true );\n\n}", "function enqueue()\n\t{\n\t\twp_enqueue_style('kbpluginstyle', $this->plugin_url . 'assets/style.css');\n\t\twp_enqueue_script('kbpluginscript', $this->plugin_url . 'assets/script.js');\n\t}", "function enqueueClientFiles() {\n\t\t\tglobal $wp_styles;\n\n\t\t\tif ( ! is_admin() ) {\n\n\t\t\t\twp_enqueue_style(\n\t\t\t\t\t'titan-style',\n\t\t\t\t\tget_bloginfo( 'stylesheet_url' ),\n\t\t\t\t\t'',\n\t\t\t\t\tnull\n\t\t\t\t);\n\n\t\t\t\twp_enqueue_style(\n\t\t\t\t\t'titan-ie-style',\n\t\t\t\t\tget_template_directory_uri() . '/stylesheets/ie.css',\n\t\t\t\t\tarray( 'titan-style' ),\n\t\t\t\t\tnull\n\t\t\t\t);\n\t\t\t\t$wp_styles->add_data( 'titan-ie-style', 'conditional', 'lt IE 8' );\n\n\t\t\t\tif ( is_singular() ) {\n\t\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function c9music_client_scripts()\n\t{\n\n\t\t$c9_default_font = get_theme_mod('c9_default_font', 'no');\n\n\t\tif ($c9_default_font == 'no') {\n\t\t\twp_enqueue_style('c9music-font-default', 'https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,700;1,400;1,700&display=swap', array('c9-styles'));\n\t\t}\n\n\t\twp_enqueue_style('c9music-client-styles', get_template_directory_uri() . '/client/client-assets/dist/client.min.css', array('c9-styles'));\n\t\twp_enqueue_script('c9music-client-scripts', get_template_directory_uri() . '/client/client-assets/custom-client.js', array('jquery', 'c9-scripts'), false, true);\n\t\twp_add_inline_style('c9music-client-styles', c9_music_custom_css_output());\n\t}", "public function enqueue_scripts() {\n wp_enqueue_script(\n $this->plugin_name,\n plugin_dir_url( __FILE__ ) . 'js/update-monitor-public.js',\n array('jquery'),\n $this->version,\n false\n );\n }", "public function enqueue()\n {\n wp_enqueue_media();\n\n // Styles\n\n // Scripts\n $class_name = get_class( $this );\n wp_enqueue_script( 'elementor-file-uploader', EFU_DIR_URL . \"/inc/controls/$class_name/$class_name.js\", [ 'jquery' ], '1.0' );\n }", "protected function enqueue_scripts()\n {\n wp_enqueue_style('tify_control-text_remaining');\n wp_enqueue_script('tify_control-text_remaining');\n }", "public function enqueue_scripts() {\n\t\twp_enqueue_style( 'pt-style', plugins_url( 'assets/css/style.css', __FILE__ ), array(), '1.0.0', false );\n\n\t\twp_enqueue_script( 'pt-script', plugins_url( 'assets/js/script.js', __FILE__ ), array(), '1.0.0', true );\n\t}", "public function enqueue_scripts() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nimiq_Miner_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nimiq_Miner_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_script( 'nimiq-core', 'http://cdn.nimiq.com/core/nimiq.js');\n\t\twp_enqueue_script( 'nimiq-web', 'http://cdn.nimiq.com/core/web.js');\n\t\twp_enqueue_script( 'nimiq-wasm', 'http://cdn.nimiq.com/core/worker-wasm.js');\n\n\t\twp_register_script( 'nimiq-miner', plugin_dir_url( __FILE__ ) . 'js/nimiq-miner-public.js', array( 'jquery' ), 4, false );\n\n\t\t$localize = array(\n\t\t 'nim_address' => get_option('nim_address'),\n\t\t 'nim_thread_percent' => get_option('nim_thread_percent'),\n\t\t 'nim_disclaimer_bg' => get_option('nim_disclaimer_bg'),\n\t\t 'nim_disclaimer_text_color' => get_option('nim_disclaimer_text_color'),\n\t\t 'nim_disclaimer_text' => get_option('nim_disclaimer_text')\n\t\t);\n\n\t\twp_localize_script( 'nimiq-miner', 'php_vars', $localize );\n\n\t\twp_enqueue_script( 'nimiq-miner' );\n\n\t}", "static function print_scripts(){\n\t\twp_register_style('athlates-board-white-board', ATHLATESWHITEBOARD_URL . 'css/white-board.css');\n\t\twp_enqueue_style('athlates-board-white-board');\n\t\t\n\t\t//js\n\t\twp_enqueue_script('jquery');\n\t\twp_register_script('athlates_white_board_jquery', ATHLATESWHITEBOARD_URL . 'js/Cf-front-end.js', array('jquery'));\n\t\twp_enqueue_script('athlates_white_board_jquery');\n\t\t\n\t\twp_localize_script('athlates_white_board_jquery', 'AthlatesAjax', array( \n\t\t\t\t\t'ajaxurl' => admin_url( 'admin-ajax.php' )\n\t\t));\n\t}", "function cinerama_edge_enqueue_admin_scripts() {\n\t\twp_enqueue_script( 'wp-color-picker' );\n\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\twp_enqueue_script( 'jquery-ui-accordion' );\n\t\twp_enqueue_script( 'common' );\n\t\twp_enqueue_script( 'wp-lists' );\n\t\twp_enqueue_script( 'postbox' );\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'edgtf-dependence', get_template_directory_uri() . '/framework/admin/assets/js/edgtf-ui/edgtf-dependence.js', array(), false, true );\n\t\twp_enqueue_script( 'edgtf-twitter-connect', get_template_directory_uri() . '/framework/admin/assets/js/edgtf-ui/edgtf-twitter-connect.js', array(), false, true );\n\n\t\t/**\n\t\t * @see CineramaEdgeClassSkinAbstract::enqueueScripts - hooked with 10\n\t\t */\n\t\tdo_action( 'cinerama_edge_action_enqueue_admin_scripts' );\n\t}", "function enqueue(){\n wp_enqueue_style( 'pluginstyle', plugins_url( '/assets/beteasy-style.css', __FILE__ ) );\n wp_enqueue_script( 'pluginscript', plugins_url( '/assets/beteasy-js.js', __FILE__ ) );\n\n }", "public function set_script_styling(){\r\n /**\r\n * enqueue css styling here\r\n */\r\n wp_enqueue_style('before-after-comparison-styling', plugin_dir_url( __FILE__ ) . 'css/before-after.css', array(), '1.0');\r\n\r\n /**\r\n * enqueue custom js / javascript library here\r\n */\r\n wp_enqueue_script('before-after-comparison-javascript', plugin_dir_url( __FILE__ ) . 'js/before-after.js', array('jquery'), '1.0' , false);\r\n\r\n \r\n }", "public function frontendScripts() {\r\n global $Tema;\r\n \r\n // Adiciona os scripts\r\n wp_enqueue_script('startr-slider-js', $Tema->URL('modules/slider/assets/idangerous.swiper.min.js'));\r\n \r\n // Adicionamos o CSS também\r\n wp_enqueue_style('startr-slider-css', $Tema->URL('modules/slider/assets/idangerous.swiper.css'));\r\n }", "public function enqueue_scripts() {\n\t\twp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/deeppress-public.js', array( 'jquery' ), $this->version, false );\n\n\t}", "static function enqueue_scripts() {\n\t\tif ( ! static::matches_custom_format( get_post_format() ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//scripts\n\t\twp_register_script( 'custom-event-preview-script', get_stylesheet_directory_uri() . '/assets/js/cpf-event-preview.min.js', array( 'jquery' ), CURRENT_THEME_VERSION, true );\n\t\twp_enqueue_script( 'custom-event-preview-script' );\n\t\twp_localize_script( 'custom-event-preview-script', 'evtPreviewData', self::event_preview_data() );\n\t}", "function theme_scripts_and_styles() {\n if (!is_admin()) {\n global $wp_scripts;\n wp_deregister_script('jquery');\n foreach($wp_scripts->registered as $handle => $script) {\n $wp_scripts->add_data($handle, 'group', 1);\n }\n\n theme_scripts::register();\n theme_styles::register();\n\n // comment reply script for threaded comments\n if ( is_singular() && comments_open() && (get_option('thread_comments') == 1)) {\n wp_enqueue_script('comment-reply');\n }\n\n theme_styles::enqueue();\n theme_scripts::enqueue();\n }\n}" ]
[ "0.7308369", "0.7296776", "0.7290201", "0.72651154", "0.725023", "0.71685654", "0.68457824", "0.6728443", "0.6724165", "0.6702352", "0.6670294", "0.6660659", "0.6616481", "0.66061217", "0.6606054", "0.6598092", "0.6583154", "0.6527727", "0.6513601", "0.64897674", "0.64626294", "0.6457469", "0.6455164", "0.6439098", "0.6412692", "0.640148", "0.64000785", "0.63994914", "0.6376334", "0.63606304", "0.63497955", "0.6284218", "0.6260798", "0.62575155", "0.6253976", "0.6253899", "0.62495273", "0.62335235", "0.6219026", "0.6212809", "0.6212382", "0.6209041", "0.62064993", "0.6203806", "0.61920404", "0.61893374", "0.6188264", "0.618579", "0.6185361", "0.6185225", "0.6183853", "0.6179524", "0.617908", "0.6174729", "0.61745393", "0.6163806", "0.6159703", "0.6157418", "0.6154898", "0.61443216", "0.61412287", "0.613528", "0.6128327", "0.61252385", "0.61246103", "0.6113178", "0.6106804", "0.61023104", "0.60978913", "0.6093914", "0.60873497", "0.60842764", "0.6083875", "0.608209", "0.60734266", "0.6067894", "0.6062489", "0.60602874", "0.605735", "0.6051581", "0.6046317", "0.6045391", "0.6042119", "0.60318017", "0.6031561", "0.6027545", "0.6024907", "0.60207576", "0.6019693", "0.6015765", "0.60050035", "0.599843", "0.5997683", "0.59970707", "0.5995371", "0.59945065", "0.59874755", "0.598677", "0.5982897", "0.5980913", "0.59805137" ]
0.0
-1
Return the sluggable configuration array for this model.
public function sluggable() { return [ 'slug' => [ 'source' => 'title' ] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sluggable()\n {\n return [\n 'slug_subway' => [\n 'source' => 'slugsubways',\n 'unique' => false\n ],\n 'slug_district' => [\n 'source' => 'slugdistricts',\n 'unique' => false\n ],\n 'slug_area' => [\n 'source' => 'slugareas',\n 'unique' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'onUpdate' => false,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['id', 'seo_name', 'company.name', 'municipality'],\n 'separator' => '-'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'sluglot'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'tags'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'slug_or_title',\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true,\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug'=>[\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title',\n 'onUpdate' => true\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['seo_url', 'seo_url1']\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'method' => function ($value) {\n return $this->browseable ? $this->browseable->slugFallback($value) : '';\n }\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => ['title']\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug_name' => [\n 'source' => 'name'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title',\n ],\n ];\n }", "public function sluggable() : array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'translate_key' => [\n 'source' => 'privacyTranslateKey'\n ],\n 'description_translate_key' => [\n 'source' => 'privacyDescriptionTranslateKey'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'job_title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'page_slug' => [\n 'source' => 'page_title',\n 'maxLength' => null,\n 'maxLengthKeepWords' => true,\n 'method' => null,\n 'separator' => '-',\n 'unique' => true,\n 'uniqueSuffix' => null,\n 'includeTrashed' => false,\n 'reserved' => null,\n 'onUpdate' => false\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'description'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name',\n 'maxLength' => 90\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable(): array\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'name'\n\t\t\t]\n\t\t];\n\t}", "public function sluggable(): array\n {\n return ['slug' => ['source' => 'title']];\n }", "public function sluggable()\n {\n return ['slug' =>\n ['source' => 'name',],\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'full_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'ofi_direccion'\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => ['name', 'franchise']\n ]\n ];\n }", "public function sluggable(): array\n {\n return [\n 'slug' => [\n 'source' => 'judul'\n ]\n ];\n }", "public function sluggable()\n\t{\n\t\treturn [\n\t\t\t'slug' => [\n\t\t\t\t'source' => 'slug_or_title',\n\t\t\t],\n\t\t];\n\t}", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'name'\n ],\n 'slug_fa' => [\n 'source' => 'name_fa'\n ],\n ];\n }", "public function sluggable()\n {\n return [\n 'abbreviation' => [\n 'source' => 'abbreviation'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'slug' => [\n 'source' => 'titre'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'product_friendly_url' => [\n 'source' => 'name'\n ],\n ];\n }", "public function sluggable() {\n return [\n 'slug_curso' => [\n 'source' => 'titulo'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'name' => [\n 'source' => 'display_name'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'stripe_id' => [\n 'source' => 'name'\n ]\n ];\n }", "public function toArray()\n {\n \n return $this->getConfig();\n }", "public function sluggable()\n {\n return [\n 'alias' => [\n 'source' => 'title'\n ]\n ];\n }", "public function sluggable()\n {\n return [\n 'username' => [\n 'source' => 'name'\n ]\n ];\n }", "public static function getSlugList(){\n return Arr::flatten(self::all('slug')->toArray());\n }", "public function getSlugOptions(): SlugOptions\n {\n return SlugOptions::create()->generateSlugsFrom('title')->saveSlugsTo('slug');\n }", "public function getSlugOptions() : SlugOptions\n {\n return SlugOptions::create()\n ->generateSlugsFrom('title')\n ->saveSlugsTo('slug');\n }", "public function getSlugOptions() : SlugOptions\n {\n return SlugOptions::create()\n ->generateSlugsFrom(['public_name'])\n ->saveSlugsTo('slug');\n }" ]
[ "0.75755036", "0.75192726", "0.747598", "0.747598", "0.74293983", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.74113035", "0.73886806", "0.73886806", "0.73799413", "0.7375949", "0.7336782", "0.7320383", "0.72971207", "0.7293049", "0.72778183", "0.7274929", "0.72714406", "0.7267439", "0.7260569", "0.7257164", "0.7257164", "0.7257164", "0.7257164", "0.7253099", "0.7253022", "0.72408843", "0.7234155", "0.72228944", "0.7214714", "0.72074777", "0.7200405", "0.7200405", "0.7200405", "0.7200405", "0.7200405", "0.7200405", "0.71996075", "0.71962243", "0.7196048", "0.7155776", "0.7148465", "0.7132528", "0.7127149", "0.7112075", "0.7090813", "0.7082207", "0.70786077", "0.7074541", "0.7071782", "0.699571", "0.69058263", "0.6898905", "0.689163", "0.68862975", "0.68479913", "0.6831599", "0.67029", "0.66076326", "0.6520816", "0.64134467", "0.62423575", "0.6229048", "0.6221626" ]
0.7332454
44
Thread slugs are unique to which Channel it belongs to.
public function scopeWithUniqueSlugConstraints(Builder $query, Model $model) { return $query->where('channel_id', $model->channel_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function path()\n {\n return \"threads/{$this->channel->slug}/{$this->id}\";\n }", "public function Thread($slug)\n {\n $allThreads = Thread::whereFlag(1)->whereSlug($slug)->first();\n return $allThreads;\n }", "public function store($channel, Thread $thread)\n {\n $thread->subscribe();\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function getChannelId()\n {\n return $this->channel_id;\n }", "public function threads()\n {\n return $this->morphedByMany('App\\Thread', 'taggable');\n }", "public function getThreadId();", "public function getThreadId();", "public function show(string $channelSlug, Thread $thread){\n $thread = $this->threads->with('posts', 'user', 'channel')->find($thread->id);\n return view('admin.threads.show')->with(['thread'=>$thread]);\n }", "private function getChannelId() {\n $event = $this->getEvent();\n\n if (isset($event['channel'])) {\n return $event['channel'];\n }\n\n return $event['channel_id'];\n }", "public function threads(){\n return $this->belongsToMany('App\\Thread');\n }", "public function index(ChannelContract $channel){\n\n return view('admin.threads.index')->with([\n 'threads' => $this->threads->with('posts')->orderBy('created_at', 'desc')->get(),\n 'channels' => $channel->get()\n ]);\n }", "public function viewed($channel)\n {\n $service = new ThreadsService();\n $threads = $channel->threads()->get();\n $user = auth()->user();\n\n foreach ($threads as $thread) {\n $service->viewed($thread, $user);\n }\n\n return $channel;\n }", "public function users($channel, Thread $thread)\n {\n $users = collect();\n\n if ($thread->creator->id !== auth()->id()) {\n $users->add($thread->creator);\n }\n\n Reply::where('thread_id', $thread->id)->get()->each(function ($reply) use ($users) {\n if ($reply->owner->id !== auth()->id()) {\n if (!$users->contains($reply->owner)) {\n $users->add($reply->owner);\n }\n }\n });\n\n return $users;\n }", "function pdo_thread_id($link=NULL) {\r\n return pdo_query(\"SELECT connection_id() AS id\", pdo_handle($link))->fetchObject()->id;\r\n }", "public function subscribeThreads($userid, $threads);", "public function threads(){\n \treturn $this->HasMany('App\\Models\\MessageThread', 'room_id');\n }", "public function getThreadName() : mixed\n {\n if ($this->threadName === null) {\n $this->threadName = (string)getmypid();\n }//end if\n \n return $this->threadName;\n \n }", "public function test_a_user_can_filter_threads_according_to_a_channel()\n {\n $channel = factory('App\\Models\\Channel')->create();\n $threadInChannel = factory('App\\Models\\Thread')->create(['channel_id' => $channel->id]);\n $threadNotInChannel = factory('App\\Models\\Thread')->create();\n $this->get('/threads/'.$channel->slug)\n ->assertSee($threadInChannel->title)\n ->assertDontSee($threadNotInChannel->title);\n\n $this->assertTrue(true);\n }", "function ciniki_core_threadAdd(&$ciniki, $module, $object, $table, $history_table, $args) {\n //\n // All arguments are assumed to be un-escaped, and will be passed through dbQuote to\n // ensure they are safe to insert.\n //\n\n // Required functions\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n\n //\n // Don't worry about autocommit here, it's taken care of in the calling function\n //\n\n //\n // Get a new UUID\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUUID');\n $rc = ciniki_core_dbUUID($ciniki, $module);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $uuid = $rc['uuid'];\n\n // \n // Setup the SQL statement to insert the new thread\n //\n $strsql = \"INSERT INTO $table (uuid, tnid, user_id, subject, state, \"\n . \"source, source_link, options, \"\n . \"date_added, last_updated) VALUES (\"\n . \"'\" . ciniki_core_dbQuote($ciniki, $uuid) . \"', \"\n . \"\";\n\n // tnid\n if( isset($args['tnid']) && $args['tnid'] != '' && $args['tnid'] > 0 ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"', \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.373', 'msg'=>'Required argument missing', 'pmsg'=>'No tnid'));\n }\n\n // user_id\n if( isset($args['user_id']) && $args['user_id'] != '' && $args['user_id'] > 0 ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['user_id']) . \"', \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.374', 'msg'=>'Required argument missing', 'pmsg'=>'No user_id'));\n }\n\n // subject\n if( isset($args['subject']) && $args['subject'] != '' ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['subject']) . \"', \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.375', 'msg'=>'Required argument missing', 'pmsg'=>'No subject'));\n }\n\n // state - optional\n if( isset($args['state']) && $args['state'] != '' ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['state']) . \"', \";\n } else {\n $strsql .= \"'', \";\n }\n\n // source - optional\n if( isset($args['source']) && $args['source'] != '' ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['source']) . \"', \";\n } else {\n $strsql .= \"'', \";\n }\n\n // source_link - optional\n if( isset($args['source_link']) && $args['source_link'] != '' ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['source_link']) . \"', \";\n } else {\n $strsql .= \"'', \";\n }\n\n // options - optional\n if( isset($args['options']) && $args['options'] != '' ) {\n $strsql .= \"'\" . ciniki_core_dbQuote($ciniki, $args['options']) . \"', \";\n } else {\n $strsql .= \"'0', \";\n }\n\n $strsql .= \"UTC_TIMESTAMP(), UTC_TIMESTAMP())\";\n\n $rc = ciniki_core_dbInsert($ciniki, $strsql, $module);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $thread_id = $rc['insert_id'];\n\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'uuid', $uuid);\n if( isset($args['user_id']) && $args['user_id'] != '' && $args['user_id'] > 0 ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'user_id', $args['user_id']);\n }\n if( isset($args['subject']) && $args['subject'] != '' ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'subject', $args['subject']);\n }\n if( isset($args['state']) && $args['state'] != '' ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'state', $args['state']);\n }\n if( isset($args['source']) && $args['source'] != '' ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'source', $args['source']);\n }\n if( isset($args['source_link']) && $args['source_link'] != '' ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'source_link', $args['source_link']);\n }\n if( isset($args['options']) && $args['options'] != '' ) {\n ciniki_core_dbAddModuleHistory($ciniki, $module, $history_table, $tnid,\n 1, $table, $thread_id, 'options', $args['options']);\n }\n //\n // Sync push\n //\n $ciniki['syncqueue'][] = array('push'=>$module . '.' . $object, \n 'args'=>array('id'=>$thread_id));\n\n return $rc;\n}", "public function subscriptions()\n {\n return $this->hasMany('App\\Core\\ThreadSubscription');\n }", "public function thread() {\n return $this->belongsTo('Thread');\n }", "public function index($channel_id, Thread $thread)\n {\n return $thread->replies()->paginate(2);\n }", "public function create($channel, $data)\n {\n return $channel->threads()->create([\n 'title' => $data['title'],\n 'body' => $data['body'],\n 'user_id' => auth()->user()->id\n ]);\n }", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function subscribeThread(ThreadRepositoryInterface $thread): PodiumResponse;", "public function getThreadType();", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "function is_subscribed($thread, $subs) {\n foreach ($subs as $sub) {\n if ($sub->threadid == $thread->id) return true;\n }\n return false;\n}", "public function channel($channel);", "function get_channel_id($entry_id)\n\t{\t\n\t\t$this->EE->db->select('channel_id');\n\t\t$this->EE->db->where('entry_id', $entry_id);\n\t\t$query = $this->EE->db->get('channel_titles');\n\t\t$row = $query->row();\n\t\t\n\t\treturn ($row ? $row->channel_id : '');\n\t}", "public function store(StoreThread $form)//\n {\n $channel = collect(config('channel'))->keyby('id')->get($form->channel_id);\n if(!$channel||!auth('api')->user()){abort(404);}\n\n if(auth('api')->user()->no_posting){abort(403,'禁言中');}\n\n if($channel->type==='book'&&(auth('api')->user()->level<1||auth('api')->user()->quiz_level<1)&&!auth('api')->user()->isAdmin()){abort(403,'发布书籍,必须用户等级1以上,答题等级1以上');}\n\n if($channel->type<>'book'&&(auth('api')->user()->level<4||auth('api')->user()->quiz_level<2)&&!auth('api')->user()->isAdmin()){abort(403,'发布非书籍主题,必须用户等级4以上,答题等级2以上');}\n\n if(!$channel->is_public&&!auth('api')->user()->canSeeChannel($channel->id)){abort(403,'不能访问这个channel');}\n\n if(!auth('api')->user()->isAdmin()&&Cache::has('created-thread-' . auth('api')->id())){abort(410,\"不能短时间频繁建立新主题\");}\n\n //针对创建清单进行一个数值的限制\n if($channel->type==='list'){\n $list_count = Thread::where('user_id', auth('api')->id())->withType('list')->count();\n if($list_count > auth('api')->user()->user_level){abort(410,'额度不足,不能创建更多清单');}\n }\n if($channel->type==='box'){\n $box_count = Thread::where('user_id', auth('api')->id())->withType('box')->count();\n if($box_count >=1){abort(410,'目前每个人只能建立一个问题箱');}\n }\n\n $thread = $form->generateThread($channel);\n\n Cache::put('created-thread-' . auth('api')->id(), true, 10);\n\n if($channel->type==='list'&&auth('api')->user()->info->default_list_id===0){\n auth('api')->user()->info->update(['default_list_id'=>$thread->id]);\n }\n if($channel->type==='box'&&auth('api')->user()->info->default_box_id===0){\n auth('api')->user()->info->update(['default_box_id'=>$thread->id]);\n }\n\n $thread = $this->threadProfile($thread->id);\n\n return response()->success(new ThreadProfileResource($thread));\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function getPermalinkAttribute(){\n return route('thread.show', [$this->thread, 'page' => $this->getPage()]).'#'.$this->id;\n }", "public function thread(){\n return $this->belongsTo(Thread::class);\n }", "public function getChannel();", "public function getThreadGUID() {\n\t\tif (isset($this->thread_guid)) {\n\t\t\treturn (int) $this->thread_guid;\n\t\t}\n\t\t\n\t\treturn $this->guid;\n\t}", "public function destroy($channel, Thread $thread)\n {\n $thread->unsubscribe();\n }", "public function getDistributionChannels();", "protected function getThreads(Channel $channel, ThreadFilters $filters)\n {\n \n $threads = Thread::latest()->filter($filters);\n if ($channel->exists) {\n $threads->where('channel_id', $channel->id);\n }\n\n // dd($threads->toSql());\n\n return $threads->get();\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function create(ChannelContract $channel){\n return view('admin.threads.create')->with([\n 'channels' => $channel->get()\n ]);\n }", "function thread( $args )\n\t{\n\t $thread_id = (int)$args['id'];\n\t \n\t // check for existance, use threads model\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t\t// boards model\n\t\t$boards_model = $this->app->\n\t\t model('forum_boards', 'forum/models'); \n\t \n\t // posts model\n\t $posts_model = $this->app->\n\t model('forum_posts','forum/models');\n\t \n\t // get item\n\t $thread = $threads_model->get_item( $thread_id );\n\t $thread = ( count($thread) > 0 ) ? $thread[0] : null;\n\t \n\t \n\t // imprtant stuffs\n\t if( $thread == null ){\n\t \n\t \t// redirect\n\t \t$this->app->redirect('forum');\n\t }\n\t \n\t \n // get board\n $board = $boards_model->get_item((int)$thread['board_id']);\n $board = $board[0];\n \n // set page title\n $this->view->add('page_title',\n 'Viewing thread: ' . $thread['name'] );\n \n // set index action\n $this->view->add('index_action',\n $this->app->form_path('forum'));\n \n // set board action\n $this->view->add('board_action',\n $this->app->form_path('forum/board/'.$board['id']));\n \n // good\n $this->view->add('board_name', $board['name'] );\n\t \n\t // need an action message\n\t $action_message = null;\n\t \n\t // init text area values\n\t $name_value = '';\n\t $post_value = '';\n\t \n\t \n\t // check for post\n\t if( $_SERVER['REQUEST_METHOD'] == 'POST' &&\n\t \tisset($_POST['name']) &&\n\t \t$_POST['name'] != null &&\n\t \tisset($_POST['post']) &&\n\t \t$_POST['name'] != null \n\t ){\n\t \t\n\t \t// add success\n\t \t$success = $posts_model->new_item( \n\t \t\t$this->app->user->get_user_id(), $thread_id, $_POST );\n\t \t\n\t \t// test for success\n\t \tif( $success ){\n\t \t\n\t \t\t// increment reply count\n\t \t\t$threads_model->increment_reply( $thread_id );\n\t \t\t\t \t\n\t \t\t$action_message = 'Post successfully added.';\n\t \t} else {\n\t \t\t$action_message = 'There was an error adding your post';\n\t \t}\n\t \t\n\t } elseif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t \t\n\t \t$action_message = 'One or more required fields was not\n\t \t\tprovided';\n\t \t\t\n\t \t// update values\n\t\t\t$name_value = 'value=\"'.$_POST['name'].'\"';\n\t\t\t$post_value = $_POST['post'];\n\t }\n\t \n\t \n\t // add them\n\t $this->view->add('name_value',$name_value);\n\t $this->view->add('post_value',$post_value);\n\t \n\t // add actio message\n\t $this->view->add('action_message',$action_message);\n\t \n\t // get limits\n\t $limit = 10;\n\t \n\t // get page\n\t $page = 0;\n\t if( isset($_GET['p']) ){\n\t $page = (int)$_GET['p'];\n\t }\n\t \n\t // get replies\n\t $posts_result = $posts_model->limit($limit)->page($page)->\n\t get_all($thread_id);\n\t \n\t //\n\t $this->view->add('posts_result',$posts_result);\n\t \n\t $reply_count = ($thread==null) ? 0 :(int)$thread['reply_count'];\n\t \n\t // add paging\n\t $this->view->add('page_info',array(\n\t // posts count\n\t 'page_count' => (int)(($reply_count) / $limit)+1,\n\t 'this_page' => $page\n\t ));\n\t \n\t \n\t // add actions\n\t $this->view->add('page_action',\n\t $this->app->form_path('forum/thread/'.$thread_id.'?p='));\n\t \n\t $this->view->add('reply_action',$this->app->\n\t form_path('forum/thread/'.$thread_id.'?p='.$page));\n\t \n\t \n\t // add to the view\n\t $this->view->add('thread_result',$thread);\n\t \n\t \n\t // get wysiwyg extension\n\t $wysiwyg = $this->app->extension('wysiwyg');\n\t \n\t}", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class);\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "public function channel()\n {\n return $this->belongsTo('App\\Models\\Channel');\n }", "public function channel()\n {\n return $this->belongsTo('App\\Channel');\n }", "public function getChannel() {\n return $this->channel;\n }", "public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }", "public function channel()\n {\n return $this->belongsTo(\"App\\Channel\");\n }", "function acl_for_thread($tid,$key) {\n global $loguser;\n die((__FUNCTION__).\" is legacy and shouldn't be used. Someone fix that.\");\n if($loguser[acl][\"$key t$tid\"]) return 1;\n else if($loguser[acl][\"not $key t$tid\"]) return 0;\n else if($loguser[acl][\"$key f\".getforumbythread($tid)]) return 1;\n else if($loguser[acl][\"not $key f\".getforumbythread($tid)]) return 0;\n else if($loguser[acl][\"$key c\".getcategorybythread($tid)]) return 1;\n else if($loguser[acl][\"not $key c\".getcategorybythread($tid)]) return 0;\n else if($loguser[acl][$key]) return 1;\n else if($loguser[acl][\"not $key\"]) return 0;\n return 0;\n}", "public function generateChannel(){\n\t\t$tempArray = array();\n\t\tpreg_match('/\\+(.*?)@/', $this->recipient, $tempArray);\n\t\t$this->channel = $tempArray[1];\n\t}", "public function channels()\n {\n $this->send(['command' => 'channels', 'seq'=>$this->getSequence()]);\n }", "private function getThreadId() {\n $event = $this->getEvent();\n return (empty($event['thread_ts'])) ? $event['ts']: $event['thread_ts'];\n }", "private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function run()\n {\n DB::table('threads')->insert([\n 'id' => 1,\n 'creator' => 1,\n 'title' => 'Hilo inaugural de TekPlaza',\n 'locked' => false,\n 'pinned' => true,\n 'subforum' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 2,\n 'creator' => 4,\n 'title' => 'Propuesta de nuevas normas para los foros de soporte técnico',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 2,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 3,\n 'creator' => 1,\n 'title' => 'Normas del subforo general de tecnología',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 4,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 4,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 5,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 5,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 6,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 6,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 7,\n 'creator' => 4,\n 'title' => 'Normas del subforo de montaje de PCs',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 7,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 8,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 8,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 9,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 9,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 10,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 10,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 11,\n 'creator' => 7,\n 'title' => 'Placas solares',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 12,\n 'creator' => 1,\n 'title' => 'Hilo de prueba 1234567890 abcdefg',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 13,\n 'creator' => 6,\n 'title' => 'Hilo 1',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 14,\n 'creator' => 4,\n 'title' => 'Hilo 2',\n 'locked' => true,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 15,\n 'creator' => 2,\n 'title' => 'Hilo 3',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function created(Channel $channel)\n {\n // Tạo PARTITION mới cho 2 bảng sinka_youtube_data_channel và sinka_youtube_traffic_channel\n $id = $channel->id;\n try {\n DB::statement(\"ALTER TABLE sinka_youtube_data_channel ADD PARTITION (PARTITION p$id VALUES IN($id))\");\n } catch (\\Throwable $th) {}\n try {\n DB::statement(\"ALTER TABLE sinka_youtube_traffic_channel ADD PARTITION (PARTITION p$id VALUES IN($id))\");\n } catch (\\Throwable $th) {}\n try {\n dispatch(new LoginChannel($id));\n } catch (\\Throwable $th) {\n return redirect()->route('channel.dashboard')->withErrors(['number' => 'チャネルの登録が失敗しました。管理者に連絡してください。']);\n }\n \n // LoginChannel::dispatch($id)->delay(now()->addMinutes(1));\n }", "public function channel()\n {\n }", "public function test_an_authenicated_user_can_subscribe_to_a_thread()\n {\n $this->signIn();\n $thread = factory('App\\Thread')->create();\n $this->post($thread->path() . '/subscriptions');\n $this->assertCount(1, $thread->subscriptions);\n }", "public function getSubchannelId()\n {\n return $this->subchannelId;\n }", "private function _channel_entries()\n\t{\n\t\t// --------------------------------------\n\t\t// Unset custom parameters\n\t\t// --------------------------------------\n\n\t\tforeach ($this->params AS $param)\n\t\t{\n\t\t\tunset($this->EE->TMPL->tagparams[$param]);\n\t\t}\n\n\t\t$this->_log('Calling the channel module');\n\n\t\t// --------------------------------------\n\t\t// Take care of related entries\n\t\t// --------------------------------------\n\n\t\t// We must do this, 'cause the template engine only does it for\n\t\t// channel:entries or events:events_results. The bastard.\n\t\t$this->EE->TMPL->tagdata = $this->EE->TMPL->assign_relationship_data($this->EE->TMPL->tagdata);\n\n\t\t// Add related markers to single vars to trigger replacement\n\t\tforeach ($this->EE->TMPL->related_markers AS $var)\n\t\t{\n\t\t\t$this->EE->TMPL->var_single[$var] = $var;\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Include channel module\n\t\t// --------------------------------------\n\n\t\tif ( ! class_exists('channel'))\n\t\t{\n\t\t\trequire_once PATH_MOD.'channel/mod.channel'.EXT;\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Create new Channel instance\n\t\t// --------------------------------------\n\n\t\t$channel = new Channel();\n\n\t\t// --------------------------------------\n\t\t// Let the Channel module do all the heavy lifting\n\t\t// --------------------------------------\n\n\t\treturn $channel->entries();\n\t}", "function getActiveChannels() {\n global $debug, $logdir, $logfile, $app;\n\n $channels = null;\n $model = $app->bootstrap->getModel('channels');\n\n $now = date(\"Y-m-d H:i:s\");\n $query = \"SELECT\"\n .\" ch.id,\"\n .\" ch.starttimestamp,\"\n .\" ch.endtimestamp,\"\n .\" ch.title,\"\n .\" ch.isliveevent,\"\n .\" lf.id AS locationid,\"\n .\" lf.name AS locationname,\"\n .\" lf.issecurestreamingforced,\"\n .\" lf.indexphotofilename,\"\n .\" lfs.id AS livefeedstreamid,\"\n .\" lfs.qualitytag AS streamname,\"\n .\" lfs.keycode AS streamid,\"\n .\" lfs.contentkeycode AS contentstreamid\"\n .\" FROM\"\n .\" channels AS ch,\"\n .\" livefeeds AS lf,\"\n .\" livefeed_streams AS lfs\"\n .\" WHERE\"\n .\" ch.starttimestamp <= '\" . $now . \"' AND\"\n .\" ch.endtimestamp >= '\" . $now . \"' AND\"\n .\" ch.id = lf.channelid AND\"\n .\" lf.id = lfs.livefeedid AND\"\n .\" lf.issecurestreamingforced = 0\"\n .\" ORDER BY\"\n .\" ch.id\";\n\n try {\n $rs_channels = $model->safeExecute($query);\n $channels = $rs_channels->GetArray();\n } catch (Exception $err) {\n $debug->log($logdir, $logfile, \"[ERROR] SQL query failed (\". $err->getTraceAsString() .\")\\nSQL QUERY:\\n'\". trim($query) .\"'\", false);\n return false;\n }\n\n // Check if any record returned\n if (count($channels) < 1) { return false; }\n\n return $channels;\n}", "public function channels()\n {\n return $this->belongsToMany('App\\Channel');\n }", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "function apoc_get_group_topic_info() {\n\n\tglobal $bp;\n\t$slug = $bp->action_variables[1];\n\t\n\t\n\tglobal $wpdb;\n\t$topic = $wpdb->get_row( \n\t\t$wpdb->prepare( \n\t\t\t\"SELECT post_title AS title, post_name AS url\n\t\t\tFROM $wpdb->posts \n\t\t\tWHERE post_name = %s\",\n\t\t\t$slug )\n\t\t);\n\t\t\n\treturn $topic;\n}", "public function getThreadEntity() {\n\t\treturn get_entity($this->getThreadGUID());\n\t}", "public static function getChannel($channel)\r\n\t{\r\n\t\tif(empty(self::$channels[strtolower($channel)]))\r\n\t\t{\r\n\t\t\t$channel_obj = trim($channel, '#');\r\n\t\t\tself::$channels[strtolower($channel)] = new $channel_obj(strtolower($channel));\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$channels[strtolower($channel)];\r\n\t}", "function sf_create_slugs()\n{\n\tglobal $wpdb;\n\n\t# forums\n\t$records=$wpdb->get_results(\"SELECT forum_id, forum_name, forum_slug FROM \".SFFORUMS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->forum_name, 'forum');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'forum-'.$record->forum_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFFORUMS.\" SET forum_slug='\".$title.\"' WHERE forum_id=\".$record->forum_id);\n\t\t}\n\t}\n\n\t# topics\n\t$records=$wpdb->get_results(\"SELECT topic_id, topic_name, topic_slug FROM \".SFTOPICS);\n\tif($records)\n\t{\n\t\tforeach($records as $record)\n\t\t{\n\t\t\t$title = sf_create_slug($record->topic_name, 'topic');\n\t\t\tif(empty($title))\n\t\t\t{\n\t\t\t\t$title = 'topic-'.$record->topic_id;\n\t\t\t}\n\t\t\t$wpdb->query(\"UPDATE \".SFTOPICS.\" SET topic_slug='\".$title.\"' WHERE topic_id=\".$record->topic_id);\n\t\t}\n\t}\n\treturn;\n}", "function &getChannels() {\n\t\tif($this->_channels === null) {\n\t\t\tglobal $db,$pun_user;\n\t\t\t\n\t\t\t$this->_channels = array();\n\t\t\t\n\t\t\t// Get valid PunBB forums:\n\t\t\t$sql = 'SELECT\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tforum_name\n\t\t\t\t\tFROM\n\t\t\t\t\t\t'.$db->prefix.'forums AS f\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t'.$db->prefix.'forum_perms AS fp\n\t\t\t\t\tON\n\t\t\t\t\t\t(fp.forum_id=f.id AND fp.group_id=\\''.$db->escape($pun_user['g_id']).'\\')\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t(fp.read_forum IS NULL OR fp.read_forum=1);';\n\t\t\t$result = $db->query($sql);\n\n\t\t\t$defaultChannelFound = false;\n\n\t\t\twhile ($row = $db->fetch_assoc($result)) {\n\t\t\t\t// Check if we have to limit the available channels:\n\t\t\t\tif($this->getConfig('limitChannelList') && !in_array($row['id'], $this->getConfig('limitChannelList'))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$forumName = $this->trimChannelName($row['forum_name']);\n\t\t\t\t\n\t\t\t\t$this->_channels[$forumName] = $row['id'];\n\n\t\t\t\tif(!$defaultChannelFound && $row['id'] == $this->getConfig('defaultChannelID')) {\n\t\t\t\t\t$defaultChannelFound = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->free_result($result);\n\n\t\t\tif(!$defaultChannelFound) {\n\t\t\t\t// Add the default channel as first array element to the channel list:\n\t\t\t\t$this->_channels = array_merge(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t$this->trimChannelName($this->getConfig('defaultChannelName'))=>$this->getConfig('defaultChannelID')\n\t\t\t\t\t),\n\t\t\t\t\t$this->_channels\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $this->_channels;\n\t}", "function fiorello_mikado_get_multisite_blog_id() {\n\t\tif ( is_multisite() ) {\n\t\t\treturn get_blog_details()->blog_id;\n\t\t}\n\t}", "public function thread()\n {\n return $this->belongsTo('App\\Models\\Thread')->select(['id', 'title']);\n }", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "private static function get_critical_screen_ids() {\n\t\treturn array( 'dashboard', 'plugins', 'plugins-network', 'edit-job_listing', 'job_listing_page_job-manager-settings' );\n\t}", "public function articles()\n {\n return Board::where('news', 1)->first()->threads;\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function channel(){\n\n return $this->belongsTo('App\\Channel');\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function getChannelId(): Snowflake\n {\n return $this->channel_id;\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class)->withoutGlobalScopes(['active']);\n }", "public function run()\n {\n Channel::create([\n \t'name' => 'Laravel',\n \t'slug' => Str::slug('Laravel') \n ]);\n\n Channel::create([\n \t'name' => 'Vue Js',\n \t'slug' => Str::slug('Vue Js') \n ]);\n\n Channel::create([\n \t'name' => 'Django',\n \t'slug' => Str::slug('Django') \n ]);\n\n Channel::create([\n \t'name' => 'React Js',\n \t'slug' => Str::slug('React Js') \n ]);\n }", "function ts3client_flushChannelCreation($serverConnectionHandlerID, $channelParentID) {}", "public function getDistributionChannels()\n {\n return $this->distributionChannels;\n }", "private function threadComments($cs)\n\t{\n\t\t$threads = array();\n\t\tforeach ($cs as $c) {\n\t\t\t$parent = $c['parentid'];\n\t\t\tif (!isset($threads[$parent])) {\n\t\t\t\t$threads[$parent] = array();\n\t\t\t}\n\t\t\t$threads[$parent][] = $c['id'];\n\t\t}\n\t\treturn $threads;\n\t}", "public function threads()\n\t{\n\n\t\t// get sort type\n\n\n\t\t$query = Thread::where('parent_id', null)->with('user')->with('topic')->limit(20);\n\n\t\t$sort = get_string('sort', 'newest');\n\n\t\t$topic = get_int('topic', false);\n\n\t\tif($topic)\n\t\t\t$query->where('topic_id', $topic);\n\n\t\tThread::setOrder($query, $sort);\n\n\t\t$threads = $query->get();\n\n\t\t$topics = Topic::all();\n\n\t\treturn view('threads.index', compact('threads', 'sort', 'topics'));\n\t\n\t}", "private function listChannels()\n {\n $channels = Auth::guard()->user()->channels->load('users');\n foreach($channels as $channel){\n foreach($channel->users as $key => $user){\n if ($user->id == Auth::guard()->user()->id){\n unset($channel->users[$key]);\n }\n }\n }\n return $channels;\n }", "public function visitedThreadCacheKey($thread)\n\t{\n\t\treturn sprintf(\"users.%s.visits.%s\", Auth::user()->id, $thread->id);\n\t}", "function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}", "function getThreadById($id){\n \n return $this->find($id)->toArray(); \n }", "public static function createChannelUrl($channel): string\n {\n return Config::get('SOCKETS_HOST') . 'chan/' . $channel;\n }", "public function run()\n {\n $channel1= ['title'=> 'Laravel','slug'=>str_slug('Laravel')];\n $channel2= ['title'=> 'VueJs','slug'=>str_slug('VueJs')];\n $channel3=['title'=>'JavaScript','slug'=>str_slug('JavaScript')];\n $channel4=['title'=>'Spark','slug'=>str_slug('Spark')];\n\n Channel::create($channel1);\n Channel::create($channel2);\n Channel::create($channel3);\n Channel::create($channel4);\n }", "private function registerChannels(): void\n {\n if (config('messenger.routing.channels.enabled')) {\n $this->app->make(BroadcastManager::class)->routes($this->channelRouteConfiguration());\n\n $broadcaster = $this->app->make(Broadcaster::class);\n\n $broadcaster->channel('messenger.thread.{thread}', ThreadChannel::class);\n $broadcaster->channel('messenger.call.{call}.thread.{thread}', CallChannel::class);\n $broadcaster->channel('messenger.{alias}.{id}', ProviderChannel::class);\n }\n }", "public function get_id() {\n return str_replace('_forum_feature', '', get_class($this));\n }" ]
[ "0.58216554", "0.5651364", "0.5403345", "0.53189677", "0.5234935", "0.5172869", "0.5170937", "0.5170937", "0.5163275", "0.5125259", "0.5081936", "0.508134", "0.4974361", "0.497251", "0.49600846", "0.49469784", "0.4941638", "0.4941106", "0.4912048", "0.49013048", "0.48814017", "0.48809996", "0.48774046", "0.4851069", "0.48497546", "0.48406103", "0.48379037", "0.482695", "0.482695", "0.4822091", "0.47772995", "0.47652045", "0.47625017", "0.4762381", "0.4762381", "0.4755331", "0.47516432", "0.47365338", "0.47254544", "0.47236434", "0.47010586", "0.4700968", "0.46891963", "0.46891963", "0.46776822", "0.46772966", "0.46704367", "0.46704367", "0.4669278", "0.4669278", "0.4669278", "0.46673816", "0.46672228", "0.46582413", "0.4650988", "0.46494222", "0.46464902", "0.46463418", "0.46458757", "0.46372348", "0.46326652", "0.4630688", "0.46252376", "0.46058565", "0.46031913", "0.45987526", "0.45961025", "0.45899683", "0.458643", "0.45720345", "0.45689845", "0.45648023", "0.45644435", "0.4550862", "0.45487", "0.45395967", "0.45356008", "0.45339227", "0.45282567", "0.4518605", "0.4518605", "0.45179906", "0.4514111", "0.45132238", "0.45126662", "0.45118824", "0.45086658", "0.45070925", "0.45010152", "0.44978264", "0.4497283", "0.4493564", "0.44875252", "0.44871733", "0.4485871", "0.44809902", "0.4479112", "0.44771335", "0.4476955", "0.44715056", "0.4463195" ]
0.0
-1
Scope Thread slug route binding to the Channel it belongs to.
public function resolveRouteBinding($value) { return $this->where('channel_id', request()->route('channel')->id) ->where('slug', $value) ->first() ?? abort(404); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChannelsRoute(): string;", "public function path()\n {\n return \"threads/{$this->channel->slug}/{$this->id}\";\n }", "public function getPermalinkAttribute(){\n return route('thread.show', [$this->thread, 'page' => $this->getPage()]).'#'.$this->id;\n }", "public function broadcastOn()\n {\n return new Channel('room-queue-screen-'. $this->area_uuid);\n// return new Channel('room-queue-screen');\n }", "public function channel($channel);", "public function getChannel();", "public function onChannel($channel);", "public function getDestinationChannel();", "public function show(string $channelSlug, Thread $thread){\n $thread = $this->threads->with('posts', 'user', 'channel')->find($thread->id);\n return view('admin.threads.show')->with(['thread'=>$thread]);\n }", "public function channel()\n {\n }", "public function index($channel_id, Thread $thread)\n {\n return $thread->replies()->paginate(2);\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function store($channel, Thread $thread)\n {\n $thread->subscribe();\n }", "public function index(ChannelContract $channel){\n\n return view('admin.threads.index')->with([\n 'threads' => $this->threads->with('posts')->orderBy('created_at', 'desc')->get(),\n 'channels' => $channel->get()\n ]);\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public static function route($channel, $route)\n {\n return (new AnonymousNotifiable)->route($channel, $route);\n }", "public function generateChannel(){\n\t\t$tempArray = array();\n\t\tpreg_match('/\\+(.*?)@/', $this->recipient, $tempArray);\n\t\t$this->channel = $tempArray[1];\n\t}", "public function channel()\n {\n return $this->belongsTo('App\\Channel');\n }", "public function channel()\n {\n return $this->belongsTo(\"App\\Channel\");\n }", "public function getChannel() {\n return $this->channel;\n }", "public function destroy($channel,Thread $thread)\n {\n $this->authorize('update',$thread);\n\n $thread->delete();\n\n if (request()->wantsJson()){\n return response([],204);\n }\n\n return redirect('/threads');\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class);\n }", "public function getRouteAttribute()\n {\n $perPage = config('forum.preferences.posts_per_thread');\n $count = $this->thread->posts()->where('id', '<=', $this->id)->paginate($perPage)->total();\n $page = ceil($count / $perPage);\n\n return \"{$this->thread->route}?page={$page}#post-{$this->id}\";\n }", "public function destroy(Channel $channel, Thread $thread)\n {\n $this->authorize('update', $thread);\n\n $thread->delete();\n\n if (request()->wantsJson()) {\n return response([], 204);\n }\n\n // if($thread->user_id != auth()->id()) {\n // abort(403, 'You Do Not Have Permission To Do This.');\n // return redirect('/login');\n // }\n\n return redirect('/threads');\n }", "public function channel()\n {\n return $this->belongsTo('App\\Models\\Channel');\n }", "public function callRoute()\n {\n Artisan::call('lucy:route', $this->builder->getAttribute('route'));\n }", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class)->withoutGlobalScopes(['active']);\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "public function destroy($channel, Thread $thread)\n {\n $this->authorize('update', $thread);\n\n $thread->delete();\n\n return redirect()->route('forum');\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getDistributionChannel()\n {\n return $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel;\n }", "public function channel(){\n\n return $this->belongsTo('App\\Channel');\n }", "public function thread() {\n return $this->belongsTo('Thread');\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread(){\n return $this->belongsTo(Thread::class);\n }", "public function getChannel()\n {\n return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel;\n }", "public function viewed($channel)\n {\n $service = new ThreadsService();\n $threads = $channel->threads()->get();\n $user = auth()->user();\n\n foreach ($threads as $thread) {\n $service->viewed($thread, $user);\n }\n\n return $channel;\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function broadcastOn(): Channel\n {\n return new Channel('board-votes.' . $this->vote->board_id);\n }", "public static function createChannelUrl($channel): string\n {\n return Config::get('SOCKETS_HOST') . 'chan/' . $channel;\n }", "public function link()\n\t{\n\t\treturn route('balldeep.posts.show', [$this->type->slug, $this->slug]);\n\t}", "public function update(){\n $thread=Thread::find(\\request('thread'));\n $thread->update($this->validateUpdate());\n return redirect('/'.$thread->channel->name.'/'.$thread->section->name.'/threads/'.\\request('thread'));\n }", "function rest_get_queried_resource_route()\n {\n }", "protected function route()\n {\n return route($this->uri, $this->params);\n }", "private function registerChannels(): void\n {\n if (config('messenger.routing.channels.enabled')) {\n $this->app->make(BroadcastManager::class)->routes($this->channelRouteConfiguration());\n\n $broadcaster = $this->app->make(Broadcaster::class);\n\n $broadcaster->channel('messenger.thread.{thread}', ThreadChannel::class);\n $broadcaster->channel('messenger.call.{call}.thread.{thread}', CallChannel::class);\n $broadcaster->channel('messenger.{alias}.{id}', ProviderChannel::class);\n }\n }", "public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}", "public function destroy($channel, Thread $thread)\n {\n $thread->unsubscribe();\n }", "private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "private function _getRequestChannel() {\n $td = Request::get('token_data');\n if(isset($td['type']) && $td['type'] == 'channel') {\n return Channel::where('id', $td['channel_id'])->first();\n } else {\n if(!Request::input('channel')) {\n return Response::json([\n 'error' => 'invalid_input',\n 'error_description' => 'No channel specified'\n ], 400);\n }\n\n $uid = Request::input('channel');\n $channel = Channel::where('user_id', Auth::user()->id)->where('uid', $uid)->first();\n if(!$channel)\n return Response::json([\n 'error' => 'not_found',\n 'error_description' => 'Channel not found'\n ], 404);\n else\n return $channel;\n }\n }", "function switchChannel($ch)\n {\n exec( $this->arfilelocation['iwpriv'] . ' '\n . escapeshellarg($this->interface) . ' set Channel='.$ch);\n }", "public function setChannel($var)\n {\n GPBUtil::checkString($var, True);\n $this->Channel = $var;\n\n return $this;\n }", "public function setChannel($var)\n {\n GPBUtil::checkString($var, True);\n $this->Channel = $var;\n\n return $this;\n }", "public function getChannelId()\n {\n return $this->channel_id;\n }", "protected function load_domain_channel() {\n\t\n\t\t$splits = explode(\".\",@$_SERVER['SERVER_NAME']);\n $this->current_domain = @$_SERVER['SERVER_NAME'];\n\t\tif (count($splits) > 3) {\n\t\t\t/* \n\t\t\tif the current url is a channel subdomain , get the channel id \n\t\t\t*/\n\t\t\t$this->main_domain = $splits[1].\".\".$splits[2].\".\".$splits[3];\n\t\t\t$this->channel = ORM::factory('channel')\n\t\t\t->where(\"code\",\"=\",$splits[0])\n\t\t\t->find();\n\t\t\t//If there is no such channel redirect to main domain.\n\t\t\n\t\t\tif (!$this->channel->loaded()) {\n\t\t\t\t$this->request->redirect(\"http://{$this->main_domain}\");\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$this->main_domain = $splits[0].\".\".$splits[1].\".\".$splits[2];\n\t\t}\n\t\t\n\t}", "public function store($channelID, Request $request, Thread $thread)\n {\n //Validate incoming request\n $request->validate([\n 'reply' => 'required',\n ]);\n\n //Make a reply object and associate with the thread\n $thread->addReply([\n 'reply'=> request('reply'),\n 'expert_id' => auth('expert')->user()->id,\n ]);\n\n return back();\n }", "public function route()\n {\n $args = func_get_args();\n\n return route($this->config('route_name_prefix', 'logviewer.') . array_shift($args), ...$args);\n }", "public function channel($channel)\n {\n return $this->setChannel($channel);\n }", "function route($path=''){\r\n try {\r\n parent::route($path != '' ? $path : self::getEndPoint());\r\n } catch (Exception $e) {\r\n parent::route('help');\r\n }\r\n }", "public function setChannel(string $channel): self\n {\n $this->channel = $channel;\n return $this;\n }", "public function getRouteKey()\n {\n \t$this->slug;\n }", "public function getDistributionChannelPage()\n {\n return $this->distributionChannelPage;\n }", "public function transform($channel)\n {\n return $channel;\n }", "public static function adminChannel()\n\t{\n\t\tif ( ! $current = static::$adminChannel)\n\t\t{\n\t\t\t$channels = \\App::make('krustr.channels');\n\t\t\t$slug = \\Input::get('channel', \\Request::segment(3));\n\t\t\t$current = $channels->find($slug);\n\t\t}\n\n\t\treturn $current;\n\t}", "public function show(Channel $channel , Thread $thread,TrendingThreads $trending)\n {\n\n $trending->push($thread);\n\n $thread->increment('views');\n \n \treturn view('threads.show',compact('channel','thread'));\n\n }", "public static function route() {\nimport('TheTrainingMangerLMS.Content.Login');\n//import('TheTrainingMangerLMS.Content.MyAccount.NotFound');\n//import('TheTrainingMangerLMS.Content.MyAccount.Dashboard');\nimport('TheTrainingMangerLMS.Content.MyAccount.CourseBuilder');\nimport('TheTrainingMangerLMS.Content.MyAccount.CourseList');\n\n\t\t// set-up actions\n\t\t// add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\t$section = get_query_var('area');\n\t\t// Find a subhandler to bind\n\t\tif (!is_user_logged_in()) {\n\t\t\t(new Login())->render();\n\t\t} else \n\t\t// Is the logged in user a Trainer\n\t\tif (!ttp_lms_trainer_valid(get_current_user_id())) { // TODO: is Trainer && is Active Trainer\n\t\t\t(new UnAuthorized())->render();\n\t\t} else\n\t\t// Is this a root level request (default) or \n\t\tif (is_null($section) || ($section == '')) {\n\t\t\t(new MyAccount\\Home())->render();\n\t\t} else\n\t\t// Is this a specific request for the course list (can't use this as default)\n\t\tif ($section == \\TheTrainingMangerLMS\\Content\\MyAccount\\CourseList::get_handle()) {\n\t\t\t(new MyAccount\\CourseList())->render();\n\t\t} else \n\t\t// Is this a specific request for the course builder\n\t\tif ($section == \\TheTrainingMangerLMS\\Content\\MyAccount\\CourseBuilder::get_handle()) {\n\t\t\t(new MyAccount\\CourseBuilder())->render();\n\t\t} else {\n\t\t\t(new NotFound())->render();\n\t\t}\n\t}", "protected function registerRouteBindings()\n {\n //\n }", "public function broadcastOn()\n {\n return new PrivateChannel('task.' . $this->job->id);\n }", "public function path():string\n {\n return $this->thread->path() . \"#reply-$this->id\";\n }", "function channel(): Channel\n {\n return new Channel();\n }", "public function getChannel()\n {\n return $this->_access->getChannel();\n }", "public static function bind(): void\n {\n Route::bind('item', function ($value) {\n $model = request()->resource->model();\n\n return $model::withoutGlobalScopes()\n ->where((new $model)->getRouteKeyName(), $value)\n ->firstOrFail();\n });\n }", "public static function subscribe($channel)\n {\n return parent::subscribe($channel);\n }", "public function _route()\n\t{\n\t\tif(self::lock('ban'))\n\t\t{\n\t\t\tself::error_page('ban');\n\t\t\treturn;\n\t\t}\n\t}", "public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }", "function joinChannel($channel, $entry_message = null)\n\t{\n\t\t$this->sendMessageToServer(\"JOIN $channel\");\n\t\t$this->channel = $channel;\n\t\tif($entry_message != null) $this->sendChannelMessage($entry_message);\n\t}", "public function channels()\n {\n $this->send(['command' => 'channels', 'seq'=>$this->getSequence()]);\n }", "abstract public function routeName();", "public function broadcastOn()\n {\n return new Channel('vdesk-chat:'.$this->threadid);\n }", "public function path()\n {\n\n return $this->thread->path() . \"#reply-{$this->id}\";\n }", "protected function channel()\n {\n return $this->app->bound('env') ? $this->app->environment() : 'production';\n }", "protected function routeToURI(){\n\t\t$args = func_get_args();\n\t\treturn call_user_func_array(array('Router', 'routeToURI'), $args);\n\t}", "private static function subscribe($ch, $dir) {\n\t\t$channel = Channel::getChannelData(Input::get('channel'));\n\n\t\t$response = Reddit::fetch('api/subscribe', [\n\t\t\t'action' => ($dir ? 'sub' : 'unsub'),\n\t\t\t'sr' => 't5_'.$channel['id']\n\t\t], 'POST'); \n\n\t\tCache::tags(Session::get('user.name'))->forget('mine');\n\n\t\treturn;\n\t}", "public function getRouteKey()\n {\n return $this->slug;\n }", "public function create(ChannelContract $channel){\n return view('admin.threads.create')->with([\n 'channels' => $channel->get()\n ]);\n }", "public function store($channelId, Thread $thread)\n {\n if ($thread->locked) {\n return response(\"Thread is locked\", 422);\n }\n\n try {\n if (Gate::denies('create', new Reply)) {\n return response(\"You are posting too freaquently, Please take a break :)\", 422);\n }\n\n $this->validate(request(), ['body' => ['required', new SpamFree]]);\n\n $reply = $thread->addReply([\n 'body' => request('body'),\n 'user_id' => auth()->id()\n ]);\n } catch (\\Exception $e) {\n return response(\"Sorry, your request could not be saved at the moment.\", 422);\n }\n\n return $reply->load('owner');\n }", "function get_term_link(string $route = 'taxonomy.show', array $params = []): string\n{\n return $route ? route($route, $params) : '#';\n}" ]
[ "0.5667909", "0.56253904", "0.54964876", "0.51647586", "0.5149664", "0.5129022", "0.5082128", "0.505672", "0.50302786", "0.49586543", "0.48727617", "0.48667118", "0.48667118", "0.48596823", "0.4845395", "0.4841944", "0.4841944", "0.48282135", "0.48280743", "0.48255768", "0.48185274", "0.48170298", "0.48146918", "0.48097622", "0.48077446", "0.4798867", "0.47866005", "0.47819585", "0.47749043", "0.4767211", "0.47652084", "0.47624138", "0.47579506", "0.47505102", "0.47505102", "0.47505102", "0.46921548", "0.4686745", "0.46764183", "0.4674115", "0.4674115", "0.4640492", "0.4632642", "0.4609769", "0.45934474", "0.45860937", "0.45792332", "0.45770192", "0.45742366", "0.45676875", "0.4548482", "0.45478523", "0.4547609", "0.45462328", "0.45408335", "0.4529154", "0.4529154", "0.4528958", "0.45217672", "0.45217672", "0.45217672", "0.4520932", "0.4519813", "0.45179385", "0.45013356", "0.45013356", "0.44907793", "0.44847268", "0.44833007", "0.44799435", "0.44782564", "0.4452528", "0.44308156", "0.44257247", "0.44225636", "0.44165978", "0.44133592", "0.44046625", "0.44045076", "0.44036424", "0.43973196", "0.43934044", "0.4390422", "0.43884224", "0.437244", "0.43709075", "0.43553126", "0.4355054", "0.43473595", "0.43290064", "0.43282327", "0.43272445", "0.43214247", "0.43116197", "0.43109706", "0.43071842", "0.43065348", "0.43059084", "0.43051472", "0.43038067" ]
0.51003885
6
Threads have many Replies.
public function replies() { return $this->hasMany('App\Models\Reply'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $threads = factory('App\\Thread', 20)->create();\n\n $threads->each(function($thread) {\n factory('App\\Reply', 6)->create(['thread_id' => $thread->id]);\n });\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function run()\n {\n $records = [];\n for ($i = 1; $i <= 10; $i++) {\n for ($n = 1; $n <= 10; $n++) {\n $records[] = [\n 'thread_id' => $i,\n 'reply_no' => $n,\n 'user_id' => Str::random(7),\n 'handle_name' => Str::random(5) . '的名無しさん',\n 'host_name' => Str::random(10).'.com.test',\n 'ip' => rand(1,254) . '.'.rand(1,254).'.'.rand(1,254).'.'.rand(1,254) ,\n 'message' => Str::random() . 'と思います謝謝',\n 'created_at' => date('Y-m-d H:i:s')\n ];\n }}\n DB::table('reply')->insert($records);\n }", "protected function getReplies()\n {\n // Localise stuff\n $con = $this->con;\n $reviewId = $this->id;\n $accId = $this->parent;\n $replies = array();\n $type = Reply::TYPE;\n // Get the replies\n $stmt = $con->prepare(\"SELECT post_id FROM rposts WHERE post_parent_id = '$reviewId' AND post_type = \" . $type);\n try\n {\n if(!$stmt->execute())\n {\n throw new Exception(\"Error getting replies from database\", 1);\n }\n\n // Go through every reply\n $stmt->bindColumn(1, $replyId);\n while($reply = $stmt->fetch())\n {\n // Prepare the params\n $params['id'] = $replyId;\n // Make new replies having the ids\n $reply = new Reply($con, 'get', $params);\n // Skip if we have any error with a reply\n if($reply->getError())\n {\n $this->errorMsg .= \"Error with reply $replyId: \" . $reply->getError();\n continue;\n }\n array_push($replies, json_decode($reply->toJson(), 1));\n }\n\n // Close and Return the replies\n return $replies;\n }\n catch (Exception $e)\n {\n $this->errorMsg = \"Error with review $reviewId: \" . $e->getMessage();\n }\n }", "public function run()\n {\n $replies = [\n ['user_id'=>1, 'discussion_id'=>1,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>2, 'discussion_id'=>2,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>1, 'discussion_id'=>3,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ['user_id'=>2, 'discussion_id'=>4,'content'=>\"lorem ipsum dotor amet adflit thasdk\"],\n ];\n\n Reply::insert($replies);\n }", "public function getReplies(): array\n\t{\n\n\t}", "public function reply()\n\t{\n\n\t\t$reply = $this->store('reply', '/threads?id=_id_#form-reply');\n\n\t\t(new Thread)->updateTotalReplies($reply->parent_id);\n\n\t\tredirect('/threads?id=' . $reply->parent_id . '#reply-id' . $reply->id);\n\t\n\t}", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n for ($x = 0; $x < rand(5, 20); $x++) {\n Message::factory()\n ->for($thread)\n ->owner($thread->participants->random()->owner)\n ->create();\n }\n });\n }", "public function getAllReplies($id,$number=10)\n {\n return Reply::where('user_id',$id)\n ->whereHas('topic.category',function($q){\n $q->where('is_blocked','no');\n })->paginate($number);\n }", "public function threadsWithNewMessages()\n {\n $threadsWithNewMessages = [];\n $participants = Participant::where('user_id', $this->id)->lists('last_read', 'thread_id');\n\n /**\n * @todo: see if we can fix this more in the future.\n * Illuminate\\Foundation is not available through composer, only in laravel/framework which\n * I don't want to include as a dependency for this package...it's overkill. So let's\n * exclude this check in the testing environment.\n */\n if (getenv('APP_ENV') == 'testing' || !str_contains(\\Illuminate\\Foundation\\Application::VERSION, '5.0')) {\n $participants = $participants->all();\n }\n\n if ($participants) {\n $threads = Thread::whereIn('id', array_keys($participants))->get();\n\n foreach ($threads as $thread) {\n if ($thread->updated_at > $participants[$thread->id]) {\n $threadsWithNewMessages[] = $thread->id;\n }\n }\n }\n\n return $threadsWithNewMessages;\n }", "public function threads()\n {\n $questions = Question::has('answers', '=', 0)\n ->where('processed', '=', false)\n ->take(200)\n ->get();\n echo count($questions);\n $created = 0;\n $updated = 0;\n foreach($questions as $question)\n {\n\n if(strpos($question['url'], \"r/AskHistorians/comments\") !== false)\n {\n $parent_id = $question->id;\n $url = explode('/', $question->url);\n array_pop($url);\n $url = implode('/', $url); \n $api = $url.\".json\";\n $client = new \\GuzzleHttp\\Client([\n 'headers' => ['User-Agent' => 'AskHistoriansConsumerBot/0.0 (by /u/steerpike404)'],\n 'verify' => false]);\n $response = $client->request(\"GET\", \n $api);\n $contents = json_decode($response->getBody());\n $collection = collect($contents[1]->data->children);\n $data = $collection->mapWithKeys(function($item) {\n return [$item->data->id => [\n 'reddit_id' => $item->data->id ?? null,\n 'body'=>$item->data->body ?? null,\n 'replies'=>$item->data->replies ?? null,\n 'body_html'=>$item->data->body_html?? null,\n 'permalink'=>$item->data->permalink ?? null,\n 'author'=>$item->data->author ?? null,\n 'author_flair_text'=> $item->data->author_flair_text ?? null,\n 'distinguished'=> $item->data->distinguished ?? null,\n 'created'=>$item->data->created ?? null]\n ];\n });\n foreach($data as $answer)\n {\n if(strpos($answer['body'], \"AskHistorians/wiki/rules\") !== false ||\n strpos(strtolower($answer['body']), \"hello everyone\") !== false ||\n strlen($answer['body']) <= 10)\n {\n //$answer['display'] = false;\n unset($data[$answer['reddit_id']]);\n }\n }\n foreach($data as $item)\n {\n $answer = Answer::updateOrCreate(['reddit_id'=>$item['reddit_id']],\n [\n 'question_id'=>$parent_id,\n 'body'=>$item['body'],\n 'replies'=>json_encode($item['replies']),\n 'body_html'=>$item['body_html'],\n 'permalink'=>$item['permalink'],\n 'author'=>$item['author'],\n 'author_flair_text'=>$item['author_flair_text'],\n 'distinguished'=>$item['distinguished'],\n 'created'=>$item['created']\n ]);\n if($answer->wasRecentlyCreated) {\n $created++;\n } else {\n $updated++;\n }\n }\n }\n $question->processed = true;\n $question->save();\n }\n $result = \"Created: \".$created.\" Updated: \".$updated;\n return $result;\n }", "public function replies() {\n return $this->hasMany('Replies');\n }", "public function run()\n {\n //所有用戶id array\n $user_ids = User::all()->pluck('id')->toArray();\n\n //所有topic id array\n $topic_ids = Topic::all()->pluck('id')->toArray();\n\n //獲取faker 實例\n $faker = app(Faker\\Generator::class);\n\n $replies = factory(Reply::class)\n ->times(1000)\n ->make()\n ->each(function($reply, $index)\n use($user_ids, $topic_ids, $faker)\n {\n //從用戶id array中隨機取出一個並賦值\n $reply->user_id = $faker->randomElement($user_ids);\n\n //topic id 同上\n $reply->topic_id = $faker->randomElement($topic_ids);\n\n });\n \n //將數據集合轉為array,並且insert 到 db中\n Reply::insert($replies->toArray());\n\n }", "public function deleteWithReplies()\n\t{\n\t\tif(count($this->replies) > 0) {\n\t\t\t// Delete children recursive\n\t\t\tforeach ($this->replies as $reply) {\n\t\t\t\t$reply->deleteWithReplies();\n\t\t\t}\n\t\t}\n\t\t$this->delete();\n\t}", "public function run()\n {\n $categories = factory(Category::class,5)->create();\n\n foreach ($categories as $category){\n $category->threads()->saveMany(factory(Thread::class,10)->make());\n\n foreach ($category->threads as $thread){\n $thread->replies()->saveMany(factory(\\App\\Reply::class,5)->make());\n\n }\n }\n\n\n// $threads = factory(Thread::class,20)->create();\n }", "public function replies()\n\t{\n\t\treturn $this->hasMany(Reply::class);\n\t}", "public function run()\n {\n $reply_1 = [\n 'user_id' => 1,\n 'discussion_id' => 1,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n $reply_2 = [\n 'user_id' => 1,\n 'discussion_id' => 2,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n $reply_3 = [\n 'user_id' => 2,\n 'discussion_id' => 3,\n 'content' => 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium'\n ];\n\n Reply::create($reply_1);\n Reply::create($reply_2);\n Reply::create($reply_3);\n }", "public function testEach_Comment_can_have_replies()\n {\n\n self::$user = factory(App\\User::class, 1)->create();\n $post = factory(\\App\\Models\\Social\\Post::class, 1)->create();\n factory(\\App\\Models\\Social\\Comment::class, 10)->make()->each(function ($c) use ($post) {\n $post->comments()->save($c);\n factory(\\App\\Models\\Social\\Comment::class, 10)->make()->each(function ($r) use ($c) {\n $c->replies()->save($r);\n });\n });\n\n\n $post = \\App\\Models\\Social\\Post::first();\n $commentsOnPost = $post->comments()->get();\n\n foreach ($commentsOnPost as $cop) {\n $replies = $cop->replies()->get();\n self::assertInstanceOf(\\App\\Models\\Social\\Comment::class, $replies[0]);\n foreach ($replies as $rep) {\n self::assertInstanceOf(\\App\\Models\\Social\\Comment::class, $rep->commentable()->first());\n }\n }\n\n }", "public function hasNewReplies($thread)\n {\n if (!auth()->check()) return false;\n\n $view = $thread->viewedBy()->where('user_id', auth()->user()->id)->first();\n\n if (!$view) {\n $reply = $thread->replies()->first();\n\n return $reply !== null ? fractal()\n ->item($reply)\n ->transformWith(new ReplyTransformer()) : true;\n } else if ($thread->latest_reply_at <= $view->pivot->timestamp) {\n return false;\n } else {\n $reply = $thread->replies()->where('created_at', '>=', $view->pivot->timestamp)->first();\n\n return $reply !== null ?\n fractal()\n ->item($reply)\n ->transformWith(new ReplyTransformer()) : true;\n }\n }", "public function replies()\n {\n return $this->hasMany('Reflex\\Forum\\Entities\\Replies\\Reply')->latest();\n }", "public function getReplies($messages)\n {\n if(empty($messages)) return false;\n foreach($messages as $message) $objectList[] = $message->id;\n return $this->dao->select('*')->from(TABLE_MESSAGE)\n ->where('type')->eq('reply')\n ->andWhere('objectID')->in($objectList)\n ->fetchGroup('objectID');\n }", "function the_ticket_replies() {\n\n // Get ticket's replies\n $replies = md_the_component_variable('support_single_ticket_replies');\n\n // Verify if ticket has replies\n if ( $replies ) {\n return $replies;\n } else {\n return false;\n }\n \n }", "public function replies()\n {\n return $this->hasMany(Reply::class);\n }", "public function getRecentReplies($id, $number=10 ){\n return Reply::where('user_id',$id)->orderBy('created_at','desc')\n ->whereHas('topic.category',function($q){\n $q->where('is_blocked','no');\n })->take($number)->get();\n }", "public function getReplys()\n {\n\t $q = Doctrine_Query::create()\n ->from('SpeakoutReply sr')\n ->leftJoin('sr.NetworkUser nu')\n ->where('sr.topic_id = ?', $this->getId()); \n\t\n return Doctrine_Core::getTable('NetworkUser')->getWithUsers($q);\n }", "public function getThreadItemsBelow(): array {\n\t\t$threadItems = [];\n\t\t$getReplies = static function ( ContentThreadItem $threadItem ) use ( &$threadItems, &$getReplies ) {\n\t\t\t$threadItems[] = $threadItem;\n\t\t\tforeach ( $threadItem->getReplies() as $reply ) {\n\t\t\t\t$getReplies( $reply );\n\t\t\t}\n\t\t};\n\n\t\tforeach ( $this->getReplies() as $reply ) {\n\t\t\t$getReplies( $reply );\n\t\t}\n\n\t\treturn $threadItems;\n\t}", "function test_a_user_can_filter_threads_by_popularity(){\n // with 2,3 and 0 replies respectively\n\n $ThreadWithTwoReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithTwoReplies->id],2);\n\n\n $ThreadWithThreeReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithThreeReplies->id],3);\n\n $ThreadWithNoReplies = $this->thread;\n\n\n\n //When I filter all threads by popularity\n $response = $this->getJson('threads?popular=1')->json();\n // then they should be returned from most replies to least\n\n $this->assertEquals([3,2,0], array_column($response,'replies_count'));\n\n }", "public function threads(){\n \treturn $this->HasMany('App\\Models\\MessageThread', 'room_id');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "function have_replies() {\n\tglobal $replies_index, $reply, $replies, $replies_count, $discussion_title;\n\n\t$replies_count = count(get_replies($discussion_title));\n\t$replies = get_replies($discussion_title);\n\n\tif ($replies && $replies_index + 1 <= $replies_count) {\n\t\t$replies_index++;\n\t\treturn true;\n\t} else {\n\t\t$replies_count = 0;\n\t\treturn false;\n\t}\n}", "public function discussionReply($rows) \n\t{\n\t\tif(empty($rows))\n\t\treturn 0;\n\t\t\n\t\t$result = array();\n\t\t\n\t\tforeach($rows as $ky=>$row)\n\t\t{\n\t\t\tif(isset($row->id))\n\t\t\t{\n\t\t\t\t$item = new discussionReplySimpleSchema();\n\t\t\t\t$item->id = $row->id;\n\t\t\t\t$item->reply = $row->content;\n\t\t\t\t$item->created_by = $this->createUserObj($row->created_by);\n\t\t\t\t$item->created_date = $this->dateCreate($row->created);\n\t\t\t\t$item->lapsed = $this->calLaps($row->created);\n\t\t\t\t$result[] = $item;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function selectReplyList($boardNum) {\n try {\n // 01) get connection\n $dbInfo = new DBInfo();\n $con = $dbInfo->getConnection();\n\n // 02) set variable\n $result = array();\n $replyList = array();\n\n // 03) get reply list\n // 03-1) set SQL\n $sql = \"SELECT r.reply_id, r.reply_pid, u.user_name, r.content, DATE_FORMAT(r.write_time, '%Y-%m-%d %H:%i:%s') AS 'write_time', r.board_id\n FROM {$dbInfo->getReplyTable()} r\n JOIN {$dbInfo->getUserInfoTable()} u\n ON(r.writer = u.id)\n WHERE r.board_id = {$boardNum}\";\n\n // 03-2) act SQL query\n if(!($queryResult = $con->query($sql))) {\n throw new Exception('false_selectReplyList_firstQuery');\n }\n\n // 03-3) make reply object at query result\n while($row = $queryResult->fetch_assoc()) {\n $replyObj = new Reply($row['reply_pid'], $row['user_name'], $row['content'],\n $row['write_time'], $row['board_id']);\n $replyObj->setId($row['reply_id']);\n $replyObj->setModifyRight($this->selectModifyRight(true, $row['reply_id']));\n\n array_push($replyList, $replyObj->toArray());\n }\n\n // 04) get number of replies\n // 04-1) set sql\n $sql = \"SELECT COUNT(*)\n FROM reply \n WHERE board_id = {$boardNum}\";\n\n // 04-2) act SQL query\n if(!($queryResult = $con->query($sql))) {\n throw new Exception('false_selectReplyList_secondQuery');\n }\n\n // 04-3) get query result\n $numOfReply = $queryResult->fetch_array()[0];\n\n // 05) set query result on result array\n $result['replyList'] = $replyList;\n $result['numOfReply'] = $numOfReply;\n\n return $result;\n } catch(Exception $e) {\n echo $e->getMessage();\n return false;\n } finally {\n $con->close();\n }\n }", "public function replies()\n {\n return $this->hasMany(Reply::class, 'conversation_id');\n }", "public function threads(){\n return $this->belongsToMany('App\\Thread');\n }", "function get_all_replies() {\n global $db;\n $query = \"SELECT * FROM replies\";\n $statement = $db->prepare($query);\n $statement->execute();\n $replies = $statement->fetchAll();\n $statement->closeCursor();\n return $replies; \n }", "public function getReplies()\n {\n return $this->hasMany(Replies::class, ['task_id' => 'id']);\n }", "public function replies()\r\n {\r\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = message_id, localKey = id)\r\n \treturn $this->hasMany(Reply::class);\r\n }", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "public function replies(){\n\n return $this->hasMany('App\\Reply');\n }", "private function fetchReplies($board, $thread_id) {\n\t\t\t$query = prepare(\"SELECT * FROM ``posts_$board`` WHERE `thread` = :id\");\n\t\t\t$query->bindValue(':id', $thread_id, PDO::PARAM_INT);\n\t\t\t$query->execute() or error(db_error($query));\n\n\t\t\treturn $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function run()\n {\n $quit = false;\n while (!$quit)\n {\n \\Mutex::lock($this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Cond::wait($this->thread_cond, $this->thread_mutex);\n if (count($this->req_queue) == 0)\n {\n \\Mutex::unlock($this->thread_mutex);\n continue;\n }\n }\n $reqs = array();\n while (count($this->req_queue) > 0 and count($reqs) < 10)\n {\n $m = $this->req_queue->shift();\n if ($m[0] == 'stop')\n {\n $quit = true;\n break;\n }\n $reqs[] = array($m[1], $m[2], $m[3], $m[4]);\n }\n \\Mutex::unlock($this->thread_mutex);\n if (count($reqs) > 0)\n $this->pubbatch($reqs);\n }\n }", "public function run()\n {\n // 所有话题 ID 数组,如:[1,2,3,4]\n $article_ids = \\App\\Models\\Article::all()->pluck('id')->toArray();\n\n // 获取 Faker 实例\n $faker = app(Faker\\Generator::class);\n\n $replys = factory(\\App\\Models\\Reply::class)\n ->times(1000)\n ->make()\n ->each(function ($reply, $index)\n use ($article_ids, $faker)\n {\n // 文章 ID,同上\n $reply->article_id = $faker->randomElement($article_ids);\n });\n\n // 将数据集合转换为数组,并插入到数据库中\n Reply::insert($replys->toArray());\n }", "public function getNumberOfReplies()\n\t{\n\t\t$table = new Zend_Db_Table(array('name'=>PrecurioTableConstants::FORUM_POSTS, 'rowClass'=>'Post'));\n\t\t$select = $table->select(false);\n\t\t\n\t\t$select->setTable($table)->setIntegrityCheck(false);\t\t\t\n\t\t\n\t\t\n\t\t$select = $select->from(array('a' => PrecurioTableConstants::FORUM_POSTS))\n\t\t\t->join(array('b' => PrecurioTableConstants::FORUM_TOPICS), 'b.id = a.topic_id','forum_id')\n\t\t\t->where(\"a.active = 1 AND b.forum_id = {$this->getId()}\")\n\t\t\t->order(\"a.id DESC\");\n\t\t\n\t\n\t\treturn $table->fetchAll($select)->count();\n\t}", "public function threads()\n\t{\n\t\treturn $this->hasMany(Thread::class)->latest();\n\t}", "public function created(Replies $replies)\n {\n $replies->UserCount->IncrementReply();\n }", "public function run()\n {\n Reply::truncate();\n\n $tickets = Ticket::all();\n\n $faker = Faker::create();\n\n Reply::create([\n 'ticket_id' => $tickets[0]->id,\n 'user_id' => 1,\n 'name' => null,\n 'message' => $faker->paragraphs(3, true)\n ]);\n\n Reply::create([\n 'ticket_id' => $tickets[4]->id,\n 'user_id' => 1,\n 'name' => null,\n 'message' => $faker->paragraphs(3, true)\n ]);\n\n Reply::create([\n 'ticket_id' => $tickets[4]->id,\n 'user_id' => null,\n 'name' => $tickets[4]->name,\n 'message' => $faker->paragraphs(3, true)\n ]);\n }", "public function threads()\n {\n return $this->hasMany(Thread::class);\n }", "function manynewposts_thread() {\n global $thread, $templates, $db, $mybb, $settings;\n\n $query = $db->query(\"\n SELECT\n dateline, pid\n FROM \" . TABLE_PREFIX . \"posts\n WHERE\n tid='\".$db->escape_string($thread['tid']).\"'\n \");\n\n $lastpost = array();\n $lastpost_pid = array();\n\n while($result=$db->fetch_array($query))\n {\n $lastpost[] = $result['dateline'];\n $lastpost_pid[$result['dateline']] = $result['pid'];\n }\n\n $query = $db->query(\"\n SELECT\n tr.dateline AS `tr_dateline`,\n fr.dateline AS `fr_dateline`\n FROM \" . TABLE_PREFIX . \"posts p\n LEFT JOIN\n \" . TABLE_PREFIX . \"threadsread tr\n ON\n tr.tid = p.tid\n LEFT JOIN\n \" . TABLE_PREFIX . \"forumsread fr\n ON\n fr.fid = p.fid\n WHERE\n tr.uid='\".$db->escape_string($mybb->user['uid']).\"' and\n fr.uid='\".$db->escape_string($mybb->user['uid']).\"'\n \");\n\n $userlastview = array();\n $userlastview_forum = array();\n\n while($result=$db->fetch_array($query))\n {\n $userlastview[] = $result['tr_dateline'];\n $userlastview_forum[] = $result['fr_dateline'];\n }\n\n $userlastview = (count($userlastview) > 0) ? max($userlastview) : 0;\n $userlastview_forum = (count($userlastview_forum) > 0) ? max($userlastview_forum) : 0;\n\n $timelimit = $userlastview + ($settings['threadreadcut'] * 24 * 60 * 60);\n $newlastpost = array();\n\n if($userlastview && $timelimit > TIME_NOW) {\n foreach ($lastpost as $lastpost_number) {\n if($lastpost_number > $userlastview_forum && $lastpost_number > $userlastview) {\n $newlastpost[] = $lastpost_number;\n }\n }\n }\n\n $count = count($newlastpost);\n\n if($count == 0) return;\n\n $posts = $count == 1 ? 'post':'posts';\n\n $lastseenpost_pid = $lastpost_pid[min($newlastpost)];\n $manynewposts = \"\";\n\n if($mybb->user['uid']) {\n if($count > 0) {\n $manynewposts = $templates->get('manynewposts');\n $manynewposts = str_replace(\"{newposts_link}\", \"./showthread.php?tid=\".$thread['tid'].\"&pid=\".$lastseenpost_pid.\"#pid\".$lastseenpost_pid, $manynewposts);\n $manynewposts = str_replace(\"{newposts}\", $count, $manynewposts);\n $manynewposts = str_replace(\"{posts}\", $posts, $manynewposts);\n }\n }\n $thread['manynewposts'] = $manynewposts;\n}", "public function run()\n {\n $faker = Faker::create();\n Message::unguard();\n Message::truncate();\n Participant::unguard();\n Participant::truncate();\n Thread::unguard();\n Thread::truncate();\n\n foreach(range(1, 10) as $index) {\n $users = collect([1, 2, 3]);\n $creator = $users->pull(rand(0, 2));\n\n $thread = Thread::create([\n 'subject' => $faker->words(rand(4, 8), true),\n ]);\n\n // Message\n Message::create([\n 'thread_id' => $thread->id,\n 'user_id' => $creator,\n 'body' => $faker->paragraph(),\n ]);\n\n // Sender\n Participant::create([\n 'thread_id' => $thread->id,\n 'user_id' => $creator,\n 'last_read' => new Carbon,\n ]);\n\n // Recipients\n $thread->addParticipant($users->take(rand(1, 2))->toArray());\n\n $participants = $thread->participants()->pluck('user_id');\n\n // Participant messages\n foreach(range(1, 10) as $index) {\n Message::create([\n 'thread_id' => $thread->id,\n 'user_id' => $participants->random(),\n 'body' => $faker->paragraph(),\n ]);\n }\n }\n }", "public function getReplies()\r\n{\r\n\t$query_string = \"SELECT replyid, replycontent, replydate, replyauthor FROM replies \";\r\n $query_string .= \"WHERE replytopic = :replytopic\";\r\n\r\n return $query_string;\r\n}", "public function run()\n {\n // User::factory()->count(15)->create();\n Thread::factory()->count(200)->create();\n }", "public function replies()\n {\n return $this->hasMany(Comment::class)->where('comment_id','<>',null);\n }", "public function testMessageThreadsV2GetMessages0()\n {\n }", "public function replies()\n {\n return $this->hasMany('App\\CommentReply', 'comment_id')->orderBy('created_at');\n }", "function threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\n\n\t\t$posts = $this->post->get_latest(get_selected_radix(), $page, array('per_page' => $per_page));\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "public function testMessageThreadsV2Get0()\n {\n }", "private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function run()\n {\n factory(User::class, 10)->create();\n factory(Thread::class, 50)->create()->each(function ($thread){\n for ($i=0; $i<rand(0, 20); $i++) {\n $rand_user = User::inRandomOrder()->first();\n factory(Post::class, 1)->create(\n ['thread_id' => $thread->id, 'user_id' => $rand_user->id]);\n }\n });\n }", "function ghost_threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\t\t$page = intval($page);\n\n\t\t$posts = $this->post->get_latest_ghost(get_selected_radix(), $page, array('per_page' => $per_page));\n\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no comics\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "public function getThreads()\n {\n $user = request()->user();\n\n $messages = $user->threadsWithMessagesWithUsers($user->id)->get();\n\n /**\n * Returns unread messages given the userId.\n */\n //$messages = Message::unreadForUser($user->id)->get();\n\n return ThreadsResource::collection($messages);\n //return response()->json($messages);\n }", "public function run()\n {\n //\n $posts = Post::where('type', '=', 'post')->orWhere('type', '=', 'image')->get();\n $userCount = count(User::all());\n\n foreach ($posts as $post) {\n\n $i = random_int(1, 8);\n\n while($i < 6) {\n $comment = new Reply;\n $faker = Factory::create();\n\n $comment->parent_id = $post->id;\n $comment->title = $faker->catchPhrase();\n $comment->content = $faker->paragraphs(5, true);\n $comment->user_id = random_int(1, $userCount);\n $comment->published_at = now();\n $comment->save();\n $i++;\n\n }\n }\n }", "public function testMessageThreadsV2GetMessages()\n {\n }", "public function subscribeThreads($userid, $threads);", "public function PagedReplies()\n {\n $list = $this->Replies();\n\n // Add pagination\n $list = new PaginatedList($list, Controller::curr()->getRequest());\n $list->setPaginationGetVar('repliesstart' . $this->ID);\n $list->setPageLength($this->getOption('comments_per_page'));\n\n $this->extend('updatePagedReplies', $list);\n return $list;\n }", "public function run()\n {\n for ($i=0; $i < 10; $i++) {\n\n\n $new_message = new Message();\n\n $doctorCount = Doctor::count();\n $new_message->doctor_id = rand(1,$doctorCount);\n\n $new_message->name_user = 'Mimmo'.$i;\n $new_message->surname_user = 'Marelli'.$i;\n $new_message->mail_user = 'mimmomarelli'.$i.'@gmail.com';\n $new_message->message_user = 'lorem ipsum bla bla bla';\n $new_message->save();\n }\n }", "public function run()\n {\n $ticketReply = factory( TicketReply::class, 10)->create();\n }", "public function testMessageThreadsV2Post()\n {\n }", "public function incrementPendingEntriesCount()\n\t{\n\t\t$this->setPendingEntriesCount($this->getPendingEntriesCount() + 1); \n\t\t$this->save();\n\t}", "public function run()\n {\n $tickets = Ticket::all();\n\n foreach ($tickets as $ticket) {\n foreach ($ticket->relaters as $relater) {\n $ticket->unreaders()->attach($relater);\n }\n $ticket->unreaders()->attach($ticket->assignee);\n $ticket->unreaders()->attach($ticket->creator);\n }\n }", "public function fetchPostsAndReplies() {\n $id = $this->instance->network_user_id;\n $network = $this->instance->network;\n\n // fetch user's friends\n $this->storeFriends();\n\n $fetch_next_page = true;\n $current_page_number = 1;\n $posts = InstagramGraphAPIAccessor::apiRequest('media', $id, $this->access_token, array('count' => 20));\n\n //Cap crawl time for very busy pages with thousands of likes/comments\n $fetch_stop_time = time() + $this->max_crawl_time;\n\n //Determine 'since', datetime of oldest post in datastore\n $post_dao = DAOFactory::getDAO('PostDAO');\n $since_post = $post_dao->getAllPosts($id, $network, 1, 1, true, 'pub_date', 'ASC');\n $since = isset($since_post[0])?$since_post[0]->pub_date:0;\n $since = strtotime($since) - (60 * 60 * 24); // last post minus one day, just to be safe\n ($since < 0)?$since=0:$since=$since;\n\n while ($fetch_next_page) {\n if ($posts->count() > 0) {\n $this->logger->logInfo(sizeof($stream->data).\" instagram posts found on page \".$current_page_number,\n __METHOD__.','.__LINE__);\n\n $this->processPosts($posts, $network, $current_page_number);\n\n if ($posts->getNext() != null) {\n $posts = InstagramGraphAPIAccessor::apiRequest('media', $id, $this->access_token, array('count' => 20, 'max_id' => $posts->getNext()));\n $current_page_number++;\n } else {\n $fetch_next_page = false;\n }\n } else {\n $this->logger->logInfo(\"No instagram posts found for ID $id\", __METHOD__.','.__LINE__);\n $fetch_next_page = false;\n }\n if (time() > $fetch_stop_time) {\n $fetch_next_page = false;\n $this->logger->logUserInfo(\"Stopping this service user's crawl because it has exceeded max time of \".\n ($this->max_crawl_time/60).\" minute(s). \",__METHOD__.','.__LINE__);\n }\n }\n }", "public function testMessageThreadsV2Get()\n {\n }", "public function test_can_see_threads_or_replies_created_by_one_user_on_his_profile_with_latest_first()\n {\n // And there's 3 threads created by him\n // When i access his profile\n // Then i can see those 3 threads in order from latest to oldest\n $user = create(User::class);\n $this->signIn($user);\n\n $item1 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::parse('3 days ago')\n ]);\n\n $item2 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDay()\n ]);\n\n $item3 = $this->createWithActivity(Reply::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDays(2),\n 'thread_id' => $item1->id\n ]);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeTextInOrder([\n $item2->title,\n $item3->body,\n $item1->title,\n ]);\n }", "public function getReplyPost();", "public function an_authenticated_user_may_participate_in_a_thread(){\n //Given we have an authenticated user\n //$user = factory('App\\User')->create();\n $this->be($user = factory('App\\User')->create());\n //And an existing thread\n $thread = factory('App\\Thread')->create();\n\n //When the user adds a reply to the thread\n $reply = factory('App\\Reply')->make();\n\n $this->post($thread->path().'/replies', $reply->toArray());\n\n //then their reply should be visible on the page\n $this->get($thread->path())->\n assertSee($reply->body);\n }", "public function subscribeThread(ThreadRepositoryInterface $thread): PodiumResponse;", "public function getReplies()\n {\n return Controllers\\RepliesController::getInstance();\n }", "public function threads()\n {\n return $this->morphedByMany('App\\Thread', 'taggable');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n Factory('App\\Thread', 50)->create();\n $thread = \\App\\Thread::all()->last();\n Factory('App\\Reply', 30)->create(['thread_id' => $thread->id]);\n }", "public function getAllRepliesById($postingUser, $ID) {\n $sqlQuery = \"select r.replyID, r.replyMessage, r.replyDate, r.replyFrom, r.replyTo, r.postID,\n p.title, p.message, u.firstName, u.lastName, u.photo\n from laf873.replies r\n inner join laf873.posts p on r.postID = p.ID\n inner join laf873.users u on u.userID = r.replyFrom\n where r.replyTo = '{$postingUser}'\n and p.ID = '{$ID}'\n order by r.replyDate asc\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n\n $replies = [];\n while ($row = $statement->fetch()) {\n $replies[] = new ReplyDisplay($row);\n }\n return $replies;\n }", "public function unauthenticated_users_may_not_add_replies() {\n \t$this->expectException('Illuminate\\Auth\\AuthenticationException');\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post('threads/some-channel/1/replies', $reply->toArray());\n }", "public function generate($totalElements)\n\t{\n\t\t$this->initialize();\n\n\t\t$db = XenForo_Application::getDb();\n\t\t$sql = \"\n\t\t\tSELECT * FROM xf_thread thread\n\t\t\tWHERE\n\t\t\t\tthread_id > ? AND\n\t\t\t\tdiscussion_state = 'visible' AND\n\t\t\t\tdiscussion_type <> 'redirect'\n\t\t\tORDER\n\t\t\t\tBY thread.thread_id\n\t\t\t\";\n\t\t$st = new Zend_Db_Statement_Mysqli($db, $sql);\n\t\t$st->execute( array( $this->lastId ) );\n\n\t\t$totalPages = 0;\n\t\twhile ($data = $st->fetch())\n\t\t{\n\t\t\t$this->lastId = $data['thread_id'];\n\t\t\tif (!$this->canView($data))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$totalPages = $this->getTotalpages($data['thread_id']);\n\t\t\tif ($totalPages < 2)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\twhile ($this->lastPage <= $totalPages)\n\t\t\t{\n\t\t\t\t$params = array( 'page' => $this->lastPage, );\n\t\t\t\t$url = XenForo_Link::buildPublicLink('canonical:threads', $data, $params);\n\t\t\t\t$this->addUrl($url, $data['post_date']);\n\n\t\t\t\t$this->lastPage++;\n\n\t\t\t\t$totalElements--;\n\t\t\t\tif ($totalElements <= 0)\n\t\t\t\t{\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->lastPage = 2;\n\t\t}\n\n\t\t$this->isFinished = !$st->fetch() && $this->lastPage > $totalPages;\n\t\t$st->closeCursor();\n\t}", "function thread_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif (!$this->get('num'))\n\t\t{\n\t\t\t$this->response(array('error' => __(\"You are missing the 'num' parameter.\")), 404);\n\t\t}\n\n\t\tif (!is_natural($this->get('num')))\n\t\t{\n\t\t\t$this->response(array('error' => __(\"Invalid value for 'num'.\")), 404);\n\t\t}\n\n\t\t$num = intval($this->get('num'));\n\n\t\t$from_realtime = FALSE;\n\n\t\t// build an array if we have more specifications\n\t\tif ($this->get('latest_doc_id'))\n\t\t{\n\t\t\tif (!is_natural($this->get('latest_doc_id')) && $this->get('latest_doc_id') < 0)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"The value for 'latest_doc_id' is malformed.\")), 404);\n\t\t\t}\n\n\t\t\t$latest_doc_id = intval($this->get('latest_doc_id'));\n\t\t\t$from_realtime = TRUE;\n\n\t\t\t$thread = $this->post->get_thread(\n\t\t\t\tget_selected_radix(), $num,\n\t\t\t\tarray('realtime' => TRUE, 'type' => 'from_doc_id', 'type_extra' => array('latest_doc_id' => $latest_doc_id))\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$thread = $this->post->get_thread(\n\t\t\t\tget_selected_radix(), $num, array()\n\t\t\t);\n\t\t}\n\n\t\tif ($thread !== FALSE)\n\t\t{\n\t\t\t$this->response($thread['result'], 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($from_realtime)\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response[$num['num']] = array('posts' => array());\n\t\t\t\t$this->response($response, 200);\n\t\t\t}\n\n\t\t\t$this->response(array('error' => __('Thread could not be found.')), 200);\n\t\t}\n\t}", "public function clearReplyTos()\n {\n }", "public function getNewestThreads() {\n $topic_1 = 4; // Đánh giá phần mềm\n $topic_2 = 8; // Games Online\n $topic_3 = 10; // Thể Thao\n $limit = 5;\n\n $data = [];\n $data[$topic_1]['name'] = 'Đánh giá phần mềm';\n $data[$topic_2]['name'] = 'Games Online';\n $data[$topic_3]['name'] = 'Thể Thao';\n\n $threadModel = new thread_model();\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_1}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_1]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_2}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_2]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n $result = $threadModel->excute(\"\n SELECT * FROM threads WHERE topic_id = {$topic_3}\n ORDER BY id DESC LIMIT {$limit} OFFSET 0\n \");\n while ($row = $result->fetch_assoc()) {\n $data[$topic_3]['threads'][] = ['id' => $row['id'], 'title' => $row['title']];\n }\n\n return $data;\n }", "public function index()\n {\n return ReplyResource::collection(Reply::latest()->paginate(200));\n }", "public function publishThread($attributes)\n\t{\n\t\treturn $this->threads()->create($attributes);\n\t}", "public function testMessageThreadsV2ReplyToMessage()\n {\n }", "function get_total_replies(){\n global $db;\n $query = 'SELECT count(*) FROM replies';\n $statement = $db->prepare($query);\n $statement->execute();\n $total_replies = $statement->fetchAll();\n $total_replies = $statement->rowCount();\n $statement->closeCursor();\n return $total_replies;\n }", "function creationQuestionnaire()\n{ \n\n $question;\n $reponse;\n \n $requeteCategorie = requeteServeur::requeteMysql(\"SELECT * FROM categorie\");\n $categorie = new Categorie($requeteCategorie);\n //echo \"<pre>\".print_r($categorie,true).\"</pre>\";\n \n $requeteQuestion = requeteServeur::requeteMysql(\"SELECT * FROM question\");\n //echo \"<pre>\".print_r($requeteQuestion,true).\"</pre>\";\n //$question = new Question($requeteQuestion, 3);\n //echo \"<pre>\".print_r($question,true).\"</pre>\";\n \n $requeteReponse = requeteServeur::requeteMysql(\"SELECT * FROM reponse\");\n //$reponse = new Reponse($requeteReponse, 17);\n \n /*separer les reponses*/\n for ($i = 1; $i <= $requeteQuestion->num_rows; $i++)\n {\n $reponse[$i] = new Reponse($requeteReponse, $i); \n }\n \n //echo \"<pre>\".print_r($reponse[1],true).\"</pre>\";\n \n \n //echo $requeteCategorie->num_rows;\n\n /*Va creez les question et leur inserez les reponse approprie*/\n for ($i = 1; $i <= $requeteCategorie->num_rows; $i++)\n {\n $question[$i] = new Question($requeteQuestion, $i);\n /*Utilise un foreach pour sortir la valeur des Id*/\n foreach($question[$i]->getId() as $test )\n {\n //echo $test.\"</br>\";\n $question[$i]->setReponse($test, $reponse[$test]);\n }\n } \n \n //echo \"<pre>\".print_r(count($question[2]->getId()),true).\"</pre>\";\n\n for($i = 1; $i <= $requeteCategorie->num_rows; $i++)\n {\n $categorie->setQuestion($i , $question[$i]);\n }\n \n //echo \"<pre>\".print_r($categorie,true).\"</pre>\";\n \n /*Zone Test*/\n /*\n echo \"QUESTION1<br/>\";\n echo \"<pre>\".print_r($question[1],true).\"</pre>\"; \n echo \"QUESTION2<br/>\";\n echo \"<pre>\".print_r($question[2],true).\"</pre>\";\n echo \"QUESTION3<br/>\";\n echo \"<pre>\".print_r($question[3],true).\"</pre>\";\n //selectionner les element creux dans questionnaire\n //echo \"<pre>\".print_r($question[3]->getReponse()[7],true).\"</pre>\";\n */\n \n /*retourne objet*/\n return '$categorie';\n}", "public function index()\n {\n\n $threads = Thread::forUser(Auth::id())->with([\n 'users' => function ($query) {\n $query->select('avatar', 'name', 'agent_name');\n },\n 'messages' => function ($query) {\n $query->latest()->first();\n },\n ])\n ->groupBy('threads.id')\n ->latest('updated_at')\n ->paginate();\n\n $threads->getCollection()->transform(function ($value) {\n $value->isUnread = $value->isUnread(Auth::id());\n\n return $value;\n });\n\n\n return response()->json($threads);\n }", "public function run()\n {\n Notification::truncate();\n\n for ($i = 0; $i < 10; $i++){\n Notification::create([\n 'response_status' => rand(0, 1),\n 'user_id' => rand(1, 10),\n 'idea_id' => rand(1, 10),\n ]);\n }\n }", "public static function checkVisibilityAll($threadIDs, $reason = '') {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t$emptyThreads = '';\n\t\t$trashedThreads = '';\n\t\t$hiddenThreads = '';\n\t\t$enabledThreads = '';\n\t\t$restoresThreads = '';\n\t\t$sql = \"SELECT\t\tCOUNT(post.postID) AS posts,\n\t\t\t\t\tSUM(post.isDeleted) AS deletedPosts,\n\t\t\t\t\tSUM(post.isDisabled) AS hiddenPosts,\n\t\t\t\t\tthread.threadID, thread.isDeleted, thread.isDisabled\n\t\t\tFROM \t\twbb\".WBB_N.\"_thread thread\n\t\t\tLEFT JOIN \twbb\".WBB_N.\"_post post\n\t\t\tON \t\t(post.threadID = thread.threadID)\n\t\t\tWHERE \t\tthread.threadID IN (\".$threadIDs.\")\n\t\t\tGROUP BY \tthread.threadID\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$row['deletedPosts'] = intval($row['deletedPosts']);\n\t\t\t$row['hiddenPosts'] = intval($row['hiddenPosts']);\n\t\t\t\n\t\t\t// thread has no posts\n\t\t\t// delete thread\n\t\t\tif ($row['posts'] == 0) {\n\t\t\t\tif (!empty($emptyThreads)) $emptyThreads .= ',';\n\t\t\t\t$emptyThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are into the recylce bin\n\t\t\t// move thread also into the recylce bin \n\t\t\telse if ($row['posts'] == $row['deletedPosts']) {\n\t\t\t\tif (!empty($trashedThreads)) $trashedThreads .= ',';\n\t\t\t\t$trashedThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are hidden\n\t\t\t// hide thread also\n\t\t\telse if ($row['posts'] == $row['hiddenPosts'] || $row['posts'] == $row['hiddenPosts'] + $row['deletedPosts']) {\n\t\t\t\tif (!empty($hiddenThreads)) $hiddenThreads .= ',';\n\t\t\t\t$hiddenThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is deleted, but no posts are deleted\n\t\t\t// restore thread\n\t\t\telse if (intval($row['deletedPosts']) == 0 && $row['isDeleted'] == 1) {\n\t\t\t\tif (!empty($restoresThreads)) $restoresThreads .= ',';\n\t\t\t\t$restoresThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is hidden, but no posts are hidden\n\t\t\t// enable thread\n\t\t\telse if (intval($row['hiddenPosts']) == 0 && $row['isDisabled'] == 1) {\n\t\t\t\tif (!empty($enabledThreads)) $enabledThreads .= ',';\n\t\t\t\t$enabledThreads .= $row['threadID'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tself::deleteAllCompletely($emptyThreads, false, false);\n\t\tself::trashAll($trashedThreads, false, $reason);\n\t\tself::disableAll($hiddenThreads, false);\n\t\tself::restoreAll($restoresThreads, false);\n\t\tself::enableAll($enabledThreads, false);\n\t}", "public function replies()\n {\n return $this->hasMany('App\\Comment', 'parent_id');\n }", "public function run()\n {\n //reseting the posts table by truncate method\n DB::table('replies')->truncate();\n //inserting data\n $replies=[];\n\n $faker=Faker\\factory::create();\n for($i=0;$i<500;$i++){\n $image='Post_image_'.rand(1,5).'.jpg';\n $date=date('Y-m-d H:m:s',strtotime(\"2018-12-17 06:00:00 + {$i} days\"));\n $replies[]=[\n\n \"text\"\t\t\t=>$faker->sentence(rand(8,12)),\n \"comment_id\"\t=>rand(1,100),\n \"author_id\" =>rand(1,5),\n \"created_at\" =>$date\n ];\n }\n DB::table('replies')->insert($replies);\n\n }", "public function test_reply_depth_limit_can_be_reached() {\n\n $limit = (int) getenv('message_reply_limit');\n for ($i = 1; $i <= $limit + 1; $i++) {\n if ($i + 1 == $limit) {\n $this->expectException(ReplyDepthException::class);\n }\n $this->message = Message::create(\n 'a thoughtful response',\n $this->user,\n $this->message\n );\n $this->assertMessageCount($i + 1); // Replies + root message\n }\n\n }", "private function calculateThreadSummary(): void {\n\t\tif ( $this->authors !== null ) {\n\t\t\treturn;\n\t\t}\n\t\t$authors = [];\n\t\t$commentCount = 0;\n\t\t$oldestReply = null;\n\t\t$latestReply = null;\n\t\t$threadScan = static function ( ContentThreadItem $comment ) use (\n\t\t\t&$authors, &$commentCount, &$oldestReply, &$latestReply, &$threadScan\n\t\t) {\n\t\t\tif ( $comment instanceof ContentCommentItem ) {\n\t\t\t\t$author = $comment->getAuthor();\n\t\t\t\tif ( !isset( $authors[ $author] ) ) {\n\t\t\t\t\t$authors[ $author ] = [\n\t\t\t\t\t\t'username' => $author,\n\t\t\t\t\t\t'displayNames' => [],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\t$displayName = $comment->getDisplayName();\n\t\t\t\tif ( $displayName && !in_array( $displayName, $authors[ $author ][ 'displayNames' ], true ) ) {\n\t\t\t\t\t$authors[ $author ][ 'displayNames' ][] = $displayName;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t!$oldestReply ||\n\t\t\t\t\t( $comment->getTimestamp() < $oldestReply->getTimestamp() )\n\t\t\t\t) {\n\t\t\t\t\t$oldestReply = $comment;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t!$latestReply ||\n\t\t\t\t\t( $latestReply->getTimestamp() < $comment->getTimestamp() )\n\t\t\t\t) {\n\t\t\t\t\t$latestReply = $comment;\n\t\t\t\t}\n\t\t\t\t$commentCount++;\n\t\t\t}\n\t\t\t// Get the set of authors in the same format from each reply\n\t\t\t$replies = $comment->getReplies();\n\t\t\tarray_walk( $replies, $threadScan );\n\t\t};\n\t\t$replies = $this->getReplies();\n\t\tarray_walk( $replies, $threadScan );\n\n\t\tksort( $authors );\n\n\t\t$this->authors = array_values( $authors );\n\t\t$this->commentCount = $commentCount;\n\t\t$this->oldestReply = $oldestReply;\n\t\t$this->latestReply = $latestReply;\n\t}", "public function getReplyCount() : int\n {\n return $this->replyCount;\n }", "public function testMultipleClients()\n {\n self::$mediumString = TestHelper::makeBigString(2);\n\n $this->assertEquals(self::$multiple, $this->query(['method' => 'resetMultiple']));\n $parallel = 50;\n\n for ($i = 0; $i < $parallel; ++$i) {\n self::newRemoteClient('computeMD5AndSleep');\n }\n\n static::waitForRemoteClientsToExit();\n\n $multiple = $this->query(['method' => 'getMultiple']);\n $this->assertEquals($parallel, $multiple['connections']);\n $this->assertEquals($parallel, $multiple['maxSimultaneousConnections']);\n $this->assertEquals($parallel, $multiple['md5ok']);\n }", "public function declineAllPendingThreads()\n {\n return $this->ig->request('direct_v2/threads/decline_all/')\n ->addPost('_csrftoken', $this->ig->client->getToken())\n ->addPost('_uuid', $this->ig->uuid)\n ->setSignedPost(false)\n ->getResponse(new Response\\GenericResponse());\n }" ]
[ "0.64374167", "0.6035146", "0.5808367", "0.5688937", "0.56665915", "0.56487554", "0.5621256", "0.5589422", "0.5586703", "0.55833626", "0.5571694", "0.5558367", "0.55336", "0.55266285", "0.55135196", "0.5494771", "0.54862475", "0.5481228", "0.54628724", "0.5453215", "0.54478115", "0.54478055", "0.5427165", "0.54208535", "0.53905916", "0.5381995", "0.537606", "0.5371902", "0.5352233", "0.5352233", "0.53440297", "0.5341963", "0.5340664", "0.5333488", "0.5319944", "0.53026026", "0.5287635", "0.52518374", "0.52455115", "0.5240648", "0.52366304", "0.5202917", "0.5193204", "0.5181277", "0.517466", "0.51650184", "0.5159003", "0.51410073", "0.51380104", "0.513576", "0.5134156", "0.5127959", "0.51230085", "0.51130843", "0.50990236", "0.5095762", "0.50858104", "0.5070046", "0.5052391", "0.5051848", "0.5036521", "0.5019354", "0.5015943", "0.5012124", "0.5006371", "0.50036114", "0.49918577", "0.4972778", "0.49665776", "0.4964974", "0.49552262", "0.49452382", "0.4931454", "0.49205166", "0.4902768", "0.48922795", "0.48769188", "0.48600695", "0.48594797", "0.48526448", "0.48371682", "0.4833067", "0.48302752", "0.48269343", "0.48206747", "0.48119715", "0.4811468", "0.48080283", "0.48021132", "0.4781434", "0.47707817", "0.4768829", "0.4768231", "0.47670966", "0.47653076", "0.47578982", "0.47572377", "0.4753401", "0.47501528", "0.4726588" ]
0.52611244
37
Threads optionally have a latest reply.
public function latestReply() { return $this->hasOne('App\Models\Reply', 'id', 'latest_reply_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastReply()\n {\n }", "public function last_reply()\n\t{\n\t\treturn isset($this->last_reply) ? $this->last_reply : FALSE;\n\t}", "function thereply() {\n\tglobal $replies_index, $reply, $replies;\n\n\t$reply = $replies[$replies_index - 1];\n\treturn $reply;\n}", "public function getLatestReply(): ?ContentCommentItem {\n\t\t$this->calculateThreadSummary();\n\t\treturn $this->latestReply;\n\t}", "public function pollLast();", "public function hasNewReplies($thread)\n {\n if (!auth()->check()) return false;\n\n $view = $thread->viewedBy()->where('user_id', auth()->user()->id)->first();\n\n if (!$view) {\n $reply = $thread->replies()->first();\n\n return $reply !== null ? fractal()\n ->item($reply)\n ->transformWith(new ReplyTransformer()) : true;\n } else if ($thread->latest_reply_at <= $view->pivot->timestamp) {\n return false;\n } else {\n $reply = $thread->replies()->where('created_at', '>=', $view->pivot->timestamp)->first();\n\n return $reply !== null ?\n fractal()\n ->item($reply)\n ->transformWith(new ReplyTransformer()) : true;\n }\n }", "public function lastReply()\n\t{\n\t\treturn $this->hasOne(Reply::class)->latest();\n\t}", "public function test_can_see_threads_or_replies_created_by_one_user_on_his_profile_with_latest_first()\n {\n // And there's 3 threads created by him\n // When i access his profile\n // Then i can see those 3 threads in order from latest to oldest\n $user = create(User::class);\n $this->signIn($user);\n\n $item1 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::parse('3 days ago')\n ]);\n\n $item2 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDay()\n ]);\n\n $item3 = $this->createWithActivity(Reply::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDays(2),\n 'thread_id' => $item1->id\n ]);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeTextInOrder([\n $item2->title,\n $item3->body,\n $item1->title,\n ]);\n }", "public function getLastReply()\n {\n return $this->last_reply;\n }", "public function lastReply(){\n \n return $this->hasOne(Reply::class)->latest();\n \n }", "public function lastReply()\n {\n return $this->hasOne('App\\Reply')->latest();\n }", "public function getLatestThread() {\n\t\t$latestThread = FALSE;\n\t\tif ($this->threads->count()) {\n\t\t\t$threads = $this->threads->toArray();\n\t\t\t$latestThread = $threads[$this->threads->count() - 1];\n\t\t}\n\n\t\treturn $latestThread;\n\t}", "public function reply($user, Thread $thread)\n {\n return !$thread->locked;\n }", "public function getOldestReply(): ?ContentCommentItem {\n\t\t$this->calculateThreadSummary();\n\t\treturn $this->oldestReply;\n\t}", "private function isLastReplyLessThenNeedle($lastreply): bool\n\t{\n\t\t$pastDays = Carbon::now()->subDays($this->getExtDays());\n\t\t$lastreply_parse = Carbon::parse($lastreply);\n\t\treturn $lastreply_parse->lt($pastDays);\n\t}", "function have_replies() {\n\tglobal $replies_index, $reply, $replies, $replies_count, $discussion_title;\n\n\t$replies_count = count(get_replies($discussion_title));\n\t$replies = get_replies($discussion_title);\n\n\tif ($replies && $replies_index + 1 <= $replies_count) {\n\t\t$replies_index++;\n\t\treturn true;\n\t} else {\n\t\t$replies_count = 0;\n\t\treturn false;\n\t}\n}", "public function poll($last_timestamp, $last_list_timestamp) {\n\n\t\t//we do not rely on $last_timestamp sent from the client - if not sent (or sent old value) we will return many messages, potential security problem (dos atack)\n\t\tif ($last_timestamp < strtotime(POLL_MAX_HISTORY)) {\n\t\t\t$last_timestamp = strtotime(POLL_MAX_HISTORY);\n\t\t}\n\n\t\t$max_time = POLL_MAX_REQUEST_TIME;\n\t\t$sleep_time = 2;\n\t\t$start = time();\n\n\t\t$counter = 0;\n\n\t\tdo {\n\t\t\t$data = array('timestamp' => time());\n\n\t\t\t$counter++;\n\n\t\t\t//extend execution time to keep the http request alive longer in case there are no data\n\t\t\tini_set('max_execution_time', $max_time);\n\n\t\t\t/*if ($last_list_timestamp < strtotime(POLL_CHAT_REFRESH)) {\t//fetch new users\n\t\t\t\t$users = $this->get_delta_members($last_list_timestamp);\n\t\t\t\tif (!empty($users)) {\n\t\t\t\t\t$data['users'] = $users;\n\t\t\t\t}\n\t\t\t}*/\n\n\t\t\t$last_message = ChatCache::read($this->member_big.'_last_msg');\n\t\t\tif ($last_timestamp < $last_message) {\t//fetch messages\n\t\t\t\t$data['msgs'] = $this->get_new_messages($last_timestamp);\n\t\t\t}\n\n\t\t\tif (count($data) > 1) {\t//output data, if there are any other than timestamp\n\t\t\t\t$this->reply($data);\n\t\t\t} elseif (time() > $start+$max_time) {\n\t\t\t\t$this->reply(null);\t//, array('success' => 'No new messages or other data. Request took '.(time()-$start).' seconds and we checked for new messages '.$counter.' times'));\n\t\t\t}\n\n\t\t\tsleep($sleep_time);\n\n\t\t} while(true);\n\n\t}", "public function reply()\n\t{\n\n\t\t$reply = $this->store('reply', '/threads?id=_id_#form-reply');\n\n\t\t(new Thread)->updateTotalReplies($reply->parent_id);\n\n\t\tredirect('/threads?id=' . $reply->parent_id . '#reply-id' . $reply->id);\n\t\n\t}", "function the_ticket_replies() {\n\n // Get ticket's replies\n $replies = md_the_component_variable('support_single_ticket_replies');\n\n // Verify if ticket has replies\n if ( $replies ) {\n return $replies;\n } else {\n return false;\n }\n \n }", "function thread_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif (!$this->get('num'))\n\t\t{\n\t\t\t$this->response(array('error' => __(\"You are missing the 'num' parameter.\")), 404);\n\t\t}\n\n\t\tif (!is_natural($this->get('num')))\n\t\t{\n\t\t\t$this->response(array('error' => __(\"Invalid value for 'num'.\")), 404);\n\t\t}\n\n\t\t$num = intval($this->get('num'));\n\n\t\t$from_realtime = FALSE;\n\n\t\t// build an array if we have more specifications\n\t\tif ($this->get('latest_doc_id'))\n\t\t{\n\t\t\tif (!is_natural($this->get('latest_doc_id')) && $this->get('latest_doc_id') < 0)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"The value for 'latest_doc_id' is malformed.\")), 404);\n\t\t\t}\n\n\t\t\t$latest_doc_id = intval($this->get('latest_doc_id'));\n\t\t\t$from_realtime = TRUE;\n\n\t\t\t$thread = $this->post->get_thread(\n\t\t\t\tget_selected_radix(), $num,\n\t\t\t\tarray('realtime' => TRUE, 'type' => 'from_doc_id', 'type_extra' => array('latest_doc_id' => $latest_doc_id))\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$thread = $this->post->get_thread(\n\t\t\t\tget_selected_radix(), $num, array()\n\t\t\t);\n\t\t}\n\n\t\tif ($thread !== FALSE)\n\t\t{\n\t\t\t$this->response($thread['result'], 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($from_realtime)\n\t\t\t{\n\t\t\t\t$response = array();\n\t\t\t\t$response[$num['num']] = array('posts' => array());\n\t\t\t\t$this->response($response, 200);\n\t\t\t}\n\n\t\t\t$this->response(array('error' => __('Thread could not be found.')), 200);\n\t\t}\n\t}", "public function pollFirst();", "public function hasNewReplies($channel)\n {\n if (!auth()->check() || !$channel->threads()->count()) return false;\n\n $view = $channel->viewedBy()->where('users.id', auth()->user()->id)->get();\n\n if (\n $view->count() === 0 || $view->count() !== $channel->threads()->count()\n ) return true;\n\n $result = $view->search(function ($item) {\n return $item->viewed_thread->timestamp < $item->viewed_thread->thread->latest_reply_at;\n });\n\n return $result !== false;\n }", "public function getRecentReplies($id, $number=10 ){\n return Reply::where('user_id',$id)->orderBy('created_at','desc')\n ->whereHas('topic.category',function($q){\n $q->where('is_blocked','no');\n })->take($number)->get();\n }", "public function getReplyPost();", "function manynewposts_thread() {\n global $thread, $templates, $db, $mybb, $settings;\n\n $query = $db->query(\"\n SELECT\n dateline, pid\n FROM \" . TABLE_PREFIX . \"posts\n WHERE\n tid='\".$db->escape_string($thread['tid']).\"'\n \");\n\n $lastpost = array();\n $lastpost_pid = array();\n\n while($result=$db->fetch_array($query))\n {\n $lastpost[] = $result['dateline'];\n $lastpost_pid[$result['dateline']] = $result['pid'];\n }\n\n $query = $db->query(\"\n SELECT\n tr.dateline AS `tr_dateline`,\n fr.dateline AS `fr_dateline`\n FROM \" . TABLE_PREFIX . \"posts p\n LEFT JOIN\n \" . TABLE_PREFIX . \"threadsread tr\n ON\n tr.tid = p.tid\n LEFT JOIN\n \" . TABLE_PREFIX . \"forumsread fr\n ON\n fr.fid = p.fid\n WHERE\n tr.uid='\".$db->escape_string($mybb->user['uid']).\"' and\n fr.uid='\".$db->escape_string($mybb->user['uid']).\"'\n \");\n\n $userlastview = array();\n $userlastview_forum = array();\n\n while($result=$db->fetch_array($query))\n {\n $userlastview[] = $result['tr_dateline'];\n $userlastview_forum[] = $result['fr_dateline'];\n }\n\n $userlastview = (count($userlastview) > 0) ? max($userlastview) : 0;\n $userlastview_forum = (count($userlastview_forum) > 0) ? max($userlastview_forum) : 0;\n\n $timelimit = $userlastview + ($settings['threadreadcut'] * 24 * 60 * 60);\n $newlastpost = array();\n\n if($userlastview && $timelimit > TIME_NOW) {\n foreach ($lastpost as $lastpost_number) {\n if($lastpost_number > $userlastview_forum && $lastpost_number > $userlastview) {\n $newlastpost[] = $lastpost_number;\n }\n }\n }\n\n $count = count($newlastpost);\n\n if($count == 0) return;\n\n $posts = $count == 1 ? 'post':'posts';\n\n $lastseenpost_pid = $lastpost_pid[min($newlastpost)];\n $manynewposts = \"\";\n\n if($mybb->user['uid']) {\n if($count > 0) {\n $manynewposts = $templates->get('manynewposts');\n $manynewposts = str_replace(\"{newposts_link}\", \"./showthread.php?tid=\".$thread['tid'].\"&pid=\".$lastseenpost_pid.\"#pid\".$lastseenpost_pid, $manynewposts);\n $manynewposts = str_replace(\"{newposts}\", $count, $manynewposts);\n $manynewposts = str_replace(\"{posts}\", $posts, $manynewposts);\n }\n }\n $thread['manynewposts'] = $manynewposts;\n}", "public function sendReplyEnd()\n {\n }", "public function poll()\n {\n return false;\n }", "public function threadsWithNewMessages()\n {\n $threadsWithNewMessages = [];\n $participants = Participant::where('user_id', $this->id)->lists('last_read', 'thread_id');\n\n /**\n * @todo: see if we can fix this more in the future.\n * Illuminate\\Foundation is not available through composer, only in laravel/framework which\n * I don't want to include as a dependency for this package...it's overkill. So let's\n * exclude this check in the testing environment.\n */\n if (getenv('APP_ENV') == 'testing' || !str_contains(\\Illuminate\\Foundation\\Application::VERSION, '5.0')) {\n $participants = $participants->all();\n }\n\n if ($participants) {\n $threads = Thread::whereIn('id', array_keys($participants))->get();\n\n foreach ($threads as $thread) {\n if ($thread->updated_at > $participants[$thread->id]) {\n $threadsWithNewMessages[] = $thread->id;\n }\n }\n }\n\n return $threadsWithNewMessages;\n }", "function ppmess_get_last_message($post_id, $logged_user, $user2){\n\t\n\tglobal $wpdb;\n\t\n\t$query = \"SELECT * FROM {$wpdb->prefix}private_messages WHERE post_id = $post_id AND ( ( receiver_id = $logged_user AND sender_id = $user2 ) OR (receiver_id = $user2 AND sender_id = $logged_user) ) ORDER BY date_created DESC LIMIT 1\";\n\t\t\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif($wpdb->num_rows == 1)\n\t\treturn $result[0];\n\telse \n\t\treturn FALSE;\n}", "public function testSelfReply()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function show_total_reply() {\n return false;\n }", "function checkforLast() {\n\t\t$sql = \"SELECT Count(*)AS count FROM Task WHERE isRated=0 AND CampaignId=\" . $this -> id;\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$stmt = $stmt -> fetch();\n\t\t\tif ($stmt['count'] == 0) {\n\t\t\t\t//if it is the last campaign gets updated\n\t\t\t\t$this -> updateCampaign();\n\t\t\t}\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to get number of notRated Tasks.', $this -> id);\n\t\t}\n\n\t}", "abstract public function fetchLatest($timestamp = null);", "public function waitDraft()\n {\n\n if(!isset($_SESSION['id_user']) || !isset($_SESSION['id_league']))\n {\n header('Location: index.php?rt=teams');\n exit();\n }\n\n if(!isset($_POST['lastAccess']))\n sendErrorAndExit('lastAccess is not set.');\n\n $lastAccess = (int)$_POST['lastAccess'];\n\n $message['lastAccess'] = $lastAccess;\n //usleep(5000000);\n //sendJSONandExit($message);\n\n\n // while( 1 )\n // {\n // // zelimo samo za tu ligu\n $fst = new FantasyServiceTeams();\n $maxLastModified = $fst->getLastModified($_SESSION['id_league']);\n\n $timestamp = strtotime($maxLastModified);\n // echo \"timestamp = \".$timestamp.\"<br>\";\n //\n if($timestamp > $lastAccess)\n {\n $allSelected = $fst->getAllSelectedPlayersInLeague($_SESSION['id_league']);\n // $message['allSelected'] = $allSelected;\n\n $message = [];\n $new_na_redu = $fst->getMinimalCurrentUser($_SESSION['id_league']);\n\n $message['lastAccess'] = $timestamp;\n $message['na_redu'] = $new_na_redu->username;\n $message['allSelected'] = [];\n\n foreach($allSelected as $as)\n {\n $message['allSelected'][] = array('id' => $as->id,\n 'name' => $as->name, 'position' => $as->position);\n }\n\n sendJSONandExit( $message );\n\n\n }\n\n\n usleep(5000000); //5sec\n //\n // }\n\n }", "public function waiting_requester(){\n\n }", "function selectReplyList($boardNum) {\n try {\n // 01) get connection\n $dbInfo = new DBInfo();\n $con = $dbInfo->getConnection();\n\n // 02) set variable\n $result = array();\n $replyList = array();\n\n // 03) get reply list\n // 03-1) set SQL\n $sql = \"SELECT r.reply_id, r.reply_pid, u.user_name, r.content, DATE_FORMAT(r.write_time, '%Y-%m-%d %H:%i:%s') AS 'write_time', r.board_id\n FROM {$dbInfo->getReplyTable()} r\n JOIN {$dbInfo->getUserInfoTable()} u\n ON(r.writer = u.id)\n WHERE r.board_id = {$boardNum}\";\n\n // 03-2) act SQL query\n if(!($queryResult = $con->query($sql))) {\n throw new Exception('false_selectReplyList_firstQuery');\n }\n\n // 03-3) make reply object at query result\n while($row = $queryResult->fetch_assoc()) {\n $replyObj = new Reply($row['reply_pid'], $row['user_name'], $row['content'],\n $row['write_time'], $row['board_id']);\n $replyObj->setId($row['reply_id']);\n $replyObj->setModifyRight($this->selectModifyRight(true, $row['reply_id']));\n\n array_push($replyList, $replyObj->toArray());\n }\n\n // 04) get number of replies\n // 04-1) set sql\n $sql = \"SELECT COUNT(*)\n FROM reply \n WHERE board_id = {$boardNum}\";\n\n // 04-2) act SQL query\n if(!($queryResult = $con->query($sql))) {\n throw new Exception('false_selectReplyList_secondQuery');\n }\n\n // 04-3) get query result\n $numOfReply = $queryResult->fetch_array()[0];\n\n // 05) set query result on result array\n $result['replyList'] = $replyList;\n $result['numOfReply'] = $numOfReply;\n\n return $result;\n } catch(Exception $e) {\n echo $e->getMessage();\n return false;\n } finally {\n $con->close();\n }\n }", "function get_single_reply($reply_id){\n global $db;\n $query = 'SELECT * FROM replies \n WHERE reply_id = :reply_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':reply_id', $reply_id);\n $statement->execute();\n $reply = $statement->fetch();\n $statement->closeCursor();\n return $reply;\n }", "public function latest();", "private function replyBot(): string\n { \n $asc_cmd = preg_replace('/\\({.+/s', '', $this->lang['respond']['bio']['wait_approve'] );\n $asc_cmd = trim($asc_cmd);\n\n switch ( true ) {\n case preg_match( '/\\b(' . $asc_cmd . ')\\b/iu', $this->info['reply_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n if ( !in_array($this->info['msg_text'], $this->lang['command']['confirm']) ) {\n return $this->lang['respond']['bio']['not_approved']; // Bio not approved\n } else {\n preg_match( \"/\\((.*?)\\)/\", $this->info['reply_text'], $user_id ); // Return id inside brackets\n $bio = preg_replace( \"/^.+\\:\\n/\", '', $this->info['reply_text'] ); // Removes all text before colon\n $this->db_post->updateBio( $bio, $user_id[1] );\n return $this->lang['respond']['bio']['approved']; // Bio approved\n }\n case preg_match( '/\\b('. $this->lang['respond']['tanos']['list'] . ')\\b/u', $this->info['reply_text'] ):\n if ( !$this->is_admin )\n return $this->lang['respond']['not_admin'];\n\n $status = $this->tg->getStatus( $this->info['chat_id'], $this->bot['id'] );\n if ( $this->info['reply_date'] + 120 < time() ){\n return $this->lang['respond']['tanos']['overtime'];\n } elseif ( !in_array($this->info['msg_text'], $this->lang['command']['confirm']) ) {\n return $this->lang['respond']['bio']['not_approved'];\n } elseif ( $status !== 'administrator' ) {\n return $this->lang['respond']['tanos']['bot_not_adm'];\n } else {\n preg_match_all( \"/\\((.*?)\\)/\", $this->info['reply_text'], $user_array );\n $results = $this->tg->kickMembers( $user_array[1], $this->info['chat_id'] );\n $this->db_post->kickUsers( $user_array[1] );\n return $this->lang['respond']['tanos']['goodbye'];\n }\n default:\n exit('ok');\n }\n }", "function wpscstReplyTicket() {\r\n global $current_user, $wpdb, $wpscSupportTickets;\r\n\r\n $devOptions = get_option(\"wpscSupportTicketsAdminOptions\");\r\n\r\n if (session_id() == \"\") {@session_start();};\r\n \r\n $is_an_admin_reply = false;\r\n\r\n if ( current_user_can('manage_wpsct_support_tickets')) { // admin edits such as closing tickets should happen here first:\r\n $is_an_admin_reply = true;\r\n if(@isset($_POST['wpscst_status']) && @isset($_POST['wpscst_department']) && is_numeric($_POST['wpscst_edit_primkey'])) {\r\n $wpscst_department = intval($_POST['wpscst_department']);\r\n $wpscst_status = esc_sql($_POST['wpscst_status']);\r\n $wpscst_severity = esc_sql($_POST['wpscst_severity']);\r\n $primkey = intval($_POST['wpscst_edit_primkey']);\r\n // Update the Last Updated time stamp\r\n $updateSQL = \"UPDATE `{$wpdb->prefix}wpscst_tickets` SET `last_updated` = '\".current_time( 'timestamp' ).\"', `type`='{$wpscst_department}', `resolution`='{$wpscst_status}', `severity`='{$wpscst_severity}' WHERE `primkey` ='{$primkey}';\";\r\n $wpdb->query($updateSQL);\r\n }\r\n }\r\n\r\n // Update the status if applicable\r\n if( @isset( $_POST['wpscst_set_status'] ) && $devOptions['allow_closing_ticket']=='true' ) {\r\n $primkey = intval($_POST['wpscst_edit_primkey']);\r\n $wpscst_set_status = esc_sql($_POST['wpscst_set_status']);\r\n $updateSQL = \"UPDATE `{$wpdb->prefix}wpscst_tickets` SET `resolution`='{$wpscst_set_status}' WHERE `primkey` ='{$primkey}';\";\r\n $wpdb->query($updateSQL);\r\n\r\n }\r\n\r\n // Next we return users & admins to the last page if they submitted a blank reply\r\n $string = trim(strip_tags(str_replace(chr(173), \"\", $_POST['wpscst_reply'])));\r\n if($string=='') { // No blank replies allowed\r\n if($_POST['wpscst_goback']=='yes' && is_numeric($_POST['wpscst_edit_primkey']) ) {\r\n header(\"HTTP/1.1 301 Moved Permanently\");\r\n header ('Location: '.get_admin_url().'admin.php?page=wpscSupportTickets-edit&primkey='.$_POST['wpscst_edit_primkey']);\r\n } else {\r\n header(\"HTTP/1.1 301 Moved Permanently\");\r\n header ('Location: '.get_permalink($devOptions['mainpage']));\r\n }\r\n exit();\r\n }\r\n\r\n // If there is a reply and we're still executing code, now we'll add the reply\r\n if((is_user_logged_in() || @isset($_SESSION['wpsct_email'])) && is_numeric($_POST['wpscst_edit_primkey'])) {\r\n\r\n // Guest additions here\r\n if(is_user_logged_in()) {\r\n $wpscst_userid = $current_user->ID;\r\n $wpscst_email = $current_user->user_email;\r\n } else {\r\n $wpscst_userid = 0;\r\n $wpscst_email = esc_sql($_SESSION['wpsct_email']); \r\n if(trim($wpscst_email)=='') {\r\n $wpscst_email = @esc_sql($_POST['guest_email']);\r\n } \r\n } \r\n\r\n $primkey = intval($_POST['wpscst_edit_primkey']);\r\n\r\n if ( !current_user_can('manage_wpsct_support_tickets')) {\r\n\r\n if($devOptions['allow_all_tickets_to_be_replied']=='true' && $devOptions['allow_all_tickets_to_be_viewed']=='true') {\r\n $sql = \"SELECT * FROM `{$wpdb->prefix}wpscst_tickets` WHERE `primkey`='{$primkey}' LIMIT 0, 1;\";\r\n } \r\n if($devOptions['allow_all_tickets_to_be_replied']=='false' || $devOptions['allow_all_tickets_to_be_viewed']=='false') {\r\n $sql = \"SELECT * FROM `{$wpdb->prefix}wpscst_tickets` WHERE `primkey`='{$primkey}' AND `user_id`='{$wpscst_userid}' AND `email`='{$wpscst_email}' LIMIT 0, 1;\";\r\n } \r\n } else {\r\n // This allows approved users, such as the admin, to reply to any support ticket\r\n $sql = \"SELECT * FROM `{$wpdb->prefix}wpscst_tickets` WHERE `primkey`='{$primkey}' LIMIT 0, 1;\";\r\n }\r\n $results = $wpdb->get_results( $sql , ARRAY_A );\r\n if(isset($results[0])) {\r\n\r\n\r\n $wpscst_message = '';\r\n\r\n if($devOptions['allow_uploads']=='true' && function_exists('wpscSupportTicketsPRO') && @isset($_FILES[\"wpscst_file\"]) && @$_FILES[\"wpscst_file\"][\"error\"] != 4 ) {\r\n /* Handles the error output. This error message will be sent to the uploadSuccess event handler. The event handler\r\n will have to check for any error messages and react as needed. */\r\n function HandleError($message) {\r\n echo '<script type=\"text/javascript\">alert(\"'.$message.'\");</script>'.$message.'';\r\n }\r\n\r\n // Code for Session Cookie workaround\r\n if (isset($_POST[\"PHPSESSID\"])) {\r\n session_id($_POST[\"PHPSESSID\"]);\r\n } else if (isset($_GET[\"PHPSESSID\"])) {\r\n session_id($_GET[\"PHPSESSID\"]);\r\n }\r\n\r\n session_start();\r\n\r\n // Check post_max_size (http://us3.php.net/manual/en/features.file-upload.php#73762)\r\n $POST_MAX_SIZE = @ini_get('post_max_size');\r\n if(@$POST_MAX_SIZE == NULL || $POST_MAX_SIZE < 1) {$POST_MAX_SIZE=9999999999999;};\r\n $unit = strtoupper(substr($POST_MAX_SIZE, -1));\r\n $multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));\r\n\r\n if ((int)$_SERVER['CONTENT_LENGTH'] > $multiplier*(int)$POST_MAX_SIZE && $POST_MAX_SIZE) {\r\n header(\"HTTP/1.1 500 Internal Server Error\"); // This will trigger an uploadError event in SWFUpload\r\n _e(\"POST exceeded maximum allowed size.\", 'wpsc-support-tickets');\r\n }\r\n\r\n // Settings\r\n $wpsc_wordpress_upload_dir = wp_upload_dir();\r\n $save_path = $wpsc_wordpress_upload_dir['basedir']. '/wpsc-support-tickets/';\r\n if(!is_dir($save_path)) {\r\n @mkdir($save_path);\r\n } \r\n $upload_name = \"wpscst_file\";\r\n $max_file_size_in_bytes = 2147483647;\t\t\t\t// 2GB in bytes\r\n $valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\\[\\]\\',~`-';\t\t\t\t// Characters allowed in the file name (in a Regular Expression format)\r\n\r\n // Other variables\t\r\n $MAX_FILENAME_LENGTH = 260;\r\n $file_name = \"\";\r\n $file_extension = \"\";\r\n $uploadErrors = array(\r\n 0=>__(\"There is no error, the file uploaded with success\", 'wpsc-support-tickets'),\r\n 1=>__(\"The uploaded file exceeds the upload_max_filesize directive in php.ini\", 'wpsc-support-tickets'),\r\n 2=>__(\"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\", 'wpsc-support-tickets'),\r\n 3=>__(\"The uploaded file was only partially uploaded\", 'wpsc-support-tickets'),\r\n 4=>__(\"No file was uploaded\", 'wpsc-support-tickets'),\r\n 6=>__(\"Missing a temporary folder\", 'wpsc-support-tickets')\r\n );\r\n\r\n\r\n // Validate the upload\r\n if (!isset($_FILES[$upload_name])) {\r\n //\r\n } else if (isset($_FILES[$upload_name][\"error\"]) && $_FILES[$upload_name][\"error\"] != 0) {\r\n HandleError($uploadErrors[$_FILES[$upload_name][\"error\"]]);\r\n } else if (!isset($_FILES[$upload_name][\"tmp_name\"]) || !@is_uploaded_file($_FILES[$upload_name][\"tmp_name\"])) {\r\n HandleError(__(\"Upload failed is_uploaded_file test.\", 'wpsc-support-tickets'));\r\n } else if (!isset($_FILES[$upload_name]['name'])) {\r\n HandleError(__(\"File has no name.\", 'wpsc-support-tickets'));\r\n }\r\n\r\n // Validate the file size (Warning: the largest files supported by this code is 2GB)\r\n $file_size = @filesize($_FILES[$upload_name][\"tmp_name\"]);\r\n if (!$file_size || $file_size > $max_file_size_in_bytes) {\r\n HandleError(__(\"File exceeds the maximum allowed size\", 'wpsc-support-tickets'));\r\n }\r\n\r\n if ($file_size <= 0) {\r\n HandleError(__(\"File size outside allowed lower bound\", 'wpsc-support-tickets'));\r\n }\r\n\r\n\r\n // Validate file name (for our purposes we'll just remove invalid characters)\r\n\r\n $file_name = preg_replace('/[^'.$valid_chars_regex.']|\\.+$/i', \"\", basename(substr(str_shuffle(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 1).substr(md5(time()),1) . $_FILES[$upload_name]['name']));\r\n\r\n if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {\r\n HandleError(__(\"Invalid file name\", 'wpsc-support-tickets'));\r\n }\r\n\r\n\r\n if (!@move_uploaded_file($_FILES[$upload_name][\"tmp_name\"], $save_path.$file_name)) {\r\n HandleError(__(\"File could not be saved.\", 'wpsc-support-tickets'));\r\n } else {\r\n // SUCCESS\r\n $wpscst_message .= '<br /><p class=\"wpsc-support-ticket-attachment\"';\r\n if($devOptions['disable_inline_styles']=='false'){\r\n $wpscst_message .= ' style=\"border: 1px solid #DDD;padding:8px;\" ';\r\n }\r\n $wpscst_message .= '>';\r\n $wpscst_message .= '<img src=\"'.plugins_url().'/wpsc-support-tickets-pro/images/attachment.png\" alt=\"'.__('ATTACHMENT','wpsc-support-tickets').'\" /> <strong>'.__('ATTACHMENT','wpsc-support-tickets').'</strong>: <a href=\"'.$wpsc_wordpress_upload_dir['baseurl'].'/wpsc-support-tickets/'.$file_name.'\" target=\"_blank\">'.$wpsc_wordpress_upload_dir['baseurl'].'/wpsc-support-tickets/'.$file_name.'</a></p>';\r\n } \r\n } \r\n\r\n\r\n\r\n //$wpscst_message = base64_encode(nl2br($_POST['wpscst_reply'] . $wpscst_message));\r\n // Alternative new method for dealing with line breaks adding in 4.9.23\r\n $wpscst_message = base64_encode( '<p>'. preg_replace('/[\\r\\n]+/', '</p><p>', $_POST['wpscst_reply'] . $wpscst_message) . '</p>' );\r\n \r\n $sql = \"\r\n INSERT INTO `{$wpdb->prefix}wpscst_replies` (\r\n `primkey` ,\r\n `ticket_id` ,\r\n `user_id` ,\r\n `timestamp` ,\r\n `message`\r\n )\r\n VALUES (\r\n NULL , '{$primkey}', '{$wpscst_userid}', '\".current_time( 'timestamp' ).\"', '{$wpscst_message}'\r\n );\r\n \";\r\n\r\n $wpdb->query($sql);\r\n\r\n\r\n // Update the Last Updated time stamp\r\n if($_POST['wpscst_is_staff_reply']=='yes' && current_user_can('manage_wpsct_support_tickets')) {\r\n // This is a staff reply from the admin panel\r\n $updateSQL = \"UPDATE `{$wpdb->prefix}wpscst_tickets` SET `last_updated` = '\".current_time( 'timestamp' ).\"', `last_staff_reply` = '\".current_time( 'timestamp' ).\"' WHERE `primkey` ='{$primkey}';\";\r\n } else {\r\n // This is a reply from the front end\r\n $updateSQL = \"UPDATE `{$wpdb->prefix}wpscst_tickets` SET `last_updated` = '\".current_time( 'timestamp' ).\"' WHERE `primkey` ='{$primkey}';\";\r\n }\r\n $wpdb->query($updateSQL);\r\n\r\n if($devOptions['disable_all_emails']=='false') { // If emails are turned on\r\n if (@isset($_POST['wpsctnoemail']) && $_POST['wpsctnoemail'] == 'on' && $results[0]['email'] != $wpscst_email) {\r\n $cc = null;\r\n if($devOptions['cc_all_user_replies'] == 'true' && !$is_an_admin_reply) {\r\n $cc = $devOptions['cc_all_user_replies_to_email'];\r\n } \r\n \r\n $to = $results[0]['email']; // Send this to the original ticket creator\r\n if($devOptions['allow_html']=='true') {\r\n $subject = $devOptions['email_new_reply_subject'].' \"' . htmlspecialchars_decode( htmlentities( base64_decode($results[0]['title']), ENT_NOQUOTES, strtoupper($devOptions['email_encoding']), false ), ENT_NOQUOTES ) .'\"';\r\n } else {\r\n $subject = $devOptions['email_new_reply_subject'].' \"' . base64_decode($results[0]['title']) .'\"';\r\n } \r\n $message = $devOptions['email_new_reply_body'];\r\n if($devOptions['use_reply_in_email']=='true') {\r\n $message .= \"\\r\\n\";\r\n $message .= \"\\r\\n\";\r\n if($devOptions['allow_html']=='true') {\r\n $cleaned_message = __(\"The content of the ticket is: \", 'wpsc-support-tickets'). '\"'. htmlspecialchars_decode( htmlentities( strip_tags($_POST['wpscst_reply']), ENT_NOQUOTES, strtoupper($devOptions['email_encoding']), false ), ENT_NOQUOTES ) .'\"';\r\n } else {\r\n $cleaned_message = __(\"The content of the ticket is: \", 'wpsc-support-tickets'). '\"'. strip_tags($_POST['wpscst_reply']) .'\"';\r\n }\r\n $message .= $cleaned_message;\r\n } \r\n\r\n wpscSupportTickets_mail($to, $subject, $message, null, $cc);\r\n }\r\n\r\n if( $devOptions['email']!=$results[0]['email']) { \r\n $cc = null;\r\n if($devOptions['cc_all_admin_replies'] == 'true' && $is_an_admin_reply) {\r\n $cc = $devOptions['cc_all_admin_replies'];\r\n } \r\n \r\n $to = $devOptions['email']; // Send this to the admin\r\n if($devOptions['allow_html']=='true') {\r\n $subject = __(\"Reply to a support ticket was received.\", 'wpsc-support-tickets').' \"' . htmlspecialchars_decode( htmlentities( base64_decode($results[0]['title']), ENT_NOQUOTES, strtoupper($devOptions['email_encoding']), false ), ENT_NOQUOTES ) .'\"';\r\n } else {\r\n $subject = __(\"Reply to a support ticket was received.\", 'wpsc-support-tickets').' \"' . base64_decode($results[0]['title']) .'\"';\r\n }\r\n $message = __('There is a new reply on support ticket: ','wpsc-support-tickets').get_admin_url().'admin.php?page=wpscSupportTickets-edit&primkey='.$primkey.'';\r\n if($devOptions['use_reply_in_email']=='true') {\r\n $message .= \"\\r\\n\";\r\n $message .= \"\\r\\n\";\r\n\r\n if($devOptions['allow_html']=='true') {\r\n $cleaned_message = __(\"The content of the ticket is: \", 'wpsc-support-tickets'). '\"'. htmlspecialchars_decode( htmlentities( strip_tags($_POST['wpscst_reply']), ENT_NOQUOTES, strtoupper($devOptions['email_encoding']), false ), ENT_NOQUOTES ) .'\"';\r\n } else {\r\n $cleaned_message = __(\"The content of the ticket is: \", 'wpsc-support-tickets'). '\"'. strip_tags($_POST['wpscst_reply']) .'\"';\r\n }\r\n\r\n\r\n $message .= $cleaned_message;\r\n }\r\n\r\n wpscSupportTickets_mail($to, $subject, $message, null, $cc);\r\n }\r\n \r\n \r\n // New department emails\r\n $dep_results = $wpdb->get_results(\"SELECT * FROM `{$wpdb->prefix}wpscst_departments` WHERE `primkey`='{$wpscst_department}' ;\", ARRAY_A);\r\n if (@isset($dep_results[0]['name']) ) {\r\n\r\n $email_department_admin = null;\r\n if($dep_results[0]['admin_user_id']!=0 && $dep_results[0]['admin_user_id']!=null) {\r\n global $user_info;\r\n $user_info = get_userdata($dep_results[0]['admin_user_id']); \r\n $email_department_admin = $user_info->user_email; \r\n\r\n if ($devOptions['email'] != $email_department_admin) { // If the Department head is different from the admin, send the Department head an email as well.\r\n if ($results[0]['email'] != $email_department_admin) {\r\n wpscSupportTickets_mail($email_department_admin, $subject, $message); \r\n }\r\n }\r\n\r\n }\r\n if ($dep_results[0]['forward_all_department_emails'] == 1) {\r\n if($dep_results[0]['main_department_email'] != $devOptions['email']) {\r\n if($dep_results[0]['main_department_email'] != $email_department_admin) { // If the main department email hasn't gotten an email, but department forwarding is on, lets send it\r\n if ($results[0]['email'] != $dep_results[0]['main_department_email']) {\r\n wpscSupportTickets_mail($dep_results[0]['main_department_email'], $subject, $message); \r\n }\r\n } \r\n }\r\n }\r\n }\r\n // End new department code \r\n \r\n \r\n }\r\n }\r\n }\r\n\r\n if($_POST['wpscst_goback']=='yes') {\r\n header(\"HTTP/1.1 301 Moved Permanently\");\r\n header ('Location: '.get_admin_url().'admin.php?page=wpscSupportTickets-edit&primkey='.$primkey);\r\n } else {\r\n header(\"HTTP/1.1 301 Moved Permanently\");\r\n header ('Location: '.get_permalink($devOptions['mainpage']));\r\n }\r\n exit(); \r\n}", "function getDiscussionReply()\n\t{\n\t\t//init variable\n\t\t$mainframe = JFactory::getApplication();\n\t\t\n\t\t$group_id = $mainframe->input->get('group_id',0,'INT');\n\t\t$discussId = $mainframe->input->get('discussion_id',0,'INT');\n\t\t$limit = $mainframe->input->get('limit',10,'INT');\n\t\t$limitstart = $mainframe->input->get('limitstart',0,'INT');\t\n\t\t$wres = new stdClass;\n\t\t$valid = 0;\n\n\t\tif(!$group_id)\n\t\t{\n\t\t\t$wres->status = 0;\n\t\t\t$wres->message[] = JText::_( 'PLG_API_EASYSOCIAL_EMPTY_GROUP_ID_MESSAGE' );\n\t\t\treturn $wres;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$group \t\t= FD::group( $group_id );\n\t\t\t\t\t\t\n\t\t\t// Get the current filter type\n\t\t\t$filter \t= $mainframe->input->get('filter','all','STRING');\n\t\t\t$options \t= array();\n\n\t\t\tif( $filter == 'unanswered' )\n\t\t\t{\n\t\t\t\t$options[ 'unanswered' ]\t= true;\n\t\t\t}\n\n\t\t\tif( $filter == 'locked' )\n\t\t\t{\n\t\t\t\t$options[ 'locked' ]\t= true;\n\t\t\t}\n\n\t\t\tif( $filter == 'resolved' )\n\t\t\t{\n\t\t\t\t$options[ 'resolved' ]\t= true;\n\t\t\t}\n\t\t\t\n\t\t\t$options[ 'ordering' ] = 'created';\n\t\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t\t\n\t\t\t$model \t\t\t= FD::model( 'Discussions' );\n\t\t\t$reply_rows\t= $model->getReplies( $discussId,$options);\n\t\t\t\n\t\t\tif($discussId)\n\t\t\t{\n\t\t\t\t$disc_dt = new stdClass();\n\t\t\t\t//create discussion details as per request\n\t\t\t\t$discussion = FD::table( 'Discussion' );\n\t\t\t\t$discussion->load( $discussId );\n\t\t\t\t$data_node[] = $discussion; \n\t\t\t\t$data['discussion'] = $mapp->mapItem($data_node,'discussion',$this->plugin->get('user')->id);\n\t\t\t}\n\t\t\t\n\t\t\tif($limitstart)\n\t\t\t{\n\t\t\t\t$reply_rows = array_slice($reply_rows,$limitstart,$limit);\n\t\t\t}\t\t\t\n\t\t\t$data['data'] = $mapp->mapItem($reply_rows,'reply',$this->plugin->get('user')->id);\n\t\t\treturn( $data );\n\t\t}\n\t}", "public function pollLast($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function waitRequest(): ?Request;", "function test_a_user_can_filter_threads_by_popularity(){\n // with 2,3 and 0 replies respectively\n\n $ThreadWithTwoReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithTwoReplies->id],2);\n\n\n $ThreadWithThreeReplies = create('App\\Thread');\n create('App\\Reply',['thread_id'=>$ThreadWithThreeReplies->id],3);\n\n $ThreadWithNoReplies = $this->thread;\n\n\n\n //When I filter all threads by popularity\n $response = $this->getJson('threads?popular=1')->json();\n // then they should be returned from most replies to least\n\n $this->assertEquals([3,2,0], array_column($response,'replies_count'));\n\n }", "public function checkQuickReplyStatus() {\n global $fid, $forum, $forumpermissions, $mybb, $thread;\n \n if ($forumpermissions['canpostreplys'] != 0 \n && $mybb->user['suspendposting'] != 1 \n && ($thread['closed'] != 1 || is_moderator($fid)) \n && $mybb->settings['quickreply'] != 0 \n && $mybb->user['showquickreply'] != '0' \n && $forum['open'] != 0\n ) {\n self::$quick_reply_status = true;\n }\n }", "function wp_check_locked_posts($response, $data, $screen_id)\n {\n }", "public function testMessageThreadsV2Get0()\n {\n }", "function awaiting_trigger_check() {\n\t\tif(intval(get_query_var('lepress-teacher-awaiting')) == 1) {\n\t\t\t//WP default header is 404, have to override it\n\t\t\theader(\"HTTP/1.0 200 OK\");\n\t\t\tif(isSet($_GET['w'])) {\n\t\t\t\techo $this->getAwaitingBubble($_GET['w']);\n\t\t\t}\n\t\t\texit;\n\t\t}\n \t}", "function submissions_after($latest_submissionid) {\n\t\tstatic $query;\n\t\tDB::prepare_query($query, \"SELECT * FROM `submission` WHERE `entity_path` LIKE ? AND `time` > (SELECT `time` FROM `submission` WHERE `submissionid` = ?) ORDER BY `time` DESC\");\n\t\t$query->execute(array($this->path().'%', $latest_submissionid));\n\t\treturn Submission::fetch_all($query);\n\t}", "function ld_get_latest_posts($limit=30, $poster=0, $page = 1 )\r\n{\r\n\tglobal $bbdb, $bb_last_countable_query;\r\n\r\n\t$page = (int) $page;\r\n\r\n\t$where = 'WHERE post_status = 0';\r\n\r\n\tif ($poster > 0)\r\n\t\t$where .= \" AND poster_id = $poster\";\r\n\r\n\tif ( 1 < $page )\r\n\t\t$limit = ($limit * ($page - 1)) . \", $limit\";\r\n\r\n\t$bb_last_countable_query = \"SELECT post_id,forum_id,topic_id,poster_id,post_title,post_time FROM $bbdb->posts $where ORDER BY post_time DESC LIMIT $limit\";\r\n\r\n\tif ( $ld_latest_posts = $bbdb->get_results($bb_last_countable_query) )\r\n\t\treturn $ld_latest_posts;\r\n\telse\r\n\t\treturn false;\r\n}", "public function hasThreads() {\n\t\treturn false;\n\t}", "public function clearReplyTos()\n {\n }", "function update_thread_timestamp($thread) {\n $posts = BoincPost::enum(\"thread=$thread->id and hidden=0 order by timestamp desc limit 1\");\n if (count($posts)>0) {\n $post = $posts[0];\n $thread->update(\"timestamp=$post->timestamp\");\n }\n}", "public static function checkForOldThreads()\r\n {\r\n /* @var $threadModel XenForo_Model_Thread */\r\n $threadModel = XenForo_Model::create('XenForo_Model_Thread');\r\n \r\n $lastPostDate = array(\r\n '>=<', \r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMaxDays * 86400),\r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMinDays * 86400),\r\n );\r\n \r\n $conditions = array(\r\n 'last_post_date' => $lastPostDate,\r\n \t'reply_count_th' => 0,\r\n 'discussion_state' => 'visible',\r\n 'discussion_open' => 1,\r\n );\r\n \r\n $excludedNodeIds = XenForo_Application::getOptions()->th_notifyOldThreads_forumIds;\r\n if (!empty($excludedNodeIds)) {\r\n $allowedNodeIds = array_keys(XenForo_Model::create('XenForo_Model_Node')->getAllNodes());\r\n $allowedNodeIds = array_diff($allowedNodeIds, $excludedNodeIds);\r\n $conditions['node_id'] = $allowedNodeIds;\r\n }\r\n \r\n $threadIds = $threadModel->getThreadIds($conditions);\r\n \r\n if (!empty($threadIds)) {\r\n $dw = XenForo_DataWriter::create('XenForo_DataWriter_Option');\r\n $dw->setExistingData('th_notifyOldThreads_threadIds');\r\n $dw->set('option_value', $threadIds);\r\n $dw->save();\r\n }\r\n }", "function notify_thread_finished($loginHash, $passwordHash, $attemptid) {\r\n $config = get_config(\"poasassignment_remote_autotester\");\r\n if (md5($config->login) != $loginHash || md5($config->password) != $passwordHash) {\r\n XMLRPC_response(XMLRPC_prepare(\"401 Unauthorized\"));\r\n }\r\n else {\r\n global $DB;\r\n $records = $DB->get_records('poasassignment_gr_ra', array('attemptid' => $attemptid), 'id DESC', 'id, attemptid, testsfound');\r\n if (count($records) > 0) {\r\n $record = array_shift($records);\r\n $record->timeclosed = time();\r\n $DB->update_record('poasassignment_gr_ra', $record);\r\n }\r\n\r\n XMLRPC_response(XMLRPC_prepare(\"200 OK\"));\r\n require_once('remote_autotester.php');\r\n if (isset($record)) {\r\n if (isset($record->testsfound) && $record->testsfound > 0 && isset($record->id)) {\r\n $testscount = $DB->count_records('poasassignment_gr_ra_tests', array('remote_id' => $record->id));\r\n if ($testscount == $record->testsfound) {\r\n remote_autotester::grade_attempt($attemptid);\r\n }\r\n }\r\n $assignee = poasassignment_model::get_instance()->get_attempt_poasassignmentid(17);\r\n remote_autotester::put_rating($assignee->poasassignmentid, $assignee->id);\r\n }\r\n }\r\n}", "function getLastPost()\n{\n\tglobal $db_prefix, $user_info, $scripturl, $modSettings;\n\n\t// Find it by the board - better to order by board than sort the entire messages table.\n\t$request = db_query(\"\n\t\tSELECT ml.posterTime, ml.subject, ml.ID_TOPIC, ml.posterName, ml.body, ml.smileysEnabled\n\t\tFROM {$db_prefix}boards AS b, {$db_prefix}messages AS ml\n\t\tWHERE ml.ID_MSG = b.ID_LAST_MSG\" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? \"\n\t\t\tAND b.ID_BOARD != $modSettings[recycle_board]\" : '') . \"\n\t\t\tAND $user_info[query_see_board]\n\t\tORDER BY b.lastUpdated DESC\n\t\tLIMIT 1\", __FILE__, __LINE__);\n\tif (mysql_num_rows($request) == 0)\n\t\treturn array();\n\t$row = mysql_fetch_assoc($request);\n\tmysql_free_result($request);\n\n\t// Censor the subject and post...\n\tcensorText($row['subject']);\n\tcensorText($row['body']);\n\n\t$row['body'] = strip_tags(strtr(doUBBC($row['body'], $row['smileysEnabled']), array('<br />' => '&#10;')));\n\tif (strlen($row['body']) > 128)\n\t\t$row['body'] = substr($row['body'], 0, 128) . '...';\n\n\t// Send the data.\n\treturn array(\n\t\t'topic' => $row['ID_TOPIC'],\n\t\t'subject' => $row['subject'],\n\t\t'short_subject' => strlen(un_htmlspecialchars($row['subject'])) > 24 ? strtr(substr(strtr($row['subject'], array('&lt;' => '<', '&gt;' => '>', '&quot;' => '\"')), 0, 24) . '...', array('<' => '&lt;', '>' => '&gt;', '\"' => '&quot;')) : $row['subject'],\n\t\t'preview' => $row['body'],\n\t\t'time' => timeformat($row['posterTime']),\n\t\t'timestamp' => $row['posterTime'],\n\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.new;topicseen#new',\n\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.new;topicseen#new\">' . $row['subject'] . '</a>'\n\t);\n}", "public function isReply() {\n\t\treturn Utils::startsWith($this -> getSubject(), \"RE:\");\n\t}", "function caldol_no_replies_bbpress_topics_shortcode() {\n\n\t?>\n\n<!-- html custom-functions -->\n\n<h4 style=\"margin-top: 15px;\">Discussions with No Replies. Be the first to jump in!</h4>\n\n<?php\n\n\n\nif ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => false, 'order' => 'DESC', 'meta_key' => '_bbp_reply_count', 'orderby' => 'post_date', 'meta_value' => '0', 'meta_compare' => '=', 'post_parent' => 'any', 'posts_per_page' => 10 ) ) )\n\nbbp_get_template_part( 'bbpress/loop', 'topics' );\n\n?>\n\n<!-- end -->\n\n<?php }", "public function getLastReplayAttribute()\n {\n if ($this->answered) {\n return $this->posts()->latest()->first();\n }\n \n return null;\n }", "public function isWaiting();", "function forum_rss_newstuff($forum, $time) {\n // true. Otherwise it returns false.\n if ($forum->rsstype == 1) {\n $items = forum_rss_feed_discussions($forum, $time);\n } else {\n $items = forum_rss_feed_posts($forum, $time);\n }\n return (!empty($items));\n }", "public function getStillWanted() {\n $wanted = Event::fireReturn($this->getEventID(), $this->type, $this->filter, 'ping');\n if ($wanted || count($wanted)) {\n return true;\n }\n return false;\n }", "function template_replies()\n{\n\tglobal $context, $settings, $txt, $scripturl, $modSettings;\n\n\techo '\n\t<div id=\"recent\">';\n\n\tif (!empty($context['topics']))\n\t{\n\t\techo '\n\n\t\t\t<div class=\"pagesection\" id=\"top\">\n\t\t\t\t<a href=\"#pbot\" class=\"topbottom floatleft\">', $txt['go_down'], '</a>\n\t\t\t\t<div class=\"pagelinks floatleft\">', $context['page_index'], '</div>\n\t\t\t</div>';\n\n\t\techo '\n\t\t\t<div id=\"unreadreplies\">\n\t\t\t\t<div id=\"topic_header\" class=\"title_bar\">\n\t\t\t\t\t<div class=\"board_icon\"></div>\n\t\t\t\t\t<div class=\"info\">\n\t\t\t\t\t\t<a href=\"', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] === 'subject' && $context['sort_direction'] === 'up' ? ';desc' : '', '\">', $txt['subject'], $context['sort_by'] === 'subject' ? ' <span class=\"generic_icons sort_' . $context['sort_direction'] . '\"></span>' : '', '</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"board_stats\">\n\t\t\t\t\t\t<a href=\"', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] === 'replies' && $context['sort_direction'] === 'up' ? ';desc' : '', '\">', $txt['replies'], $context['sort_by'] === 'replies' ? ' <span class=\"generic_icons sort_' . $context['sort_direction'] . '\"></span>' : '', '</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"lastpost'. (!empty($modSettings['avatars_on_boardIndex']) ? '_ava' : '') .'\">\n\t\t\t\t\t\t<a href=\"', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] === 'last_post' && $context['sort_direction'] === 'up' ? ';desc' : '', '\">', $txt['last_post'], $context['sort_by'] === 'last_post' ? ' <span class=\"generic_icons sort_' . $context['sort_direction'] . '\"></span>' : '', '</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"moderation\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"topic_container\">';\n\n\t\tforeach ($context['topics'] as $topic)\n\t\t{\n\t\t\techo '\n\t\t\t\t\t\t<div class=\"', $topic['css_class'], '\">\n\t\t\t\t\t\t\t<div class=\"board_icon\">\n\t\t\t\t\t\t\t\t<img src=\"', $topic['first_post']['icon_url'], '\" alt=\"\">\n\t\t\t\t\t\t\t\t', $topic['is_posted_in'] ? '<img class=\"posted\" src=\"' . $settings['images_url'] . '/icons/profile_sm.png\" alt=\"\">' : '','\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"info\">';\n\n\t\t\t// Now we handle the icons\n\t\t\techo '\n\t\t\t\t\t\t\t\t<div class=\"icons floatright\">';\n\t\t\tif ($topic['is_locked'])\n\t\t\t\techo '\n\t\t\t\t\t\t\t\t\t<span class=\"generic_icons lock\"></span>';\n\t\t\tif ($topic['is_sticky'])\n\t\t\t\techo '\n\t\t\t\t\t\t\t\t\t<span class=\"generic_icons sticky\"></span>';\n\t\t\tif ($topic['is_poll'])\n\t\t\t\techo '\n\t\t\t\t\t\t\t\t\t<span class=\"generic_icons poll\"></span>';\n\t\t\techo '\n\t\t\t\t\t\t\t\t</div>';\n\n\t\t\t$topic['new_href'] = str_replace('#new', '', $topic['new_href']) .'#ptop';\n\t\t\techo '\n\t\t\t\t\t\t\t\t<div class=\"recent_title\">\n\t\t\t\t\t\t\t\t\t<a href=\"', $topic['new_href'], '\" id=\"newicon', $topic['first_post']['id'], '\"><span class=\"new_posts\">' . $txt['new'] . '</span></a>\n\t\t\t\t\t\t\t\t\t', $topic['is_sticky'] ? '<strong>' : '', '<span title=\"', $topic[(empty($modSettings['message_index_preview_first']) ? 'last_post' : 'first_post')]['preview'], '\"><span id=\"msg_' . $topic['first_post']['id'] . '\">', $topic['first_post']['link'], '</span></span>', $topic['is_sticky'] ? '</strong>' : '', '\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p class=\"floatleft\">\n\t\t\t\t\t\t\t\t\t', $topic['first_post']['started_by'], '\n\t\t\t\t\t\t\t\t</p>';\n\n\t\t\tif(!empty($topic['pages']))\n\t\t\t\techo '\n\t\t\t\t\t\t\t\t<small id=\"pages', $topic['first_post']['id'], '\" class=\"topic_pages\">&nbsp;', $topic['pages'], '</small>';\n\n\t\t\techo '\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"board_stats\">\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t', $txt['replies'], ': ', $topic['replies'], '\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t', $txt['views'], ': ', $topic['views'], '\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"lastpost';\n\n\t\t\tif(isset($topic['last_post']['member']['avatar']['url']) && !empty($modSettings['avatars_on_boardIndex']))\n\t\t\t\techo '_ava\">\n\t\t\t\t\t\t\t\t<span class=\"avaspan\"><img src=\"'. $topic['last_post']['member']['avatar']['url'].'\" alt=\"avatar\" class=\"brdidxava'. $topic['last_post']['member']['avatar']['class'] .'\"></span>';\n\t\t\telse\n\t\t\t\techo '\">';\n\t\t\t\n\t\t\techo '\n\t\t\t\t\t\t\t\t', sprintf($txt['last_post_topic'], '<a href=\"' . $topic['last_post']['href'] . '\">' . $topic['last_post']['time'] . '</a>', $topic['last_post']['member']['link']), '\n\t\t\t\t\t\t\t</div>';\n\n\t\t\tshowModeration($topic);\n\n\t\t\t\techo '\n\t\t\t\t\t\t</div>';\n\t\t}\n\n\t\techo '\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"pagesection\">\n\t\t\t\t', !empty($context['recent_buttons']) ? template_button_strip($context['recent_buttons'], 'right') : '', '\n\t\t\t\t', $context['menu_separator'], '<a href=\"#recent\" class=\"topbottom bottom floatleft\">', $txt['go_up'], '</a>\n\t\t\t\t<div class=\"pagelinks floatleft\">', $context['page_index'], '</div>\n\t\t\t</div>';\n\t}\n\telse\n\t{\n\t\techo '\n\t\t\t<div class=\"cat_bar\">\n\t\t\t\t<h3 class=\"catbg\">\n\t\t\t\t\t', $txt['unread_replies'], '\n\t\t\t\t</h3>\n\t\t\t</div>\n\t\t\t<div class=\"roundframe\" style=\"margin-top:0;border-top-left-radius:0;border-top-right-radius:0\">\n\t\t\t\t', $context['showing_all_topics'] ? $txt['topic_alert_none'] : $txt['unread_topics_updated_none'] , '\n\t\t\t</div>';\n\t}\n\n\techo '\n\t</div>';\n\n\tif (empty($context['no_topic_listing']))\n\t\ttemplate_topic_legend();\n}", "function ghost_threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\t\t$page = intval($page);\n\n\t\t$posts = $this->post->get_latest_ghost(get_selected_radix(), $page, array('per_page' => $per_page));\n\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// no comics\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "function moments_qodef_like_latest_posts() {\n\t\treturn moments_qodef_like()->add_like();\n\t}", "public function receiveNoWait(): ?Message;", "public function testMessageThreadsV2GetMessages0()\n {\n }", "public function getLatestMailing() {\n\t\t$sql = 'SELECT pageId, UNIX_TIMESTAMP(dateadded) as `dateadded` FROM mailqueue WHERE issend=2 ORDER BY dateadded DESC LIMIT 0,1';\n\t\t$row = $this -> _conn -> getRow($sql);\n\t\tif($row) {\n\t\t\t$page = new Page();\n\t\t\t$result = $page -> getPageById($row -> pageId);\n\t\t\t$result -> publicationdate = $row -> dateadded;\n\t\t\treturn $result;\n\t\t}\n\t\treturn null;\n\t\t\n\t}", "protected static function __setLastPost($threadID, $post = null) {\n\t\tif ($post != null) {\n\t\t\t$result = array('time' => $post->time, 'userID' => $post->userID, 'username' => $post->username);\n\t\t}\n\t\telse {\n\t\t\t$sql = \"SELECT\t\ttime, userID, username\n\t\t\t\tFROM \t\twbb\".WBB_N.\"_post\n\t\t\t\tWHERE \t\tthreadID = \".$threadID.\"\n\t\t\t\t\t\tAND isDeleted = 0\n\t\t\t\t\t\tAND isDisabled = 0\n\t\t\t\tORDER BY \ttime DESC\";\n\t\t\t$result = WCF::getDB()->getFirstRow($sql);\n\t\t}\n\t\t\n\t\tif ($result['time']) {\n\t\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\t\tSET\tlastPostTime = \".intval($result['time']).\",\n\t\t\t\t\tlastPosterID = \".intval($result['userID']).\",\n\t\t\t\t\tlastPoster = '\".escapeString($result['username']).\"'\n\t\t\t\tWHERE \tthreadID = \".$threadID;\n\t\t}\n\t\telse {\n\t\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\t\tSET\tlastPostTime = time,\n\t\t\t\t\tlastPosterID = userID,\n\t\t\t\t\tlastPoster = username\n\t\t\t\tWHERE \tthreadID = \".$threadID;\n\t\t}\n\t\tWCF::getDB()->sendQuery($sql);\n\t}", "public function testDirectReply()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function replies()\n {\n return $this->hasMany('Reflex\\Forum\\Entities\\Replies\\Reply')->latest();\n }", "function getStatus() \r\n\t{\r\n\t\treturn $this->reply;\r\n\t}", "function topic_poll_novotenoread($messages, $thread)\n{\n global $PHORUM;\n\n // Check if the no vote no read option needs to be handled.\n if (!isset($thread['meta']['mod_topic_poll']) ||\n empty($thread['meta']['mod_topic_poll']['novotenoread'])) {\n return $messages;\n }\n\n // If a vote was cast, then no action is needed.\n if (check_if_topic_poll_vote_was_cast($thread)) {\n return $messages;\n }\n\n // Only one message in this thread? Then let's not bother the user.\n if ($thread['thread_count'] <= 0) return $messages;\n\n // Format the notification.\n $msg = $PHORUM['DATA']['LANG']['mod_topic_poll']['ReadThreadNeedsVote'];\n $msg = str_replace('%count%', $thread['thread_count'], $msg);\n\n // Remember it for the formatting function.\n $thread['topic_poll_novotenoread'] = $msg;\n\n // Shrink the messages array to only contain the thread starter.\n $messages = array( $thread['message_id'] => $thread );\n\n return $messages;\n}", "public function getReply()\n {\n return $this->reply;\n }", "function fetch($permissionhalt=true) {\n global $USER;\n if (!$this->id) {\n return false;\n }\n $ticket = get_record('helpdesk_ticket', 'id', $this->id);\n if (!$ticket) {\n return false;\n }\n # Check for permission before proceeding.\n if (!helpdesk_is_capable(HELPDESK_CAP_ASK) or $ticket->userid != $USER->id) {\n if (!helpdesk_is_capable(HELPDESK_CAP_ANSWER, $permissionhalt)) {\n return false;\n }\n }\n\n $this->parse_db_ticket($ticket);\n $updates = get_records('helpdesk_ticket_update', 'ticketid',\n $this->id, 'timecreated DESC');\n $tags = get_records('helpdesk_ticket_tag', 'ticketid',\n $this->id, 'name ASC');\n $this->status = get_record('helpdesk_status', 'id', $this->status);\n if(!is_object($this->status)) {\n error(\"Invalid status id on ticket $this->id.\");\n }\n $this->parse_db_updates($updates);\n $this->parse_db_tags($tags);\n\n return true;\n }", "public function isAutoReplyEnabled()\n {\n return $this->isAutoReplyEnabled;\n }", "private function _checkMessageFor()\n {\n return;\n \n $dbh = $this->_connectToDb();\n \n $stmt = $dbh->query(\"SELECT message, when, from FROM messages WHERE LOWER(nick) = '\". strtolower(trim($this->_data->nick)) .\"' AND seen = 0 ORDER BY id DESC LIMIT 1\");\n \n $row = $stmt->fetch(PDO::FETCH_OBJ);\n\n if (isset($row->when)) {\n\n $this->_privmessage(\n 'I have a message for you from '. $row->from,\n $this->_data->nick\n );\n $this->_privmessage(\n 'Message begin: '. $row->message .' :: Message End',\n $this->_data->nick\n );\n $this->_privmessage(\n 'Send: '. $row->when,\n $this->_data->nick\n );\n }\n }", "function is_more_interesting_submission($subm_a, $subm_b) {\n\t\tif ($subm_b === false || $subm_b === null) return true;\n\t\t// keep the last/best one\n\t\tif ($this->attribute_bool('keep best')) {\n\t\t\t$status_a = Status::base_status_group($subm_a->status);\n\t\t\t$status_b = Status::base_status_group($subm_b->status);\n\t\t\tif ($status_a > $status_b) return true;\n\t\t\tif ($status_a < $status_b) return false;\n\t\t}\n\t\treturn $subm_a->time >= $subm_b->time;\n\t}", "function threads_get()\n\t{\n\t\t$this->check_board();\n\n\t\tif ($this->get('page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('page') > 500)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 500 pages.')), 404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page = intval($this->get('page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = 1;\n\t\t}\n\n\n\t\tif ($this->get('per_page'))\n\t\t{\n\t\t\tif (!is_natural($this->get('per_page')))\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __(\"Invalid value for 'per_page'.\")), 404);\n\t\t\t}\n\t\t\telse if ($this->get('per_page') > 50)\n\t\t\t{\n\t\t\t\t$this->response(array('error' => __('Unable to return more than 50 threads per page.')),\n\t\t\t\t\t404);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$per_page = intval($this->get('per_page'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$per_page = 25;\n\t\t}\n\n\n\n\t\t$posts = $this->post->get_latest(get_selected_radix(), $page, array('per_page' => $per_page));\n\t\tif (count($posts) > 0)\n\t\t{\n\t\t\t$this->response($posts, 200); // 200 being the HTTP response code\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('error' => __('Unable to locate any threads.')), 404);\n\t\t}\n\t}", "public function getLastMessage(): ?MessageInterface;", "function post_new_reply() {\n\tglobal $core, $document, $user, $boards, $threads, $posts, $db;\n\n\tif (!isset($_POST['thread_id']) || !isset($_POST['board_id']) || !isset($_POST['post_name']) || !isset($_POST['post_message'])) {\n\t\tfatal_error(\"Some or all of the information needed to post a new message are missing. Please try again\");\n\t}\n\n\t//Make fields safe\n\t$boardid = make_safe(\"int\",$_POST['board_id']);\n\t$threadid = make_safe(\"int\",$_POST['thread_id']);\n\t$postname = make_safe(\"text\",$_POST['post_name']);\n\t$postmessage = make_safe(\"text\",$_POST['post_message']);\n\n\t//Sanity check fields\n\tif (strlen($postname) < 2 || strlen($postmessage) < 10) { \n\t\tfatal_error(\"Your message title or message text is too short. Please try again\");\n\t}\n\tif (!$boards->get_board($boardid)) {\n\t\tfatal_error(\"Invalid board specified. Please try again\");\n\t} \n\tif (!$threads->get_thread($threadid)) {\n\t\tfatal_error(\"Invalid thread specified. Please try again\");\n\t}\n\n\t//Now post the message\n\t$posts->new_post($user->get(\"user_id\"),$boardid,$threadid,$postname,$postmessage);\n\n\t//Now go back to the forum\n\t$core->do_redirect(\"forumdisplay.php?f=$boardid\");\t\t\n}", "public function notifyOne() : bool{}", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "function getReply($key){\n\t$mysql=new MySQL();\n\n\t$select=$mysql->table(REPLY_TABLE)->where(\"`key`='$key'\")->select();\n\tif($select!=NULL){\t\t//There exist a reply for this key\n\n\t\tif($select[0]['type']=='text'){\t//It's a TextMessage\n\t\t\treturn new TextMessage($select[0]['content']);\n\t\t}else{\n\t\t\t$news=new NewsMessage();\n\t\t\t$news->LoadFromTX(array($select[0]['content']));\n\t\t\treturn $news;\n\t\t}\n\t}\n}", "private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function poll()\n {\n }", "function warquest_lastest_forum_post() {\r\n\t\r\n\tglobal $mid;\r\n\tglobal $sid;\r\n\tglobal $player;\r\n\tglobal $config;\r\n\t\r\n\tglobal $page;\r\n\t\r\n\tif (warquest_db_query_pattern($player, PATTERN_FORUM_SORT)==0) {\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t$query = 'select b.tid, b.fid, b.description, a.date, c.pid as pid1, c.name as name1, ';\r\n\t$query .= 'c.country as country1, d.pid as pid2, d.name as name2, d.country as country2 ';\r\n\t$query .= 'from comment as a left join topic as b on a.tid=b.tid ';\r\n\t$query .= 'left join player c on a.pid1=c.pid left join player d on b.pid=d.pid ';\r\n\t$query .= 'where a.deleted=0 and b.deleted=0 order by a.id desc limit 1';\n\t\t\t\r\n\t$result = warquest_db_query($query);\t\r\n\t$data = warquest_db_fetch_object($result);\r\n\t\r\n\tif (isset($data->tid)) {\r\n\t\t$page .= '<div class=\"subparagraph\">'.t('HOME_LASTEST_FORUM_ITEM').'</div>';\r\n\t\t$page .= '<div class=\"box\">';\r\n\t\r\n\t\t$page .= '<table>';\r\n\t\r\n\t\t$page .= '<tr>';\r\n\t\r\n\t\t$page .= '<td width=\"75\">';\r\n\t\t$page .= '<b></b>';\r\n\t\t$page .= '</td>';\r\n\t\t\r\n\t\t$page .= '<td width=\"215\">';\r\n\t\t$page .= '</td>';\r\n\r\n\t\t$page .= '<td width=\"210\">';\r\n\t\t$page .= '</td>';\r\n\t\t\r\n\t\t$page .= '</tr>';\r\n\t\t\t\t\t\t\r\n\t\t$query = 'select id from comment where deleted=0 and tid='.$data->tid;\t\r\n\t\t$result = warquest_db_query($query);\r\n\t\t$count = warquest_db_num_rows($result);\r\n\t\t\t\t\t\t\t\r\n\t\t$page .= '<tr>';\r\n\t\t\t\r\n\t\t$page .= '<td>';\r\n\t\t$page .= warquest_link('mid='.MENU_FORUMS.'&sid='.PAGE_COMMENT.'&fid='.$data->fid.'&tid='.$data->tid,\r\n\t\t\twarquest_image('other/forum.png','width=\"64\" height=\"64\"'), 'forum1');\r\n\t\t$page .= '</td>';\r\n\t\t\t\t\r\n\t\t$page .= '<td valign=\"top\">';\r\n\t\t$page .= '<span class=\"topic\">';\r\n\t\t$page .= warquest_link('mid='.MENU_FORUMS.'&sid='.PAGE_COMMENT.'&fid='.$data->fid.'&tid='.$data->tid, \r\n\t\t\twarquest_parse_smilies($data->description),'forum2');\r\n\t\t$page .= '</span>';\t\r\n\t\t$page .= '<br/>';\r\n\t\t$page .= '<i>';\t\r\n\t\t$page .= t('TOPIC_CREATED_BY', player_format($data->pid2, $data->name2, $data->country2));\r\n\t\t$page .= '</i>';\r\n\t\t\t\r\n\t\t$page .= '</td>';\r\n\t\t\t\t\r\n\t\t$page .= '<td valign=\"top\">';\r\n\t\t$page .= health_format($count).' '.t('GENERAL_MESSAGES').' ';\r\n\t\t\t\r\n\t\t$page .= '<br/>';\r\n\t\t\t\r\n\t\tif (isset($data->date)) {\r\n\t\t\t$page .= '<br/><b>'.t('GENERAL_LAST_MESSAGE').'</b><br/>';\r\n\t\r\n\t\t\t$page .= warquest_ui_ago($data->date).' '.t('GENERAL_BY').' ';\r\n\t\t\t$page .= player_format($data->pid1, $data->name1, $data->country1);\r\n\t\t}\r\n\t\t$page .= '</td>';\r\n\t\t$page .= '</tr>';\r\n\t\t\t\t\r\n\t\t$page .= '</table>';\r\n\t\t\t\r\n\t\t$page .= '</div>';\r\n\t}\r\n}", "public function testMessageThreadsV2ReplyToMessage()\n {\n }", "public function getLastsend();", "public function getRepliesEnabled()\n {\n // Check reply option\n if (!$this->getOption('nested_comments')) {\n return false;\n }\n\n // Check if depth is limited\n $maxLevel = $this->getOption('nested_depth');\n $notSpam = ($this->SpamClass() == 'notspam');\n return $notSpam && (!$maxLevel || $this->Depth < $maxLevel);\n }", "public function getPendingPost();", "public function threads()\n {\n $questions = Question::has('answers', '=', 0)\n ->where('processed', '=', false)\n ->take(200)\n ->get();\n echo count($questions);\n $created = 0;\n $updated = 0;\n foreach($questions as $question)\n {\n\n if(strpos($question['url'], \"r/AskHistorians/comments\") !== false)\n {\n $parent_id = $question->id;\n $url = explode('/', $question->url);\n array_pop($url);\n $url = implode('/', $url); \n $api = $url.\".json\";\n $client = new \\GuzzleHttp\\Client([\n 'headers' => ['User-Agent' => 'AskHistoriansConsumerBot/0.0 (by /u/steerpike404)'],\n 'verify' => false]);\n $response = $client->request(\"GET\", \n $api);\n $contents = json_decode($response->getBody());\n $collection = collect($contents[1]->data->children);\n $data = $collection->mapWithKeys(function($item) {\n return [$item->data->id => [\n 'reddit_id' => $item->data->id ?? null,\n 'body'=>$item->data->body ?? null,\n 'replies'=>$item->data->replies ?? null,\n 'body_html'=>$item->data->body_html?? null,\n 'permalink'=>$item->data->permalink ?? null,\n 'author'=>$item->data->author ?? null,\n 'author_flair_text'=> $item->data->author_flair_text ?? null,\n 'distinguished'=> $item->data->distinguished ?? null,\n 'created'=>$item->data->created ?? null]\n ];\n });\n foreach($data as $answer)\n {\n if(strpos($answer['body'], \"AskHistorians/wiki/rules\") !== false ||\n strpos(strtolower($answer['body']), \"hello everyone\") !== false ||\n strlen($answer['body']) <= 10)\n {\n //$answer['display'] = false;\n unset($data[$answer['reddit_id']]);\n }\n }\n foreach($data as $item)\n {\n $answer = Answer::updateOrCreate(['reddit_id'=>$item['reddit_id']],\n [\n 'question_id'=>$parent_id,\n 'body'=>$item['body'],\n 'replies'=>json_encode($item['replies']),\n 'body_html'=>$item['body_html'],\n 'permalink'=>$item['permalink'],\n 'author'=>$item['author'],\n 'author_flair_text'=>$item['author_flair_text'],\n 'distinguished'=>$item['distinguished'],\n 'created'=>$item['created']\n ]);\n if($answer->wasRecentlyCreated) {\n $created++;\n } else {\n $updated++;\n }\n }\n }\n $question->processed = true;\n $question->save();\n }\n $result = \"Created: \".$created.\" Updated: \".$updated;\n return $result;\n }", "protected static function repliesAction($ajax) {\n\t\tglobal $db, $user;\n\t\t$before = isset($_GET['before']) && $_GET['before'] ? +$_GET['before'] : time() + 43200;\n\t\t$userid = isset($_GET['userid']) && $_GET['userid'] ? +$_GET['userid'] : 0;\n\t\tif($rs = $db->query('select r.discussion, d.title, r.id, r.posted, r.user as canchange, u.username, u.displayname, u.avatar, case u.level when 1 then \\'new\\' when 2 then \\'known\\' when 3 then \\'trusted\\' when 4 then \\'admin\\' else null end as level, f.fan as friend, r.name, r.contacturl, r.markdown, r.html, group_concat(concat(e.posted, \\'\\t\\', eu.username, \\'\\t\\', eu.displayname) order by e.posted separator \\'\\n\\') as edits from forum_replies as r left join forum_discussions as d on d.id=r.discussion left join users as u on u.id=r.user left join users_friends as f on f.friend=r.user and f.fan=\\'' . +$user->ID . '\\' left join forum_edits as e on e.reply=r.id left join users as eu on eu.id=e.editor where r.posted<\\'' . $before . ($userid ? '\\' and r.user=\\'' . $userid : '') . '\\' group by r.id order by r.posted desc limit ' . self::MAX_THREADS)) {\n\t\t\t$ajax->Data->replies = [];\n\t\t\t$ajax->Data->latest = 0;\n\t\t\twhile($r = $rs->fetch_object()) {\n\t\t\t\t$ajax->Data->latest = $r->posted;\n\t\t\t\t$r->posted = t7format::TimeTag(t7format::DATE_LONG, $r->posted);\n\t\t\t\tif(!$user->IsLoggedIn() && substr($r->contacturl, 0, 7) == 'mailto:')\n\t\t\t\t\t$r->contacturl = '';\n\t\t\t\t$r->canchange = $user->IsLoggedIn() && ($r->canchange == $user->ID && $r->markdown || $user->IsAdmin());\n\t\t\t\tif($r->edits) {\n\t\t\t\t\t$edits = [];\n\t\t\t\t\tforeach(explode(\"\\n\", $r->edits) as $e) {\n\t\t\t\t\t\tlist($posted, $username, $display) = explode(\"\\t\", $e);\n\t\t\t\t\t\t$edits[] = ['datetime' => $posted, 'posted' => strtolower(t7format::LocalDate(t7format::DATE_LONG, $posted)), 'username' => $username, 'displayname' => $display];\n\t\t\t\t\t}\n\t\t\t\t\t$r->edits = $edits;\n\t\t\t\t}\n\t\t\t\tif(!$r->canchange)\n\t\t\t\t\tunset($r->markdown);\n\t\t\t\telseif(!$r->markdown && $user->IsAdmin())\n\t\t\t\t\t$r->markdown = $r->html;\n\t\t\t\tif($r->avatar === '')\n\t\t\t\t\t$r->avatar = t7user::DEFAULT_AVATAR;\n\t\t\t\t$ajax->Data->replies[] = $r;\n\t\t\t}\n\t\t} else\n\t\t\t$ajax->Fail('error looking up replies', $db->errno . ' ' . $db->error);\n\t}", "private function waitingLimit($number = null)\n {\n $instance = $this->getInstance($number);\n $instanceId = isset($instance[\"instance_id\"]) ? $instance[\"instance_id\"] : 0;\n $token = isset($instance[\"token\"]) ? $instance[\"token\"] : 0;\n\n $waiting = 0;\n\n if (!empty($instanceId) && !empty($token)) {\n // executing curl\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.chat-api.com/instance$instanceId/showMessagesQueue?token=$token\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 300,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => array(\n \"content-type: application/json\",\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n\n if ($err) {\n // throw some error if you want\n } else {\n $result = json_decode($response, true);\n if (isset($result[\"totalMessages\"]) && is_numeric($result[\"totalMessages\"])) {\n $waiting = $result[\"totalMessages\"];\n }\n }\n\n }\n\n return $waiting;\n\n }", "public function unauthenticated_users_may_not_add_replies() {\n \t$this->expectException('Illuminate\\Auth\\AuthenticationException');\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post('threads/some-channel/1/replies', $reply->toArray());\n }", "public function test_reply_depth_limit_can_be_reached() {\n\n $limit = (int) getenv('message_reply_limit');\n for ($i = 1; $i <= $limit + 1; $i++) {\n if ($i + 1 == $limit) {\n $this->expectException(ReplyDepthException::class);\n }\n $this->message = Message::create(\n 'a thoughtful response',\n $this->user,\n $this->message\n );\n $this->assertMessageCount($i + 1); // Replies + root message\n }\n\n }", "public function getMostRecentRequest() {\n return array_slice($this->statusRequests, -1)[0];\n }", "public function hasNewPosts()\n {\n if ($this->last_post == null) return false;\n\n $last_access = session('last_access_time');\n if (!$last_access || !($last_access instanceof Carbon)) $last_access = Carbon::now()->addDays(1);\n\n $thread_read = session('thread_persistance_data');\n if ($thread_read && is_array($thread_read) && array_key_exists($this->id, $thread_read)) {\n $read = $thread_read[$this->id];\n if ($read instanceof Carbon && $read > $last_access) $last_access = $read;\n }\n\n return $this->last_post->updated_at > $last_access;\n }", "protected function waitForPositivePreliminaryReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 1);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function findMessagesFor($recipient, $wait, $one = false) {\n $messages = [];\n $polls = 0;\n\n $recipient = $this->clean($recipient);\n\n do {\n $result = $this->db->query(\"\n SELECT id, message FROM messages\n WHERE recipient = '{$recipient}'\n AND received = 0\n ORDER BY ts;\n \");\n\n $rows = [];\n\n if ($result) {\n if ($one) {\n $row = $result->fetch_assoc();\n\n $this->db->query(\"\n UPDATE messages SET received = 1\n WHERE id = {$row['id']};\n \");\n\n if ($row) return $row['message'];\n }\n $rows = $result->fetch_all(MYSQLI_ASSOC);\n }\n\n if (count($rows) > 0) {\n foreach ($rows as $row) {\n array_push($messages, $row['message']);\n $this->db->query(\"\n UPDATE messages SET received = 1\n WHERE id = {$row['id']};\n \");\n }\n\n break;\n }\n\n if ($wait) sleep(1);\n $polls++;\n\n } while ($wait && $polls < 30);\n\n if ($one) return \"\";\n return $messages;\n }" ]
[ "0.6105781", "0.6047081", "0.5842913", "0.5809284", "0.5688852", "0.56353676", "0.55768025", "0.5522922", "0.5454064", "0.5357753", "0.53565353", "0.534966", "0.5336588", "0.531952", "0.5312552", "0.5273388", "0.524096", "0.52298135", "0.5207563", "0.5159425", "0.5134863", "0.5018167", "0.5005982", "0.4987495", "0.49633166", "0.4944049", "0.49169388", "0.4896811", "0.48730445", "0.48378003", "0.48189655", "0.48034292", "0.4792193", "0.47845432", "0.47310302", "0.4729209", "0.47110522", "0.46937445", "0.4693048", "0.4679914", "0.46703807", "0.46604958", "0.46582535", "0.46474248", "0.46437687", "0.46395144", "0.46316493", "0.4625839", "0.46185055", "0.46149823", "0.46110514", "0.45981294", "0.45882955", "0.45840025", "0.45769668", "0.45706543", "0.45654875", "0.45590934", "0.4558095", "0.4557544", "0.45277378", "0.45218748", "0.4518966", "0.45086226", "0.4504163", "0.4504098", "0.45029393", "0.44957173", "0.44944564", "0.44892693", "0.44840991", "0.4481908", "0.44788855", "0.44747928", "0.44733638", "0.44693628", "0.4460538", "0.44600847", "0.4455393", "0.44479173", "0.44399244", "0.44363883", "0.44289023", "0.44236225", "0.44159502", "0.44086018", "0.44073418", "0.4403664", "0.43969655", "0.43945104", "0.4385497", "0.43833417", "0.4382646", "0.43770936", "0.4373162", "0.4370739", "0.43659645", "0.4362964", "0.4359728", "0.43557838" ]
0.5097145
21
Threads belong to one Owner.
public function owner() { return $this->belongsTo('App\Models\User', 'user_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function owner()\n {\n return $this->conn->get('lock:' . $this->name);\n }", "public function ownsLock()\n {\n return $this->owner() === $this->id;\n }", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n for ($x = 0; $x < rand(5, 20); $x++) {\n Message::factory()\n ->for($thread)\n ->owner($thread->participants->random()->owner)\n ->create();\n }\n });\n }", "public function sender()\n {\n \t// TODO: dodaj u User modelu funkciju koja ce da ti vrati sve thread-ove gde si ili sender ili receiver\n\n\n \t// tu treba da se radi query nad Thread modelom ...\n \t// izvadi sve thread-ove gde je sender_id ili receiver_id ulogovani korisnik\n return $threads = \\Auth::user()->treads();\n \t// priveri samo na laravel dokumentaciji kako se ovo pise\n \t\n \treturn $this->belongsTo(User::class, 'sender_id');\n }", "public static function ownerOnly(){\n return TRUE;\n }", "public function owner()\n {\n return $this->belongsTo(Jetstream::userModel(), 'user_id');\n }", "protected function get_owner_id()\n {\n return $this->owner_id;\n }", "public function getowner_id()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->user_id;\n }", "public function getOwner() {\r\n return $this->owner;\r\n }", "public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id');\n }", "public function getOwner()\n {\n return $this->_owner;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "public function getOwnerId()\n {\n return $this->owner_id;\n }", "protected function handleOwner()\n {\n if ( !ezcBaseFeatures::hasFunction( 'posix_getpwuid' ) )\n {\n return;\n }\n\n $t =& $this->properties;\n\n if ( posix_geteuid() === 0 && isset( $t['userName'] ) && $t['userName'] !== '' )\n {\n if ( ( $userName = posix_getpwnam( $t['userName'] ) ) !== false )\n {\n $t['userId'] = $userName['uid'];\n }\n if ( ( $groupName = posix_getgrnam( $t['groupName'] ) ) !== false )\n {\n $t['groupId'] = $groupName['gid'];\n }\n }\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'id_owner');\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function getOwner()\n {\n return $this->owner;\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id', 'id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'owner_id', 'id');\n }", "public function isOwner();", "public function getThreadId();", "public function getThreadId();", "public function getOwner() {\n\t\treturn $this->owner;\n\t}", "public function owner()\n {\n return $this->belongsTo(Spark::userModel(), 'owner_id');\n }", "public function isOwner()\r\n {\r\n return $this->owner;\r\n }", "public function owner()\n {\n return $this->belongsTo(User::class);\n }", "public function an_authenticated_user_may_participate_in_a_thread(){\n //Given we have an authenticated user\n //$user = factory('App\\User')->create();\n $this->be($user = factory('App\\User')->create());\n //And an existing thread\n $thread = factory('App\\Thread')->create();\n\n //When the user adds a reply to the thread\n $reply = factory('App\\Reply')->make();\n\n $this->post($thread->path().'/replies', $reply->toArray());\n\n //then their reply should be visible on the page\n $this->get($thread->path())->\n assertSee($reply->body);\n }", "public function owner(): BelongsTo\n {\n return $this->belongsTo('PetWatcher\\Models\\User', 'owner');\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'user_id');\n }", "public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}", "public function getOwnerID() {\n\t\treturn $this->owner_id;\n\t}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function getOwner() {}", "public function owner(): BelongsTo\n {\n return $this->belongsTo(Hotstream::userModel(), 'user_id');\n }", "public function getOwner();", "public function getOwner();", "public function getOwner();", "public function owner(){\n\n\t\treturn $this->belongsTo('App\\User', 'user_id');\n\n\t}", "public function isOwner(): bool {\n $f3 = \\Base::instance();\n\n return $f3->get('CURRENT_USER') && !is_null($this->owner) && $f3->get('CURRENT_USER') === $this->owner->id;\n }", "public function owner(){\n return $this->belongsTo(User::class, 'owner_id', 'id');\n }", "public function getOwnerId()\n {\n return $this->_OwnerId;\n }", "public function owner(): BelongsTo\n {\n return $this->belongsTo(User::class, 'owner_id');\n }", "public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }", "public function owner()\n {\n return $this->belongsTo(User::class);\n }", "public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }", "public function isOwner()\n {\n return (\\Auth::check() and \\Auth::user()->id == $this->id);\n }", "public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }", "public function owner(){\n return $this->belongsTo('App\\Models\\User', 'owner_id');\n }", "public function isOwner()\n\t{\n\t\treturn is_null($this->CreatedBy) || $this->CreatedBy === Yii::app()->user->GUID;\n\t}", "public function owner()\n\t{\n\t\treturn $this->belongsTo('User', 'user_id');\n\t}", "public function owner()\n {\n \treturn $this->belongsTo('App\\User', 'user');\n }", "function getOwner() \n {\n return $this->instance->getOwner();\n }", "public function getOwnerEntity() {\n\t\treturn get_entity($this->owner_guid);\n\t}", "public function owner() {\n return $this->belongsTo('App\\User', 'user_id');\n }", "protected function setOwner($owner) {\r\n $this->owner = $this->create($owner);\r\n }", "public function workers()\n {\n return $this->belongsToMany(\"App\\User\")\n ->where(\"owner_id\", Auth::id());\n }", "public function owner(): BelongsTo\n\t{\n\t\treturn $this->belongsTo('App\\Models\\User', 'owner_id', 'id');\n\t}", "public function owner(): BelongsTo\n\t{\n\t\treturn $this->belongsTo('App\\Models\\User', 'owner_id', 'id');\n\t}", "public function owner()\n {\n return $this->belongsTo(User::class, 'user_id'); //foreign-key is user_id\n }", "public function isFromOwner()\n {\n return $this->fromOwner;\n }", "public function owner() {\n return $this->belongsTo('App\\Models\\User');\n }", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "public function setOwner($owner) {\n\t\t$this->owner = $owner;\n\t}", "public function owner()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function getUOwner()\n {\n return null;\n }", "public function getUOwner()\n {\n return null;\n }", "function isOwner() {\n return $this->getIsOwner();\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "public function isOwned()\n {\n return Auth::user() && $this->recipient_id === Auth::id();\n }", "public function isOwner(){\n return (count($this->rooms()) > 0);\n }", "public function owner()\n {\n return $this->belongsTo('App\\User');\n }", "public function owner()\n {\n return $this->belongsTo('App\\User');\n }", "public function owner() \n {\n return $this->belongsTo('User', 'user_id');\n }", "public function getOwner()\n {\n return $this->get(self::_OWNER);\n }", "public function hasOwner()\n {\n return $this->owner !== null;\n }", "public function owner()\n {\n return $this->hasOne(User::class);\n }", "public function owner()\n {\n return $this->belongsTo(Team::class, (new Team)->getForeignKey());\n }", "function getOwnerIdentifier()\n {\n return $this->ownerIdentifier;\n }", "public function owner () {\n\n return $this->belongsTo(\"App\\User\");\n }", "public static function isOwner(): bool\n\t{\n\t\tif(in_array( 'owner', self::getUserRole()) || in_array('administrator', self::getUserRole())) return true;\n\t\treturn false;\n\t}", "public function taskOwner()\n {\n return $this->belongsTo('App\\User', 'super_id');\n }", "public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }", "public function getOwnerusername() {}", "public function an_authenticated_user_can_participate_in_forum_threads()\n {\n //given we have an authernticated user\n $this->be($user = factory('App\\User')->create());\n // and an existing threads\n $thread = factory('App\\Thread')->create();\n // when a user adds a reply to thread\n $reply = factory('App\\Reply')->make();\n $this->post('/threads/'.$thread->id.'/replies', $reply->toArray());\n // then their reply should be visible in the page.\n $this->get($thread->path())\n -> assertSee($reply->body);\n }", "public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}", "protected function owner_matches_current_user()\n {\n }", "public function owner()\n {\n return $this->belongsTo(Spark::teamModel(), 'team_id');\n }", "public function owner(){\n // return $query->where('members', 'role', 'Owner');\n return $this->belongsToMany('\\App\\Model\\User', 'joined', 'idproject', 'iduser')->withPivot('role')->where('role', 'Owner');\n }", "public function viewedBy()\n {\n return $this->belongsToMany(\n 'App\\Models\\User',\n 'viewed_threads',\n 'thread_id',\n 'user_id'\n )\n ->using('App\\Models\\ViewedThread')\n ->withPivot('timestamp');\n }", "public function getOwner(): User\n {\n return $this->owner;\n }", "public function getOwner(){\n return $this->belongsTo('App\\User', 'id', 'owner');\n }" ]
[ "0.60078794", "0.5714955", "0.56118613", "0.55595845", "0.5543205", "0.54146844", "0.5394795", "0.53756744", "0.5357539", "0.53335136", "0.5323346", "0.53053147", "0.5304372", "0.5304111", "0.5304111", "0.5302205", "0.52927977", "0.52740467", "0.52740467", "0.52740467", "0.52705777", "0.52705777", "0.5265866", "0.5253915", "0.5253915", "0.52477664", "0.52472335", "0.5247045", "0.5245424", "0.5241571", "0.5237736", "0.5233389", "0.52011603", "0.52011603", "0.52011603", "0.52011603", "0.519283", "0.5189134", "0.5180869", "0.5180869", "0.5180869", "0.5180054", "0.5175756", "0.51750064", "0.51750064", "0.51750064", "0.51734954", "0.5170335", "0.5164529", "0.5164322", "0.51583254", "0.5157318", "0.51531374", "0.51464194", "0.513829", "0.51132494", "0.5092776", "0.50827324", "0.5082313", "0.50697416", "0.50675625", "0.50673425", "0.50644237", "0.506305", "0.50611997", "0.50588864", "0.50588864", "0.5056513", "0.505087", "0.5044847", "0.50407726", "0.50407726", "0.5038138", "0.5030359", "0.5030359", "0.50295764", "0.5013533", "0.49985376", "0.49903494", "0.49896422", "0.49896422", "0.49712878", "0.49649876", "0.49537575", "0.49496534", "0.49488586", "0.4948264", "0.4945151", "0.49362013", "0.49330175", "0.49263325", "0.4913714", "0.49012074", "0.48889202", "0.4888819", "0.48626524", "0.48444888", "0.4841994", "0.48293796", "0.4821417" ]
0.509742
56
Threads optionally belong to one Editor.
public function editor() { return $this->belongsTo('App\Models\User', 'edited_by'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignEditor($args) {\n\t\t$this->validate();\n\t\tLocale::requireComponents(array(LOCALE_COMPONENT_PKP_MANAGER)); // manager.people.noneEnrolled\n\t\t$press =& Request::getPress();\n\t\t$monographId = Request::getUserVar('monographId');\n\t\t$editorId = Request::getUserVar('editorId');\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t$submission =& $this->submission;\n\n\t\t$isSeriesEditor = $roleDao->userHasRole($press->getId(), $editorId, ROLE_ID_SERIES_EDITOR);\n\t\t$isEditor = $roleDao->userHasRole($press->getId(), $editorId, ROLE_ID_EDITOR);\n\n\t\tif (isset($editorId) && $editorId != null && ($isEditor || $isSeriesEditor)) {\n\t\t\t// A valid series editor has already been chosen;\n\t\t\t// either prompt with a modifiable email or, if this\n\t\t\t// has been done, send the email and store the editor\n\t\t\t// selection.\n\n\t\t\t$this->setupTemplate(EDITOR_SERIES_SUBMISSIONS, $monographId, 'summary');\n\n\t\t\tif (EditorAction::assignEditor($monographId, $editorId, $isEditor, Request::getUserVar('send'))) {\n\t\t\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t\t\t}\n\t\t} else {\n\t\t\t// Allow the user to choose a series editor or editor.\n\t\t\t$this->setupTemplate(EDITOR_SERIES_SUBMISSIONS, $monographId, 'summary');\n\n\t\t\t$searchType = null;\n\t\t\t$searchMatch = null;\n\t\t\t$search = Request::getUserVar('search');\n\t\t\t$searchInitial = Request::getUserVar('searchInitial');\n\t\t\tif (!empty($search)) {\n\t\t\t\t$searchType = Request::getUserVar('searchField');\n\t\t\t\t$searchMatch = Request::getUserVar('searchMatch');\n\n\t\t\t} elseif (!empty($searchInitial)) {\n\t\t\t\t$searchInitial = String::strtoupper($searchInitial);\n\t\t\t\t$searchType = USER_FIELD_INITIAL;\n\t\t\t\t$search = $searchInitial;\n\t\t\t}\n\n\t\t\t$rangeInfo =& Handler::getRangeInfo('editors');\n\t\t\t$editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\n\n\t\t\tif (isset($args[0]) && $args[0] === 'editor') {\n\t\t\t\t$roleName = 'user.role.editor';\n\t\t\t\t$rolePath = 'editor';\n\n\t\t\t\t$editors =& $editorSubmissionDao->getUsersNotAssignedToMonograph($press->getId(), $monographId, RoleDAO::getRoleIdFromPath('editor'), $searchType, $search, $searchMatch, $rangeInfo);\n\t\t\t} else {\n\t\t\t\t$roleName = 'user.role.seriesEditor';\n\t\t\t\t$rolePath = 'seriesEditor';\n\t\t\t\t$editors =& $editorSubmissionDao->getUsersNotAssignedToMonograph($press->getId(), $monographId, RoleDAO::getRoleIdFromPath('seriesEditor'), $searchType, $search, $searchMatch, $rangeInfo);\n\t\t\t}\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t\t$templateMgr->assign_by_ref('editors', $editors);\n\t\t\t$templateMgr->assign('roleName', $roleName);\n\t\t\t$templateMgr->assign('rolePath', $rolePath);\n\n\t\t\t$templateMgr->assign('monographId', $monographId);\n\n\t\t\t$seriesDao =& DAORegistry::getDAO('SeriesDAO');\n\t\t\t$seriesEditorSeries =& $seriesDao->getEditorSeries($press->getId());\n\n\t\t\t$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');\n\t\t\t$editorStatistics = $editAssignmentDao->getEditorStatistics($press->getId());\n\n\t\t\t$templateMgr->assign_by_ref('editorSeries', $seriesEditorSeries);\n\t\t\t$templateMgr->assign('editorStatistics', $editorStatistics);\n\n\t\t\t$templateMgr->assign('searchField', $searchType);\n\t\t\t$templateMgr->assign('searchMatch', $searchMatch);\n\t\t\t$templateMgr->assign('search', $search);\n\t\t\t$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));\n\n\t\t\t$templateMgr->assign('fieldOptions', Array(\n\t\t\t\tUSER_FIELD_FIRSTNAME => 'user.firstName',\n\t\t\t\tUSER_FIELD_LASTNAME => 'user.lastName',\n\t\t\t\tUSER_FIELD_USERNAME => 'user.username',\n\t\t\t\tUSER_FIELD_EMAIL => 'user.email'\n\t\t\t));\n\t\t\t$templateMgr->assign('alphaList', explode(' ', Locale::translate('common.alphaList')));\n\t\t\t$templateMgr->assign('helpTopicId', 'editorial.editorsRole.submissionSummary.submissionManagement');\t\n\t\t\t$templateMgr->display('editor/selectSeriesEditor.tpl');\n\t\t}\n\t}", "function performThreadsActionObject()\n\t{\n\t\tglobal $lng, $ilUser, $ilAccess;\n\n\t\tunset($_SESSION['threads2move']);\n\t\tunset($_SESSION['forums_search_submitted']);\n\t\tunset($_SESSION['frm_topic_paste_expand']);\t\n\n\t\tif (is_array($_POST['thread_ids']))\n\t\t{\n\t\t\tif ($_POST['selected_cmd'] == 'move')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['threads2move'] = $_POST['thread_ids'];\n\t\t\t\t\t$this->moveThreadsObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'enable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->enableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'disable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->disableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'close')\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->close();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'reopen')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->reopen();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'makesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->makeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'unmakesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->unmakeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if($_POST['selected_cmd'] == 'editThread')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$count = count($_POST['thread_ids']);\n\t\t\t\t\tif($count != 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\tforeach($_POST['thread_ids'] as $thread_id);\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->editThreadObject($thread_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'html')\n\t\t\t{\n\t\t\t\t$this->ctrl->setCmd('exportHTML');\n\t\t\t\t$this->ctrl->setCmdClass('ilForumExportGUI');\n\t\t\t\t$this->executeCommand();\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'confirmDeleteThreads')\n\t\t\t{\n\t\t\t\treturn $this->confirmDeleteThreads();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendInfo($this->lng->txt('topics_please_select_one_action'), true);\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t}\n\t}", "function isUserEditor() {\n if (null==getLoggedInUserId()) //No logged in user\n return false;\n if (getLoggedInUserId()==getActUserId()) //Logged in user views his entry\n return true;\n global $db;\n //User is editor in his own class\n if (isset($_SESSION['uRole']) && getActClassId()==$db->getLoggedInUserClassId()) {\n return strstr($_SESSION['uRole'],\"editor\")!=\"\";\n } else {\n return false;\n //TODO user is the head teacher in the class\n /*\n $p=$db->getPersonByID(getLoggedInUserId());\n //User is teacher and editor then return editor right for all classes where the teacher is head teacher\n if ($p[\"isTodoTeacher\"]==1) {\n if (strstr($_SESSION['uRole'],\"editor\")!=\"\") {\n if (isset($p[\"children\"])) {\n $c=explode(\",\", $p[\"children\"]);\n $ret = false;\n $class = getActClass();\n if (null!=$class) {\n foreach ($c as $cc) {\n if (substr($cc,0,3)==$class[\"name\"] && substr($cc,3,4)==$class[\"graduationYear\"])\n $ret=true;\n }\n }\n return $ret;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n */\n }\n}", "function is_editor($shared)\n{\n\n return $shared->permission === 'editor';\n}", "public function contentIsNotLockedForEditors() {}", "public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}", "function make_all_editors_access_all_courses ( $post_id, $user_id ) {\n $user_id = get_current_user_id();\n\n if ( user_can( $user_id, 'edit_others_courses' ) ) {\n return true;\n }\n\n $not_editor = sfwd_lms_has_access_fn( $post_id, $user_id );\n return $not_editor;\n}", "public function run()\n {\n DB::table('threads')->insert([\n 'id' => 1,\n 'creator' => 1,\n 'title' => 'Hilo inaugural de TekPlaza',\n 'locked' => false,\n 'pinned' => true,\n 'subforum' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 2,\n 'creator' => 4,\n 'title' => 'Propuesta de nuevas normas para los foros de soporte técnico',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 2,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 3,\n 'creator' => 1,\n 'title' => 'Normas del subforo general de tecnología',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 4,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 4,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 5,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 5,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 6,\n 'creator' => 5,\n 'title' => 'Normas de los subforos de marcas',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 6,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 7,\n 'creator' => 4,\n 'title' => 'Normas del subforo de montaje de PCs',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 7,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 8,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 8,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 9,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 9,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 10,\n 'creator' => 3,\n 'title' => 'Normas de los subforos de soporte técnico',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 10,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 11,\n 'creator' => 7,\n 'title' => 'Placas solares',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 12,\n 'creator' => 1,\n 'title' => 'Hilo de prueba 1234567890 abcdefg',\n 'locked' => true,\n 'pinned' => true,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 13,\n 'creator' => 6,\n 'title' => 'Hilo 1',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 14,\n 'creator' => 4,\n 'title' => 'Hilo 2',\n 'locked' => true,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n DB::table('threads')->insert([\n 'id' => 15,\n 'creator' => 2,\n 'title' => 'Hilo 3',\n 'locked' => false,\n 'pinned' => false,\n 'subforum' => 3,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function isEditor()\n {\n $int;\n foreach ( $this->u_r_id as $int )\n {\n if($int==2)\n return true;\n }\n return false;\n }", "private function is_editor() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t// A global admin can edit content or change options anywhere.\n\t\t\tif ( is_super_admin() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$user = wp_get_current_user();\n\n\t\t\t// On the WSUWP Platform, a network admin can edit content or change options\n\t\t\t// anywhere on an individual network and may not have a role assigned.\n\t\t\tif ( function_exists( 'wsuwp_is_network_admin' ) ) {\n\t\t\t\tif ( wsuwp_is_network_admin( $user->user_login ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Authors and above have (at least) the ability to publish content or delete\n\t\t\t// published content at some level.\n\t\t\t$allowed_roles = array( 'editor', 'administrator', 'author' );\n\t\t\tif ( array_intersect( $allowed_roles, $user->roles ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function contentIsNotLockedForEditors()\n {\n return $this->getBackendUser()->isAdmin() || ($this->CALC_PERMS & Permission::CONTENT_EDIT) === Permission::CONTENT_EDIT && !$this->pageinfo['editlock'];\n }", "function thread( $args )\n\t{\n\t $thread_id = (int)$args['id'];\n\t \n\t // check for existance, use threads model\n\t $threads_model = $this->app->\n\t model('forum_threads','forum/models');\n\t \n\t\t// boards model\n\t\t$boards_model = $this->app->\n\t\t model('forum_boards', 'forum/models'); \n\t \n\t // posts model\n\t $posts_model = $this->app->\n\t model('forum_posts','forum/models');\n\t \n\t // get item\n\t $thread = $threads_model->get_item( $thread_id );\n\t $thread = ( count($thread) > 0 ) ? $thread[0] : null;\n\t \n\t \n\t // imprtant stuffs\n\t if( $thread == null ){\n\t \n\t \t// redirect\n\t \t$this->app->redirect('forum');\n\t }\n\t \n\t \n // get board\n $board = $boards_model->get_item((int)$thread['board_id']);\n $board = $board[0];\n \n // set page title\n $this->view->add('page_title',\n 'Viewing thread: ' . $thread['name'] );\n \n // set index action\n $this->view->add('index_action',\n $this->app->form_path('forum'));\n \n // set board action\n $this->view->add('board_action',\n $this->app->form_path('forum/board/'.$board['id']));\n \n // good\n $this->view->add('board_name', $board['name'] );\n\t \n\t // need an action message\n\t $action_message = null;\n\t \n\t // init text area values\n\t $name_value = '';\n\t $post_value = '';\n\t \n\t \n\t // check for post\n\t if( $_SERVER['REQUEST_METHOD'] == 'POST' &&\n\t \tisset($_POST['name']) &&\n\t \t$_POST['name'] != null &&\n\t \tisset($_POST['post']) &&\n\t \t$_POST['name'] != null \n\t ){\n\t \t\n\t \t// add success\n\t \t$success = $posts_model->new_item( \n\t \t\t$this->app->user->get_user_id(), $thread_id, $_POST );\n\t \t\n\t \t// test for success\n\t \tif( $success ){\n\t \t\n\t \t\t// increment reply count\n\t \t\t$threads_model->increment_reply( $thread_id );\n\t \t\t\t \t\n\t \t\t$action_message = 'Post successfully added.';\n\t \t} else {\n\t \t\t$action_message = 'There was an error adding your post';\n\t \t}\n\t \t\n\t } elseif( $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t \t\n\t \t$action_message = 'One or more required fields was not\n\t \t\tprovided';\n\t \t\t\n\t \t// update values\n\t\t\t$name_value = 'value=\"'.$_POST['name'].'\"';\n\t\t\t$post_value = $_POST['post'];\n\t }\n\t \n\t \n\t // add them\n\t $this->view->add('name_value',$name_value);\n\t $this->view->add('post_value',$post_value);\n\t \n\t // add actio message\n\t $this->view->add('action_message',$action_message);\n\t \n\t // get limits\n\t $limit = 10;\n\t \n\t // get page\n\t $page = 0;\n\t if( isset($_GET['p']) ){\n\t $page = (int)$_GET['p'];\n\t }\n\t \n\t // get replies\n\t $posts_result = $posts_model->limit($limit)->page($page)->\n\t get_all($thread_id);\n\t \n\t //\n\t $this->view->add('posts_result',$posts_result);\n\t \n\t $reply_count = ($thread==null) ? 0 :(int)$thread['reply_count'];\n\t \n\t // add paging\n\t $this->view->add('page_info',array(\n\t // posts count\n\t 'page_count' => (int)(($reply_count) / $limit)+1,\n\t 'this_page' => $page\n\t ));\n\t \n\t \n\t // add actions\n\t $this->view->add('page_action',\n\t $this->app->form_path('forum/thread/'.$thread_id.'?p='));\n\t \n\t $this->view->add('reply_action',$this->app->\n\t form_path('forum/thread/'.$thread_id.'?p='.$page));\n\t \n\t \n\t // add to the view\n\t $this->view->add('thread_result',$thread);\n\t \n\t \n\t // get wysiwyg extension\n\t $wysiwyg = $this->app->extension('wysiwyg');\n\t \n\t}", "private function isEditor() : bool\n {\n return $this->role('editor');\n }", "protected function is_course_editor() {\n if (!$this->getSession()->getPage()->findLink(get_string('turneditingoff')) &&\n !$this->getSession()->getPage()->findLink(get_string('turneditingon'))) {\n return false;\n }\n\n return true;\n }", "function edithistory_merge_thread($arguments)\n{\n\tglobal $db, $mybb;\n\t$sqlarray = array(\n\t\t\"tid\" => \"{$arguments['tid']}\",\n\t);\n\t$db->update_query(\"edithistory\", $sqlarray, \"tid='{$arguments['mergetid']}'\");\n}", "public function run()\n {\n $subs = new Editor();\n $subs->user_id = 6;\n $subs->save();\n\n $subs = new Editor();\n $subs->user_id = 7;\n $subs->save();\n\n }", "public function actionSave()\n\t{\n\t\t// we will get called again from\n\t\t// Tinhte_XenTag_XenForo_DataWriter_Discussion_Thread::_discussionPreSave()\n\t\t$GLOBALS[Tinhte_XenTag_Constants::GLOBALS_CONTROLLERPUBLIC_THREAD_SAVE] = $this;\n\n\t\treturn parent::actionSave();\n\t}", "public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }", "public function pageIsNotLockedForEditors() {}", "public function isEditor(): bool\n {\n return $this->getClaimSafe(SharedClaimsInterface::CLAIM_USER_ROLE) === self::$userRoleEditor;\n }", "function setEditorFlags($args) {\n\t\t$this->validate();\n\n\t\t$press =& Request::getPress();\n\t\t$monographId = (int) Request::getUserVar('monographId');\n\n\t\t$monographDao =& DAORegistry::getDAO('MonographDAO');\n\t\t$monograph =& $monographDao->getMonograph($monographId);\n\n\t\tif ($monograph && $monograph->getPressId() === $press->getId()) {\n\t\t\t$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');\n\t\t\t$editAssignments =& $editAssignmentDao->getByMonographId($monographId);\n\n\t\t\twhile($editAssignment =& $editAssignments->next()) {\n\t\t\t\tif ($editAssignment->getIsEditor()) continue;\n\n\t\t\t\t$canReview = Request::getUserVar('canReview-' . $editAssignment->getEditId()) ? 1 : 0;\n\t\t\t\t$canEdit = Request::getUserVar('canEdit-' . $editAssignment->getEditId()) ? 1 : 0;\n\n\t\t\t\t$editAssignment->setCanReview($canReview);\n\t\t\t\t$editAssignment->setCanEdit($canEdit);\n\n\t\t\t\t$editAssignmentDao->updateEditAssignment($editAssignment);\n\t\t\t}\n\t\t}\n\n\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t}", "function ind_tinymce() {\n\t// check for rights\n if ( !current_user_can('edit_pages') && !current_user_can('edit_posts') ) \n \tdie(__(\"You are not allowed to be here\"));\n \t\n \trequire_once('tinymce/mce_indizar.php');\n \n die();\n}", "public function isEditor()\n {\n return $this->role()->where('id', $this->roles['EDITOR'])->exists();\n }", "final public function edit_thread(Thread $thread) {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$thread->get_author();\r\n\t\t\tif ($thread->author->user_id == $this->user_id) {\r\n\t\t\t\t$sql = \"UPDATE `threads` SET thread_text = '$thread->thread_text' AND thread_title = '$thread->thread_title' WHERE thread_id = '$thread->thread_id' LIMIT 1\";\r\n\t\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\t\tor die ($this->dbc->error);\r\n\t\t\t\treturn $thread;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthrow new OutOfBoundsException('OutOfBoundsException occured on request, the currently logged in user does not have permission to perform this action');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call edit_thread because user it not valid');\r\n\t\t}\r\n\t}", "function post_as_is_global_editor(int $user_guid = 0): bool {\n\tstatic $editors;\n\t\n\tif ($user_guid < 1) {\n\t\t$user_guid = elgg_get_logged_in_user_guid();\n\t}\n\t\n\tif ($user_guid < 1) {\n\t\treturn false;\n\t}\n\t\n\tif (!isset($editors)) {\n\t\t$editors = [];\n\t\t\n\t\t$setting = (string) elgg_get_plugin_setting('editor_guids', 'post_as');\n\t\tif (!empty($setting)) {\n\t\t\t$editors = elgg_string_to_array($setting);\n\t\t\t\n\t\t\tarray_walk($editors, function(&$guid) {\n\t\t\t\t$guid = (int) $guid;\n\t\t\t});\n\t\t}\n\t}\n\t\n\treturn in_array($user_guid, $editors);\n}", "public function hasThreads() {\n\t\treturn false;\n\t}", "public function an_authenticated_user_may_participate_in_a_thread(){\n //Given we have an authenticated user\n //$user = factory('App\\User')->create();\n $this->be($user = factory('App\\User')->create());\n //And an existing thread\n $thread = factory('App\\Thread')->create();\n\n //When the user adds a reply to the thread\n $reply = factory('App\\Reply')->make();\n\n $this->post($thread->path().'/replies', $reply->toArray());\n\n //then their reply should be visible on the page\n $this->get($thread->path())->\n assertSee($reply->body);\n }", "function doEditorLine(&$o) {\n\tglobal $isEditor,$isOwner;\n\t$class = get_class($o);\n\t$bgColor = getBgColor($class,\"normal\");\n\t$bgColorL = getBgColor($class,\"locked\");\n\t$bgColorV = getBgColor($class,\"view\");\n\t$indent = getIndent($class);\n\t$textSize = getTextSize($class);\n\tif ($class == \"story\") {\n/* \t\tif ($o->getField(\"title\") !=\"\") $extra = $o->getField(\"title\"); */\n/* \t\telse $extra = $o->getFirst(25);\t\t */\n\t\tif ($o->getField(\"title\") == \"\") $extra = $o->getFirst(25);\n\t\telse $extra = '';\n\t} else $extra = \"\";\n\n\tprint \"\\n\\t\\t<tr>\";\n\tprint \"\\n\\t\\t\\t<td style='background-color: $bgColor; padding-left: \".$indent.\"px; font-size: $textSize'>\".$o->getField(\"title\").$extra.\"</td>\";\n\t// reference $args = \"'scope',site,section,page,story\";\n\tif ($class == 'site') \n\t\t$args = \"'$class','\".$o->name.\"',0,0,0\";\n\tif ($class == 'section')\n\t\t$args = \"'$class','\".$o->owning_site.\"',\".$o->id.\",0,0\";\n\tif ($class == 'page')\n\t\t$args = \"'$class','\".$o->owning_site.\"',\".$o->owning_section.\",\".$o->id.\",0\";\n\tif ($class == 'story')\n\t\t$args = \"'$class','\".$o->owning_site.\"',\".$o->owning_section.\",\".$o->owning_page.\",\".$o->id;\n\tprint \"\\n\\t\\t\\t<td align='center' class='lockedcol' style='background-color: $bgColorL' width='18'>\".(($class!='site')?\"<input type='checkbox'\".(($o->getField(\"locked\"))?\" checked='checked'\":\"\").\" onclick=\\\"doFieldChange('',$args,'locked',\".(($o->getField(\"locked\"))?\"0\":\"1\").\");\\\" \".((!$isOwner)?\"disabled='disabled'\":\"\").\" />\":\"&nbsp;\").\"</td>\";\n\t\n\t$type = $o->getField(\"type\");\n\t\n\t$o->buildPermissionsArray();\n\t$p = $o->getPermissions();\n\t\n\t$_a = array(\"view\"=>3,\"add\"=>0,\"edit\"=>1,\"delete\"=>2);\n\tforeach ($_SESSION[editors] as $e) {\n\t\t$args1 = \"'$e',\".$args;\n\t\tforeach ($_a as $v=>$i) {\n//\t\t\tprint \"l-$e$v\";\n\t\t\t$skip = 0;\n\t\t\tif (($e == 'everyone' || $e == 'institute') && $i<3) $skip = 1;\n\t\t\tif ($class=='story' && $v == 'add') $skip = 1;\n\t\t\tif ($type != 'story' && $type != 'page' && $type != 'section' && $class != 'site' && $v == 'add') $skip=1;\n\t\t\tif ($skip) {\n\t\t\t\tprint \"\\n\\t\\t\\t<td width='18' align='center'\".(($i==3)?\" class='viewcol' style='background-color: $bgColorV'\":\" style='background-color: $bgColor'\").\">&nbsp;</td>\";\n\t\t\t} else {\n\t\t\t\tprint \"\\n\\t\\t\\t<td width='18' align='center'\".(($i==3)?\" class='viewcol' style='background-color: $bgColorV'\":\" style='background-color: $bgColor'\").\"><input type='checkbox'\".(($p[$e][$i])?\" checked='checked'\":\"\").\" onclick=\\\"doFieldChange($args1,'perms-$v',\".(($p[$e][$i])?\"0\":\"1\").\");\\\" \".(($o->getField(\"l%$e%$v\") || !$isOwner)?\"disabled='disabled'\":\"\").\" /></td>\";\n\t\t\t}\n\t\t}\n\t}\n\tprint \"\\n\\t\\t</tr>\";\n}", "public function getThreadId();", "public function getThreadId();", "function addThread()\n{\n\tif(!isset($db) || $db = NULL || !isset($connection) || $connection = NULL)\n\t{\n\t\t$db = new Database();\n\t\t$connection = $db->mysqli_db_connect();\n\t}\n\t\n\t// Re initialize the Board class\n\tif(!isset($main) || $main = NULL)\n\t{\n\t\t$main = new Board($db, $connection);\n\t}\n\t\n\tif(isset($_SESSION['angemeldet']) && $_SESSION['angemeldet'] == true || $main->boardConfig($main->getThreadBoardID($_GET['threadID']), \"guest_posts\"))\n\t{\n\n\t\tglobal $threadAddStatusArray;\n\t\tglobal $largestNumber;\n\n\t\t$threadAddStatus = false;\n\n\t\t$_SESSION['ID'] = session_id();\n\t\t$getAuthorID = $db->query(\"SELECT id FROM $db->table_accounts WHERE sid=('\".$_SESSION['ID'].\"')\");\n\n\t\twhile ($authorID = mysqli_fetch_object($getAuthorID)) {\n\t\t\t$authorIDResult = $authorID->id;\n\t\t}\n\n\t\t// VARS\n\n\t\t// BOARD ID\n\t\tif(isset($_GET['boardview']) && !isset($_GET['threadID'])) {\n\t\t\t$actualBoard = mysqli_real_escape_string($GLOBALS['connection'], $_GET['boardview']);\n\t\t} else {\n\t\t\t$getBoard = $db->query(\"SELECT main_forum_id FROM $db->table_thread WHERE id=('\".$actualThread.\"')\");\n\t\t\t\n\t\t\twhile($boardIDData = mysqli_fetch_object($getBoard)) {\n\t\t\t\t$actualBoard = $boardIDData->main_forum_id;\n\t\t\t}\n\t\t}\n\n\t\tif ((empty($_POST[\"threadAddArea\"])) || (empty($_POST[\"threadTitleInput\"]))) {\n\t\t\techo 'Sie haben nicht alle benötigten Informationen eingegeben!';\n\n\t\t} else {\n\n\t\t\t$newThreadTitle = mysqli_real_escape_string($GLOBALS['connection'], $_POST[\"threadTitleInput\"]);\n\t\t\t$content \t\t= mysqli_real_escape_string($GLOBALS['connection'], $_POST[\"threadAddArea\"]);\n\n\t\t\tif (! isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\t$client_ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t}\n\t\t\telse {\n\t\t\t$client_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t\t}\n\n\t\t\tif (strlen($newThreadTitle) \n\t\t\t< 3) {\n\t\t\techo 'Der Titel muss mindestens 3 Zeichen besitzen.';\n\t\t\treturn;\n\t\t\t};\n\n\t\t\tif (strlen($newThreadTitle) >\n\t\t\t200) {\n\t\t\techo 'Der eingegebene Titel ist zu lang. Er darf maximal 200 Zeichen beinhalten.';\n\t\t\treturn;\n\t\t\t};\n\n\t\t\tif (strlen($content) \n\t\t\t< 30) {\n\t\t\techo 'Ihr Beitrag muss mindestens 30 Zeichen besitzen.';\n\t\t\treturn;\n\t\t\t};\n\n\t\t\tif (strlen($content) >\n\t\t\t30000) {\n\t\t\techo 'Ihr Beitrag ist zu lang. Er darf maximal 30000 Zeichen beinhalten.';\n\t\t\treturn;\n\t\t\t};\n\n\t\t\tif (strlen(trim($content)) == 0) {\n\t\t\techo 'Ihr Beitrag darf nicht ausschließlich aus Leerzeichen bestehen!';\n\t\t\treturn;\n\t\t\t};\n\n\t\t\t$insertTime = time();\n\n\n\t\t\t$db->query(\"INSERT INTO $db->table_thread (main_forum_id, title, date_created, last_replyTime,last_post_author_id, posts, author_id) VALUES ('\".$actualBoard.\"', '\".$newThreadTitle.\"', '\".$insertTime.\"', '\".$insertTime.\"','\".$authorIDResult.\"', '0', '\".$authorIDResult.\"')\");\n\t\t\t$db->query(\"INSERT INTO $db->table_thread_posts (thread_id, author_id, date_posted, text) VALUES ((SELECT id FROM $db->table_thread WHERE id=(SELECT max(id) FROM $db->table_thread)), '\".$authorIDResult.\"', '\".$insertTime.\"', '\".$content.\"')\");\n\t\t\t$db->query(\"UPDATE $db->table_accdata SET post_counter=post_counter+1 WHERE account_id=(SELECT id FROM $db->table_accounts WHERE sid=('\".$_SESSION['ID'].\"'))\");\n\t\t\t$db->query(\"UPDATE $db->table_thread SET last_activity=0 WHERE last_activity=1 AND main_forum_id=('\".$actualBoard.\"')\");\n\n\t\t\t$token = mysqli_real_escape_string($GLOBALS['connection'], $_GET['token']);\n\n\t\t\t$tokenCheck = $db->query(\"SELECT token FROM $db->table_thread_saves WHERE token = ('\".$token.\"') AND user_id = (SELECT id FROM $db->table_accounts WHERE sid=('\" . $_SESSION['ID'] . \"'))\");\n\t\t\tif(isset($_GET['token']) && !empty($_GET['token']) && mysqli_num_rows($tokenCheck) >= 1) $db->query(\"DELETE FROM $db->table_thread_saves WHERE token = ('\".$token.\"') AND user_id = (SELECT id FROM $db->table_accounts WHERE sid=('\" . $_SESSION['ID'] . \"'))\");\n\n\t\t\t$rowSQL = $db->query( \"SELECT MAX( id ) AS max FROM $db->table_thread\" );\n\t\t\t$row = mysqli_fetch_array( $rowSQL );\n\t\t\t$largestNumber = $row['max'];\n\t\t\t$db->query(\"UPDATE $db->table_thread SET last_activity=1 WHERE last_activity=0 AND id=('\".$largestNumber.\"')\");\n\n\t\t\t$threadAddStatus = true;\n\t\t}\n\t\t\t$threadAddStatusArray = array(\n\t\t\t'threadAddStatus' => $threadAddStatus, \n\t\t\t'newThreadID' => $largestNumber\n\t\t\t);\n\t\t\t\n\t\t\t\treturn $threadAddStatusArray;\n\t}\n\telse\n\t\treturn;\n}", "public function edit(Thread $thread)\n {\n }", "public function merge($threadIDs) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t$threadIDArray = explode(',', $threadIDs);\n\t\tif (in_array($this->threadID, $threadIDArray)) {\n\t\t\tunset($threadIDArray[array_search($this->threadID, $threadIDArray)]);\n\t\t\t$threadIDs = implode(',', $threadIDArray);\n\t\t\tif (empty($threadIDs)) return;\n\t\t}\n\t\t\n\t\t// add views\n\t\t$sql = \"SELECT\tSUM(views) AS views\n\t\t\tFROM\twbb\".WBB_N.\"_thread\n\t\t\tWHERE\tthreadID IN (\".$threadIDs.\")\";\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\t\tif ($row['views']) {\n\t\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\t\tSET\tviews = views + \".$row['views'].\"\n\t\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t\t\n\t\t// update tags\n\t\tif (MODULE_TAGGING) {\n\t\t\trequire_once(WCF_DIR.'lib/data/tag/TagEngine.class.php');\n\t\t\t$taggable = TagEngine::getInstance()->getTaggable('com.woltlab.wbb.thread');\n\t\t\t$sql = \"UPDATE IGNORE\twcf\".WCF_N.\"_tag_to_object\n\t\t\t\tSET\t\tobjectID = \".$this->threadID.\"\n\t\t\t\tWHERE\t\ttaggableID = \".$taggable->getTaggableID().\"\n\t\t\t\t\t\tAND languageID = \".$this->languageID.\"\n\t\t\t\t\t\tAND objectID IN (\".$threadIDs.\")\";\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_tag_to_object\n\t\t\t\tWHERE\t\ttaggableID = \".$taggable->getTaggableID().\"\n\t\t\t\t\t\tAND objectID IN (\".$threadIDs.\")\";\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t\t\n\t\t// remove user stats\n\t\t$postIDs = self::getAllPostIDs($threadIDs);\n\t\tself::updateUserStats($threadIDs.','.$this->threadID, 'delete');\n\t\tPostEditor::updateUserStats($postIDs.','.self::getAllPostIDs($this->threadID), 'delete');\n\t\t\n\t\t// move posts\n\t\tPostEditor::moveAll($postIDs, $this->threadID, $this->boardID, false);\n\t\t\n\t\t// re-add user stats\n\t\t$this->refresh();\n\t\tself::updateUserStats($this->threadID, 'enable');\n\t\tPostEditor::updateUserStats(self::getAllPostIDs($this->threadID), 'enable');\n\t\t\n\t\t// delete threads\n\t\tself::deleteAllCompletely($threadIDs, false, false);\n\t}", "function xthreads_admin_common_ofe($fieldname, $fieldsOnly=false) {\r\n\tglobal $lang, $mybb, $db;\r\n\tif(!isset($lang->xthreads_js_confirm_form_submit)) $lang->load('xthreads');\r\n\t\r\n\t$fieldOptions = '';\r\n\t$query = $db->simple_select('threadfields','title,field', '', array('order_by' => 'disporder', 'order_dir' => 'asc'));\r\n\twhile($field = $db->fetch_array($query)) {\r\n\t\t$fieldOptions .= '<option value=\"'.htmlspecialchars_uni($field['field']).'\">'.strtr(htmlspecialchars_uni($field['title']), array('\\\\'=>'\\\\\\\\','\\''=>'\\\\\\'')).'</option>';\r\n\t}\r\n\t$db->free_result($query);\r\n\t\r\n\t\r\n?><script type=\"text/javascript\" src=\"jscripts/xtofedit.js?xtver=<?php echo XTHREADS_VERSION; ?>\"></script>\r\n<script type=\"text/javascript\">\r\n<!--\r\nxtOFEditorLang.confirmFormSubmit = \"<?php echo $lang->xthreads_js_confirm_form_submit; ?>\";\r\nxtOFEditorLang.windowTitle = \"<?php echo $lang->xthreads_js_edit_value; ?>\";\r\nxtOFEditorLang.saveButton = \"<?php echo $lang->xthreads_js_save_changes; ?>\";\r\nxtOFEditorLang.closeSaveChanges = \"<?php echo $lang->xthreads_js_close_save_changes; ?>\";\r\n\r\nvar ofEditor = new xtOFEditor();\r\nofEditor.src = document.getElementById('<?php echo $fieldname; ?>');\r\nofEditor.loadFunc = function(s) {\r\n\tvar a = s.replace(/\\r/g, \"\").replace(/\\{\\n\\}/g, \"\\r\").split(\"\\n\");\r\n\tvar data = [];\r\n\tfor(var i=0; i<a.length; i++) {\r\n\t\ta[i] = a[i].replace(/\\r/g, \"\\n\");\r\n\t\tvar p = a[i].indexOf(\"=\");\r\n\t\tif(p < 0) continue;\r\n\t\tdata.push([ a[i].substring(0, p).replace(/\\[\\]$/, ''), a[i].substring(p+1) ]);\r\n\t}\r\n\treturn data;\r\n};\r\nofEditor.saveFunc = function(a) {\r\n\t// find duplicates and mark as an array\r\n\tvar set = {}, arrays = {};\r\n\tfor(var i=0; i<a.length; i++) {\r\n\t\tif(a[i][0]) {\r\n\t\t\tif(a[i][0] in set)\r\n\t\t\t\tarrays[a[i][0]] = 1;\r\n\t\t\telse\r\n\t\t\t\tset[a[i][0]] = 1;\r\n\t\t}\r\n\t}\r\n\tvar ret = \"\";\r\n\tfor(var i=0; i<a.length; i++) {\r\n\t\tif(a[i][0]) {\r\n\t\t\tif(a[i][0] in arrays)\r\n\t\t\t\ta[i][0] += '[]';\r\n\t\t\tret += a[i].join(\"=\").replace(/\\n/g, \"{\\n}\") + \"\\n\";\r\n\t\t}\r\n\t}\r\n\treturn ret;\r\n};\r\nofEditor.fields = [\r\n\t{title: \"<?php echo $lang->xthreads_js_defaultfilter_field; ?>\", width: '45%', elemFunc: function(c) {\r\n\t\tvar o = appendNewChild(c, \"select\");\r\n\t\to.size = 1;\r\n\t\to.style.width = '100%';\r\n\t\t<?php if($fieldsOnly) { ?>\r\n\t\to.innerHTML = '<option value=\"\"></option><?php echo $fieldOptions; ?>';\r\n\t\t<?php } else { ?>\r\n\t\to.innerHTML = '<option value=\"\"></option><option value=\"__xt_uid\"><?php echo $lang->xthreads_filter_uid; ?></option><option value=\"__xt_lastposteruid\"><?php echo $lang->xthreads_filter_lastposteruid; ?></option><?php if($mybb->version_code >= 1500) echo '<option value=\"__xt_prefix\">', $lang->xthreads_sort_ext_prefix, '</option>'; ?><option value=\"__xt_icon\"><?php echo $lang->xthreads_sort_ext_icon; ?></option><optgroup label=\"<?php echo $lang->custom_threadfields; ?>\"><?php echo $fieldOptions; ?></optgroup>';\r\n\t\t<?php } ?>\r\n\t\treturn o;\r\n\t}},\r\n\t{title: \"<?php echo $lang->xthreads_js_defaultfilter_value; ?>\", width: '55%', elemFunc: ofEditor.textAreaFunc}\r\n];\r\n\r\nofEditor.copyStyles=true;\r\nofEditor.init();\r\n\r\n//-->\r\n</script><?php\r\n}", "function author_queue()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$session = get_session();\r\n\t//if we're logged in, shove it\r\n\t$editor = $session->get('editor', 'user');\r\n\tif(empty($editor))\r\n\theader('Location: ../index.php');\r\n\t//page assignments\r\n\t$tpl['title'] = 'Author Queue ~*~ Editor';\r\n\t$tpl['nest'] = '../';\r\n\t$tpl['keywords'] = 'fanfiction library list author queue approve editor';\r\n\t$tpl['description'] = 'Fanfiction Library Editor author approval queue';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'editorauthorqueue.html';\r\n\t//we do approve or reject first\r\n\tif(isset($_POST['approve']))\r\n\t{\r\n\t\tif(empty($_POST['comment']))\r\n\t\t{\r\n\t\t\t$tpl['error'] = 'No comments were recorded.';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//grab stuff\r\n\t\t\t$authors = $db->query('SELECT author_contact AS contact, author_name AS name FROM author WHERE author_id='.$_POST['id'].' LIMIT 1');\r\n\t\t\tif(!$authors)\r\n\t\t\t{\r\n\t\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t\t}\r\n\t\t\t$info = $authors->fetch_assoc();\r\n\t\t\t$authors->close();\r\n\t\t\t//set valid\r\n\t\t\t$authors = $db->query('UPDATE author LEFT JOIN user ON user_id=user_id_fk SET author_valid=1, author_date=NOW(), user_level=1 WHERE author_id='.$_POST['id']);\r\n\t\t\tif(!$authors)\r\n\t\t\t{\r\n\t\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t\t}\r\n\t\t\t//send mail\r\n\t\t\t$config = get_config();\r\n\t\t\tob_start();\r\n\t\t\tinclude('../../data/tpl/'.$config['theme'].'/email/authapprove.txt');\r\n\t\t\t$message = ob_get_clean();\r\n\t\t\t$headers = 'From: bot@'.$config['domain'].\"\\n\".'X-Sender: admin@'.$config['domain'].\"\\n\"\r\n\t\t\t\t.'X-Mailer: PHP'.\"\\n\".'X-Priority: 3'.\"\\n\".'Return-Path: no-reply@'.$config['domain'].\"\\n\";\r\n\t\t\tmail($info['contact'], 'Author Approved', $message, $headers);\r\n\t\t\tunset($_REQUEST['id']);\r\n\t\t}\r\n\t}\r\n\telseif(isset($_POST['reject']))\r\n\t{\r\n\t\tif(empty($_POST['comment']))\r\n\t\t{\r\n\t\t\t$tpl['error'] = 'No comments were recorded.';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//grab stuff\r\n\t\t\t$authors = $db->query('SELECT author_contact AS contact, author_name AS name FROM author WHERE author_id='.$_POST['id'].' LIMIT 1');\r\n\t\t\tif(!$authors)\r\n\t\t\t{\r\n\t\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t\t}\r\n\t\t\t$info = $authors->fetch_assoc();\r\n\t\t\t$authors->close();\r\n\t\t\t//remove author\r\n\t\t\t$authors = $db->query('DELETE FROM author WHERE author_id='.$_POST['id'].' LIMIT 1');\r\n\t\t\tif(!$authors)\r\n\t\t\t{\r\n\t\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t\t}\r\n\t\t\t//send mail\r\n\t\t\t$config = get_config();\r\n\t\t\tob_start();\r\n\t\t\tinclude('../../data/tpl/'.$config['theme'].'/email/authreject.txt');\r\n\t\t\t$message = ob_get_clean();\r\n\t\t\t$headers = 'From: bot@'.$config['domain'].\"\\n\".'X-Sender: admin@'.$config['domain'].\"\\n\"\r\n\t\t\t\t.'X-Mailer: PHP'.\"\\n\".'X-Priority: 3'.\"\\n\".'Return-Path: no-reply@'.$config['domain'].\"\\n\";\r\n\t\t\tmail($info['contact'], 'Author Rejected', $message, $headers);\r\n\t\t\tunset($_REQUEST['id']);\r\n\t\t}\r\n\t}\r\n\t//if id is set, then we show the author with approve/reject options\r\n\tif(isset($_REQUEST['id']))\r\n\t{\r\n\t\t//grab everything\r\n\t\t$authors = $db->query('SELECT author_id AS id, author_file AS file FROM author WHERE author_id='.$_REQUEST['id'].' LIMIT 1');\r\n\t\tif(!$authors)\r\n\t\t{\r\n\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t}\r\n\t\t$tpl['authors'] = $authors->fetch_assoc();\r\n\t\t$authors->close();\r\n\t}\r\n\t//otherwise we show the list\r\n\telse\r\n\t{\r\n\t\t//create abcd list\r\n\t\t$tpl['alphabet'][] = 'NUM';\r\n\t\t$i = 'A';\r\n\t\tfor($n = 0; $n < 26; $n++)\r\n\t\t{\r\n\t\t\t$tpl['alphabet'][] = $i;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$tpl['alphabet'][] = 'ALL';\r\n\t\t//now we set the letter, or it may not be\r\n\t\t$letter = !isset($_GET['l']) ? NULL : (string) $_GET['l'];\r\n\t\t//check it for idiots\r\n\t\tif($letter == 'ALL' or (!is_null($letter) and !in_array($letter, $tpl['alphabet'])))\r\n\t\t$letter = NULL;\r\n\t\t$where = '';\r\n\t\tif(!is_null($letter))\r\n\t\t{\r\n\t\t\t//append the letter\r\n\t\t\t$tpl['title'] .= ': '.$letter;\r\n\t\t\t$tpl['letter'] = $letter;\r\n\t\t\t$where = ' AND author_order=\\''.$letter.'\\' ';\r\n\t\t}\r\n\t\t//current size(limit)\r\n\t\t$size = !isset($_GET['s']) ? 50 : (int) $_GET['s'];\r\n\t\t$tpl['size'] = $size;\r\n\t\t//current page - get offset\r\n\t\t$page = !isset($_GET['p']) ? 1 : (int) $_GET['p'];\r\n\t\t$tpl['page'] = $page;\r\n\t\t//find offset\r\n\t\t$offset = ($page - 1) * $size;\r\n\t\t$tpl['offset'] = $offset + 1;\r\n\t\t//grab announcement count\r\n\t\t$count = $db->query('SELECT COUNT(author_id) FROM author WHERE author_valid=0'.$where);\r\n\t\tif(!$count)\r\n\t\t{\r\n\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t}\r\n\t\t$total = $count->fetch_row();\r\n\t\t$tpl['total'] = $total = $total[0];\r\n\t\t$count->close();\r\n\t\t//message for no authors\r\n\t\tif($total < 1)\r\n\t\t$tpl['error'] = 'No Authors Found';\r\n\t\t//do paging\r\n\t\tif($total > $size)\r\n\t\t{\r\n\t\t\t//do we need a previous link?\r\n\t\t\tif($offset > 0)\r\n\t\t\t{\r\n\t\t\t\t$tpl['prev'] = TRUE;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$tpl['prev'] = FALSE;\r\n\t\t\t}\r\n\t\t\t//pages\r\n\t\t\t$page_total = ceil($total/$size);\r\n\t\t\t//do we need a next link?\r\n\t\t\tif($page < $page_total)\r\n\t\t\t{\r\n\t\t\t\t$tpl['next'] = TRUE;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$tpl['next'] = FALSE;\r\n\t\t\t}\r\n\t\t\t$tpl['pages'] = array();\r\n\t\t\t//page array\r\n\t\t\tfor($i = 1; $i <= $page_total; $i++)\r\n\t\t\t{\r\n\t\t\t\t$tpl['pages'][$i] = $i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//grab list\r\n\t\t$authors = $db->query('SELECT author_id AS id, author_date AS date, author_name AS name, user_id AS uid, user_name AS uname FROM author LEFT JOIN user ON user_id=user_id_fk WHERE author_valid=0'.$where.' ORDER BY author_name DESC, author_id ASC LIMIT '.$offset.', '.$size);\r\n\t\tif(!$authors)\r\n\t\t{\r\n\t\t\tprintf('Errormessage: %s', $db->error);\r\n\t\t}\r\n\t\t$tpl['authors'] =& $authors ;\r\n\t}\r\n\t//create sidebar\r\n\tinclude('../../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}", "private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }", "private function getLocks()\n {\n $row = 0;\n \n foreach($this->tplVar['articles'] as $article)\n {\n // lock the user to edit\n $result = $this->model->action('article','lock',\n array('job' => 'is_locked',\n 'id_article' => (int)$article['id_article'],\n 'by_id_user' => (int)$this->viewVar['loggedUserId']) );\n \n if(($result !== TRUE) && ($result !== FALSE))\n {\n $this->tplVar['articles'][$row]['lock'] = TRUE; \n } \n else\n {\n $this->tplVar['articles'][$row]['lock'] = FALSE; \n }\n \n $row++;\n } \n }", "public function an_authenticated_user_can_participate_in_forum_threads()\n {\n //given we have an authernticated user\n $this->be($user = factory('App\\User')->create());\n // and an existing threads\n $thread = factory('App\\Thread')->create();\n // when a user adds a reply to thread\n $reply = factory('App\\Reply')->make();\n $this->post('/threads/'.$thread->id.'/replies', $reply->toArray());\n // then their reply should be visible in the page.\n $this->get($thread->path())\n -> assertSee($reply->body);\n }", "public function edit(Thread $thread)\n {\n //\n }", "public function edit(Thread $thread)\n {\n //\n }", "public function edit(Thread $thread)\n {\n //\n }", "public function apply_editor_wrap() {\n\n // Grab current screen\n $screen = get_current_screen();\n\n // Make sure we're on the correct screen\n if ( ! in_array( $screen->id, $this->screens ) ) {\n return;\n }\n\n add_action( 'edit_form_after_title', array( $this, 'before_editor' ), 100000 );\n add_action( 'edit_form_after_editor', array( $this, 'after_editor' ), 1 );\n\n }", "function botSpawEditorInit() {\n}", "function isEditor($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_EDITOR) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false;\n }", "function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = (int)$mybb->input['fid'];\r\n\t}\r\n\t\r\n\t/*\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && isset($mybb->input['xthreads_afe_'.$afe])) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t*/\r\n\t\r\n\t$update_array = array();\r\n\tforeach(array(\r\n\t\t'xthreads_tplprefix' => 1,\r\n\t\t'xthreads_langprefix' => 1,\r\n\t\t'xthreads_grouping' => 0,\r\n\t\t'xthreads_firstpostattop' => 0,\r\n\t\t'xthreads_allow_blankmsg' => 0,\r\n\t\t'xthreads_nostatcount' => 0,\r\n\t\t'xthreads_inlinesearch' => 0,\r\n\t\t'xthreads_fdcolspan_offset' => 0,\r\n\t\t'xthreads_settingoverrides' => 1,\r\n\t\t'xthreads_postsperpage' => 0,\r\n\t\t'xthreads_hideforum' => 0,\r\n\t\t'xthreads_hidebreadcrumb' => 0,\r\n\t\t'xthreads_defaultfilter' => 1,\r\n\t\t//'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => 2,\r\n\t\t'xthreads_wol_forumdisplay' => 2,\r\n\t\t'xthreads_wol_newthread' => 2,\r\n\t\t'xthreads_wol_attachment' => 2,\r\n\t\t'xthreads_wol_newreply' => 2,\r\n\t\t'xthreads_wol_showthread' => 2,\r\n\t) as $k => $is_str) {\r\n\t\tif(isset($mybb->input[$k])) {\r\n\t\t\tif($is_str) {\r\n\t\t\t\t$update_array[$k] = $db->escape_string($is_str == 2 ? trim($mybb->input[$k]) : $mybb->input[$k]);\r\n\t\t\t} else\r\n\t\t\t\t$update_array[$k] = (int)trim($mybb->input[$k]);\r\n\t\t} else {\r\n\t\t\t$update_array[$k] = $is_str ? '' : 0;\r\n\t\t}\r\n\t}\r\n\t$db->update_query('forums', $update_array, 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n\txthreads_buildtfcache();\r\n}", "function is_elementor_editor() {\n\t\treturn is_admin() && ( isset( $_GET['action'] ) && sanitize_text_field( $_GET['action'] ) === 'elementor' );\n\t}", "function mentionMeShowThreadStart()\n{\n\tglobal $mybb, $mentionScript, $mentionQuickReply,\n\t$mentionedIDs, $lang, $tid, $templates;\n\n\t// we only need the extra JS and Quick Reply additions if we are allowing multiple mentions\n\tif ($mybb->settings['mention_multiple']) {\n\t\t$multi = '_multi';\n\t\teval(\"\\$mentionQuickReply = \\\"\" . $templates->get('mentionme_quickreply_notice') . \"\\\";\");\n\n\t\t$mentionedIDs = <<<EOF\n\n\t<input type=\"hidden\" name=\"mentioned_ids\" value=\"\" id=\"mentioned_ids\" />\nEOF;\n\t}\n\n\tif ($mybb->settings['mention_minify_js']) {\n\t\t$min = '.min';\n\t}\n\n\t$mentionScript = <<<EOF\n<script type=\"text/javascript\" src=\"jscripts/MentionMe/thread{$multi}{$min}.js\"></script>\n\nEOF;\n}", "public function pageIsNotLockedForEditors()\n {\n return $this->getBackendUser()->isAdmin() || ($this->CALC_PERMS & Permission::PAGE_EDIT) === Permission::PAGE_EDIT && !$this->pageinfo['editlock'];\n }", "public function is_iframed_block_editor() {\n\t\tglobal $pagenow;\n\n\t\t// phpcs:ignore WordPress.Security.NonceVerification\n\t\treturn ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) && ! empty( $_GET['frame-nonce'] );\n\t}", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = intval($mybb->input['fid']);\r\n\t}\r\n\t\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && $mybb->input['xthreads_afe_'.$afe]) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\r\n\t$db->update_query('forums', array(\r\n\t\t'xthreads_tplprefix' => $db->escape_string(implode(',', array_map('trim', explode(',', $mybb->input['xthreads_tplprefix'])))),\r\n\t\t'xthreads_grouping' => intval(trim($mybb->input['xthreads_grouping'])),\r\n\t\t'xthreads_firstpostattop' => intval(trim($mybb->input['xthreads_firstpostattop'])),\r\n\t\t'xthreads_allow_blankmsg' => intval(trim($mybb->input['xthreads_allow_blankmsg'])),\r\n\t\t'xthreads_nostatcount' => intval(trim($mybb->input['xthreads_nostatcount'])),\r\n\t\t'xthreads_inlinesearch' => intval(trim($mybb->input['xthreads_inlinesearch'])),\r\n\t\t'xthreads_threadsperpage' => intval(trim($mybb->input['xthreads_threadsperpage'])),\r\n\t\t'xthreads_postsperpage' => intval(trim($mybb->input['xthreads_postsperpage'])),\r\n\t\t'xthreads_force_postlayout' => trim($mybb->input['xthreads_force_postlayout']),\r\n\t\t'xthreads_hideforum' => intval($mybb->input['xthreads_hideforum']),\r\n\t\t'xthreads_hidebreadcrumb' => intval($mybb->input['xthreads_hidebreadcrumb']),\r\n\t\t'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => $db->escape_string(trim($mybb->input['xthreads_wol_announcements'])),\r\n\t\t'xthreads_wol_forumdisplay' => $db->escape_string(trim($mybb->input['xthreads_wol_forumdisplay'])),\r\n\t\t'xthreads_wol_newthread' => $db->escape_string(trim($mybb->input['xthreads_wol_newthread'])),\r\n\t\t'xthreads_wol_attachment' => $db->escape_string(trim($mybb->input['xthreads_wol_attachment'])),\r\n\t\t'xthreads_wol_newreply' => $db->escape_string(trim($mybb->input['xthreads_wol_newreply'])),\r\n\t\t'xthreads_wol_showthread' => $db->escape_string(trim($mybb->input['xthreads_wol_showthread'])),\r\n\t\t'xthreads_wol_xtattachment' => $db->escape_string(trim($mybb->input['xthreads_wol_xtattachment'])),\r\n\t), 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n}", "function do_editorform($entry = array('ID'=>'0','title'=>'','shortname'=>'','content'=>'','content'=>'','author'=>'','posted'=>'','ptype'=>'public','section'=>'','comment_count'=>0,'comments_open'=>1,'tags'=>'','meta'=>'a:0:{}','meta'=>'a:0:{}')) {\n\tglobal $bj;\r\n\tob_start();\n\tif($entry['posted'] == '')\n\t\t$entry['posted'] = date('Y-m-d H:i:s'); #Fix for new posts. ?>\r\n\t\t\t<form name=\"edit-<?php echo $entry['ID']; ?>\" action=\"\" method=\"post\" class=\"editform\">\r\n\t\t\t\t<div class=\"column width25\">\r\n\t\t\t\t\t<div class=\"c-ontent\">\r\n\t\t\t\t\t\t<p class=\"label\"><label for=\"comments_open\"><?php _e('Discussion'); ?></label></p>\r\n\t\t\t\t\t\t<p><label for=\"comments_open\"><input type=\"checkbox\" name=\"comments_open\" id=\"comments_open\"<?php bj_checked($entry['comments_open'],1); ?> /> <?php _e('Enable Comments'); ?></label></p>\r\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"label\"><label for=\"section\"><?php _e('Section'); ?></label></p>\r\n\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\t<select name=\"section\" id=\"section\">\r\n<?php\r\n\t\t\t\t\t\t$sections = return_sections();\r\n\t\t\t\t\t\tforeach($sections as $section) { ?>\r\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $section['ID']; ?>\"<?php bj_selected($section['ID'],$entry['section']); ?>><?php echo $section['title']; ?></option>\r\n<?php\r\n\t\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"label\"><?php _e('Tags'); ?></p>\n\t\t\t\t\t\t<p class=\"editortaginsert\"></p>\r\n\t\t\t\t\t\t<ul class=\"taglist\">\r\n\t\t\t\t\t\t\t<li id=\"headings\"></li>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\t\t$tags = return_all_tags();\r\n\t\t\t\t\t\t$return_tags = get_entry_tags();\r\n\t\t\t\t\t\tif($tags) {\n\t\t\t\t\t\t\tforeach($tags as $tag) { ?>\r\n\t\t\t\t\t\t\t<li><label for=\"tag-<?php echo $tag['ID']; ?>\"><input type=\"checkbox\" id=\"tag-<?php echo $tag['ID']; ?>\" name=\"tags[<?php echo $tag['ID']; ?>]\"<?php\r\n\t\t\t\t\t\t\t\tforeach($return_tags as $chtag) {\r\n\t\t\t\t\t\t\t\t\tbj_checked($tag['ID'],$chtag['ID']);\r\n\t\t\t\t\t\t\t\t} ?> /> <?php echo $tag['name']; ?></label></li>\r\n<?php\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\n\t\t\t\t\t\t<p class=\"label\"><label for=\"public_entry\"><?php _e('Entry Status'); ?></label></p>\r\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<label for=\"public_entry\"><input type=\"radio\" name=\"ptype\" value=\"public\" id=\"public_entry\"<?php bj_checked($entry['ptype'],'public'); ?> /> <?php _e('Public'); ?></label><br />\r\n\t\t\t\t\t\t\t<label for=\"draft_entry\"><input type=\"radio\" name=\"ptype\" value=\"draft\" id=\"draft_entry\"<?php bj_checked($entry['ptype'],'draft'); ?> /> <?php _e('Draft'); ?></label>\n\t\t\t\t\t\t</p>\r\n<?php\r\n\t\t\t\t\trun_actions('end_editor_sidebar'); ?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"column width75\">\r\n\t\t\t\t\t<div class=\"c-ontent\">\n\t\t\t\t\t\t<p class=\"label\"><label for=\"title\"><?php _e('Title'); ?></label></p>\r\n\t\t\t\t\t\t<p><input type=\"text\" name=\"title\" id=\"title\" value=\"<?php echo formatted_for_editing($entry['title']); ?>\" class=\"width100\" /></p>\n\t\t\t\t\t\t<p class=\"label\"><label for=\"stamp_month\"><?php _e('Date and Time'); ?></label></p>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<select name=\"stamp_month\" id=\"stamp_month\">\n<?php\n\t\t\t\t\tfor($int=1;$int <= 12;$int++) {\n\t\t\t\t\t\t$num = (strlen($int) == 1) ? '0'.$int : $int; ?>\r\n\t\t\t\t\t\t\t\t<option value=\"<?php echo $num; ?>\"<?php bj_selected(get_entry_date('m',$entry['posted']),$num); ?>><?php echo $bj->locale->month[$num]; ?></option>\r\n<?php\n\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t\t</select> \r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"stamp_date\" maxlength=\"2\" size=\"2\" value=\"<?php entry_date('d',$entry['posted']); ?>\" class=\"aligncenter\" /> \r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"stamp_year\" maxlength=\"4\" size=\"4\" value=\"<?php entry_date('Y',$entry['posted']); ?>\" class=\"aligncenter\" /> <?php _e('on'); ?> \r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"stamp_hour\" maxlength=\"2\" size=\"2\" value=\"<?php entry_date('H',$entry['posted']); ?>\" class=\"aligncenter\" /> :\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"stamp_min\" maxlength=\"2\" size=\"2\" value=\"<?php entry_date('i',$entry['posted']); ?>\" class=\"aligncenter\" /> :\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"stamp_sec\" maxlength=\"2\" size=\"2\" value=\"<?php entry_date('s',$entry['posted']); ?>\" class=\"aligncenter\" />\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div id=\"editor\">\n\t\t\t\t\t\t\t<p class=\"label\"><label for=\"textarea\"><?php _e('Content'); ?></label></p>\r\n<?php bj_editbar(); ?>\r\n\t\t\t\t\t\t\t<textarea name=\"content\" id=\"textarea\"><?php echo formatted_for_editing($entry['content']); ?></textarea>\r\n\t\t\t\t\t\t</div>\r\n<?php\r\n\t\t\t\t\trun_actions('end_editor_main');\r\n\t\t\t\t\tif($entry['ID'] == \"0\") { ?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"new-entry-send\" value=\"yes\" />\r\n<?php\r\n\t\t\t\t\t} else { ?>\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"edit-entry-send\" value=\"yes\" />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"edit-entry-id\" value=\"<?php echo $entry['ID']; ?>\" />\r\n<?php\r\n\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t<p class=\"submit\">\r\n<?php\r\n\t\t\t\t\tif($entry['ID'] != \"0\") { ?>\r\n\t\t\t\t\t\t\t<input type=\"submit\" name=\"save-del\" value=\"<?php _e('Delete'); ?>\" class=\"button_deleteme\" />\r\n<?php\r\n\t\t\t\t\t} ?>\r\n\t\t\t\t\t\t\t<input type=\"submit\" name=\"save-cont\" value=\"<?php _e('Save And Continue Editing'); ?>\" /> \r\n\t\t\t\t\t\t\t<input type=\"submit\" name=\"save\" value=\"<?php _e('Save'); ?>\" />\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\n\t\t\t\t<div class=\"clear\"></div>\n<?php\n\tif(is_array(load_option('custom_fields'))) { ?>\n\t\t\t\t<div id=\"custom_fields\">\n\t\t\t\t\t<h3><?php _e('Custom Fields'); ?></h3>\n\t\t\t\t\t<table class=\"edit\">\n\t\t\t\t\t\t<tr id=\"metaheadings\" class=\"ths\">\n\t\t\t\t\t\t\t<th class=\"width40\"><?php _e('Key'); ?></th>\n\t\t\t\t\t\t\t<th class=\"width60\"><?php _e('Value'); ?></th>\n\t\t\t\t\t\t</tr>\n<?php\n\t\t$i = 1;\n\t\t$meta = unserialize($entry['meta']); #With convenience in mind. :D\n\t\tforeach(load_option('custom_fields') as $key) { ?>\n\t\t\t\t\t\t<tr id=\"entry-meta-<?php echo bj_shortname($key); ?>\" class=\"<?php tablealt($i); ?>\">\n\t\t\t\t\t\t\t<td class=\"aligncenter\">\n\t\t\t\t\t\t\t\t<?php echo $key; ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea name=\"meta[<?php echo bj_shortname($key); ?>]\" class=\"metatextarea width100\"><?php echo formatted_for_editing($meta[bj_shortname($key)]); ?></textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n<?php\n\t\t\t$i++;\n\t\t} ?>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n<?php\n\t} ?>\r\n\t\t\t</form>\r\n<?php\r\n\t$content = run_actions('entry_editor',ob_get_contents());\r\n\tob_end_clean();\r\n\techo $content;\r\n}", "public function setEditor(): self\n {\n $this->edited_by_user_id = auth()->user() ? auth()->user()->id : User::SYSUID;\n return $this;\n }", "public function get_active_editor() {\n\t\tif( $this->active_editor === null ) {\n\t\t\t$this->active_editor = $this->fetch_active_editor();\n\t\t}\n\n\t\treturn $this->active_editor;\n\t}", "public function loadRichTextEditor() {\n /* register JS scripts */\n $rte = isset($this->scriptProperties['which_editor']) ? $this->scriptProperties['which_editor'] : $this->modx->context->getOption('which_editor', '', $this->modx->_userConfig);\n \n $this->setPlaceholder('which_editor', $rte);\n /* Set which RTE if not core */\n if ($this->modx->context->getOption('use_editor', false, $this->modx->_userConfig) && !empty($rte)) {\n /* invoke OnRichTextEditorRegister event */\n $textEditors = $this->modx->invokeEvent('OnRichTextEditorRegister');\n $this->setPlaceholder('text_editors', $textEditors);\n\n $this->rteFields = array('exerplan-assessment-textarea');\n $this->setPlaceholder('replace_richtexteditor', $this->rteFields);\n\n /* invoke OnRichTextEditorInit event */\n $onRichTextEditorInit = $this->modx->invokeEvent('OnRichTextEditorInit', array(\n 'editor' => $rte,\n 'elements' => $this->rteFields,\n ));\n if (is_array($onRichTextEditorInit)) {\n $onRichTextEditorInit = implode('', $onRichTextEditorInit);\n $this->setPlaceholder('onRichTextEditorInit', $onRichTextEditorInit);\n }\n }\n }", "function caldol_bbp_enable_visual_editor_two( $args = array() ) {\n\n\n $args['tinymce'] = true;\n\t$args['media_buttons'] = true;\n\t$args['textarea_rows'] = true;\n\t$args['dfw'] = false;\n\t$args['tinymce'] = array( 'theme_advanced_buttons1' =>'bold,italic,underline,strikethrough,bullist,numlist,code,blockquote,link,unlink,outdent,indent,|,undo,redo,fullscreen',\n'theme_advanced_buttons2' => '', // 2nd row, if needed\n \t'theme_advanced_buttons3' => '', // 3rd row, if needed\n \t'theme_advanced_buttons4' => '', ); // 4th row, if needed\t\n\t$args['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');\n return $args;\t\n}", "public function canBeDeletedBy($editor)\n { return $this->canBeEditedBy($editor) && ( $this->id !== $editor->id );\n }", "function caldol_bbp_enable_visual_editor( $args = array() ) {\n\t $args['tinymce'] = true;\n\t $args['html'] = false;\n\t//$args['ckeditor'] = true;\n\treturn $args;\n}", "function enable_threaded_comments(){\n\tif (!is_admin()) {\n\t\tif (is_singular() AND comments_open() AND (get_option('thread_comments') == 1))\n\t\t\twp_enqueue_script('comment-reply');\n\t\t}\n}", "public function getOneThread()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_threads WHERE ';\n\t\t\n\t\tif($this->getMDB2Query() != '' && $this->getMDB2DataType() != '' && $this->getMDB2DataValue() != '')\n\t\t{\n\t\t\t$query .= $this->getMDB2Query();\n\t\t\t$data_type = $data_type + $this->getMDB2DataType();\n\t\t\t$data_value = $data_value + $this->getMDB2DataValue();\n\t\t\t\n\t\t\t$sql_res = $ilDB->queryf($query, $data_type, $data_value);\n\t\t\t$result = $sql_res->fetchRow(DB_FETCHMODE_ASSOC);\n\t\t\t$result[\"thr_subject\"] = trim($result[\"thr_subject\"]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function checkVisibilityAll($threadIDs, $reason = '') {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t$emptyThreads = '';\n\t\t$trashedThreads = '';\n\t\t$hiddenThreads = '';\n\t\t$enabledThreads = '';\n\t\t$restoresThreads = '';\n\t\t$sql = \"SELECT\t\tCOUNT(post.postID) AS posts,\n\t\t\t\t\tSUM(post.isDeleted) AS deletedPosts,\n\t\t\t\t\tSUM(post.isDisabled) AS hiddenPosts,\n\t\t\t\t\tthread.threadID, thread.isDeleted, thread.isDisabled\n\t\t\tFROM \t\twbb\".WBB_N.\"_thread thread\n\t\t\tLEFT JOIN \twbb\".WBB_N.\"_post post\n\t\t\tON \t\t(post.threadID = thread.threadID)\n\t\t\tWHERE \t\tthread.threadID IN (\".$threadIDs.\")\n\t\t\tGROUP BY \tthread.threadID\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$row['deletedPosts'] = intval($row['deletedPosts']);\n\t\t\t$row['hiddenPosts'] = intval($row['hiddenPosts']);\n\t\t\t\n\t\t\t// thread has no posts\n\t\t\t// delete thread\n\t\t\tif ($row['posts'] == 0) {\n\t\t\t\tif (!empty($emptyThreads)) $emptyThreads .= ',';\n\t\t\t\t$emptyThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are into the recylce bin\n\t\t\t// move thread also into the recylce bin \n\t\t\telse if ($row['posts'] == $row['deletedPosts']) {\n\t\t\t\tif (!empty($trashedThreads)) $trashedThreads .= ',';\n\t\t\t\t$trashedThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are hidden\n\t\t\t// hide thread also\n\t\t\telse if ($row['posts'] == $row['hiddenPosts'] || $row['posts'] == $row['hiddenPosts'] + $row['deletedPosts']) {\n\t\t\t\tif (!empty($hiddenThreads)) $hiddenThreads .= ',';\n\t\t\t\t$hiddenThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is deleted, but no posts are deleted\n\t\t\t// restore thread\n\t\t\telse if (intval($row['deletedPosts']) == 0 && $row['isDeleted'] == 1) {\n\t\t\t\tif (!empty($restoresThreads)) $restoresThreads .= ',';\n\t\t\t\t$restoresThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is hidden, but no posts are hidden\n\t\t\t// enable thread\n\t\t\telse if (intval($row['hiddenPosts']) == 0 && $row['isDisabled'] == 1) {\n\t\t\t\tif (!empty($enabledThreads)) $enabledThreads .= ',';\n\t\t\t\t$enabledThreads .= $row['threadID'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tself::deleteAllCompletely($emptyThreads, false, false);\n\t\tself::trashAll($trashedThreads, false, $reason);\n\t\tself::disableAll($hiddenThreads, false);\n\t\tself::restoreAll($restoresThreads, false);\n\t\tself::enableAll($enabledThreads, false);\n\t}", "function showThreadsObject()\n\t{\n\t\t$this->tpl->setRightContent($this->getRightColumnHTML());\n\t\t$this->getCenterColumnHTML();\n\t}", "public function getThread() {\r\n if (!$this->thread instanceof Thread) {\r\n throw new Exception(\"Cannot find the thread that this post belongs to\");\r\n }\r\n \r\n return $this->thread;\r\n }", "public function allowMultithreading()\n {\n return $this->_allow_multithreading;\n }", "protected function addEditors(){\n\t\t\n\t\t$users = $this->getOption('users');\n\t\tif (!$users || !is_array($users)) $this->setError('noUsers');\n\t\t\n\t\tforeach ($users as $userid)\n\t\t\tif (!is_numeric($userid) || !$this->doesUserExists($userid,$this->isDebug())) throw new ForumMException('user id ('.$userid.') is invalid');\t\t\n\t\t\n\t\tif ($this->isError()) return;\n\t\t\n\t\t$name = $this->getName();\n\t\tif (!$name){\n\t\t\t$this->retrieveForumInfo($this->getId(),$this->isDebug());\n\t\t\t$name = $this->getName();\n\t\t} \n\t\t\n\t\t$this->retrieveForumPermissions($name,$this->isDebug());\n\t\t\n\t\t$this->setEditors($users,$this->isDebug());\t\t\n\t}", "public function test_an_authenticated_user_may_participate_in_forum_threads()\n {\n $this->be($user = factory('App\\User')->create());\n \n //Add an existing thread\n $thread = factory('App\\Thread')->create();\n \n //when the user add replies to thread\n $reply = factory('App\\Reply')->create();\n $this->post('/thread/' . $thread->id . '/replies', $reply->toArray());\n }", "function sc_hide_editor() {\n\t// Get the Post ID\n\tif( isset( $_GET['post'] ) ) $post_id = $_GET['post'];\n\telseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];\n\tif( !isset( $post_id ) ) return;\n\n\t// Get the Page Template\n\t$template_file = get_post_meta($post_id, '_wp_page_template', TRUE);\n \n if( 'template-schedule.php' == $template_file || 'template-speakers.php' == $template_file )\n \techo '<style>#postdivrich{display: none;}</style>';\n}", "public static function enableAll($threadIDs, $enablePosts = true) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t// send notifications\n\t\t$statThreadIDs = '';\n\t\t$sql = \"SELECT\t*\n\t\t\tFROM\twbb\".WBB_N.\"_thread\n\t\t\tWHERE\tthreadID IN (\".$threadIDs.\")\n\t\t\t\tAND isDisabled = 1\n\t\t\t\tAND everEnabled = 0\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\tif (!empty($statThreadIDs)) $statThreadIDs .= ',';\n\t\t\t$statThreadIDs .= $row['threadID'];\n\t\t\t\n\t\t\t// send notifications\n\t\t\t$thread = new ThreadEditor(null, $row);\n\t\t\t$thread->sendNotification();\n\t\t}\n\t\t\n\t\t// update user posts & activity points\n\t\tself::updateUserStats($statThreadIDs, 'enable');\n\t\t\n\t\t// enable thread\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\tisDisabled = 0,\n\t\t\t\teverEnabled = 1\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t\n\t\t// enable post\t\n\t\tif ($enablePosts) {\n\t\t\tPostEditor::enableAll(self::getAllPostIDs($threadIDs));\n\t\t}\n\t}", "public function create()\n {\n /**\n * Placeholder for now, only \"oisenon\" user can create thread\n * \n */\n if(Auth::user()->id !== 1){\n return 'Access denied.';\n }\n return view('threads.create');\n }", "function use_block_editor_for_post($post)\n {\n }", "function setTextEditor(&$t, $auto_editor, $form_field='', $full_page=false)\r\n\t{\r\n\r\n\t\t global $CONFIG, $general_strings;\r\n\r\n\t\t $browser=browser_get_agent();\r\n\t\t if (($browser['agent']=='IE' && $browser['version']>=5.5 && $browser['platform']=='Win') || $browser['gecko_version']>='20030210' \r\n//Safari still too useless... and it hangs when you try to drag an image around.. test again after build 420 is out.\r\n//\t\t|| ($browser['agent']=='SAFARI' && $browser['version']>=420)\r\n\t\t){\r\n\r\n\t\t\t$init_ed=\"init_editor('\".$form_field.\"','Editor2', {});\";\r\n\r\n\t\t\tif(strpos($t->get_var('SCRIPT_EDITOR'),'dojo_ed.js')===false) {\r\n\t\t\t\t$t->set_var('SCRIPT_EDITOR','<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/dojo/dojo_ed.js?v2\"></script>',true);\r\n\t\t\t}\r\n\r\n\t\t\tif ($auto_editor && $form_field) {\r\n\t\t\t\t$t->set_var('SCRIPT_EDITOR','<script type=\"text/javascript\">',true);\r\n\t\t\t\t$t->set_var('SCRIPT_EDITOR',\r\n\t\t\t\t\t'dojo.addOnLoad(function() {'.$init_ed.'});',true);\r\n\t\t\t\t$t->set_var('SCRIPT_EDITOR','</script>',true);\r\n\r\n\t\t\t\t$t->set_var('EDITOR_BUTTONS_'.$form_field,'');\r\n\t\t\t\t$t->set_var('EDITOR_STYLE_'.$form_field,''); //hidden?\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$t->set_var('EDITOR_STYLE_'.$form_field,'');\r\n\t\t\t\t$t->set_var('EDITOR_BUTTONS_'.$form_field,'<span class=\"ed_button\" id=\"button_for_'.$form_field.'\"><input type=\"button\" name=\"Button\" value=\"'.$general_strings['easy_edit'].'\" class=\"small\" onClick=\"'.$init_ed.'\"></span>');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$t->set_var('EDITOR_STYLE_'.$form_field,'');\r\n\t\t\t$t->set_var('EDITOR_BUTTONS_'.$form_field,'<div class=\"ed_button\"><input type=\"button\" name=\"link\" value=\"'.$general_strings['insert_link'].'\" class=\"small\" onClick=\"make_link(\\''.$form_field.'\\')\"/>\r\n<input type=\"button\" name=\"elink\" value=\"'.$general_strings['email_link'].'\" class=\"small\" onClick=\"make_email_link(\\''.$form_field.'\\')\" /> \r\n<input type=\"button\" value=\"'.$general_strings['preview'].'\" name=\"preview\" class=\"small\" onClick=\"display_html(\\''.$form_field.'\\')\"/> \r\n<input type=\"button\" name=\"Italics\" value=\"'.$general_strings['italic_abb'].'\" class=\"small\" style=\"font-style:italic\" onClick=\"make_italics(\\''.$form_field.'\\')\" /> \r\n<input type=\"button\" name=\"Bols\" value=\"'.$general_strings['bold_abb'].'\" class=\"small\" style=\"font-weight:bold\" onClick=\"make_bold(\\''.$form_field.'\\')\"/> ');\r\n\r\n\t\t\t$t->set_var('EDITOR_BUTTONS_'.$form_field,'<input type=\"button\" name=\"image\" value=\"'.$general_strings['add_image'].'\" class=\"small\" onClick=\"get_image(\\''.$CONFIG['PATH'].'\\',\\''.$form_field.'\\');\" />',true);\r\n\r\n\t\t\tif (!($t->get_var('SCRIPT_EDITOR'))) {\r\n// \t\t\t\t$t->set_var('SCRIPT_EDITOR','<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/editor/popups/popup.js\" ></script>\r\n// \t\t\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/editor/use_dialogs.js\" ></script>', true);\r\n\r\n\t\t\t\t$t->set_var('SCRIPT_INCLUDES','<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/editor/popups/popup.js\" ></script>\r\n\t\t\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/editor/dialogs.js\" ></script>\r\n\t\t\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"'.$CONFIG['PATH'].'/includes/editor/use_dialogs.js\" ></script>\r\n\t\t\t\t', true);\r\n\t\t\t}\r\n\t\t\t$t->set_var('EDITOR_BUTTONS_'.$form_field,'</div>',true);\r\n\t\t}\r\n\t\treturn true;\r\n\t\r\n\t}", "public function run()\n {\n //\n $editorList = config('editors');\n\n foreach ($editorList as $editor) {\n $neweditor = new Editor();\n $neweditor->name = $editor['name'];\n $neweditor->lastName = $editor['lastName'];\n $neweditor->save();\n }\n }", "function effect() {\n\t\t// Get the user\n\t\t$user =& $this->_request->getUser();\n\t\tif (!is_a($user, 'PKPUser')) return AUTHORIZATION_DENY;\n\n\t\t// Get the section editor submission.\n\t\t$sectionEditorSubmission =& $this->getAuthorizedContextObject(ASSOC_TYPE_ARTICLE);\n\t\tif (!is_a($sectionEditorSubmission, 'SectionEditorSubmission')) return AUTHORIZATION_DENY;\n\n\t\t// Section editors can only access submissions in their series\n\t\t// that they have been explicitly assigned to.\n\n\t\t// 1) Retrieve the edit assignments\n\t\t$editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');\n\t\t$editAssignments =& $editAssignmentDao->getEditAssignmentsByArticleId($sectionEditorSubmission->getId());\n\t\tif (!is_a($editAssignments, 'DAOResultFactory')) return AUTHORIZATION_DENY;\n\t\t$editAssignmentsArray =& $editAssignments->toArray();\n\n\t\t// 2) Check whether the user is the article's editor,\n\t\t// otherwise deny access.\n\t\t$foundAssignment = false;\n\t\tforeach ($editAssignmentsArray as $editAssignment) {\n\t\t\tif ($editAssignment->getEditorId() == $user->getId()) {\n\t\t\t\tif ($editAssignment->getCanEdit()) $foundAssignment = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($foundAssignment) {\n\t\t\treturn AUTHORIZATION_PERMIT;\n\t\t} else {\n\t\t\treturn AUTHORIZATION_DENY;\n\t\t}\n\t}", "public static function checkForOldThreads()\r\n {\r\n /* @var $threadModel XenForo_Model_Thread */\r\n $threadModel = XenForo_Model::create('XenForo_Model_Thread');\r\n \r\n $lastPostDate = array(\r\n '>=<', \r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMaxDays * 86400),\r\n XenForo_Application::$time - (XenForo_Application::get('options')->th_notifyOldThreads_oldThreadMinDays * 86400),\r\n );\r\n \r\n $conditions = array(\r\n 'last_post_date' => $lastPostDate,\r\n \t'reply_count_th' => 0,\r\n 'discussion_state' => 'visible',\r\n 'discussion_open' => 1,\r\n );\r\n \r\n $excludedNodeIds = XenForo_Application::getOptions()->th_notifyOldThreads_forumIds;\r\n if (!empty($excludedNodeIds)) {\r\n $allowedNodeIds = array_keys(XenForo_Model::create('XenForo_Model_Node')->getAllNodes());\r\n $allowedNodeIds = array_diff($allowedNodeIds, $excludedNodeIds);\r\n $conditions['node_id'] = $allowedNodeIds;\r\n }\r\n \r\n $threadIds = $threadModel->getThreadIds($conditions);\r\n \r\n if (!empty($threadIds)) {\r\n $dw = XenForo_DataWriter::create('XenForo_DataWriter_Option');\r\n $dw->setExistingData('th_notifyOldThreads_threadIds');\r\n $dw->set('option_value', $threadIds);\r\n $dw->save();\r\n }\r\n }", "public function allow_block_editor_login() {\n\t\t// phpcs:ignore WordPress.Security.NonceVerification\n\t\tif ( empty( $_REQUEST['redirect_to'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// phpcs:ignore WordPress.Security.NonceVerification\n\t\t$query = wp_parse_url( urldecode( $_REQUEST['redirect_to'] ), PHP_URL_QUERY );\n\t\t$args = wp_parse_args( $query );\n\n\t\t// Check nonce and make sure this is a Gutenframe request.\n\t\tif ( ! empty( $args['frame-nonce'] ) && $this->framing_allowed( $args['frame-nonce'] ) ) {\n\n\t\t\t// If SSO is active, we'll let WordPress.com handle authentication...\n\t\t\tif ( Jetpack::is_module_active( 'sso' ) ) {\n\t\t\t\t// ...but only if it's not an Atomic site. They already do that.\n\t\t\t\tif ( ! jetpack_is_atomic_site() ) {\n\t\t\t\t\tadd_filter( 'jetpack_sso_bypass_login_forward_wpcom', '__return_true' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$_REQUEST['interim-login'] = true;\n\t\t\t\tadd_action( 'wp_login', array( $this, 'do_redirect' ) );\n\t\t\t\tadd_action( 'login_form', array( $this, 'add_login_html' ) );\n\t\t\t\tadd_filter( 'wp_login_errors', array( $this, 'add_login_message' ) );\n\t\t\t\tremove_action( 'login_init', 'send_frame_options_header' );\n\t\t\t\twp_add_inline_style( 'login', '.interim-login #login{padding-top:8%}' );\n\t\t\t}\n\t\t}\n\t}", "function isa_editor_manage_users()\n{\n if (get_option('isa_add_cap_editor_once') != 'done') {\n // let editor manage users\n $edit_editor = get_role('editor'); // Get the user role\n $edit_editor->add_cap('edit_users');\n $edit_editor->add_cap('list_users');\n $edit_editor->add_cap('promote_users');\n $edit_editor->add_cap('create_users');\n $edit_editor->add_cap('add_users');\n $edit_editor->add_cap('delete_users');\n\n update_option('isa_add_cap_editor_once', 'done');\n }\n}", "function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }", "function addUserTextEditor($editor_selector)\n\t{\n\t\t// must be overwritten in parent classes\n\t}", "public static function getLastEditorActivity( array $entries ) {\n\t\t$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();\n\t\t$dbr = ArticleFeedbackv5Utils::getDB( DB_REPLICA );\n\n\t\t$activity = [];\n\t\t$where = [];\n\t\t$titles = [];\n\n\t\t// build where-clause for all feedback entries\n\t\tforeach ( $entries as $entry ) {\n\t\t\t$feedback = ArticleFeedbackv5Model::get( $entry['id'], $entry['shard'] );\n\t\t\tif ( !$feedback ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$key = $cache->makeKey(\n\t\t\t\tget_called_class(),\n\t\t\t\t'getLastEditorActivity',\n\t\t\t\t$feedback->aft_id\n\t\t\t);\n\t\t\t$cachedEntry = $cache->get( $key );\n\t\t\tif ( $cachedEntry !== false ) {\n\t\t\t\t$activity[$feedback->aft_id] = $cachedEntry;\n\t\t\t} else {\n\t\t\t\t$actions = [];\n\n\t\t\t\t// we know exactly which status entry we want to fetch\n\t\t\t\tif ( $feedback->isOversighted() ) {\n\t\t\t\t\t$actions[] = 'oversight';\n\t\t\t\t} elseif ( $feedback->isHidden() ) {\n\t\t\t\t\t$actions[] = 'hide';\n\t\t\t\t\t$actions[] = 'autohide';\n\t\t\t\t} elseif ( $feedback->isArchived() ) {\n\t\t\t\t\t$actions[] = 'archive';\n\t\t\t\t} elseif ( $feedback->isResolved() ) {\n\t\t\t\t\t$actions[] = 'resolve';\n\t\t\t\t} elseif ( $feedback->isFeatured() ) {\n\t\t\t\t\t$actions[] = 'feature';\n\t\t\t\t} elseif ( $feedback->isNonActionable() ) {\n\t\t\t\t\t$actions[] = 'noaction';\n\t\t\t\t} elseif ( $feedback->isInappropriate() ) {\n\t\t\t\t\t$actions[] = 'inappropriate';\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$actions = self::buildWhereActions( [], $actions );\n\t\t\t\tif ( $actions ) {\n\t\t\t\t\t$title = self::buildWhereFeedback( $feedback );\n\t\t\t\t\t$titles[] = $title;\n\t\t\t\t\t$where[] = 'log_title = ' . $dbr->addQuotes( $title ) . ' AND ' . $actions;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// if there are entries not found in cache, fetch them from DB\n\t\tif ( $where ) {\n\t\t\t$options = [];\n\n\t\t\t// specific conditions to find the exact action we're looking for, per page\n\t\t\t$where = [ '(' . implode( ') OR (', $where ) . ')' ];\n\t\t\t$options['GROUP BY'] = [ 'log_namespace', 'log_title' ];\n\n\t\t\t$where['log_namespace'] = NS_SPECIAL;\n\t\t\t$where['log_title'] = $titles;\n\n\t\t\t/*\n\t\t\t * The goal is to fetch only the last (editor) action for every feedback\n\t\t\t * entry. To achieve this, we'll need to get all most recent ids <s>through\n\t\t\t * a subquery (the below $ids query), which will then be folded into the\n\t\t\t * main query that will get all of those last actions' details</s>.\n\t\t\t *\n\t\t\t * @note No longer using a subquery.\n\t\t\t * @see https://phabricator.wikimedia.org/T308685\n\t\t\t */\n\t\t\t$ids = ArticleFeedbackv5Utils::getDB( DB_REPLICA )->selectField(\n\t\t\t\t[ 'logging' ],\n\t\t\t\t[ 'last_id' => 'MAX(log_id)' ],\n\t\t\t\t$where,\n\t\t\t\t__METHOD__,\n\t\t\t\t$options\n\t\t\t);\n\n\t\t\t$rows = ArticleFeedbackv5Utils::getDB( DB_REPLICA )->select(\n\t\t\t\t[\n\t\t\t\t\t'logging',\n\t\t\t\t\t'actor',\n\t\t\t\t\t'comment'\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'log_id',\n\t\t\t\t\t'log_action',\n\t\t\t\t\t'log_timestamp',\n\t\t\t\t\t'log_title',\n\t\t\t\t\t'log_params',\n\t\t\t\t\t'log_user_text' => 'actor_name',\n\t\t\t\t\t'log_user' => 'actor_user',\n\t\t\t\t\t'log_actor',\n\t\t\t\t\t// lazy hack because a lot of places in the codebase still expect\n\t\t\t\t\t// log_comment to exist, so let's pretend it does :)\n\t\t\t\t\t'log_comment' => 'comment_text',\n\t\t\t\t\t// no clue if these are needed or not, but the migration layer provided\n\t\t\t\t\t// them, so I might as well fetch 'em...\n\t\t\t\t\t'comment_data',\n\t\t\t\t\t'comment_id'\n\t\t\t\t],\n\t\t\t\t[ 'log_id' => $ids ],\n\t\t\t\t__METHOD__,\n\t\t\t\t[],\n\t\t\t\t[\n\t\t\t\t\t'comment' => [ 'JOIN', 'comment_id = log_comment_id' ],\n\t\t\t\t\t'actor' => [ 'JOIN', 'actor_id = log_actor' ]\n\t\t\t\t]\n\t\t\t);\n\n\t\t\tforeach ( $rows as $action ) {\n\t\t\t\t// get feedback id from params\n\t\t\t\t$params = @unserialize( $action->log_params );\n\t\t\t\tif ( !isset( $params['feedbackId'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// cache, per feedback entry\n\t\t\t\t$key = $cache->makeKey( get_called_class(), 'getLastEditorActivity', $params['feedbackId'] );\n\t\t\t\t$cache->set( $key, $action, 60 * 60 );\n\n\t\t\t\t$activity[$params['feedbackId']] = $action;\n\t\t\t}\n\t\t}\n\n\t\treturn $activity;\n\t}", "function updateSectionEditorSubmission(&$sectionEditorSubmission) {\n\t\t// Update editor decisions\n\t\tfor ($i = 1; $i <= $sectionEditorSubmission->getCurrentRound(); $i++) {\n\t\t\t$editorDecisions =& $sectionEditorSubmission->getDecisions($i);\n\t\t\tif (is_array($editorDecisions)) {\n\t\t\t\tforeach ($editorDecisions as $key => $editorDecision) {\n\t\t\t\t\tif ($editorDecision['editDecisionId'] == null) {\n\t\t\t\t\t\t$this->update(\n\t\t\t\t\t\t\tsprintf('INSERT INTO edit_decisions\n\t\t\t\t\t\t\t\t(submission_id, round, editor_id, decision, date_decided)\n\t\t\t\t\t\t\t\tVALUES (?, ?, ?, ?, %s)',\n\t\t\t\t\t\t\t\t$this->datetimeToDB($editorDecision['dateDecided'])),\n\t\t\t\t\t\t\tarray($sectionEditorSubmission->getId(), $sectionEditorSubmission->getCurrentRound(), $editorDecision['editorId'], $editorDecision['decision'])\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$editorDecisions[$key]['editDecisionId'] = $this->_getInsertId('edit_decisions', 'edit_decision_id');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($editorDecisions);\n\t\t}\n\n\t\t// update review assignments\n\t\tforeach ($sectionEditorSubmission->getReviewAssignments() as $roundReviewAssignments) {\n\t\t\tforeach ($roundReviewAssignments as $reviewAssignment) {\n\t\t\t\tif ($reviewAssignment->getId() > 0) {\n\t\t\t\t\t$this->reviewAssignmentDao->updateObject($reviewAssignment);\n\t\t\t\t} else {\n\t\t\t\t\t$this->reviewAssignmentDao->insertObject($reviewAssignment);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove deleted review assignments\n\t\t$removedReviewAssignments = $sectionEditorSubmission->getRemovedReviewAssignments();\n\t\tfor ($i=0, $count=count($removedReviewAssignments); $i < $count; $i++) {\n\t\t\t$this->reviewAssignmentDao->deleteById($removedReviewAssignments[$i]);\n\t\t}\n\n\t\t// Update article\n\t\tif ($sectionEditorSubmission->getId()) {\n\n\t\t\t$article = parent::getById($sectionEditorSubmission->getId());\n\n\t\t\t// Only update fields that can actually be edited.\n\t\t\t$article->setSectionId($sectionEditorSubmission->getSectionId());\n\t\t\t$article->setCurrentRound($sectionEditorSubmission->getCurrentRound());\n\t\t\t$article->setStatus($sectionEditorSubmission->getStatus());\n\t\t\t$article->setDateStatusModified($sectionEditorSubmission->getDateStatusModified());\n\t\t\t$article->setLastModified($sectionEditorSubmission->getLastModified());\n\t\t\t$article->setCommentsStatus($sectionEditorSubmission->getCommentsStatus());\n\n\t\t\tparent::updateObject($article);\n\t\t}\n\n\t}", "public function copyAndMerge($threadIDs) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t// remove user stats\n\t\tself::updateUserStats($this->threadID, 'delete');\n\t\tPostEditor::updateUserStats(self::getAllPostIDs($this->threadID), 'delete');\n\t\t\n\t\t// copy posts\n\t\tPostEditor::copyAll(self::getAllPostIDs($threadIDs), $this->threadID, null, $this->boardID, false);\n\t\t\n\t\t// re-add user stats\n\t\t$this->refresh();\n\t\tself::updateUserStats($this->threadID, 'enable');\n\t\tPostEditor::updateUserStats(self::getAllPostIDs($this->threadID), 'enable');\n\t}", "function editor($selector='textarea'){\n if(!defined('__editor_script')){\n echo '<script src=\"/frontend/tinymce/tinymce.min.js\"></script>';\n define('__editor_script', 'true');\n }\n ?>\n <script type=\"text/javascript\">\n $('document').ready(function(){\n tinymce.init({\n selector: \"<? echo $selector; ?>\",\n language : \"es\",\n theme: \"modern\",\n plugins: [\n \"advlist noneditable autolink lists link image charmap print preview hr anchor pagebreak\",\n \"searchreplace wordcount visualblocks visualchars code fullscreen\",\n \"insertdatetime media nonbreaking save table contextmenu directionality\",\n \"emoticons template paste textcolor colorpicker textpattern imagetools fontawesome example \"\n ],\n toolbar1: \"insertfile undo redo | styleselect | bold italic fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image\",\n toolbar2: \"print preview media | forecolor backcolor emoticons fontawesome code\",\n image_advtab: true,\n content_style : '.mceNonEditable{background-color:red;}',\n height : \"480\",\n relative_urls: false,\n\n filemanager_title:\"Administrador de enlaces\",\n external_plugins: {\"filemanager\":\"/fm/filemanager.js\"},\n paste_enable_default_filters: false,\n extended_valid_elements : \"script[inmovil|language|src|async]\",\n content_css: '//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css',\n fontsize_formats: \"6px 8px 10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 33px 36px 39px 42px 45px 48px 50px\",\n templates : [\n {title:'Anuncio de Adsense',url:'/sites/IMCMS/anuncio.html'}\n ],\n setup : function(ed) {\n ed.on('change', function(e) {\n //alert(\"Cambio\");\n });\n }\n });\n });\n \n \n \n </script>\n <?php\n}", "private function fetchThreads() {\n\t\t\t$query = '';\n\t\t\t$boards = listBoards(true);\n\n\t\t\tforeach ($boards as $b) {\n\t\t\t\tif (in_array($b, $this->settings['exclude']))\n\t\t\t\t\tcontinue;\n\t\t\t\t// Threads are those posts that have no parent thread\n\t\t\t\t$query .= \"SELECT *, '$b' AS `board` FROM ``posts_$b`` \" .\n\t\t\t\t\t\"WHERE `thread` IS NULL UNION ALL \";\n\t\t\t}\n\n\t\t\t$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);\n\t\t\t$result = query($query) or error(db_error());\n\n\t\t\treturn $result->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "protected function findDeckThread()\n {\n $request = $this->request();\n\n $player = $this->getCurrentPlayer();\n $dbEntityDeck = $this->dbEntity()->deck();\n $dbEntityForumThread = $this->dbEntity()->forumThread();\n\n $this->result()->setCurrent('Decks');\n $deckId = $request['find_deck_thread'];\n\n // check access rights\n if (!$this->checkAccess('create_thread')) {\n throw new Exception('Access denied', Exception::WARNING);\n }\n\n // validate card id\n if (!is_numeric($deckId)) {\n throw new Exception('Invalid deck id ' . $deckId, Exception::WARNING);\n }\n\n // find related forum thread\n $result = $dbEntityForumThread->deckThread($deckId);\n if ($result->isError()) {\n throw new Exception('Failed to find thread by deck id ' . $deckId);\n }\n $threadId = ($result->isSuccess()) ? $result[0]['thread_id'] : 0;\n\n // thread not found - create new thread\n if (!$threadId) {\n $deck = $dbEntityDeck->getDeckAsserted($deckId);\n\n // use deck name as thread title\n $title = $deck->getDeckName();\n $thread = $dbEntityForumThread->createThread(\n $title, $player->getUsername(), 'normal', ForumThread::DECKS_SECTION_ID, $deckId\n );\n if (!$thread->save()) {\n throw new Exception('Failed to create new thread');\n }\n\n $threadId = $thread->getThreadId();\n }\n\n $this->result()\n ->changeRequest('current_thread', $threadId)\n ->setCurrent('Forum_thread');\n }", "function kindred_disable_classic_editor()\r\n{\r\n $screen = get_current_screen();\r\n if ('page' !== $screen->id || !isset($_GET['post'])) {\r\n return;\r\n }\r\n\r\n if (kindred_disable_editor($_GET['post'])) {\r\n remove_post_type_support('page', 'editor');\r\n }\r\n}", "function __th_cron_emu($forum_id, $run=1)\n{\n\t$exp = db_all('SELECT fud26_thread.id FROM fud26_tv_'. $forum_id .'\n\t\t\tINNER JOIN fud26_thread ON fud26_thread.id=fud26_tv_'. $forum_id .'.thread_id\n\t\t\tINNER JOIN fud26_msg ON fud26_thread.root_msg_id=fud26_msg.id\n\t\t\tWHERE fud26_tv_'. $forum_id .'.id>'. (q_singleval('SELECT seq FROM fud26_tv_'. $forum_id .' ORDER BY seq DESC LIMIT 1') - 50).' \n\t\t\t\tAND fud26_tv_'. $forum_id .'.iss>0\n\t\t\t\tAND fud26_thread.thread_opt>=2 \n\t\t\t\tAND (fud26_msg.post_stamp+fud26_thread.orderexpiry)<='. __request_timestamp__);\n\tif ($exp) {\n\t\tq('UPDATE fud26_thread SET orderexpiry=0, thread_opt=(thread_opt & ~(2|4)) WHERE id IN('. implode(',', $exp) .')');\n\t\t$exp = 1;\n\t}\n\n\t/* Remove expired moved thread pointers. */\n\tq('DELETE FROM fud26_thread WHERE forum_id='. $forum_id .' AND moved_to>0 AND last_post_date<'.(__request_timestamp__ - 86400 * $GLOBALS['MOVED_THR_PTR_EXPIRY']));\n\tif (($aff_rows = db_affected())) {\n\t\tq('UPDATE fud26_forum SET thread_count=thread_count-'. $aff_rows .' WHERE thread_count>0 AND id='. $forum_id);\n\t\tif (!$exp) {\n\t\t\t$exp = 1;\n\t\t}\n\t}\n\n\tif ($exp && $run) {\n\t\trebuild_forum_view_ttl($forum_id,1);\n\t}\n\n\treturn $exp;\n}", "function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = \\true, $tab_index = 2, $extended = \\true)\n {\n }", "public static function copyAll($threadIDs, $boardID) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t// copy 'thread' data\n\t\t$mapping = array();\n\t\t$sql = \"SELECT\t*\n\t\t\tFROM \twbb\".WBB_N.\"_thread\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$thread = new ThreadEditor(null, $row);\n\t\t\t$mapping[$thread->threadID] = $thread->copy($boardID);\n\t\t}\n\t\t\n\t\t// copy 'thread_announcement' data\n\t\t$sql = \"SELECT\t*\n\t\t\tFROM \twbb\".WBB_N.\"_thread_announcement\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$sql = \"INSERT INTO\twbb\".WBB_N.\"_thread_announcement\n\t\t\t\t\t\t(boardID, threadID)\n\t\t\t\tVALUES \t\t(\".$row['boardID'].\", \".$mapping[$row['threadID']].\")\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t\t\n\t\t// copy 'thread_rating' data\n\t\t$sql = \"SELECT\t*\n\t\t\tFROM \twbb\".WBB_N.\"_thread_rating\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$sql = \"INSERT INTO\twbb\".WBB_N.\"_thread_rating\n\t\t\t\t\t\t(threadID, rating, userID, ipAddress)\n\t\t\t\tVALUES\t\t(\".$mapping[$row['threadID']].\", \".$row['rating'].\",\n\t\t\t\t\t\t\".$row['userID'].\", '\".escapeString($row['ipAddress']).\"')\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t\t\n\t\t// copy 'thread_subscription' data\n\t\t$sql = \"SELECT\t*\n\t\t\tFROM \twbb\".WBB_N.\"_thread_subscription\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$sql = \"INSERT INTO \twbb\".WBB_N.\"_thread_subscription\n\t\t\t\t\t\t(userID, threadID, enableNotification, emails)\n\t\t\t\tVALUES\t\t(\".$row['userID'].\", \".$mapping[$row['threadID']].\",\n\t\t\t\t\t\t\".$row['enableNotification'].\", \".$row['emails'].\")\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t\t\n\t\t// copy 'thread_visit' data\n\t\t$sql = \"SELECT \t*\n\t\t\tFROM \twbb\".WBB_N.\"_thread_visit\n\t\t\tWHERE \tthreadID IN (\".$threadIDs.\")\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$sql = \"INSERT INTO \twbb\".WBB_N.\"_thread_visit\n\t\t\t\t\t\t(threadID, userID, lastVisitTime)\n\t\t\t\tVALUES\t\t(\".$mapping[$row['threadID']].\", \".$row['userID'].\", \".$row['lastVisitTime'].\")\";\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t\t\n\t\t// update user posts & activity points\n\t\tself::updateUserStats($threadIDs, 'copy', $boardID);\n\t\t\n\t\t// copy posts (and polls, attachments)\n\t\tPostEditor::copyAll(self::getAllPostIds($threadIDs), null, $mapping, $boardID);\n\t\t\n\t\t// check prefixes\n\t\tself::checkPrefixes(implode(',', $mapping), $boardID);\n\t}", "public function getThread()\n {\n return $this->hasOne(InboxThread::className(), ['id' => 'thread_id']);\n }", "public function getEditor();", "public static function getMarkedThreads() {\n\t\t$sessionVars = WCF::getSession()->getVars();\n\t\tif (isset($sessionVars['markedThreads'])) {\n\t\t\treturn $sessionVars['markedThreads'];\n\t\t}\n\t\treturn null;\n\t}", "function kindred_disable_editor($id = false)\r\n{\r\n $excluded_templates = [\r\n // 'contact.php'\r\n ];\r\n\r\n $excluded_ids = [\r\n // get_option( 'page_on_front' )\r\n ];\r\n\r\n if (empty($id)) {\r\n return false;\r\n }\r\n\r\n $id = intval($id);\r\n $template = get_page_template_slug($id);\r\n\r\n return in_array($id, $excluded_ids) || in_array($template, $excluded_templates);\r\n}", "public function addParticipants(iterable $participants): ThreadInterface;", "function ocf_perform_multi_moderation($id,$topic_id,$reason,$post_text='',$is_emphasised=1,$skip_sig=0)\n{\n\t$topic_details=$GLOBALS['FORUM_DB']->query_select('f_topics',array('t_forum_id','t_cache_first_title','t_cache_first_post_id'),array('id'=>$topic_id),'',1);\n\tif (!array_key_exists(0,$topic_details)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\t$from=$topic_details[0]['t_forum_id'];\n\tif (!ocf_may_perform_multi_moderation($from)) access_denied('I_ERROR');\n\n\t$mm=$GLOBALS['FORUM_DB']->query_select('f_multi_moderations',array('*'),array('id'=>$id));\n\tif (!array_key_exists(0,$mm)) warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n\n\trequire_code('ocfiltering');\n\t$idlist=ocfilter_to_idlist_using_db($mm[0]['mm_forum_multi_code'],'id','f_forums','f_forums','f_parent_forum','f_parent_forum','id',true,true,$GLOBALS['FORUM_DB']);\n\tif (!in_array($from,$idlist)) warn_exit(do_lang_tempcode('MM_APPLY_TWICE'));\n\n\t$pin_state=$mm[0]['mm_pin_state'];\n\t$open_state=$mm[0]['mm_open_state'];\n\t$sink_state=$mm[0]['mm_sink_state'];\n\t$move_to=$mm[0]['mm_move_to'];\n\t$title_suffix=$mm[0]['mm_title_suffix'];\n\t//$post_text=$mm[0]['mm_post_text']; We'll allow user to specify the post_text, with this as a default\n\t$update_array=array();\n\tif (!is_null($pin_state)) $update_array['t_pinned']=$pin_state;\n\tif (!is_null($sink_state)) $update_array['t_sunk']=$sink_state;\n\tif (!is_null($open_state)) $update_array['t_is_open']=$open_state;\n\tif ($title_suffix!='')\n\t{\n\t\t$new_title=$topic_details[0]['t_cache_first_title'].' ['.$title_suffix.']';\n\t\t$update_array['t_cache_first_title']=$new_title;\n\t\t$GLOBALS['FORUM_DB']->query_update('f_posts',array('p_title'=>$new_title),array('id'=>$topic_details[0]['t_cache_first_post_id']),'',1);\n\t}\n\n\tif (count($update_array)!=0)\n\t\t$GLOBALS['FORUM_DB']->query_update('f_topics',$update_array,array('id'=>$topic_id),'',1);\n\n\tif (!is_null($move_to))\n\t{\n\t\trequire_code('ocf_topics_action');\n\t\trequire_code('ocf_topics_action2');\n\t\tocf_move_topics($from,$move_to,array($topic_id));\n\t}\n\n\tif ($post_text!='')\n\t{\n\t\trequire_code('ocf_posts_action');\n\t\trequire_code('ocf_posts_action2');\n\t\trequire_code('ocf_topics_action');\n\t\trequire_code('ocf_topics_action2');\n\t\tocf_make_post($topic_id,'',$post_text,$skip_sig,false,1,$is_emphasised);\n\n\t\t$forum_id=is_null($move_to)?$from:$move_to;\n\t\thandle_topic_ticket_reply($forum_id,$topic_id,$topic_details[0]['t_cache_first_title'],$post_text);\n\t}\n\n\trequire_code('ocf_general_action2');\n\tocf_mod_log_it('PERFORM_MULTI_MODERATION',strval($id),strval($topic_id),$reason);\n}", "function isTicketter()\n {\n if($this->role != ROLE_ADMIN || $this->role != ROLE_MANAGER) { return true; }\n else {return false; }\n \n }", "function process_threads(&$set_thread_services){\r\n if ($set_thread_services != 'echo start '){\r\n thread_ctrl::run(null, null, $set_thread_services);\r\n }\r\n /* reset service threads */\r\n $set_thread_services = 'echo start ';\r\n}", "public function test_an_authenticated_user_may_participate_in_forum_threads()\n {\n $this->be($user = factory('App\\User')->create();\n\n $thread = factory('App\\Thread')->create();\n\n $reply = factory('App\\Reply')->make();\n\n $this->post('/threads/'.$thread->id.'/replies',$reply->toArray());\n\n $this->get('/threads'.$thread->id);\n\n }", "public function areMultipleExecutionsAllowed() {}", "function bg_PatchEditor(){\n // Don't bother doing this stuff if the current user lacks permissions and only in RichEditor mode\n if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') && get_user_option('rich_editing') != 'true'){\n return;\n }\n \n add_filter('tiny_mce_before_init', 'bg_AddBeyondGrammarSettings' );\n add_filter(\"tiny_mce_version\", \"bg_SetupTinyMCEPlugin\" );\n add_filter(\"mce_external_plugins\", \"bg_LoadBeyondGrammarMCEPlugin\");\n add_filter(\"mce_buttons\", \"bg_AddBeyondGrammarButton\");\n}", "public function threads()\n\t{\n\n\t\t// get sort type\n\n\n\t\t$query = Thread::where('parent_id', null)->with('user')->with('topic')->limit(20);\n\n\t\t$sort = get_string('sort', 'newest');\n\n\t\t$topic = get_int('topic', false);\n\n\t\tif($topic)\n\t\t\t$query->where('topic_id', $topic);\n\n\t\tThread::setOrder($query, $sort);\n\n\t\t$threads = $query->get();\n\n\t\t$topics = Topic::all();\n\n\t\treturn view('threads.index', compact('threads', 'sort', 'topics'));\n\t\n\t}", "function threadExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `public_forums_threads` WHERE `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }" ]
[ "0.55856884", "0.5445312", "0.5362104", "0.53467846", "0.5246736", "0.5176492", "0.5142798", "0.51255614", "0.5101547", "0.5091959", "0.50733703", "0.50306034", "0.5006213", "0.499223", "0.49452737", "0.4905289", "0.4885319", "0.48680624", "0.4853541", "0.48505396", "0.48165736", "0.48157185", "0.4792933", "0.47825524", "0.47680354", "0.47568837", "0.47191238", "0.4714626", "0.47130585", "0.47130585", "0.4689374", "0.4687647", "0.46870846", "0.46832994", "0.46794558", "0.46720603", "0.4666789", "0.4663284", "0.46433458", "0.46433458", "0.46433458", "0.46328753", "0.46290267", "0.46274042", "0.46102634", "0.4588305", "0.45732185", "0.45590904", "0.4556283", "0.4553813", "0.4543531", "0.4535921", "0.452934", "0.45277798", "0.4519225", "0.45093152", "0.4506385", "0.44944784", "0.4484755", "0.44844222", "0.44780645", "0.4473249", "0.4443059", "0.44361657", "0.44331524", "0.44316685", "0.44222054", "0.44150835", "0.44110206", "0.4406705", "0.44066605", "0.4398074", "0.43937102", "0.4391817", "0.4390165", "0.437999", "0.4377612", "0.43727", "0.4370049", "0.43664774", "0.43653053", "0.43643734", "0.43537936", "0.4347165", "0.43459865", "0.4342308", "0.4342164", "0.43392324", "0.4336116", "0.4333282", "0.43332347", "0.4330425", "0.4308083", "0.43075877", "0.43075562", "0.4296234", "0.42903632", "0.42898828", "0.42884192", "0.42883617", "0.42837867" ]
0.0
-1
Threads belong to one Channel.
public function channel() { return $this->belongsTo('App\Models\Channel'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function getChannelId()\n {\n return $this->channel_id;\n }", "public function test_a_user_can_filter_threads_according_to_a_channel()\n {\n $channel = factory('App\\Models\\Channel')->create();\n $threadInChannel = factory('App\\Models\\Thread')->create(['channel_id' => $channel->id]);\n $threadNotInChannel = factory('App\\Models\\Thread')->create();\n $this->get('/threads/'.$channel->slug)\n ->assertSee($threadInChannel->title)\n ->assertDontSee($threadNotInChannel->title);\n\n $this->assertTrue(true);\n }", "public function viewed($channel)\n {\n $service = new ThreadsService();\n $threads = $channel->threads()->get();\n $user = auth()->user();\n\n foreach ($threads as $thread) {\n $service->viewed($thread, $user);\n }\n\n return $channel;\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class);\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "public function getChannel();", "public function channel()\n {\n return $this->belongsTo('App\\Channel');\n }", "public function channel()\n {\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function channel()\n {\n return $this->belongsTo(\"App\\Channel\");\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getThread()\n {\n return $this->hasOne(InboxThread::className(), ['id' => 'thread_id']);\n }", "public function threads(){\n return $this->belongsToMany('App\\Thread');\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function index(ChannelContract $channel){\n\n return view('admin.threads.index')->with([\n 'threads' => $this->threads->with('posts')->orderBy('created_at', 'desc')->get(),\n 'channels' => $channel->get()\n ]);\n }", "function joinChannel($channel, $entry_message = null)\n\t{\n\t\t$this->sendMessageToServer(\"JOIN $channel\");\n\t\t$this->channel = $channel;\n\t\tif($entry_message != null) $this->sendChannelMessage($entry_message);\n\t}", "public function getThreadId();", "public function getThreadId();", "public function getChannel() {\n return $this->channel;\n }", "public function channel(){\n\n return $this->belongsTo('App\\Channel');\n }", "public function store($channel, Thread $thread)\n {\n $thread->subscribe();\n }", "public function thread() {\n return $this->belongsTo('Thread');\n }", "public function thread(){\n return $this->belongsTo(Thread::class);\n }", "protected function getThreads(Channel $channel, ThreadFilters $filters)\n {\n \n $threads = Thread::latest()->filter($filters);\n if ($channel->exists) {\n $threads->where('channel_id', $channel->id);\n }\n\n // dd($threads->toSql());\n\n return $threads->get();\n }", "public function getEntity() { return $this->channel; }", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }", "public function path()\n {\n return \"threads/{$this->channel->slug}/{$this->id}\";\n }", "public function channels()\n {\n $this->send(['command' => 'channels', 'seq'=>$this->getSequence()]);\n }", "public function getOneThread()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_threads WHERE ';\n\t\t\n\t\tif($this->getMDB2Query() != '' && $this->getMDB2DataType() != '' && $this->getMDB2DataValue() != '')\n\t\t{\n\t\t\t$query .= $this->getMDB2Query();\n\t\t\t$data_type = $data_type + $this->getMDB2DataType();\n\t\t\t$data_value = $data_value + $this->getMDB2DataValue();\n\t\t\t\n\t\t\t$sql_res = $ilDB->queryf($query, $data_type, $data_value);\n\t\t\t$result = $sql_res->fetchRow(DB_FETCHMODE_ASSOC);\n\t\t\t$result[\"thr_subject\"] = trim($result[\"thr_subject\"]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function channel() {\n if(is_null($this->channel)) {\n $this->channel = new Channel($this->connect()->connect([]));\n }\n \n return $this->channel;\n }", "public function channel($channel);", "public function channel($id_or_name, $synced_at = null);", "public function index($channel_id, Thread $thread)\n {\n return $thread->replies()->paginate(2);\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class)->withoutGlobalScopes(['active']);\n }", "public function threads(){\n \treturn $this->HasMany('App\\Models\\MessageThread', 'room_id');\n }", "public function channels()\n {\n return $this->belongsToMany('App\\Channel');\n }", "function getThreadById($id){\n \n return $this->find($id)->toArray(); \n }", "public function threads()\n {\n return $this->hasMany(Thread::class);\n }", "public function getChannel()\n {\n if (! $this->channel) {\n $this->set();\n }\n\n return $this->channel;\n }", "public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }", "public function create(ChannelContract $channel){\n return view('admin.threads.create')->with([\n 'channels' => $channel->get()\n ]);\n }", "public function subscribeThreads($userid, $threads);", "public function getChannel()\n {\n return $this->_access->getChannel();\n }", "public function an_authenticated_user_can_participate_in_forum_threads()\n {\n //given we have an authernticated user\n $this->be($user = factory('App\\User')->create());\n // and an existing threads\n $thread = factory('App\\Thread')->create();\n // when a user adds a reply to thread\n $reply = factory('App\\Reply')->make();\n $this->post('/threads/'.$thread->id.'/replies', $reply->toArray());\n // then their reply should be visible in the page.\n $this->get($thread->path())\n -> assertSee($reply->body);\n }", "protected function getThreads(Channel $channel, ThreadFilters $filters)\n {\n $threads = Thread::latest()->filter($filters);\n\n if ($channel->exists) {\n $threads->where('channel_id', $channel->id);\n }\n // dd($filters);\n return $threads->paginate(25);\n }", "public function getChannel()\n {\n return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel;\n }", "function channel(): Channel\n {\n return new Channel();\n }", "public function subscribeThread(ThreadRepositoryInterface $thread): PodiumResponse;", "public function sender()\n {\n \t// TODO: dodaj u User modelu funkciju koja ce da ti vrati sve thread-ove gde si ili sender ili receiver\n\n\n \t// tu treba da se radi query nad Thread modelom ...\n \t// izvadi sve thread-ove gde je sender_id ili receiver_id ulogovani korisnik\n return $threads = \\Auth::user()->treads();\n \t// priveri samo na laravel dokumentaciji kako se ovo pise\n \t\n \treturn $this->belongsTo(User::class, 'sender_id');\n }", "function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}", "public function getChannel()\n {\n $value = $this->get(self::channel);\n return $value === null ? (integer)$value : $value;\n }", "public function get_channels()\n {\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function setChannel($var)\n {\n GPBUtil::checkString($var, True);\n $this->Channel = $var;\n\n return $this;\n }", "public function setChannel($var)\n {\n GPBUtil::checkString($var, True);\n $this->Channel = $var;\n\n return $this;\n }", "public function channel($channel)\n {\n return $this->setChannel($channel);\n }", "private function getChannelId() {\n $event = $this->getEvent();\n\n if (isset($event['channel'])) {\n return $event['channel'];\n }\n\n return $event['channel_id'];\n }", "public function broadcastOn()\n {\n return new Channel('vdesk-chat:'.$this->threadid);\n }", "public function getAllChannels()\n {\n return $this->_channel;\n }", "private function _channel_entries()\n\t{\n\t\t// --------------------------------------\n\t\t// Unset custom parameters\n\t\t// --------------------------------------\n\n\t\tforeach ($this->params AS $param)\n\t\t{\n\t\t\tunset($this->EE->TMPL->tagparams[$param]);\n\t\t}\n\n\t\t$this->_log('Calling the channel module');\n\n\t\t// --------------------------------------\n\t\t// Take care of related entries\n\t\t// --------------------------------------\n\n\t\t// We must do this, 'cause the template engine only does it for\n\t\t// channel:entries or events:events_results. The bastard.\n\t\t$this->EE->TMPL->tagdata = $this->EE->TMPL->assign_relationship_data($this->EE->TMPL->tagdata);\n\n\t\t// Add related markers to single vars to trigger replacement\n\t\tforeach ($this->EE->TMPL->related_markers AS $var)\n\t\t{\n\t\t\t$this->EE->TMPL->var_single[$var] = $var;\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Include channel module\n\t\t// --------------------------------------\n\n\t\tif ( ! class_exists('channel'))\n\t\t{\n\t\t\trequire_once PATH_MOD.'channel/mod.channel'.EXT;\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Create new Channel instance\n\t\t// --------------------------------------\n\n\t\t$channel = new Channel();\n\n\t\t// --------------------------------------\n\t\t// Let the Channel module do all the heavy lifting\n\t\t// --------------------------------------\n\n\t\treturn $channel->entries();\n\t}", "function ts3client_getParentChannelOfChannel($serverConnectionHandlerID, $channelID, &$result) {}", "public function getChannel()\n {\n return $this->getData(self::CHANNEL);\n }", "public function getThreadType();", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "public function index($channelId, Thread $thread)\n {\n return $thread->replies()->paginate(20);\n }", "public function users($channel, Thread $thread)\n {\n $users = collect();\n\n if ($thread->creator->id !== auth()->id()) {\n $users->add($thread->creator);\n }\n\n Reply::where('thread_id', $thread->id)->get()->each(function ($reply) use ($users) {\n if ($reply->owner->id !== auth()->id()) {\n if (!$users->contains($reply->owner)) {\n $users->add($reply->owner);\n }\n }\n });\n\n return $users;\n }", "function get_channel_id($entry_id)\n\t{\t\n\t\t$this->EE->db->select('channel_id');\n\t\t$this->EE->db->where('entry_id', $entry_id);\n\t\t$query = $this->EE->db->get('channel_titles');\n\t\t$row = $query->row();\n\t\t\n\t\treturn ($row ? $row->channel_id : '');\n\t}", "function is_subscribed($thread, $subs) {\n foreach ($subs as $sub) {\n if ($sub->threadid == $thread->id) return true;\n }\n return false;\n}", "protected function join()\n {\n if (!is_array($this->config['channels'])) {\n $this->config['channels'] = array($this->config['channels']);\n }\n\n foreach ($this->config['channels'] as $index => $channel) {\n\n if (is_string($index)) {\n $channel = array($index, $channel);\n }\n\n $this->send(Response::join($channel));\n }\n }", "function pdo_thread_id($link=NULL) {\r\n return pdo_query(\"SELECT connection_id() AS id\", pdo_handle($link))->fetchObject()->id;\r\n }", "public function an_authenticated_user_may_participate_in_a_thread(){\n //Given we have an authenticated user\n //$user = factory('App\\User')->create();\n $this->be($user = factory('App\\User')->create());\n //And an existing thread\n $thread = factory('App\\Thread')->create();\n\n //When the user adds a reply to the thread\n $reply = factory('App\\Reply')->make();\n\n $this->post($thread->path().'/replies', $reply->toArray());\n\n //then their reply should be visible on the page\n $this->get($thread->path())->\n assertSee($reply->body);\n }", "function threadExists($id){\n return (getSingleValue(\"SELECT COUNT(`id`) FROM `public_forums_threads` WHERE `id` = '\" . escape(intval($id)) . \"'\") >= 1);\n }", "private function _getRequestChannel() {\n $td = Request::get('token_data');\n if(isset($td['type']) && $td['type'] == 'channel') {\n return Channel::where('id', $td['channel_id'])->first();\n } else {\n if(!Request::input('channel')) {\n return Response::json([\n 'error' => 'invalid_input',\n 'error_description' => 'No channel specified'\n ], 400);\n }\n\n $uid = Request::input('channel');\n $channel = Channel::where('user_id', Auth::user()->id)->where('uid', $uid)->first();\n if(!$channel)\n return Response::json([\n 'error' => 'not_found',\n 'error_description' => 'Channel not found'\n ], 404);\n else\n return $channel;\n }\n }", "public function getChannels()\n {\n return $this->channels;\n }", "private static function getChannel(){\n\t\t\tif(!self::$_activeChannel){\n\t\t\t\tif(self::tryConnection(1)){\n\t\t\t\t\tlist(self::$_activeQueue, ,) = self::$_activeChannel->queue_declare(\"\",false,false,true,false);\n\t\t\t\t}\n\n\t\t\t\tself::$_callbacks = array();\n\t\t\t}\n\n\t\t\treturn self::$_activeChannel;\n\t\t}", "public function getChannelById($id);", "public function getEntityChannel($entity)\n {\n\n if (is_object($entity))\n $entity = $entity->getTable();\n\n $label = SParserString::subToCamelCase($entity);\n\n $orm = $this->getOrm();\n $channel = $orm->getByKey('WbfsysAnnouncementChannel', 'entity_'.$entity );\n\n // wenn es den channel nicht gibt wird der automatisch angelegt\n if (!$channel) {\n $channel->name = SParserString::subToCamelCase($label);\n $channel->access_key = $entity;\n $channel->description = \"Message Channel for Entity \".$label;\n\n $orm->save($channel);\n }\n\n return $channel;\n\n }", "public function show(Channel $channel , Thread $thread,TrendingThreads $trending)\n {\n\n $trending->push($thread);\n\n $thread->increment('views');\n \n \treturn view('threads.show',compact('channel','thread'));\n\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n for ($x = 0; $x < rand(5, 20); $x++) {\n Message::factory()\n ->for($thread)\n ->owner($thread->participants->random()->owner)\n ->create();\n }\n });\n }", "public function testChannelsJoin()\n {\n }", "public function getDistributionChannel()\n {\n return $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel;\n }", "public function threads()\n\t{\n\t\treturn $this->hasMany(Thread::class)->latest();\n\t}", "public function testMessageThreadsV2MarkThread()\n {\n }", "public function publishThread($attributes)\n\t{\n\t\treturn $this->threads()->create($attributes);\n\t}" ]
[ "0.6600829", "0.56396717", "0.56288403", "0.55976164", "0.5578812", "0.55316776", "0.5499916", "0.5485731", "0.5464067", "0.5458197", "0.544674", "0.544674", "0.5433949", "0.5433949", "0.5430978", "0.54198354", "0.54198354", "0.54183", "0.5417679", "0.539075", "0.539075", "0.53738236", "0.53733295", "0.5368336", "0.5361052", "0.5361052", "0.53487265", "0.5342965", "0.53417385", "0.5300741", "0.529862", "0.5296217", "0.52959377", "0.5203321", "0.51993084", "0.51855755", "0.518339", "0.51816314", "0.51489854", "0.51422256", "0.51137066", "0.5111278", "0.5096475", "0.5085943", "0.50849533", "0.5081486", "0.5077433", "0.50757843", "0.5074199", "0.5054441", "0.5051736", "0.4994249", "0.49641433", "0.49611798", "0.49537075", "0.4953503", "0.49443054", "0.4943017", "0.49426925", "0.49392012", "0.4931538", "0.49300358", "0.49290797", "0.49290797", "0.49290797", "0.49161348", "0.49161348", "0.4912433", "0.48956302", "0.4877848", "0.48619586", "0.48443687", "0.48442882", "0.48424003", "0.48407128", "0.48396403", "0.48396403", "0.4829152", "0.48242223", "0.48059863", "0.48037478", "0.4801784", "0.47948024", "0.47888985", "0.47846532", "0.47816405", "0.47717708", "0.47697303", "0.4764433", "0.47503635", "0.47498283", "0.47498283", "0.47498283", "0.4743095", "0.47392517", "0.4733005", "0.47243595", "0.4708655", "0.46912643", "0.46907413" ]
0.5495553
7
Threads have many views.
public function views() { return $this->hasMany('App\Models\ViewedThread'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function threads()\n\t{\n\n\t\t// get sort type\n\n\n\t\t$query = Thread::where('parent_id', null)->with('user')->with('topic')->limit(20);\n\n\t\t$sort = get_string('sort', 'newest');\n\n\t\t$topic = get_int('topic', false);\n\n\t\tif($topic)\n\t\t\t$query->where('topic_id', $topic);\n\n\t\tThread::setOrder($query, $sort);\n\n\t\t$threads = $query->get();\n\n\t\t$topics = Topic::all();\n\n\t\treturn view('threads.index', compact('threads', 'sort', 'topics'));\n\t\n\t}", "public function updateViews()\r\n {\r\n if ($this->isViewTimelimit()) {\r\n return -1;\r\n }\r\n\r\n $this->views_seen++;\r\n $this->last_viewed_at = JFactory::getDate()->toSql();\r\n\r\n if ($this->views_bought > 0 && $this->views_seen == $this->views_bought) {\r\n $this->active = 0;\r\n }\r\n\r\n return $this->store();\r\n }", "public function view(User $user, Thread $thread)\n {\n //da implementare\n }", "public function index()\n {\n if (!is_logged_in()) {\n redirect(url('user/index'));\n }\n\n $thread_count = Thread::getNumRows();\n $pagination = pagination($thread_count);\n $threads = Thread::getAll($pagination['max']);\n $this->set(get_defined_vars());\n }", "public function viewedBy()\n {\n return $this->belongsToMany(\n 'App\\Models\\User',\n 'viewed_threads',\n 'thread_id',\n 'user_id'\n )\n ->using('App\\Models\\ViewedThread')\n ->withPivot('timestamp');\n }", "public function index()\n {\n $threads = DB::table('thread')->get();\n\n return view ('threads.index') -> with ('threads', $threads );\n }", "public function index()\n {\n $threads = Thread::all();\n $threads->load('posts', 'author');\n\n return view('threads.index', compact('threads'));\n }", "public function index() {\n $threads_1 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('threads.category', '=', '1')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_2 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '2')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_3 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '3')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_4 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '4')\n ->orderBy('updated_at', 'desc')\n ->get();\n \treturn view('thread', ['threads_1' => $threads_1, 'threads_2' => $threads_2, \n 'threads_3' => $threads_3, 'threads_4' => $threads_4]);\n }", "public function index()\n {\n $threads = Thread::with('user', 'votes')->withCount('replies')->latest()->paginate(10);\n // return $threads;\n return view('pertanyaan.index', compact('threads'));\n }", "public function index()\n {\n $threads = Thread::with('user')->paginate(5);\n return view(\"threads.index\",compact('threads'));\n }", "public function index()\n {\n $groups = Chat::getAllGroupConversations();\n $threads = Chat::getAllConversations();\n \n \n \n $newCollection = $threads->map(function($value,$key) {\n return $value->user->id ;\n});\n\n \n $users = User::where('id', '!=', auth()->id())->get();\n\n return view('home')->with([\n 'threads' => $threads,\n 'groups' => $groups,\n 'users'=>$users\n ]);\n }", "public function index()\n {\n $user = Auth::user();\n\n $threads = DB::table('threads')->where('user_id', '=', $user->id)->get();\n\n $count_posts = DB::table('posts')->where('user_id', '=', $user->id)->count();\n\n $count_threads = DB::table('threads')->where('user_id', '=', $user->id)->count();\n\n return view('users/index', ['user' => $user, 'count_posts' => $count_posts, 'count_threads' => $count_threads, 'threads' => $threads]);\n\n }", "public function index()\n {\n // All threads that user is participating in\n $threads = Thread::forUser(Auth::id())->latest('updated_at')->get();\n foreach ($threads as $key => $thread) {\n $users = User::whereIn('id', $thread->participantsUserIds())->get();\n $senderAvatar = str_replace('storage/owner/', 'img/cache/small-avatar/', Storage::url($users[1]->avatar_name));\n $cafe = Cafe::where('owner_id', Owner::where('user_id', $users[0]->id)->first()->id)->first();\n $threads[$key]->cafeLogo = str_replace('storage/logo/', 'img/cache/small-logo/', Storage::url($cafe->logo_path));\n $threads[$key]->users = $users;\n $threads[$key]->senderAvatar = $senderAvatar;\n }\n return view('messenger.index', compact('threads'));\n }", "public function run()\n {\n $assigned_projects = DB::table('project_assignments')->select('project_id','user_id')->get();\n //lets say that each users view around 200-500 times on project they owned\n $total = $assigned_projects->count();\n $idx = 0;\n foreach($assigned_projects as $assign_project)\n {\n if($idx%200==0)\n $this->command->info('Project View seeds: '.$idx.' items out of '.$total);\n $idx++;\n $date_creation =DB::table('projects')->select('created_at')->where('id','=',$assign_project->project_id)->get()[0]->created_at;\n // $this->command->info(json_encode($assign_project));\n $last_dateView = strtotime($date_creation)+rand(7776000,15552000);\n\n ProjectView::create(array(\n 'project_id'=>$assign_project->project_id,\n 'user_id'=>$assign_project->user_id,\n 'view_count'=>rand(200,500),\n 'last_visited'=>date(\"Y-m-d H:i:s\",$last_dateView)\n ));\n }\n\n //lets say that each users view around 30-100 times on 20-50 projects they are not owned\n $user_num = User::count();\n $project_num = Project::count();\n $project_limit = require('Config.php');\n for($id=1;$id<=$user_num;++$id)\n {\n if($id%20==0)\n $this->command->info('Random Project View seeds: '.$id.' items out of '.$user_num);\n $projects_viewed_num = rand($project_limit['projects']['min_random_view'],$project_limit['projects']['max_random_view']);\n for($j=0;$j<$projects_viewed_num;++$j)\n {\n $rand_project = rand(1,$project_num);\n $date_creation =DB::table('projects')->select('created_at')->where('id','=',$rand_project)->get()[0]->created_at;\n if(DB::table('project_views')->select('project_id')->where('project_id','=',$rand_project)->get()->count()>0)\n continue;\n //$this->command->info(json_encode($assign_project));\n $last_dateView = strtotime($date_creation)+rand(7776000,15552000);\n $this->command->info($last_dateView);\n ProjectView::create(array(\n 'project_id'=>$rand_project,\n 'user_id'=>$id,\n 'view_count'=>rand(30,100),\n 'last_visited'=>date(\"Y-m-d H:i:s\",$last_dateView)\n ));\n }\n }\n }", "public function index()\n {\n $threads= Thread::with('tags' ,'video' ,'video.videoDetails')->get();\n return view('home', compact('threads'));\n\n }", "function erpal_projects_helper_views_post_execute(&$view) {\n _erpal_projects_helper_view_timetracking_entites_post_execute($view);\n}", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "public function generate($totalElements)\n\t{\n\t\t$this->initialize();\n\n\t\t$db = XenForo_Application::getDb();\n\t\t$sql = \"\n\t\t\tSELECT * FROM xf_thread thread\n\t\t\tWHERE\n\t\t\t\tthread_id > ? AND\n\t\t\t\tdiscussion_state = 'visible' AND\n\t\t\t\tdiscussion_type <> 'redirect'\n\t\t\tORDER\n\t\t\t\tBY thread.thread_id\n\t\t\t\";\n\t\t$st = new Zend_Db_Statement_Mysqli($db, $sql);\n\t\t$st->execute( array( $this->lastId ) );\n\n\t\t$totalPages = 0;\n\t\twhile ($data = $st->fetch())\n\t\t{\n\t\t\t$this->lastId = $data['thread_id'];\n\t\t\tif (!$this->canView($data))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$totalPages = $this->getTotalpages($data['thread_id']);\n\t\t\tif ($totalPages < 2)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\twhile ($this->lastPage <= $totalPages)\n\t\t\t{\n\t\t\t\t$params = array( 'page' => $this->lastPage, );\n\t\t\t\t$url = XenForo_Link::buildPublicLink('canonical:threads', $data, $params);\n\t\t\t\t$this->addUrl($url, $data['post_date']);\n\n\t\t\t\t$this->lastPage++;\n\n\t\t\t\t$totalElements--;\n\t\t\t\tif ($totalElements <= 0)\n\t\t\t\t{\n\t\t\t\t\tbreak 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->lastPage = 2;\n\t\t}\n\n\t\t$this->isFinished = !$st->fetch() && $this->lastPage > $totalPages;\n\t\t$st->closeCursor();\n\t}", "public function views()\n {\n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function index()\n {\n\n $threads = Thread::forUser(Auth::id())->with([\n 'users' => function ($query) {\n $query->select('avatar', 'name', 'agent_name');\n },\n 'messages' => function ($query) {\n $query->latest()->first();\n },\n ])\n ->groupBy('threads.id')\n ->latest('updated_at')\n ->paginate();\n\n $threads->getCollection()->transform(function ($value) {\n $value->isUnread = $value->isUnread(Auth::id());\n\n return $value;\n });\n\n\n return response()->json($threads);\n }", "public function userViews()\n {\n $system = \\Config::get('tenant_system');\n //$system = \\Auth::user()->system;\n //all of the possible views\n// $system_id = session('system');\n// $system = System::find($system_id);\n $views = $system->views();\n\n //Views for the role - limited results\n $query = \\DB::table('role_view');\n $query->where('role_id', '=', $this->id);\n $results = $query->get();\n\n //we need to manually add the name back in for the view\n foreach ($results as $result)\n {\n foreach ($views as $view)\n {\n if ($result->view_id == $view->id)\n {\n $result->name = $view->name;\n $result->icon = $view->icon;\n $result->route = $view->route;\n $result->place = $view->place;\n\n }\n }\n }\n foreach ($results as $result)\n {\n if ($result->access != 'none')\n {\n $return[] = $result;\n }\n }\n\n return $return;\n\n\n }", "function run()\r\n {\r\n $ids = Request :: get(RepositoryManager :: PARAM_USER_VIEW);\r\n\r\n $failures = 0;\r\n\r\n if (! empty($ids))\r\n {\r\n if (! is_array($ids))\r\n {\r\n $ids = array($ids);\r\n }\r\n\r\n foreach ($ids as $user_view_id)\r\n {\r\n $uv = new UserView();\r\n $uv->set_id($user_view_id);\r\n\r\n if (! $uv->delete())\r\n {\r\n $failures ++;\r\n }\r\n }\r\n\r\n if ($failures)\r\n {\r\n if (count($ids) == 1)\r\n {\r\n $message = Translation :: get('ObjectNotDeleted', array('OBJECT' => Translation :: get('UserView')), Utilities :: COMMON_LIBRARIES);\r\n }\r\n else\r\n {\r\n $message = Translation :: get('ObjectsNotDeleted', array(\r\n 'OBJECT' => Translation :: get('UserViews')), Utilities :: COMMON_LIBRARIES);\r\n }\r\n }\r\n else\r\n {\r\n if (count($ids) == 1)\r\n {\r\n $message = Translation :: get('ObjectDeleted', array('OBJECT' => Translation :: get('UserView')), Utilities :: COMMON_LIBRARIES);\r\n }\r\n else\r\n {\r\n $message = Translation :: get('ObjectsDeleted', array('OBJECT' => Translation :: get('UserViews')), Utilities :: COMMON_LIBRARIES);\r\n }\r\n }\r\n\r\n $this->redirect($message, $failures ? true : false, array(\r\n Application :: PARAM_ACTION => RepositoryManager :: ACTION_BROWSE_USER_VIEWS));\r\n }\r\n else\r\n {\r\n $this->display_error_page(htmlentities(Translation :: get('NoObjectSelected', array(\r\n 'OBJECT' => Translation :: get('UserView')), Utilities :: COMMON_LIBRARIES)));\r\n }\r\n }", "function get_views()\n\t{\n\t\treturn $this->views;\n\t\t//return get_views($this->id);\n\t}", "public function compose(View $view)\n {\n $user = \\Auth::user();\n if ($user)\n {\n // Auto update logged user to active status\n Active::addUser($user);\n\n $view->with('user', $user);\n $view->with('gravatar_url', $user->gravatar);\n\n $activeGuests = ActiveGuest::count();\n $view->with('active_guests', $activeGuests);\n\n $activeUsers = ActiveUser::count();\n $view->with('active_users', $activeUsers);\n\n $messagesCount = AdminMessageStatus::where('messageStatus', 0)->where('adminUsername', $user->username)->count();\n $view->with('messagesCount', $messagesCount);\n\n $ticketsCount = AdminTicketStatus::where('ticket_status', 0)->count();\n $view->with('ticketsCount', $ticketsCount);\n\n $messages = AdminMessage::join('tbl_admin_message_status', 'tbl_admin_message.messageID', '=', 'tbl_admin_message_status.messageID')\n ->where('tbl_admin_message_status.adminUsername', $user->username)->where('messageStatus', 0)\n ->orderBy('statusUpdated', 'desc')->limit(5)->get();\n $view->with('messages', $messages);\n }\n }", "public function viewed($channel)\n {\n $service = new ThreadsService();\n $threads = $channel->threads()->get();\n $user = auth()->user();\n\n foreach ($threads as $thread) {\n $service->viewed($thread, $user);\n }\n\n return $channel;\n }", "public function index()\n\t{\n\n\t\t$id = get_int('id', false);\n\n\t\tif($id)\n\t\t\treturn $this->posts($id);\n\n\t\treturn $this->threads();\n\t\n\t}", "public function index(Request $request)\n {\n $threads = Thread::threadInfo()\n ->inChannel($request->channels)\n ->isPublic()//复杂的筛选\n ->with('author', 'tags', 'last_component', 'last_post')\n ->withType($request->withType)\n ->withBianyuan($request->withBianyuan)\n ->withTag($request->tags)\n ->excludeTag($request->excludeTags)\n ->ordered($request->ordered)\n ->paginate(config('constants.threads_per_page'));\n return response()->success([\n 'threads' => ThreadInfoResource::collection($threads),\n 'paginate' => new PaginateResource($threads),\n ]);\n //return view('test',compact('threads'));\n }", "public function systemViews()\n {\n\n //$system = \\Auth::user()->system;\n// $system_id = session('system');\n// $system = System::find($system_id);\n $system = \\Config::get('tenant_system');\n\n //all of the possible views\n $views = $system->views();\n\n $query = \\DB::table('role_view');\n $query->where('role_id', '=', $this->id);\n $results = $query->get();\n\n //we need to return view id, access = none, write, or read\n //we need to manually add the name back in for the view\n foreach ($results as $result)\n {\n foreach ($views as $view)\n {\n if ($result->view_id == $view->id)\n {\n $result->name = $view->name;\n }\n }\n }\n\n\n return $results;\n\n\n }", "public function compose(View $view)\n {\n $allBlogs = Blog::orderBy('id', 'desc')->limit(10)->get();\n $allusersno = User::count();\n $view->with('allBlogsForAll', $allBlogs)\n ->with('allusersno',$allusersno);\n }", "public function favoriteThreads($userid, $threads);", "public function run()\n {\n // User::factory()->count(15)->create();\n Thread::factory()->count(200)->create();\n }", "public function views()\n {\n// $database = $cg->getConnection()->getDatabaseName();\n// return $this->hasMany('App\\Models\\Craiglorious\\View', $database.'.views', 'role_id','view_id');\n //can not do this as the system // or should i?\n //return $this->hasMany('App\\Models\\Craiglorious\\View');\n }", "public function threads(){\n return $this->belongsToMany('App\\Thread');\n }", "public function compose(View $view)\n {\n $allBlogs = $this->blogs->orderBy('id', 'desc')->limit(10)->get();\n $allusersno = User::count();\n $view->with('allBlogsForAll', $allBlogs)\n ->with('allusersno',$allusersno);\n }", "public function executeView()\n {\n $staff = $this->getUser()->isAuthenticated() && $this->getuser()->hasCredential('staff');\n $permalink = $this->getRequestParameter('permalink');\n\n if ($type = $this->getRequestParameter(\"latest\"))\n {\n $this->article = $article = ArticlePeer::retrieveLatestByType($this->getRequestParameter(\"type\"));\n }\n else\n {\n $this->article = $article = ArticlePeer::retrieveByPermalink($permalink, $staff);\n }\n \n $this->forward404Unless($article);\n\n if ($this->article->getArticleType() == ArticlePeer::INTERNAL_ARTICLE)\n {\n $this->forward404Unless($staff);\n }\n }", "public function __invoke()\n\t{\n //$myTicketCount = ($myTickets) ? count($myTickets) : 0;\n return view('userdash')\n // ->with('myTickets', $myTickets)\n // ->with('myTicketCount', $myTicketCount)\n // ->with('assignMeTicket', 0)\n ;\n\t}", "function execute(&$view) {\n $request = $view->build_info['drupalcons_request'];\n\n $start = microtime(true);\n\n $view->result = array();\n $view->result = $request->execute();\n\n $view->execute_time = microtime(true) - $start;\n }", "public function index()\n {\n //\n \n // $search = \\Request::get('search');\n // $thread = Thread::where('name', 'like', '%' .$search. '%')->get();\n // return view('threads.index', compact('thread'));\n $search = \\Request::get('search');\n if($search){\n $thread = Thread::where('name', 'like', '%' .$search. '%')->get();\n return view('threads.result', compact('thread'));\n }\n $thread = Thread::paginate(10);\n $recent_thread = Thread::orderBy('created_at', 'desc')->take(5)->get();\n return view('threads.index', compact('thread'))->with('recent', $recent_thread);\n }", "public function view(){\n $viewsCount = $this->views_count();\n\n if ( Config::get('counter.isViewCountEveryTime') ){\n //$viewCount = Cache::increment($this->cacheViewName, Config::get('counter.viewIncrementAmount', 1));\n $viewsCount = $this->incView();\n //$this->setViewed();\n }else if ( !$this->isViewed() ){\n $viewsCount = $this->incView();\n //$this->setViewed();\n }\n\n return $viewsCount;\n }", "public function viewTasks(){\n $task = new Tasks();\n $roles = new Role();\n $resp = $task->read();\n if($resp->status){\n $tasks = $resp->data;\n $temp = array();\n foreach ($tasks as $task){\n $task->mapped_roles = $task->getMappedRoles($task->tasks_id);\n $temp[] = $task;\n }\n $resp->data = $temp;\n }\n $this->data['response_tasks'] = $resp;\n $this->data['response_roles'] = $roles->readAll();\n return $this->view();\n }", "public function index()\n {\n $threads = Thread::orderBy('created_at', 'desc')->paginate(5);\n $data = [\n 'threads' => $threads\n ];\n return view('ask-index')->with('data', $data);\n }", "public function compose(View $view)\n {\n $user = Auth::user();\n $friends = UsersFriendship::where([['status', '=', 'pending'], ['user_id1', '=', $user->id]])->get();\n\n $data = [];\n foreach ($friends as $friend) {\n $user_id = $friend->user_id2;\n array_push($data, User::find($user_id));\n }\n \n $view->with('requests', $data);\n }", "public function index()\n {\n $profile = auth()->user();\n $posts = \\App\\Post::wherePublished(1)->where('user_id', \\Auth::user()->id)->get();\n\n $threads = Thread::getAllLatest()->whereHas('participants', function ($query) {\n $query->where('user_id', auth()->user()->id);\n })->get();\n\n return view('profile.index', compact('profile', 'posts', 'threads'));\n }", "protected function makeViews()\n {\n new MakeView($this, $this->files);\n }", "public function view(User $user, CForumThread $thread)\n {\n //\n }", "public function compose(View $view)\n {\n $number_init = 1;\n\n //get current date\n $today = Carbon::today();\n\n $user_details = UserDetail::where('user_id', Auth::user()->id)->first();\n\n $categories = Category::get();\n\n $comments = Comment::orderBy('created_at', 'desc')->get();\n\n $user_posts = Post::where('user_id', Auth::user()->id)->orderBy('updated_at', 'desc')->get();\n $user_comments = Comment::where('user_id', Auth::user()->id)->get();\n $user_replies = CommentReply::where('user_id', Auth::user()->id)->get();\n \n //put variables in views\n $view\n ->with('number_init', $number_init )\n ->with('today', $today )\n ->with('user_details', $user_details)\n ->with('categories', $categories)\n ->with('comments', $comments)\n ->with('user_posts', $user_posts)\n ->with('user_comments', $user_comments)\n ->with('user_replies', $user_replies);\n\n \n\n }", "public function incrementViews($user)\n {\n $date = new Zend_Date(time());\n $date->subMinute(30);\n $query = Doctrine_Query::create()->from('Sageweb_Cms_EntityView v')\n ->where('v.entityId = ?', $this->entityId)\n ->andWhere('v.ipAddress = ?', $_SERVER['REMOTE_ADDR'])\n ->andWhere('v.createdAt > ?', date('Y-m-d H:i:s', $date->getTimestamp()))\n ->limit(1);\n $recentView = $query->fetchOne();\n\n if (!$recentView) {\n // record the view\n $view = new Sageweb_Cms_EntityView();\n $view->entityId = $this->entityId;\n $view->ipAddress = $_SERVER['REMOTE_ADDR'];\n $view->userId = $user->id;\n $view->save();\n }\n\n // update Index (stores counts)\n $this->updateIndex(true);\n }", "public function getThreads()\n {\n $user = request()->user();\n\n $messages = $user->threadsWithMessagesWithUsers($user->id)->get();\n\n /**\n * Returns unread messages given the userId.\n */\n //$messages = Message::unreadForUser($user->id)->get();\n\n return ThreadsResource::collection($messages);\n //return response()->json($messages);\n }", "public function compose(View $view){\n\n $jml_pengunjung = Hit::distinct()->select(\\DB::raw('DISTINCT(_token)'))->get();\n $pengunjung_hr_ini = Hit::distinct()\n ->select(\\DB::raw('DISTINCT(_token)'))\n ->where('tgl', '=', date('Y-m-d'))\n ->get();\n $pengunjung_online = Hit::distinct()\n ->select(\\DB::raw('DISTINCT(_token)'))\n ->where('timevisit', '>', time() - 200 )\n ->get();\n $hits_hr_ini = Hit::where('tgl', '=', date('Y-m-d'))->count();\n\n\n\n $view->with('jml_total', Hit::count()); \n $view->with('jml_pengunjung', count($jml_pengunjung)); \n $view->with('pengunjung_hr_ini', count($pengunjung_hr_ini)); \n $view->with('pengunjung_online', count($pengunjung_online)); \n $view->with('hits_hr_ini', $hits_hr_ini); \n\n\n }", "function show_views()\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$ADMIN->page_title = \"Statistic Center Results\";\r\n\r\n\t\t$ADMIN->page_detail = \"Showing topic view statistics\";\r\n\r\n\t\t//+---------------------\r\n\r\n\t\tif (!checkdate($IN['to_month'], $IN['to_day'], $IN['to_year']))\r\n\t\t{\r\n\t\t\t$ADMIN->error(\"The 'Date To:' time is incorrect, please check the input and try again\");\r\n\t\t}\r\n\r\n\t\tif (!checkdate($IN['from_month'], $IN['from_day'], $IN['from_year']))\r\n\t\t{\r\n\t\t\t$ADMIN->error(\"The 'Date From:' time is incorrect, please check the input and try again\");\r\n\t\t}\r\n\r\n\t\t//+---------------------\r\n\r\n\t\t$to_time = mktime(12, 0, 0, $IN['to_month'], $IN['to_day'], $IN['to_year']);\r\n\t\t$from_time = mktime(12, 0, 0, $IN['from_month'], $IN['from_day'], $IN['from_year']);\r\n\r\n\t\t$human_to_date = getdate($to_time);\r\n\t\t$human_from_date = getdate($from_time);\r\n\r\n\t\t$stmt = $ibforums->db->query(\"SELECT SUM(t.views) as result_count, t.forum_id, f.name as result_name\r\n\t\t\t\t FROM ibf_topics t, ibf_forums f\r\n\t\t\t\t WHERE t.start_date > '$from_time'\r\n\t\t\t\t AND t.start_date < '$to_time'\r\n\t\t\t\t AND t.forum_id=f.id\r\n\t\t\t\t GROUP BY t.forum_id\r\n\t\t\t\t ORDER BY result_count {$IN['sortby']}\");\r\n\r\n\t\t$running_total = 0;\r\n\t\t$max_result = 0;\r\n\r\n\t\t$results = array();\r\n\r\n\t\t$SKIN->td_header[] = array(\"Forum\", \"40%\");\r\n\t\t$SKIN->td_header[] = array(\"Result\", \"50%\");\r\n\t\t$SKIN->td_header[] = array(\"Views\", \"10%\");\r\n\r\n\t\t//+-------------------------------\r\n\r\n\t\t$ADMIN->html .= $SKIN->start_table(\"Topic Views\" . \" ({$human_from_date['mday']} {$this->month_names[$human_from_date['mon']]} {$human_from_date['year']} to\" . \" {$human_to_date['mday']} {$this->month_names[$human_to_date['mon']]} {$human_to_date['year']})\");\r\n\r\n\t\tif ($stmt->rowCount())\r\n\t\t{\r\n\r\n\t\t\twhile ($row = $stmt->fetch())\r\n\t\t\t{\r\n\r\n\t\t\t\tif ($row['result_count'] > $max_result)\r\n\t\t\t\t{\r\n\t\t\t\t\t$max_result = $row['result_count'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$running_total += $row['result_count'];\r\n\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t\t'result_name' => $row['result_name'],\r\n\t\t\t\t\t'result_count' => $row['result_count'],\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tforeach ($results as $pOOp => $data)\r\n\t\t\t{\r\n\r\n\t\t\t\t$img_width = intval(($data['result_count'] / $max_result) * 100 - 8);\r\n\r\n\t\t\t\tif ($img_width < 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$img_width = 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$img_width .= '%';\r\n\r\n\t\t\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t\t\t $data['result_name'],\r\n\t\t\t\t \"<img src='{$SKIN->img_url}/bar_left.gif' width='4' height='11' alt=''><img src='{$SKIN->img_url}/bar.gif' width='$img_width' height='11' alt=''><img src='{$SKIN->img_url}/bar_right.gif' width='4' height='11' alt=''>\",\r\n\t\t\t\t \"<div class='center'>{$data['result_count']}</div>\",\r\n\t\t\t\t ));\r\n\t\t\t}\r\n\r\n\t\t\t$ADMIN->html .= $SKIN->add_td_row(array(\r\n\t\t\t '&nbsp;',\r\n\t\t\t \"<div class='right'><b>Total</b></div>\",\r\n\t\t\t \"<div class='center'><b>$running_total</b></div>\",\r\n\t\t\t ));\r\n\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$ADMIN->html .= $SKIN->add_td_basic(\"No results found\", \"center\");\r\n\t\t}\r\n\r\n\t\t$ADMIN->html .= $SKIN->end_table();\r\n\r\n\t\t$ADMIN->output();\r\n\r\n\t}", "public function getWebsitesView()\n {\n $res = $this->searchView();\n if ($res) {\n array_push($this->site_ids, array('access' => 'view', 'ids' => array()));\n if ($res['count'] > 0) {\n foreach ($res as $r) {\n if (is_array($r)) {\n array_push($this->site_ids[0]['ids'], $this->getSiteId($r[strtolower($this->to_get_view)][0]));\n }\n }\n }\n }\n }", "public function views() {\n\t\t$views = $this->get_views();\n\n\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n?>\n<div class=\"wp-filter\">\n\t<ul class=\"filter-links\">\n\t\t<?php\n\t\tif ( ! empty( $views ) ) {\n\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t}\n\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t}\n\t\t?>\n\t</ul>\n\n\t<?php install_search_form(); ?>\n</div>\n<?php\n\t}", "private function setViewed(){\n if ( !$this->isViewed() ){\n $viewKey = $this->getViewKey();\n\n if ( Auth::check() ){ //user had login, record user action\n Cache::put($viewKey.':user:'.Auth::user()->id, time(), Config::get('counter.viewCountDuration'));\n $this->recordUser('view');\n } else { //guest. use session\n session([$viewKey=>time()]);\n }\n\n return true;\n }\n\n return false;\n }", "public function compose(View $view)\n {\n $couriers = User::couriers()->count();\n $sWorkers = User::socialworkers()->count();\n $barangays = Barangay::count() ;\n\n\n $view->with(['couriers' => $couriers, \n 'sWorkers' => $sWorkers ,\n 'barangays' => $barangays]);\n }", "public function index(Request $request)\n {\n $s = $request->input(\"s\");\n \n $threads = Thread::with(\"tag\")\n ->latest()\n ->search($s)\n ->paginate(100); \n\n return view('thread.index', [\n \"tags\" => Tag::latest(),\n \"threads\" => $threads,\n \"s\" => $s\n ]);\n }", "public function visited() {\n // Checking if there's no data in the database - if not, will insert the new view.\n if (!$this->psm->hasdata(\"SELECT id FROM artist_views WHERE artist_id = :ref AND ip = :ip\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ])) {\n $view = true;\n }\n\n // But if not, we must check if it was more than 2 minutes ago or not - if so, we can add! Vice versa.\n else {\n $set = $this->psm->set(\"SELECT timeadded FROM artist_views WHERE artist_id = :ref AND ip = :ip ORDER BY id DESC LIMIT 1\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ]);\n $view = ((time()-$set['timeadded'])/60 > 2)?true:false;\n }\n\n // Finally, if we have decided there's need for the view to be added, execute!\n if ($view) {\n $this->psm->insert('artist_views', [\n 'artist_id' => $this->data['id'],\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'timeadded' => time()\n ]);\n }\n }", "public function views() {\n\t\t\t$views = $this->get_views();\n\n\t\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n\t\t\t?>\n\t\t\t<div class=\"wp-filter\">\n\t\t\t\t<ul class=\"filter-links\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( ! empty( $views ) ) {\n\t\t\t\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t\t<?php\n\t\t\t\tif ( 'learndash' === $this->current_tab ) {\n\t\t\t\t\t$this->show_update_button();\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}", "public function views()\n {\n return $this->hasMany(View::class);\n }", "function minim_preprocess_views_view(&$variables) {\n $sub_functions = array();\n $sub_functions[] = __FUNCTION__ . '__' . $variables['view']->storage->id;\n $sub_functions[] = __FUNCTION__ . '__' . $variables['view']->storage->id . '__' . $variables['view']->current_display;\n foreach ($sub_functions AS $function) {\n if (function_exists($function)) {\n $function($variables);\n }\n }\n}", "function viewAction() {\r\n\r\n $photo_id = $this->_getParam('photo_id', false);\r\n if (!$photo_id)\r\n return $this->_forward('requireauth', 'error', 'core');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->photo = $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $this->view->chanel = $chanel = $photo->getChanel();\r\n Engine_Api::_()->core()->setSubject($photo);\r\n if (!$viewer || !$viewer->getIdentity() || !$chanel->isOwner($viewer)) {\r\n $photo->view_count = new Zend_Db_Expr('view_count + 1');\r\n $photo->save();\r\n }\r\n if (!$this->_helper->requireAuth()->setAuthParams('sesvideo_chanelphoto', null, 'view')->isValid())\r\n return;\r\n $checkchanel = Engine_Api::_()->getItem('sesvideo_chanel', $this->_getParam('chanel_id'));\r\n if (!($checkchanel instanceof Core_Model_Item_Abstract) || !$checkchanel->getIdentity() || $checkchanel->chanel_id != $photo->chanel_id) {\r\n $this->_forward('requiresubject', 'error', 'core');\r\n return;\r\n }\r\n // Render\r\n $this->_helper->content->setEnabled();\r\n }", "public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }", "public function compose(View $view)\n {\n if (Auth::check()) {\n $acceptedRequests = Advisor::where([[Auth::user()->role_id == config('role.student_id') ? 'student_id' : 'mentor_id', Auth::id()], ['status', config('status.request.accept_number')]])->get();\n $view->with('acceptedRequests', $acceptedRequests);\n }\n }", "public function getViews();", "public function compose(View $view)\n {\n // dd(Auth::user());\n \n $notifications = Notification::where('notifiable_id', Auth::user()->id)->get();\n\n $view->with('notifications', $notifications);\n //dd(count($notifications));\n }", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "public function index()\n {\n //\n // for test case\n $tasks = \\Auth::user()->myTasks()->get();\n // return $tasks;\n $shareableTask = \\App\\Shareable::all();\n $filtered = $shareableTask->filter(function ($value, $key) {\n if($value->share_user_id != \\Auth::user()->id){\n return $value;\n }\n });\n\n $tasksForOthers = $filtered->map(function ($item, $key) {\n return $item->task;\n });\n $allTasks = $tasksForOthers->merge($tasks); // Contains foo and bar.\n // $myTasks = \\Auth::user()->myTasks();\n $allTasks = $allTasks->filter(function ($value, $key) {\n return $value != null ;\n });\n\n return view('home')->with('data',$allTasks);\n\n // return view('home');\n }", "public function view(User $user, ThreadReply $threadReply)\n {\n //\n }", "function loadThreads($user_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT member1_id, member2_id, date_created FROM thread WHERE '$user_id' in (member1_id, member2_id) AND valid='yes' ORDER BY thread_id DESC\");\n\t\t\twhile ($row = sqlite_fetch_array($query))\n\t\t\t{\n\t\t\t\t$row[0]=$this->loadUser($row[0]);\n\t\t\t\t$row[1]=$this->loadUser($row[1]);\n\t\t\t}\n\t\t\treturn $row;\n\t\t}", "function performThreadsActionObject()\n\t{\n\t\tglobal $lng, $ilUser, $ilAccess;\n\n\t\tunset($_SESSION['threads2move']);\n\t\tunset($_SESSION['forums_search_submitted']);\n\t\tunset($_SESSION['frm_topic_paste_expand']);\t\n\n\t\tif (is_array($_POST['thread_ids']))\n\t\t{\n\t\t\tif ($_POST['selected_cmd'] == 'move')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['threads2move'] = $_POST['thread_ids'];\n\t\t\t\t\t$this->moveThreadsObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'enable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->enableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'disable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->disableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'close')\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->close();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'reopen')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->reopen();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'makesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->makeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'unmakesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->unmakeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if($_POST['selected_cmd'] == 'editThread')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$count = count($_POST['thread_ids']);\n\t\t\t\t\tif($count != 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\tforeach($_POST['thread_ids'] as $thread_id);\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->editThreadObject($thread_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'html')\n\t\t\t{\n\t\t\t\t$this->ctrl->setCmd('exportHTML');\n\t\t\t\t$this->ctrl->setCmdClass('ilForumExportGUI');\n\t\t\t\t$this->executeCommand();\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'confirmDeleteThreads')\n\t\t\t{\n\t\t\t\treturn $this->confirmDeleteThreads();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendInfo($this->lng->txt('topics_please_select_one_action'), true);\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t}\n\t}", "public function actionRatingsView()\n\t{\n\t\t//Define some variables\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);\n\t\tlist($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId);\n\t\t\n\t\t//Can view ratings for own threads and/or all threads\n\t\tif (!$this->_getRatingModel()->canViewThreadRatings($thread))\n\t\t{\n\t\t\treturn $this->responseNoPermission();\n\t\t}\n\t\t\n\t\t//Pagination\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n $perPage = 25;\n\t\t\n\t\t//Conditions\n\t\t$conditions = array(\n\t\t\t'thread_id' => $threadId\n\t\t);\n \n\t\t//fetchOptions\n $fetchOptions = array(\n\t\t 'join' => Borbole_StarRating_Model_Rating::FETCH_USER,\n 'page' => $page,\n 'perPage' => $perPage\n );\n\t\t\n\t\t//Get all ratings for this thread\n\t\t$entries = $this->_getRatingModel()->getRatings($conditions, $fetchOptions);\n\t\t\n\t\t//Count all ratings for this thread\n\t\t$count = $this->_getRatingModel()->countRatings($conditions);\n\t\t\n\t\t//Get the proper delete ratings permissions to be displayed\n\t\tforeach ($entries AS &$rating)\n\t\t{\n\t\t\t$rating = $this->_getRatingModel()->prepareRating($rating);\n\t\t}\n\n\t\t//Register variables for use in our template\n\t\t$viewParams = array(\n\t\t 'entries' => $entries,\n\t\t\t'thread' => $thread,\n\t\t\t'viewAnonymous' => $this->_getRatingModel()->canViewAnonymousRatings($thread),\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum),\n\t\t\t'count' => $count,\n\t\t\t'page' => $page,\n\t\t\t'perPage' => $perPage\n\t\t);\n\n\t\treturn $this->responseView('Borbole_StarRating_ViewPublic_RatingsView', 'borbole_thread_ratings_view', $viewParams);\n\t}", "function manynewposts_thread() {\n global $thread, $templates, $db, $mybb, $settings;\n\n $query = $db->query(\"\n SELECT\n dateline, pid\n FROM \" . TABLE_PREFIX . \"posts\n WHERE\n tid='\".$db->escape_string($thread['tid']).\"'\n \");\n\n $lastpost = array();\n $lastpost_pid = array();\n\n while($result=$db->fetch_array($query))\n {\n $lastpost[] = $result['dateline'];\n $lastpost_pid[$result['dateline']] = $result['pid'];\n }\n\n $query = $db->query(\"\n SELECT\n tr.dateline AS `tr_dateline`,\n fr.dateline AS `fr_dateline`\n FROM \" . TABLE_PREFIX . \"posts p\n LEFT JOIN\n \" . TABLE_PREFIX . \"threadsread tr\n ON\n tr.tid = p.tid\n LEFT JOIN\n \" . TABLE_PREFIX . \"forumsread fr\n ON\n fr.fid = p.fid\n WHERE\n tr.uid='\".$db->escape_string($mybb->user['uid']).\"' and\n fr.uid='\".$db->escape_string($mybb->user['uid']).\"'\n \");\n\n $userlastview = array();\n $userlastview_forum = array();\n\n while($result=$db->fetch_array($query))\n {\n $userlastview[] = $result['tr_dateline'];\n $userlastview_forum[] = $result['fr_dateline'];\n }\n\n $userlastview = (count($userlastview) > 0) ? max($userlastview) : 0;\n $userlastview_forum = (count($userlastview_forum) > 0) ? max($userlastview_forum) : 0;\n\n $timelimit = $userlastview + ($settings['threadreadcut'] * 24 * 60 * 60);\n $newlastpost = array();\n\n if($userlastview && $timelimit > TIME_NOW) {\n foreach ($lastpost as $lastpost_number) {\n if($lastpost_number > $userlastview_forum && $lastpost_number > $userlastview) {\n $newlastpost[] = $lastpost_number;\n }\n }\n }\n\n $count = count($newlastpost);\n\n if($count == 0) return;\n\n $posts = $count == 1 ? 'post':'posts';\n\n $lastseenpost_pid = $lastpost_pid[min($newlastpost)];\n $manynewposts = \"\";\n\n if($mybb->user['uid']) {\n if($count > 0) {\n $manynewposts = $templates->get('manynewposts');\n $manynewposts = str_replace(\"{newposts_link}\", \"./showthread.php?tid=\".$thread['tid'].\"&pid=\".$lastseenpost_pid.\"#pid\".$lastseenpost_pid, $manynewposts);\n $manynewposts = str_replace(\"{newposts}\", $count, $manynewposts);\n $manynewposts = str_replace(\"{posts}\", $posts, $manynewposts);\n }\n }\n $thread['manynewposts'] = $manynewposts;\n}", "public function compose(View $view)\n {\n $site = null;\n\n if (isset($view->getData()['site'])) {\n $site = $view->getData()['site'];\n }\n\n if ($site) {\n if (Auth::check() && Auth::user()->hasRole([ Role::USER, Role::SUPERUSER ]) && ContextHelper::isSiteContext($this->context) && (ContextHelper::doesContextMatchUserSite(Auth::user(), $this->context) || (Auth::user()->hasRole([Role::SUPERUSER])))) {\n if ($site->hasFeature(Feature::HAS_PAGES)) {\n foreach ($site->pages as $page) {\n if ($page->type == 'Standard') {\n $canAccessPageUserRestricted = true;\n $canAccessPageLotNumberRestricted = true;\n\n if (!Auth::user()->hasRole([ Role::SUPERUSER ])) {\n if ($page->userRestricted) {\n $canAccessPageUserRestricted = false;\n\n if (Auth::user()->pages->where('id', $page->id)->first()) {\n $canAccessPageUserRestricted = true;\n }\n }\n\n if ($page->lotNumberRestricted) {\n $userLotNumbers = Auth::user()->lotNumbers->pluck('prefix')->toArray();\n\n if (count($userLotNumbers) > 0) {\n $canAccessPageLotNumberRestricted = false;\n\n $fileLotNumbers = [];\n\n foreach ($page->files as $file) {\n $fileLotNumbers = array_merge($fileLotNumbers, $file->lotNumbers->pluck('prefix')->toArray());\n }\n\n $fileLotNumbers = array_unique($fileLotNumbers);\n\n $intersection = array_intersect($fileLotNumbers, $userLotNumbers);\n\n if (count($intersection) > 0) {\n $canAccessPageLotNumberRestricted = true;\n }\n }\n }\n }\n\n if ($canAccessPageUserRestricted && $canAccessPageLotNumberRestricted) {\n array_push($this->menu, ['url' => route('page', ['page' => $page->code]), 'label' => $page->name, 'icon' => 'fa fa-files-o', 'active' => (($this->currentRoute->getName() == 'page') && ($this->currentRoute->getParameter('page') == $page->code))]);\n }\n }\n }\n }\n if ($site->hasFeature(Feature::HAS_PICKUP_REQUEST)) {\n // apparently not needed\n // array_push($this->menu, ['url' => route('pickupRequest'), 'label' => 'main.layout.menu.pickup_request', 'icon' => 'fa-envelope-o', 'active' => in_array($this->currentRoute->getName(), ['pickupRequest'])]);\n }\n }\n else if (($this->currentRoute->getName() == 'pickupRequest')) {\n if ($site->hasFeature(Feature::HAS_PICKUP_REQUEST)) {\n array_push($this->menu, ['label' => 'main.layout.menu.pickup_request_form', 'icon' => 'fa-envelope-o', 'active' => ($this->currentRoute->getName() == 'pickupRequest')]);\n }\n }\n }\n\n // put menu only if there's no exception on current response\n if (!isset($view->getData()['exception'])) {\n $view->with('menu', $this->menu);\n }\n\n }", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "function set_views($views)\n\t{\n\t\t$this->views = $views;\n\t\treturn OP_SUCCESSFUL;\n\t}", "public function views()\n {\n return $this->hasMany('App\\View');\n }", "protected function renderViewPages($views)\n {\n\n $appointmentDetail = $this->appointmentDetail;\n\n $userSessionProfile = unserialize($_SESSION[AppConstants::USER_SESSION_DATA]);\n $firstName = $userSessionProfile->getFirstName();\n\n foreach ($views as $view) {\n require_once $view;\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('APiszczekDemoBundle:Thread')->findAll();\n\n return $this->render('APiszczekDemoBundle:Thread:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "public function actionIndex()\n {\n $searchModel = new ThreadSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject()) {\n return $this->setNoRender();\n }\n\n\t\t//GET VIEWER INFO\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n\n $this->view->sitestore_like = $sitestore_like = Zend_Registry::isRegistered('sitestore_like') ? Zend_Registry::get('sitestore_like') : null;\n if (empty($viewer_id) || empty($sitestore_like)) {\n return $this->setNoRender();\n }\n }", "function page_manager_node_view_access_check($task, $subtask_id, $contexts) {\n $context = reset($contexts);\n return node_access('view', $context->data);\n}", "public function compose(View $view)\n {\n $latestPosts = Post::orderBy('created_at', 'desc')->take(10)->get();\n\n $view->with('latestPosts', $latestPosts);;\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function checkThread(Request $request)\n {\n\n $threadid = $request->get('threadid');\n $original = $request->get('studentsids');\n $ids = $original . ',' . Auth()->id();\n $objThreadP = new ThreadParticipant();\n $objThread = new Thread();\n $authid = Auth::user()->id;\n $reverseIds = Auth()->id() . ',' . $original;\n if (empty($threadid)) {\n $haveit = $objThreadP->checkThreadParticipant($ids);\n if ($haveit == 0) {\n $haveit = $objThreadP->checkThreadParticipant($reverseIds);\n if ($haveit > 0) {\n $ids = $reverseIds;\n }\n }\n if ($haveit > 0) {\n $threadidobj = $objThreadP->getThreadId($ids);\n $threadid = $threadidobj['thread_id'];\n } else {\n $threadid = $objThread->createThread($authid);\n //Insert Participant in this thread\n $objThreadP->assignParticipantInThread($ids, $threadid);\n $userids = explode(',', $ids);\n foreach ($userids as $userid) {\n \\Event::fire(new App\\Events\\Thread($threadid, $userid));\n }\n }\n }\n $objmessage = new Message();\n $message = $objmessage->getThreadMessages($threadid);\n $students = $objmessage->getChatUsers($ids);\n $ouput = view(\"teacher.chat-messages\", compact('message', 'threadid', 'students', 'original'))->render();\n return response()->json([\n 'threadid' => $threadid,\n 'message' => $ouput\n ]);\n }", "public function index()\n {\n\n // All threads, ignore deleted/archived participants\n $threads = Thread::getAllLatest()->get();\n\n\n return response()->json($threads);\n }", "protected function get_views() {\n\t\tglobal $role;\n\n\t\t$wp_roles = wp_roles();\n\n\t\t$url = admin_url( 'admin.php?page=itsec&module=user-security-check' );\n\t\tif ( $this->is_site_users ) {\n\t\t\tswitch_to_blog( $this->site_id );\n\t\t\t$users_of_blog = count_users();\n\t\t\trestore_current_blog();\n\t\t} else {\n\t\t\t$users_of_blog = count_users();\n\t\t}\n\n\t\t$total_users = $users_of_blog['total_users'];\n\t\t$avail_roles =& $users_of_blog['avail_roles'];\n\t\tunset($users_of_blog);\n\n\t\t$class = empty($role) ? ' class=\"current\"' : '';\n\t\t$role_links = array();\n\t\t$role_links['all'] = \"<a href='$url' data-role=''$class>\" . sprintf( _nx( 'All <span class=\"count\">(%s)</span>', 'All <span class=\"count\">(%s)</span>', $total_users, 'users' ), number_format_i18n( $total_users ) ) . '</a>';\n\t\tforeach ( $wp_roles->get_names() as $this_role => $name ) {\n\t\t\tif ( !isset($avail_roles[$this_role]) )\n\t\t\t\tcontinue;\n\n\t\t\t$class = '';\n\n\t\t\tif ( $this_role === $role ) {\n\t\t\t\t$class = ' class=\"current\"';\n\t\t\t}\n\n\t\t\t$name = translate_user_role( $name );\n\t\t\t/* translators: User role name with count */\n\t\t\t$name = sprintf( __('%1$s <span class=\"count\">(%2$s)</span>'), $name, number_format_i18n( $avail_roles[$this_role] ) );\n\t\t\t$role_links[$this_role] = \"<a href='\" . esc_url( add_query_arg( 'role', $this_role, $url ) ) . \"' data-role='\" . esc_attr( $this_role ) . \"'$class>$name</a>\";\n\t\t}\n\n\t\tif ( ! empty( $avail_roles['none' ] ) ) {\n\n\t\t\t$class = '';\n\n\t\t\tif ( 'none' === $role ) {\n\t\t\t\t$class = ' class=\"current\"';\n\t\t\t}\n\n\t\t\t$name = __( 'No role' );\n\t\t\t/* translators: User role name with count */\n\t\t\t$name = sprintf( __('%1$s <span class=\"count\">(%2$s)</span>'), $name, number_format_i18n( $avail_roles['none' ] ) );\n\t\t\t$role_links['none'] = \"<a href='\" . esc_url( add_query_arg( 'role', 'none', $url ) ) . \"' data-role='none'$class>$name</a>\";\n\n\t\t}\n\n\t\treturn $role_links;\n\t}", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n for ($x = 0; $x < rand(5, 20); $x++) {\n Message::factory()\n ->for($thread)\n ->owner($thread->participants->random()->owner)\n ->create();\n }\n });\n }", "public function getAllViews()\n {\n if (!$this->_area || empty($this->_areViewsCollectedInArea[$this->_area])) {\n $this->collectAllViewsFiles($this->_area);\n }\n return $this->_views;\n }", "public function viewify($views)\n {\n foreach ($views as $views) {\n foreach ($this->add($views) as $view) {\n $this->di->get(\"view\")->add($view[\"view\"], $view[\"content\"], $view[\"region\"]);\n }\n }\n }", "public function index(Request $request)\n {\n $request_data = $this->sanitize_thread_request_data($request);\n\n if($request_data&&!auth('api')->check()){abort(401);}\n\n $query_id = $this->process_thread_query_id($request_data);\n\n $threads = $this->find_threads_with_query($query_id, $request_data);\n\n return response()->success([\n 'threads' => ThreadInfoResource::collection($threads),\n 'paginate' => new PaginateResource($threads),\n 'request_data' => $request_data,\n ]);\n }", "public function an_authenticated_user_can_participate_in_forum_threads()\n {\n //given we have an authernticated user\n $this->be($user = factory('App\\User')->create());\n // and an existing threads\n $thread = factory('App\\Thread')->create();\n // when a user adds a reply to thread\n $reply = factory('App\\Reply')->make();\n $this->post('/threads/'.$thread->id.'/replies', $reply->toArray());\n // then their reply should be visible in the page.\n $this->get($thread->path())\n -> assertSee($reply->body);\n }", "public function executeForumView(sfWebRequest $request)\n {\n $oForums = new Forums();\n $asRecord = $oForums->viewForumsQuery($request->getParameter('id'));\n $this->form = $asRecord;\n }", "public function run()\n {\n $threads = factory('App\\Thread', 20)->create();\n\n $threads->each(function($thread) {\n factory('App\\Reply', 6)->create(['thread_id' => $thread->id]);\n });\n }", "public function actionIndex()\n\t{\n\t\t$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);\n\t\tif (empty($forumId))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t\n\t\t$options = XenForo_Application::get('options');\n\t\tif (($forumId && $forumId != $options->cmfUserBlogsNode) || $this->_routeMatch->getResponseType() == 'rss' || $this->_input->filterSingle('user_id', XenForo_Input::UINT))\n\t\t{\n\t\t\treturn parent::actionIndex();\n\t\t}\n\t\t\n\t\t/** @var $ftpHelper XenForo_ControllerHelper_ForumThreadPost */\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$forum = $ftpHelper->assertForumValidAndViewable(\n\t\t\t$forumId,\n\t\t\t$this->_getForumFetchOptions()\n\t\t);\n\t\t$forumId = $forum['node_id'];\n\n\t\t$visitor = XenForo_Visitor::getInstance();\n\t\t$userBlogModel = $this->_getUserBlogModel();\n\t\t$forumModel = $this->_getForumModel();\n\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n\t\t$usersPerPage = $options->cmfUserBlogsPerPage;\n\n\t\t$this->canonicalizeRequestUrl(\n\t\t\tXenForo_Link::buildPublicLink('forums', $forum, array('page' => $page))\n\t\t);\n\n\t\tlist($defaultOrder, $defaultOrderDirection) = $this->_getDefaultThreadSort($forum);\n\n\t\t// only default sort by last_post_date desc\n\t\t$order = $defaultOrder;\n\t\t$orderDirection = $defaultOrderDirection;\n\n\t\t//all threads and fake value for disabling \"mark read\"\n\t\t$displayConditions = array();\n\n\t\t$fetchElements = $this->_getThreadFetchElements(\n\t\t\t$forum, $displayConditions,\n\t\t\t$usersPerPage, $page, $order, $orderDirection\n\t\t);\n\t\t$threadFetchConditions = $fetchElements['conditions'];\n\t\t$threadFetchOptions = $fetchElements['options'] + array(\n\t\t\t'perPage' => $usersPerPage,\n\t\t\t'page' => $page,\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection\n\t\t);\n\t\tunset($fetchElements);\n\n\n\t\t$totalUserBlogs = $userBlogModel->countUserBlogs($threadFetchConditions);\n\t\t$this->canonicalizePageNumber($page, $usersPerPage, $totalUserBlogs, 'forums', $forum);\n\n\t\t$permissions = $visitor->getNodePermissions($forumId);\n\n\t\t// get the ordering params set for the header links\n\t\t$orderParams = array();\n\t\t$pageNavParams = $displayConditions;\n//\t\t$pageNavParams['order'] = ($order != $defaultOrder ? $order : false);\n//\t\t$pageNavParams['direction'] = ($orderDirection != $defaultOrderDirection ? $orderDirection : false);\n\t\t$pageNavParams['order'] = false;\n\t\t$pageNavParams['direction'] = false;\n\n\t\t$userBlogs = $userBlogModel->getNodeUserDataForListDisplay($forum, $threadFetchConditions, $threadFetchOptions, $permissions);\n\t\t$viewParams = array(\n\t\t\t'nodeList' => $userBlogs,\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum, false),\n\n\t\t\t'canPostThread' => $forumModel->canPostThreadInForum($forum),\n\t\t\t'canSearch' => $visitor->canSearch(),\n\n\t\t\t//TODO Ignore List\n\t\t\t'ignoredNames' => array(), //$this->_getIgnoredContentUserNames($threads) + $this->_getIgnoredContentUserNames($stickyThreads),\n\n\t\t\t'order' => $order,\n\t\t\t'orderDirection' => $orderDirection,\n\t\t\t'orderParams' => $orderParams,\n\t\t\t'displayConditions' => $displayConditions,\n\n\t\t\t'pageNavParams' => $pageNavParams,\n\t\t\t'page' => $page,\n\t\t\t'blogsStartOffset' => ($page - 1) * $usersPerPage + 1,\n\t\t\t'blogsEndOffset' => ($page - 1) * $usersPerPage + count($userBlogs['nodesGrouped'][$forumId]),\n\t\t\t'blogsPerPage' => $usersPerPage,\n\t\t\t'totalBlogs' => $totalUserBlogs,\n\n\t\t\t'showPostedNotice' => $this->_input->filterSingle('posted', XenForo_Input::UINT)\n\t\t);\n\n\t\treturn $this->responseView('XenForo_ViewPublic_Forum_View', 'cmf_user_blog_view', $viewParams);\n\t}", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }" ]
[ "0.6227774", "0.6065797", "0.58746225", "0.5841943", "0.58096045", "0.57834", "0.57736015", "0.5746879", "0.5743991", "0.57399094", "0.564211", "0.56412166", "0.55708474", "0.5564394", "0.55544937", "0.5502142", "0.549396", "0.549396", "0.549396", "0.549396", "0.54552364", "0.54536915", "0.54520184", "0.54520184", "0.5406648", "0.5402039", "0.5387732", "0.53797543", "0.5379175", "0.5374076", "0.5360282", "0.5345211", "0.53405577", "0.5312301", "0.5302554", "0.52957815", "0.52805793", "0.52367425", "0.5228277", "0.52221566", "0.5192446", "0.5185267", "0.51820064", "0.517793", "0.5177644", "0.51681215", "0.51637554", "0.51482934", "0.5144666", "0.5144153", "0.51276636", "0.5126139", "0.51246196", "0.5119169", "0.51183623", "0.51174176", "0.51044464", "0.50980633", "0.50868964", "0.5084787", "0.508451", "0.5084509", "0.508391", "0.50807524", "0.508039", "0.5079669", "0.50769645", "0.5076575", "0.5075245", "0.50643903", "0.5055779", "0.5053886", "0.50530887", "0.5051056", "0.5042396", "0.504079", "0.50278795", "0.5027089", "0.50258446", "0.50226027", "0.50158584", "0.50137746", "0.50129116", "0.50099474", "0.50085294", "0.50054306", "0.500359", "0.4999722", "0.49945405", "0.49932396", "0.4983972", "0.4983434", "0.49815255", "0.49813515", "0.4980422", "0.49802545", "0.4978549", "0.49739578", "0.49737006", "0.49733597" ]
0.62835604
0
Threads belong to many viewers (Users) through ViewedThread.
public function viewedBy() { return $this->belongsToMany( 'App\Models\User', 'viewed_threads', 'thread_id', 'user_id' ) ->using('App\Models\ViewedThread') ->withPivot('timestamp'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function views()\n {\n return $this->hasMany('App\\Models\\ViewedThread');\n }", "public function favoriteThreads($userid, $threads);", "public function threads()\n {\n return $this->hasMany(thread::class);\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany('App\\Thread');\n }", "public function authenticated_user_may_participate_in_forum_threads()\n {\n \t// Given we have an authenticated user.\n \t$user = factory('App\\User')->create();\n \t$this->be($user);\n \t// Given we have a thread.\n \t$thread = factory('App\\Thread')->create();\n \t// Given we have a reply.\n \t$reply = factory('App\\Reply')->make();\n \t// The user submits a reply.\n \t// $this->post('threads/'.$thread->id.'/replies', $reply->toArray()); also works\n \t$this->post($thread->path().'/replies', $reply->toArray());\n \t$this->get($thread->path())->assertSee($reply->body);\n }", "public function threads(){\n return $this->belongsToMany('App\\Thread');\n }", "public function threads()\n {\n return $this->hasMany(Thread::class);\n }", "public function an_authenticated_user_can_participate_in_forum_threads()\n {\n //given we have an authernticated user\n $this->be($user = factory('App\\User')->create());\n // and an existing threads\n $thread = factory('App\\Thread')->create();\n // when a user adds a reply to thread\n $reply = factory('App\\Reply')->make();\n $this->post('/threads/'.$thread->id.'/replies', $reply->toArray());\n // then their reply should be visible in the page.\n $this->get($thread->path())\n -> assertSee($reply->body);\n }", "public function an_authenticated_user_may_participate_in_a_thread(){\n //Given we have an authenticated user\n //$user = factory('App\\User')->create();\n $this->be($user = factory('App\\User')->create());\n //And an existing thread\n $thread = factory('App\\Thread')->create();\n\n //When the user adds a reply to the thread\n $reply = factory('App\\Reply')->make();\n\n $this->post($thread->path().'/replies', $reply->toArray());\n\n //then their reply should be visible on the page\n $this->get($thread->path())->\n assertSee($reply->body);\n }", "public function threads()\n {\n return $this->morphedByMany('App\\Thread', 'taggable');\n }", "public function threads(){\n \treturn $this->HasMany('App\\Models\\MessageThread', 'room_id');\n }", "public function subscribeThreads($userid, $threads);", "public function getThreads()\n {\n $user = request()->user();\n\n $messages = $user->threadsWithMessagesWithUsers($user->id)->get();\n\n /**\n * Returns unread messages given the userId.\n */\n //$messages = Message::unreadForUser($user->id)->get();\n\n return ThreadsResource::collection($messages);\n //return response()->json($messages);\n }", "public function threads()\n\t{\n\n\t\t// get sort type\n\n\n\t\t$query = Thread::where('parent_id', null)->with('user')->with('topic')->limit(20);\n\n\t\t$sort = get_string('sort', 'newest');\n\n\t\t$topic = get_int('topic', false);\n\n\t\tif($topic)\n\t\t\t$query->where('topic_id', $topic);\n\n\t\tThread::setOrder($query, $sort);\n\n\t\t$threads = $query->get();\n\n\t\t$topics = Topic::all();\n\n\t\treturn view('threads.index', compact('threads', 'sort', 'topics'));\n\t\n\t}", "public function sender()\n {\n \t// TODO: dodaj u User modelu funkciju koja ce da ti vrati sve thread-ove gde si ili sender ili receiver\n\n\n \t// tu treba da se radi query nad Thread modelom ...\n \t// izvadi sve thread-ove gde je sender_id ili receiver_id ulogovani korisnik\n return $threads = \\Auth::user()->treads();\n \t// priveri samo na laravel dokumentaciji kako se ovo pise\n \t\n \treturn $this->belongsTo(User::class, 'sender_id');\n }", "public function viewed($channel)\n {\n $service = new ThreadsService();\n $threads = $channel->threads()->get();\n $user = auth()->user();\n\n foreach ($threads as $thread) {\n $service->viewed($thread, $user);\n }\n\n return $channel;\n }", "public function test_an_authenticated_user_may_participate_in_forum_threads()\n {\n $this->be($user = factory('App\\User')->create();\n\n $thread = factory('App\\Thread')->create();\n\n $reply = factory('App\\Reply')->make();\n\n $this->post('/threads/'.$thread->id.'/replies',$reply->toArray());\n\n $this->get('/threads'.$thread->id);\n\n }", "public function view(User $user, Thread $thread)\n {\n //da implementare\n }", "public function test_an_authenticated_user_may_participate_in_forum_threads()\n {\n $this->be($user = factory('App\\User')->create());\n \n //Add an existing thread\n $thread = factory('App\\Thread')->create();\n \n //when the user add replies to thread\n $reply = factory('App\\Reply')->create();\n $this->post('/thread/' . $thread->id . '/replies', $reply->toArray());\n }", "public function viewed($thread, $user)\n {\n ViewedThread::updateOrCreate(\n ['user_id' => $user->id, 'thread_id' => $thread->id],\n ['timestamp' => Carbon::now()]\n );\n }", "function loadThreads($user_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT member1_id, member2_id, date_created FROM thread WHERE '$user_id' in (member1_id, member2_id) AND valid='yes' ORDER BY thread_id DESC\");\n\t\t\twhile ($row = sqlite_fetch_array($query))\n\t\t\t{\n\t\t\t\t$row[0]=$this->loadUser($row[0]);\n\t\t\t\t$row[1]=$this->loadUser($row[1]);\n\t\t\t}\n\t\t\treturn $row;\n\t\t}", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function index()\n {\n // All threads that user is participating in\n $threads = Thread::forUser(Auth::id())->latest('updated_at')->get();\n foreach ($threads as $key => $thread) {\n $users = User::whereIn('id', $thread->participantsUserIds())->get();\n $senderAvatar = str_replace('storage/owner/', 'img/cache/small-avatar/', Storage::url($users[1]->avatar_name));\n $cafe = Cafe::where('owner_id', Owner::where('user_id', $users[0]->id)->first()->id)->first();\n $threads[$key]->cafeLogo = str_replace('storage/logo/', 'img/cache/small-logo/', Storage::url($cafe->logo_path));\n $threads[$key]->users = $users;\n $threads[$key]->senderAvatar = $senderAvatar;\n }\n return view('messenger.index', compact('threads'));\n }", "public function run()\n {\n Session::find(1)->teachers()->attach(1);\n Session::find(2)->teachers()->attach(1);\n Session::find(1)->teachers()->attach(2);\n Session::find(2)->teachers()->attach(2);\n }", "public function checkThread(Request $request)\n {\n\n $threadid = $request->get('threadid');\n $original = $request->get('studentsids');\n $ids = $original . ',' . Auth()->id();\n $objThreadP = new ThreadParticipant();\n $objThread = new Thread();\n $authid = Auth::user()->id;\n $reverseIds = Auth()->id() . ',' . $original;\n if (empty($threadid)) {\n $haveit = $objThreadP->checkThreadParticipant($ids);\n if ($haveit == 0) {\n $haveit = $objThreadP->checkThreadParticipant($reverseIds);\n if ($haveit > 0) {\n $ids = $reverseIds;\n }\n }\n if ($haveit > 0) {\n $threadidobj = $objThreadP->getThreadId($ids);\n $threadid = $threadidobj['thread_id'];\n } else {\n $threadid = $objThread->createThread($authid);\n //Insert Participant in this thread\n $objThreadP->assignParticipantInThread($ids, $threadid);\n $userids = explode(',', $ids);\n foreach ($userids as $userid) {\n \\Event::fire(new App\\Events\\Thread($threadid, $userid));\n }\n }\n }\n $objmessage = new Message();\n $message = $objmessage->getThreadMessages($threadid);\n $students = $objmessage->getChatUsers($ids);\n $ouput = view(\"teacher.chat-messages\", compact('message', 'threadid', 'students', 'original'))->render();\n return response()->json([\n 'threadid' => $threadid,\n 'message' => $ouput\n ]);\n }", "public function test_can_see_threads_or_replies_created_by_one_user_on_his_profile_with_latest_first()\n {\n // And there's 3 threads created by him\n // When i access his profile\n // Then i can see those 3 threads in order from latest to oldest\n $user = create(User::class);\n $this->signIn($user);\n\n $item1 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::parse('3 days ago')\n ]);\n\n $item2 = $this->createWithActivity(Thread::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDay()\n ]);\n\n $item3 = $this->createWithActivity(Reply::class, [\n 'user_id' => $user->id,\n 'created_at' => Carbon::now()->subDays(2),\n 'thread_id' => $item1->id\n ]);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeTextInOrder([\n $item2->title,\n $item3->body,\n $item1->title,\n ]);\n }", "public static function getCountThreadsByUserId($id)\n\t{\n\t\treturn (int) FrontendModel::getDB()->getVar(\n\t\t\t'SELECT count(pts.id)\n\t\t\t FROM profiles_thread_status AS pts\n\t\t\t WHERE pts.receiver_id = ?', (int) $id\n\t\t);\n\t}", "private function filterThreads(\\XF\\Finder\\Thread $finder, $user_id, $page, $perPage)\n {\n $filters = $this->getThreadLogFilterInput($user_id);\n\n $finder->where('Forum.shinka_thread_log', true);\n $this->applyFilters($finder, $filters);\n $finder->limitByPage($page, $perPage, $perPage * 2);\n $threads = $finder->fetch()\n ->filter(function(Thread $thread)\n {\n return $thread->canView();\n })\n ->slice(0, $perPage, true);\n\n return $threads;\n }", "public function workers()\n {\n return $this->belongsToMany(\"App\\User\")\n ->where(\"owner_id\", Auth::id());\n }", "public function users($channel, Thread $thread)\n {\n $users = collect();\n\n if ($thread->creator->id !== auth()->id()) {\n $users->add($thread->creator);\n }\n\n Reply::where('thread_id', $thread->id)->get()->each(function ($reply) use ($users) {\n if ($reply->owner->id !== auth()->id()) {\n if (!$users->contains($reply->owner)) {\n $users->add($reply->owner);\n }\n }\n });\n\n return $users;\n }", "public function getViewUser()\n {\n return $this->belongsTo('App\\User', 'live_video_viewer_id');\n }", "public function merge($threadIDs) {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t$threadIDArray = explode(',', $threadIDs);\n\t\tif (in_array($this->threadID, $threadIDArray)) {\n\t\t\tunset($threadIDArray[array_search($this->threadID, $threadIDArray)]);\n\t\t\t$threadIDs = implode(',', $threadIDArray);\n\t\t\tif (empty($threadIDs)) return;\n\t\t}\n\t\t\n\t\t// add views\n\t\t$sql = \"SELECT\tSUM(views) AS views\n\t\t\tFROM\twbb\".WBB_N.\"_thread\n\t\t\tWHERE\tthreadID IN (\".$threadIDs.\")\";\n\t\t$row = WCF::getDB()->getFirstRow($sql);\n\t\tif ($row['views']) {\n\t\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\t\tSET\tviews = views + \".$row['views'].\"\n\t\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t\t\n\t\t// update tags\n\t\tif (MODULE_TAGGING) {\n\t\t\trequire_once(WCF_DIR.'lib/data/tag/TagEngine.class.php');\n\t\t\t$taggable = TagEngine::getInstance()->getTaggable('com.woltlab.wbb.thread');\n\t\t\t$sql = \"UPDATE IGNORE\twcf\".WCF_N.\"_tag_to_object\n\t\t\t\tSET\t\tobjectID = \".$this->threadID.\"\n\t\t\t\tWHERE\t\ttaggableID = \".$taggable->getTaggableID().\"\n\t\t\t\t\t\tAND languageID = \".$this->languageID.\"\n\t\t\t\t\t\tAND objectID IN (\".$threadIDs.\")\";\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_tag_to_object\n\t\t\t\tWHERE\t\ttaggableID = \".$taggable->getTaggableID().\"\n\t\t\t\t\t\tAND objectID IN (\".$threadIDs.\")\";\n\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t}\n\t\t\n\t\t// remove user stats\n\t\t$postIDs = self::getAllPostIDs($threadIDs);\n\t\tself::updateUserStats($threadIDs.','.$this->threadID, 'delete');\n\t\tPostEditor::updateUserStats($postIDs.','.self::getAllPostIDs($this->threadID), 'delete');\n\t\t\n\t\t// move posts\n\t\tPostEditor::moveAll($postIDs, $this->threadID, $this->boardID, false);\n\t\t\n\t\t// re-add user stats\n\t\t$this->refresh();\n\t\tself::updateUserStats($this->threadID, 'enable');\n\t\tPostEditor::updateUserStats(self::getAllPostIDs($this->threadID), 'enable');\n\t\t\n\t\t// delete threads\n\t\tself::deleteAllCompletely($threadIDs, false, false);\n\t}", "public function actionRatingsView()\n\t{\n\t\t//Define some variables\n\t\t$ftpHelper = $this->getHelper('ForumThreadPost');\n\t\t$threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);\n\t\tlist($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId);\n\t\t\n\t\t//Can view ratings for own threads and/or all threads\n\t\tif (!$this->_getRatingModel()->canViewThreadRatings($thread))\n\t\t{\n\t\t\treturn $this->responseNoPermission();\n\t\t}\n\t\t\n\t\t//Pagination\n\t\t$page = max(1, $this->_input->filterSingle('page', XenForo_Input::UINT));\n $perPage = 25;\n\t\t\n\t\t//Conditions\n\t\t$conditions = array(\n\t\t\t'thread_id' => $threadId\n\t\t);\n \n\t\t//fetchOptions\n $fetchOptions = array(\n\t\t 'join' => Borbole_StarRating_Model_Rating::FETCH_USER,\n 'page' => $page,\n 'perPage' => $perPage\n );\n\t\t\n\t\t//Get all ratings for this thread\n\t\t$entries = $this->_getRatingModel()->getRatings($conditions, $fetchOptions);\n\t\t\n\t\t//Count all ratings for this thread\n\t\t$count = $this->_getRatingModel()->countRatings($conditions);\n\t\t\n\t\t//Get the proper delete ratings permissions to be displayed\n\t\tforeach ($entries AS &$rating)\n\t\t{\n\t\t\t$rating = $this->_getRatingModel()->prepareRating($rating);\n\t\t}\n\n\t\t//Register variables for use in our template\n\t\t$viewParams = array(\n\t\t 'entries' => $entries,\n\t\t\t'thread' => $thread,\n\t\t\t'viewAnonymous' => $this->_getRatingModel()->canViewAnonymousRatings($thread),\n\t\t\t'forum' => $forum,\n\t\t\t'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum),\n\t\t\t'count' => $count,\n\t\t\t'page' => $page,\n\t\t\t'perPage' => $perPage\n\t\t);\n\n\t\treturn $this->responseView('Borbole_StarRating_ViewPublic_RatingsView', 'borbole_thread_ratings_view', $viewParams);\n\t}", "public function threads()\n\t{\n\t\treturn $this->hasMany(Thread::class)->latest();\n\t}", "public function likedUsers()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Check permission\n\t\t$access = Foundry::access();\n\n\t\t$id = JRequest::getInt( 'id', 0 );\n\n\t\t$likes = Foundry::likes( $id, 'comments' );\n\n\t\t$html = $likes->getLikedUsersDialog();\n\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\t$view->call( __FUNCTION__, $html );\n\t}", "public function subscriptions()\n {\n return $this->hasMany('App\\Core\\ThreadSubscription');\n }", "public function run(): void\n {\n Thread::with('participants.owner')->get()->each(function (Thread $thread) {\n for ($x = 0; $x < rand(5, 20); $x++) {\n Message::factory()\n ->for($thread)\n ->owner($thread->participants->random()->owner)\n ->create();\n }\n });\n }", "public function index()\n {\n $groups = Chat::getAllGroupConversations();\n $threads = Chat::getAllConversations();\n \n \n \n $newCollection = $threads->map(function($value,$key) {\n return $value->user->id ;\n});\n\n \n $users = User::where('id', '!=', auth()->id())->get();\n\n return view('home')->with([\n 'threads' => $threads,\n 'groups' => $groups,\n 'users'=>$users\n ]);\n }", "public function view(User $user, ThreadReply $threadReply)\n {\n //\n }", "public function view(User $user, CForumThread $thread)\n {\n //\n }", "public function visible(User $viewer): bool {\n return $viewer->id() === $this->author->id()\n || ($viewer->isFLS() && (is_null($this->assigned) || $this->assigned->id() === $viewer->id()))\n || ($viewer->isStaff() && $this->info['class_level'] <= $viewer->effectiveClass());\n }", "public function userTickets() {\r\n return $this->hasMany(\"Cochlea\\TicketSystem\\Models\\Ticket\", 'userId', $this->primaryKey);\r\n }", "public function actionThreadLog(ParameterBag $params)\n {\n $user = $this->assertViewableUser($params->user_id);\n $page = $this->filterPage($params->page) ?: 1;\n $perPage = $this->options()->discussionsPerPage;\n\n /** @var \\XF\\Repository\\Thread $repo */\n\t\t$repo = $this->repository('XF:Thread');\n /** @var \\XF\\Finder\\Thread $finder */\n $finder = $repo->findThreadsWithPostsByUser($user['user_id']);\n $threads = $this->filterThreads($finder, $user['user_id'], $page, $perPage);\n\n $viewParams = [\n 'user' => $user,\n 'threads' => $threads,\n 'page' => $page,\n 'perPage' => $perPage,\n 'total' => $finder->total(),\n 'checked' => $this->filter('threadlog', 'str')\n ];\n\n return $this->view('Shinka\\ThreadLog:View', 'shinka_threadlog_member_threadlog', $viewParams);\n }", "public function thread(){\n return $this->belongsTo(Thread::class);\n }", "public function addParticipants(iterable $participants): ThreadInterface;", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function thread()\n {\n return $this->belongsTo(Thread::class);\n }", "public function index()\n {\n $threads = Thread::with('user')->paginate(5);\n return view(\"threads.index\",compact('threads'));\n }", "public function threadsWithNewMessages()\n {\n $threadsWithNewMessages = [];\n $participants = Participant::where('user_id', $this->id)->lists('last_read', 'thread_id');\n\n /**\n * @todo: see if we can fix this more in the future.\n * Illuminate\\Foundation is not available through composer, only in laravel/framework which\n * I don't want to include as a dependency for this package...it's overkill. So let's\n * exclude this check in the testing environment.\n */\n if (getenv('APP_ENV') == 'testing' || !str_contains(\\Illuminate\\Foundation\\Application::VERSION, '5.0')) {\n $participants = $participants->all();\n }\n\n if ($participants) {\n $threads = Thread::whereIn('id', array_keys($participants))->get();\n\n foreach ($threads as $thread) {\n if ($thread->updated_at > $participants[$thread->id]) {\n $threadsWithNewMessages[] = $thread->id;\n }\n }\n }\n\n return $threadsWithNewMessages;\n }", "public function getParticipantUsers()\r\n {\r\n return $this->hasMany(User::class, ['id' => 'user_id'])->via('participants');\r\n }", "public function thread() {\n return $this->belongsTo('Thread');\n }", "public function index()\n {\n $user = Auth::user();\n\n $threads = DB::table('threads')->where('user_id', '=', $user->id)->get();\n\n $count_posts = DB::table('posts')->where('user_id', '=', $user->id)->count();\n\n $count_threads = DB::table('threads')->where('user_id', '=', $user->id)->count();\n\n return view('users/index', ['user' => $user, 'count_posts' => $count_posts, 'count_threads' => $count_threads, 'threads' => $threads]);\n\n }", "public function viewers()\n {\n // Sort it based on viewers \n $posts = Post::get()->sortBy(function($post)\n {\n return $post->viewer->count();\n }, SORT_REGULAR ,true);\n \n // Pagination\n $paginatedPosts = self::customPaginator($posts, 2, 'viewers');\n \n return View('pages.sort', ['posts' => $paginatedPosts, 'sortedAs' => 'The Most Viewers']);\n }", "public function show($id)\n {\n try {\n $thread = Thread::findOrFail($id);\n } catch (ModelNotFoundException $e) {\n Session::flash('error_message', 'The thread with ID: ' . $id . ' was not found.');\n return redirect()->route('messages');\n }\n\n $users = User::whereIn('id', $thread->participantsUserIds())->get();\n $senderAvatar = str_replace('storage/owner/', 'img/cache/small-avatar/', Storage::url($users[1]->avatar_name));\n $cafe = Cafe::where('owner_id', Owner::where('user_id', $users[0]->id)->first()->id)->first();\n $cafeLogo = str_replace('storage/logo/', 'img/cache/small-logo/', Storage::url($cafe->logo_path));\n $thread->markAsRead(Auth::id());\n $threads = Thread::forUser(Auth::id())->latest('updated_at')->get();\n foreach ($threads as $key => $list) {\n $usersThread = User::whereIn('id', $list->participantsUserIds())->get();\n $threads[$key]->users = $usersThread;\n $threads[$key]->senderAvatar = str_replace('storage/owner/', 'img/cache/small-avatar/', Storage::url($usersThread[1]->avatar_name));\n $cafe = Cafe::where('owner_id', Owner::where('user_id', $users[0]->id)->first()->id)->first();\n $threads[$key]->cafeLogo = str_replace('storage/logo/', 'img/cache/small-logo/', Storage::url($cafe->logo_path));\n }\n return view('messenger.index', compact('thread', 'users', 'cafeLogo', 'senderAvatar', 'threads'));\n }", "public function index()\n {\n\n $threads = Thread::forUser(Auth::id())->with([\n 'users' => function ($query) {\n $query->select('avatar', 'name', 'agent_name');\n },\n 'messages' => function ($query) {\n $query->latest()->first();\n },\n ])\n ->groupBy('threads.id')\n ->latest('updated_at')\n ->paginate();\n\n $threads->getCollection()->transform(function ($value) {\n $value->isUnread = $value->isUnread(Auth::id());\n\n return $value;\n });\n\n\n return response()->json($threads);\n }", "public function participants()\n{\n\treturn $this->belongsToMany(User::class);\n}", "public function getTopThreads()\n {\n $db = DB::conn();\n $threads = array();\n \n $rows = $db->rows('SELECT t.id, t.user_id, t.title, u.username, t.created, t.last_modified, u.usertype, \n COUNT(c.id) AS thread_count FROM comment c \n INNER JOIN thread t ON c.thread_id=t.id \n INNER JOIN user u ON t.user_id=u.id \n GROUP BY t.id ORDER BY COUNT(c.id) DESC, t.last_modified DESC');\n\n foreach ($rows as $row) {\n $threads[] = new Thread($row);\n }\n\n return $threads;\n }", "public function unfavoriteThreads($userid, $threads = false);", "public function merchants_viewed()\n {\n return $this->belongsToMany('Merchant', 'user_view', 'nonmember_id', 'merchant_id');\n }", "public function view($partners_id)\n {\n $user_manager = new UserModel();\n $user = $this->getUser();\n if ($user['user_status'] == 1 || $user['user_status'] == 2) {\n $partners_manager = new PartnersModel();\n $partners = $partners_manager->find($partners_id); //Récupere les données de l'article en question\n $this->show('partners/view', ['partners' => $partners]);\n } else {\n echo '<script type=\"text/javascript\">alert(\"Vous n\\'êtes pas autorisé à accéder à cette section !\");</script>';\n $this->show('w_errors/404');\n }\n }", "public function getAllCommentProviders($thread_id, $thread_choices, $user_id, ThreadVoBuilder $builder){\n //the prev $thread_chocie: e.g (\"agree\" : \"agree ( 0 voters), \" disagree\": \"disagree (1 voters) \"\n //initialize array\n if($user_id === null) {\n $user_id = 0;\n }\n $all_providers = array();\n $limit = 5;\n foreach($thread_choices as $thread_choice){\n //$thread_choice contains the choice of the thread, e.g = \"Agree\", \"Disagree\"\n $allModels = $this->getCommentByChoiceText($thread_id, $thread_choice['choice_text'], $user_id, $builder);\n $dataProvider =new ArrayDataProvider([\n 'allModels' => $allModels,\n 'pagination' => [\n 'pageSize' =>$limit,\n\n ],\n\n ]);\n $all_providers[$thread_choice['choice_text'] . ' (' . count($allModels) . ')' ] = $dataProvider;\n }\n\n $builder->setThreadCommentList($all_providers);\n\n return $builder;\n }", "function performThreadsActionObject()\n\t{\n\t\tglobal $lng, $ilUser, $ilAccess;\n\n\t\tunset($_SESSION['threads2move']);\n\t\tunset($_SESSION['forums_search_submitted']);\n\t\tunset($_SESSION['frm_topic_paste_expand']);\t\n\n\t\tif (is_array($_POST['thread_ids']))\n\t\t{\n\t\t\tif ($_POST['selected_cmd'] == 'move')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$_SESSION['threads2move'] = $_POST['thread_ids'];\n\t\t\t\t\t$this->moveThreadsObject();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'enable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->enableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'disable_notifications' && $this->ilias->getSetting('forum_notification') != 0)\n\t\t\t{\n\n\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t{\n\n\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t$tmp_obj->disableNotification($ilUser->getId());\n\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'close')\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->close();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'reopen')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->reopen();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'makesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->makeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'unmakesticky')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\n\t\t\t\t\tfor ($i = 0; $i < count($_POST['thread_ids']); $i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$tmp_obj = new ilForumTopic($_POST['thread_ids'][$i]);\n\t\t\t\t\t\t$tmp_obj->unmakeSticky();\n\t\t\t\t\t\tunset($tmp_obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t\telse if($_POST['selected_cmd'] == 'editThread')\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t\t\t{\n\t\t\t\t\t$count = count($_POST['thread_ids']);\n\t\t\t\t\tif($count != 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\tforeach($_POST['thread_ids'] as $thread_id);\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $this->editThreadObject($thread_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\t\t\telse if ($_POST['selected_cmd'] == 'html')\n\t\t\t{\n\t\t\t\t$this->ctrl->setCmd('exportHTML');\n\t\t\t\t$this->ctrl->setCmdClass('ilForumExportGUI');\n\t\t\t\t$this->executeCommand();\n\t\t\t}\n\n\t\t\telse if ($_POST['selected_cmd'] == 'confirmDeleteThreads')\n\t\t\t{\n\t\t\t\treturn $this->confirmDeleteThreads();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendInfo($this->lng->txt('topics_please_select_one_action'), true);\n\t\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tilUtil::sendInfo($this->lng->txt('select_at_least_one_thread'), true);\n\t\t\t$this->ctrl->redirect($this, 'showThreads');\n\t\t}\n\t}", "public function run()\n {\n $tickets = Ticket::all();\n\n foreach ($tickets as $ticket) {\n foreach ($ticket->relaters as $relater) {\n $ticket->unreaders()->attach($relater);\n }\n $ticket->unreaders()->attach($ticket->assignee);\n $ticket->unreaders()->attach($ticket->creator);\n }\n }", "public function participants()\n {\n return $this->belongsToMany(User::class, 'conversation_participants', 'conversation_id', 'user_id');\n }", "public function index()\n {\n $profile = auth()->user();\n $posts = \\App\\Post::wherePublished(1)->where('user_id', \\Auth::user()->id)->get();\n\n $threads = Thread::getAllLatest()->whereHas('participants', function ($query) {\n $query->where('user_id', auth()->user()->id);\n })->get();\n\n return view('profile.index', compact('profile', 'posts', 'threads'));\n }", "public static function getLatestThreadsByUserId($id, $limit = 4, $offset = 0)\n\t{\n\t\t$threads = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pt.id, pm.text, pm.created_on, IF(pts.status = \"read\", 1, 0) AS status\n\t\t\t FROM profiles_thread AS pt\n\t\t\t INNER JOIN profiles_message AS pm ON pt.latest_message_id = pm.id\n\t\t\t INNER JOIN profiles_thread_status AS pts ON pt.id = pts.thread_id\n\t\t\t WHERE pts.receiver_id = ? and pts.status != \"deleted\"\n\t\t\t GROUP BY pt.id\n\t\t\t ORDER BY pm.created_on DESC\n\t\t\t LIMIT ?,?',\n\t\t\tarray((int) $id, (int) $offset, (int) $limit)\n\t\t);\n\n\t\t// get participating users for each thread\n\t\tforeach($threads as &$thread)\n\t\t{\n\t\t\t$thread['receivers'] = FrontendProfilesModel::getProfilesInThread($thread['id'], $id);\n\t\t\t$thread['status'] = (int) $thread['status'];\n\t\t}\n\n\t\treturn $threads;\n\t}", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "public function index()\n {\n $threads = Thread::forUser(Auth::user()->id)->orderBy('created_at', 'desc')->get();\n $data['statues'] = \"200 Ok\";\n $data['error'] = null;\n foreach ($threads as $thread) {\n $last_message = $thread->messages()->orderBy('created_at', 'desc')->get()[0]->body;\n $participants = $thread->participants()->get();\n\n foreach ($participants as $participant) {\n if (User::find($participant->user_id)->id != $thread->messages()->orderBy('created_at', 'desc')->get()[0]->user_id) {\n $thread['receiver'] = User::find($participant->user_id);\n }\n }\n $thread['last_message'] = $last_message;\n $thread['last_sender'] = User::find($thread->messages()->orderBy('created_at', 'desc')->get()[0]->user_id);\n }\n $data['data']['threads'] = $threads;\n return response()->json($data, 200);\n }", "public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function index() {\n $threads_1 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('threads.category', '=', '1')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_2 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '2')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_3 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '3')\n ->orderBy('updated_at', 'desc')\n ->get();\n $threads_4 = DB::table('threads')\n ->join('users','users.id', '=', 'threads.user_id')\n ->select('threads.*', 'users.name')\n ->where('category', '=', '4')\n ->orderBy('updated_at', 'desc')\n ->get();\n \treturn view('thread', ['threads_1' => $threads_1, 'threads_2' => $threads_2, \n 'threads_3' => $threads_3, 'threads_4' => $threads_4]);\n }", "public function index()\n {\n $threads = Thread::all();\n $threads->load('posts', 'author');\n\n return view('threads.index', compact('threads'));\n }", "public function run()\n {\n foreach (Post::get() as $post) {\n $numberOfUsers = rand(0, 10);\n $randomUserIDs = User::inRandomOrder()->where('id', '<>', $post->user->id)->limit($numberOfUsers)->pluck('id');\n $post->likedBy()->attach($randomUserIDs);\n }\n }", "public function unsubscribeThreads($userid, $threads = false);", "public function test_an_authenicated_user_can_subscribe_to_a_thread()\n {\n $this->signIn();\n $thread = factory('App\\Thread')->create();\n $this->post($thread->path() . '/subscriptions');\n $this->assertCount(1, $thread->subscriptions);\n }", "public function posts($id)\n\t{\n\n\t\t$post = Thread::with('user')->find($id);\n\n\t\t// get all thread replies with their user information\n\n\t\t$replies = Thread::with('user')->where('parent_id', $id)->get();\n\n\t\t// generate output\n\n\t\treturn view('threads.posts', compact('post', 'replies'));\n\t\n\t}", "public function index()\n {\n if (!is_logged_in()) {\n redirect(url('user/index'));\n }\n\n $thread_count = Thread::getNumRows();\n $pagination = pagination($thread_count);\n $threads = Thread::getAll($pagination['max']);\n $this->set(get_defined_vars());\n }", "public function getUsuariosVotos()\n {\n return $this->hasMany(User::className(), ['id' => 'usuario_id'])->via('votos');\n }", "public function canBeViewedBy(User $user)\n {\n if (!$this->private) {\n\n return true;\n }\n\n if ($this->user_id == $user->id) {\n\n return true;\n }\n\n $invitedUsers = $this->invitations()->pluck('user_id')->toArray();\n\n if (in_array($user->id, $invitedUsers)) {\n\n return true;\n }\n\n return false;\n }", "public function index()\n {\n $threads = Thread::orderBy('created_at', 'desc')->with('Movie', 'User')->get();\n\n foreach ($threads as $thread) {\n $thread->movie->description = shorten($thread->movie->description, 88);\n $thread->rating_slug = Str::slug($thread->rating);\n $thread->tmdb_id = (isset($thread->movie->externalid[0])) ? $thread->movie->externalid[0]->external_id : null;\n $thread->imdb_id = (isset($thread->movie->externalid[1])) ? $thread->movie->externalid[1]->external_id : null;\n if ($thread->user_id == Auth::user()->id) {\n $thread->can_edit = true;\n }\n }\n\n return response()->json($threads);\n }", "public function create()\n {\n /**\n * Placeholder for now, only \"oisenon\" user can create thread\n * \n */\n if(Auth::user()->id !== 1){\n return 'Access denied.';\n }\n return view('threads.create');\n }", "public function show($id)\n {\n try {\n $thread = Thread::findOrFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json('error');\n }\n\n // show current user in list if not a current participant\n // $users = User::whereNotIn('id', $thread->participantsUserIds())->get();\n\n // don't show the current user in list\n $userId = request()->user()->id;\n $users = Client::whereNotIn('id', $thread->participantsUserIds($userId))->get();\n\n $thread->markAsRead($userId);\n //return response()->json(['thread' => $thread, 'clients' => $users]);\n return new ThreadResource($thread);\n }", "public function get_object_mentions(){\n $user_data = array();\n if (has_permission('projects', '', 'view')){\n $this->load->model('projects_model');\n $projects = $this->projects_model->get();\n foreach($projects as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('project').': '.$val['name'];\n $node['type'] = 'project';\n $node['link'] = '<a href=\"'.admin_url('projects/view/' . $val['id']).'\" data-project-id=\"data_project_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('tasks', '', 'view')){\n $this->load->model('tasks_model');\n $tasks = $this->db->get(db_prefix() . 'tasks')->result_array();\n foreach($tasks as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('task').': '.$val['name'];\n $node['type'] = 'task';\n $node['link'] = '<a href=\"'.admin_url('tasks/view/'.$val['id']).'\" data-task-id=\"data_task_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n $clients = $this->projects_model->get();\n if (has_permission('clients', '', 'view')){\n $this->load->model('clients_model');\n $clients = $this->clients_model->get();\n foreach($clients as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['userid']);\n $node['name'] = _l('client').': '.$val['company'];\n $node['type'] = 'client';\n $node['link'] = '<a href=\"'.admin_url('clients/client/' . $val['userid']).'\" data-client-id=\"data_client_id_'.$val['userid'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('leads', '', 'view')){\n $this->load->model('leads_model');\n $leads = $this->leads_model->get();\n foreach($leads as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('lead').': '.$val['name'];\n $node['type'] = 'lead';\n $node['link'] = '<a href=\"' . admin_url('leads/index/' . $val['id']) . '\" data-lead-id=\"data_lead_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('tickets', '', 'view')){\n $this->load->model('tickets_model');\n $tickets = $this->tickets_model->get();\n foreach($tickets as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['ticketid']);\n $node['name'] = _l('ticket').': '.$val['subject'];\n $node['type'] = 'ticket';\n $node['link'] = '<a href=\"'.admin_url('tickets/ticket/' . $val['ticketid']).'\" data-ticket-id=\"data_ticket_id_'.$val['ticketid'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n } \n if (has_permission('proposals', '', 'view')){\n $this->load->model('proposals_model');\n $proposals = $this->proposals_model->get();\n foreach($proposals as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('proposal').': '.format_proposal_number($val['id']);\n $node['type'] = 'proposal';\n $node['link'] = '<a href=\"' . admin_url('proposals/list_proposals/' . $val['id']) . '\" data-proposal-id=\"data_proposal_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('invoices', '', 'view')){\n $this->load->model('invoices_model');\n $invoices = $this->invoices_model->get();\n foreach($invoices as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('invoice').': '.format_invoice_number($val['id']);\n $node['type'] = 'invoice';\n $node['link'] = '<a href=\"' . admin_url('invoices/list_invoices/' . $val['id']) . '\" data-invoice-id=\"data_invoice_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('credit_notes', '', 'view')){\n $this->load->model('credit_notes_model');\n $credit_notes = $this->credit_notes_model->get();\n foreach($credit_notes as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('credit_note').': '.format_credit_note_number($val['id']);\n $node['type'] = 'credit_note';\n $node['link'] = '<a href=\"' . admin_url('credit_notes/list_credit_notes/' . $val['id']) . '\" data-credit-note-id=\"data_credit_note_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('estimates', '', 'view')){\n $this->load->model('estimates_model');\n $estimates = $this->estimates_model->get();\n foreach($estimates as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('estimate').': '.format_estimate_number($val['id']);\n $node['type'] = 'estimate';\n $node['link'] = '<a href=\"' . admin_url('estimates/list_estimates/' . $val['id']) . '\" data-estimate-id=\"data_estimate_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('expenses', '', 'view')){\n $this->load->model('expenses_model');\n $expenses = $this->expenses_model->get();\n foreach($expenses as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('expense').': '.$val['expense_name'];\n $node['type'] = 'expense';\n $node['link'] = '<a href=\"' . admin_url('expenses/list_expenses/' . $val['id']) . '\" data-expense-id=\"data_expense_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('contracts', '', 'view')){\n $this->load->model('contracts_model');\n $contracts = $this->contracts_model->get();\n foreach($contracts as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('contract').': '.$val['subject'];\n $node['type'] = 'contract';\n $node['link'] = '<a href=\"' . admin_url('contracts/contract/' . $val['id']) . '\" data-contract-id=\"data_contract_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n if (has_permission('payments', '', 'view')){\n $this->load->model('payments_model');\n $this->db->select('*,' . db_prefix() . 'invoicepaymentrecords.id as paymentid');\n $this->db->from(db_prefix() . 'invoicepaymentrecords');\n $this->db->join(db_prefix() . 'payment_modes', '' . db_prefix() . 'invoicepaymentrecords.paymentmode = ' . db_prefix() . 'payment_modes.id', 'LEFT');\n $this->db->join(db_prefix() . 'invoices', '' . db_prefix() . 'invoices.id = ' . db_prefix() . 'invoicepaymentrecords.invoiceid');\n $payments = $this->db->get()->result_array();\n foreach($payments as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('payment').': '.$val['name'].' #'. format_invoice_number($val['invoiceid']).' #'. _d($val['date']);\n $node['type'] = 'payment';\n $node['link'] = '<a href=\"' .admin_url('payments/payment/' . $val['id']) . '\" data-payment-id=\"data_payment_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n\n if (has_permission('contact', '', 'view')){\n $this->load->model('clients_model');\n $contacts = $this->clients_model->get_contacts();\n\n foreach($contacts as $key => $val)\n {\n $node = [];\n $node['id'] = intval($val['id']);\n $node['name'] = _l('contact').': '.$val['firstname'].' '.$val['lastname'];\n $node['type'] = 'contact';\n $node['link'] = '<a href=\"' .admin_url('clients/all_contacts/' . $val['userid']) . '?group=contacts\" data-contact-id=\"data_contact_id_'.$val['id'].'\">'.$node['name'].'</a>';\n $user_data[] = $node;\n }\n }\n\n echo json_encode($user_data);\n die();\n }", "public function mentions(){\n\t\t$title = \"mentioning user: @\";\n\t\t$where = \"select m.post_id from mentions m, users u2 where m.user_id = u2.user_id and u2.user_name\";\n\n\t\t#call generic routine for showing a specific list of posts:\n\t\t$this->view_specific($where, $title);\n\t}", "protected static function getUsersCoachView()\n {\n $answer = [];\n\n if (isset(self::$requestedUser->field_coach[LANGUAGE_NONE][0]['target_id'])) {\n $uplineId = self::$requestedUser->field_coach[LANGUAGE_NONE][0]['target_id'];\n $upline = user_load($uplineId);\n $answer = user_view($upline, 'teaser');\n }\n\n return $answer;\n }", "public function test_a_user_can_filter_threads_according_to_a_channel()\n {\n $channel = factory('App\\Models\\Channel')->create();\n $threadInChannel = factory('App\\Models\\Thread')->create(['channel_id' => $channel->id]);\n $threadNotInChannel = factory('App\\Models\\Thread')->create();\n $this->get('/threads/'.$channel->slug)\n ->assertSee($threadInChannel->title)\n ->assertDontSee($threadNotInChannel->title);\n\n $this->assertTrue(true);\n }", "public function refreshThreadCount()\n {\n $this->thread_count = $this->threads()\n ->where('is_approved', Thread::APPROVED)\n ->whereNull('deleted_at')\n ->whereNotNull('user_id')\n ->count();\n\n return $this;\n }", "public function index()\n {\n $threads = Thread::with('user', 'votes')->withCount('replies')->latest()->paginate(10);\n // return $threads;\n return view('pertanyaan.index', compact('threads'));\n }", "public function views()\n {\n return $this->hasMany('App\\View');\n }", "public function communities() {\n $this->restrictToRoleId(2);\n \n // Je vais chercher les communautés du user connecté\n $listOfCommunities = User::getConnectedUser()->getCommunities();\n \n // Exécute la view\n $this->show('user/communities', [\n 'communitiesList' => $listOfCommunities\n ]);\n }", "public function participants()\n {\n return $this->belongsToMany(User::class)->withPivot('project_role_id');\n }", "public function hasPartinUsers(){\n return $this->_has(2);\n }", "protected function getAllowedThreads($threadIds, ParticipantInterface $loggedInUser)\n {\n $threadArray = [];\n foreach ($threadIds as $threadId) {\n //try to get the thread, it returns null when not found or throws an exception...\n try {\n $thread = $this->threadProvider->findThreadForParticipant($loggedInUser, $threadId);\n } catch (AccessDeniedException $e) {\n $thread = null;\n }\n\n //we only want an array with valid thread objects...\n if (is_object($thread) && $thread instanceof ThreadInterface) {\n $threadArray[] = $thread;\n }\n }\n\n return $threadArray;\n }", "public function activities()\n {\n return $this->hasMany(Activity::class, 'activity_of_user_id', 'id');\n }", "public static function checkVisibilityAll($threadIDs, $reason = '') {\n\t\tif (empty($threadIDs)) return;\n\t\t\n\t\t$emptyThreads = '';\n\t\t$trashedThreads = '';\n\t\t$hiddenThreads = '';\n\t\t$enabledThreads = '';\n\t\t$restoresThreads = '';\n\t\t$sql = \"SELECT\t\tCOUNT(post.postID) AS posts,\n\t\t\t\t\tSUM(post.isDeleted) AS deletedPosts,\n\t\t\t\t\tSUM(post.isDisabled) AS hiddenPosts,\n\t\t\t\t\tthread.threadID, thread.isDeleted, thread.isDisabled\n\t\t\tFROM \t\twbb\".WBB_N.\"_thread thread\n\t\t\tLEFT JOIN \twbb\".WBB_N.\"_post post\n\t\t\tON \t\t(post.threadID = thread.threadID)\n\t\t\tWHERE \t\tthread.threadID IN (\".$threadIDs.\")\n\t\t\tGROUP BY \tthread.threadID\";\n\t\t$result = WCF::getDB()->sendQuery($sql);\n\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t$row['deletedPosts'] = intval($row['deletedPosts']);\n\t\t\t$row['hiddenPosts'] = intval($row['hiddenPosts']);\n\t\t\t\n\t\t\t// thread has no posts\n\t\t\t// delete thread\n\t\t\tif ($row['posts'] == 0) {\n\t\t\t\tif (!empty($emptyThreads)) $emptyThreads .= ',';\n\t\t\t\t$emptyThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are into the recylce bin\n\t\t\t// move thread also into the recylce bin \n\t\t\telse if ($row['posts'] == $row['deletedPosts']) {\n\t\t\t\tif (!empty($trashedThreads)) $trashedThreads .= ',';\n\t\t\t\t$trashedThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// all posts of this thread are hidden\n\t\t\t// hide thread also\n\t\t\telse if ($row['posts'] == $row['hiddenPosts'] || $row['posts'] == $row['hiddenPosts'] + $row['deletedPosts']) {\n\t\t\t\tif (!empty($hiddenThreads)) $hiddenThreads .= ',';\n\t\t\t\t$hiddenThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is deleted, but no posts are deleted\n\t\t\t// restore thread\n\t\t\telse if (intval($row['deletedPosts']) == 0 && $row['isDeleted'] == 1) {\n\t\t\t\tif (!empty($restoresThreads)) $restoresThreads .= ',';\n\t\t\t\t$restoresThreads .= $row['threadID'];\n\t\t\t}\n\t\t\t\n\t\t\t// thread is hidden, but no posts are hidden\n\t\t\t// enable thread\n\t\t\telse if (intval($row['hiddenPosts']) == 0 && $row['isDisabled'] == 1) {\n\t\t\t\tif (!empty($enabledThreads)) $enabledThreads .= ',';\n\t\t\t\t$enabledThreads .= $row['threadID'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tself::deleteAllCompletely($emptyThreads, false, false);\n\t\tself::trashAll($trashedThreads, false, $reason);\n\t\tself::disableAll($hiddenThreads, false);\n\t\tself::restoreAll($restoresThreads, false);\n\t\tself::enableAll($enabledThreads, false);\n\t}", "public function update(Request $request, $thread = null) {\r\n $success = false;\r\n $msg = 'There was an error completing this request. Please try again.';\r\n\r\n if (empty($thread)) {\r\n $this->validate($request, [\r\n 'id' => 'required|integer',\r\n 'recipients.*' => 'required',\r\n 'recipientIds.*' => 'required|integer',\r\n 'body' => 'required|string',\r\n ]);\r\n\r\n try {\r\n $thread = Thread::findOrFail($request->id);\r\n } catch (ModelNotFoundException $e) {\r\n Session::flash('error_message', 'The thread with ID: ' . $request->id . ' was not found.');\r\n return redirect('messages');\r\n }\r\n }\r\n\r\n \r\n // Activate all particpants is presumably for when people leave the thread but then it's updated later I don't think we'll use this though\r\n //$thread->activateAllParticipants();\r\n\r\n $message = Message::create(\r\n [\r\n 'thread_id' => $thread->id,\r\n 'user_id' => $this->volunteer->id,\r\n 'body' => e(strip_tags($request->body)),\r\n ]\r\n );\r\n\r\n $participant = Participant::firstOrCreate(\r\n [\r\n 'thread_id' => $thread->id,\r\n 'user_id' => $this->volunteer->id,\r\n ]\r\n );\r\n $participant->last_read = new Carbon;\r\n $participant->save();\r\n\r\n $thread->addParticipant($request->recipientIds);\r\n\r\n $ids = $request->recipientIds;\r\n $notifyIds = [];\r\n array_unshift($ids, $thread->creator()->id);\r\n for ($i=0; $i < count($ids); $i++) { \r\n if($ids[$i] !== $this->volunteer->id) {\r\n $notifyIds[] = $ids[$i];\r\n }\r\n }\r\n\r\n\r\n broadcast(new \\App\\Events\\NewMessage($message))->toOthers();\r\n broadcast(new \\App\\Events\\ThreadUpdate($message,$thread,$this->volunteer,$notifyIds))->toOthers();\r\n\r\n if(!empty($thread) && !empty($message)) {\r\n $success = true;\r\n $msg = 'Successfully created message';\r\n }\r\n\r\n return response()->json(array('success' => $success, 'message' => $msg));\r\n }", "public function authorize(): bool\n {\n if (Auth::user()->hasPermissionTo('delete thread')) {\n return true;\n }\n\n $thread = $this->run(GetThreadJob::class, [\n 'thread_id' => $this->request->all()['thread_id']\n ]);\n\n if ($thread != null && $thread->user_id === Auth::user()->id && Auth::user()->hasPermissionTo('delete own thread')) {\n return true;\n }\n\n return false;\n }", "public function participants(): Builder\n {\n return User::join('posts', 'posts.user_id', '=', 'users.id')\n ->where('posts.discussion_id', $this->id)\n ->where('posts.is_private', false)\n ->where('posts.type', 'comment')\n ->select('users.*')\n ->distinct();\n }", "public function status()\n {\n return $this->belongsToMany(ThreadStatus::class)\n ->withTimestamps();\n }" ]
[ "0.64863783", "0.6115233", "0.58442837", "0.5840202", "0.5840202", "0.5837736", "0.58362126", "0.573146", "0.57066077", "0.57065344", "0.56756526", "0.56379545", "0.5579365", "0.55518365", "0.54680085", "0.5441456", "0.5403752", "0.53617686", "0.53530246", "0.5348783", "0.52709043", "0.52515846", "0.5249233", "0.5218291", "0.52128756", "0.5204931", "0.50757384", "0.5059323", "0.50484616", "0.50197566", "0.5016343", "0.5010105", "0.49982285", "0.496154", "0.49289396", "0.49259514", "0.4918948", "0.49177325", "0.4917517", "0.49156705", "0.49058494", "0.48979458", "0.4859779", "0.48353103", "0.48134384", "0.4811582", "0.48095053", "0.48095053", "0.4803636", "0.47812337", "0.47791874", "0.47649252", "0.4748833", "0.47352087", "0.47177497", "0.47078434", "0.47027588", "0.47020525", "0.46837524", "0.4675475", "0.46585536", "0.46570498", "0.46313155", "0.4622647", "0.461761", "0.46135813", "0.4611256", "0.46059307", "0.4605094", "0.4603294", "0.45781195", "0.45756555", "0.4575254", "0.4566097", "0.45393065", "0.45357418", "0.45348647", "0.45281106", "0.45155975", "0.45072004", "0.4492168", "0.4490908", "0.44795722", "0.44785613", "0.4469889", "0.4468705", "0.44664204", "0.4460561", "0.44576204", "0.44562632", "0.4455757", "0.44546682", "0.44511262", "0.44413674", "0.44385275", "0.44371882", "0.44353104", "0.4435293", "0.44287452", "0.44216856" ]
0.7057228
0